Skip to content

Commit

Permalink
chore: Update tutorial to latest engine (#11)
Browse files Browse the repository at this point in the history
* chore(tutorial): migrate tutorial modules with engine package movement

* style: update copyright and remove unused imports

* style: fix remaining checkstyle warnings

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
  • Loading branch information
DarkWeird and skaldarnar committed Sep 2, 2021
1 parent 276a4ca commit 3c9141d
Show file tree
Hide file tree
Showing 19 changed files with 63 additions and 286 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui;

import org.terasology.engine.Time;
import org.terasology.registry.In;
import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.core.Time;
import org.terasology.engine.registry.In;
import org.terasology.engine.rendering.nui.CoreScreenLayer;
import org.terasology.nui.widgets.UIButton;
import org.terasology.nui.widgets.UIText;

Expand Down
19 changes: 3 additions & 16 deletions src/main/java/org/terasology/tutorialnui/widgets/UIBoxScreen.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIBoxScreen extends CoreScreenLayer {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIButtonScreen extends CoreScreenLayer {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UICheckboxScreen extends CoreScreenLayer {
@Override
public void initialise(){

}
public void initialise() { }
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;


import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIDoubleSliderScreen extends CoreScreenLayer {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;
import org.terasology.nui.widgets.UIDropdown;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;
import org.terasology.nui.widgets.UIDropdownScrollable;

import java.util.ArrayList;
Expand All @@ -12,10 +12,12 @@ public class UIDropdownScrollableScreen extends CoreScreenLayer {

@Override
public void initialise() {
UIDropdownScrollable dropdown = find("Dropdown", UIDropdownScrollable.class);
UIDropdownScrollable<String> dropdown = find("Dropdown", UIDropdownScrollable.class);

List<String> options = new ArrayList<>();
for (int i = 1; i <= 10; i++)
for (int i = 1; i <= 10; i++) {
options.add("Option " + i);
}
dropdown.setOptions(options);
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIIconBarScreen extends CoreScreenLayer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIImageScreen extends CoreScreenLayer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UILabelScreen extends CoreScreenLayer {

Expand Down
19 changes: 3 additions & 16 deletions src/main/java/org/terasology/tutorialnui/widgets/UIListScreen.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;
import org.terasology.nui.widgets.UIList;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UILoadBarScreen extends CoreScreenLayer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIRadialScreen extends CoreScreenLayer {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIScrollbarScreen extends CoreScreenLayer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UIScrollingTextScreen extends CoreScreenLayer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.tutorialnui.widgets;

import org.terasology.rendering.nui.CoreScreenLayer;
import org.terasology.engine.rendering.nui.CoreScreenLayer;

public class UISliderScreen extends CoreScreenLayer {

Expand Down
Loading

0 comments on commit 3c9141d

Please sign in to comment.