diff --git a/app/src/main/java/org/toop/Main.java b/app/src/main/java/org/toop/Main.java index c929d5d..657f9bf 100644 --- a/app/src/main/java/org/toop/Main.java +++ b/app/src/main/java/org/toop/Main.java @@ -36,4 +36,5 @@ public final class Main { }).start(); } + } diff --git a/app/src/main/java/org/toop/app/game/TicTacToeGameThread.java b/app/src/main/java/org/toop/app/game/TicTacToeGameThread.java index a71bf07..58ed74c 100644 --- a/app/src/main/java/org/toop/app/game/TicTacToeGameThread.java +++ b/app/src/main/java/org/toop/app/game/TicTacToeGameThread.java @@ -8,9 +8,7 @@ import org.toop.framework.networking.events.NetworkEvents; import org.toop.game.Game; import org.toop.game.tictactoe.TicTacToe; import org.toop.game.tictactoe.TicTacToeAI; - import java.util.function.Consumer; - import javafx.geometry.Pos; import javafx.scene.paint.Color; @@ -24,8 +22,8 @@ public final class TicTacToeGameThread extends BaseGameThread { + root.getChildren().clear(); + root.getChildren().add(view.getNode()); + currentView = view; + }); + } } \ No newline at end of file diff --git a/app/src/main/java/org/toop/app/widget/tutorial/BaseTutorialWidget.java b/app/src/main/java/org/toop/app/widget/tutorial/BaseTutorialWidget.java new file mode 100644 index 0000000..b12d727 --- /dev/null +++ b/app/src/main/java/org/toop/app/widget/tutorial/BaseTutorialWidget.java @@ -0,0 +1,60 @@ +package org.toop.app.widget.tutorial; + +import javafx.geometry.Pos; +import javafx.scene.image.ImageView; +import javafx.scene.text.Text; +import org.toop.app.widget.Primitive; +import org.toop.app.widget.complex.ViewWidget; + +import javafx.scene.control.Button; +import org.toop.local.AppContext; + +import java.io.File; + +public class BaseTutorialWidget extends ViewWidget { + + private TState state; + private Text tutorialText; + private Button previousButton; + private Button nextButton; + private Button noButton; + private Button yesButton; + private Button neverButton; + private ImageView imagery; + + public BaseTutorialWidget(String key, Runnable onNo, Runnable onYes, Runnable onNever) { + System.out.println("Trying to initialize..."); + this.tutorialText = Primitive.text(key); + this.yesButton = Primitive.button("ok", () -> onYes.run()); + this.noButton = Primitive.button("no", () -> onNo.run()); + this.neverButton = Primitive.button("never", () -> onNever.run()); + var a = Primitive.hbox(yesButton, noButton, neverButton); + add(Pos.CENTER, Primitive.vbox(tutorialText, a)); + } + + public BaseTutorialWidget(TState state, String key, Runnable onPrevious, Runnable onNext) { + this.state = state; + this.tutorialText = Primitive.text(key); + this.previousButton = Primitive.button("<", () -> onPrevious.run()); + this.nextButton = Primitive.button(">", () -> onNext.run()); + var w = Primitive.hbox(previousButton, nextButton); + add(Pos.CENTER, Primitive.vbox(tutorialText, w)); + } + + public BaseTutorialWidget(TState state, String key, File image, Runnable onPrevious, Runnable onNext) { + this.state = state; + this.imagery = Primitive.image(image); + this.tutorialText = Primitive.text(key); + this.previousButton = Primitive.button("<", () -> onPrevious.run()); + this.nextButton = Primitive.button(">", () -> onNext.run()); + var w = Primitive.hbox(previousButton, nextButton); + var x = Primitive.vbox(imagery, tutorialText); + add(Pos.CENTER, Primitive.vbox(x, w)); + } + + public void update(String key, File image) { + tutorialText.textProperty().unbind(); + tutorialText.setText(AppContext.getString(key)); + imagery.setImage(Primitive.image(image).getImage()); + } +} diff --git a/app/src/main/java/org/toop/app/widget/tutorial/TState.java b/app/src/main/java/org/toop/app/widget/tutorial/TState.java new file mode 100644 index 0000000..4efc2d2 --- /dev/null +++ b/app/src/main/java/org/toop/app/widget/tutorial/TState.java @@ -0,0 +1,44 @@ +package org.toop.app.widget.tutorial; + +public class TState { + + private int current; + private int total; + + public TState(int total) { + this.total = total; + this.current = 0; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public void next() { + current = current + 1; + } + + public void previous() { + current = current - 1; + } + + public boolean hasNext() { + return current < total - 1; + } + + public boolean hasPrevious() { + return current > 0; + } +} diff --git a/app/src/main/java/org/toop/app/widget/tutorial/TicTacToeTutorialWidget.java b/app/src/main/java/org/toop/app/widget/tutorial/TicTacToeTutorialWidget.java new file mode 100644 index 0000000..60c1293 --- /dev/null +++ b/app/src/main/java/org/toop/app/widget/tutorial/TicTacToeTutorialWidget.java @@ -0,0 +1,44 @@ +package org.toop.app.widget.tutorial; + +import javafx.geometry.Pos; +import org.toop.app.widget.complex.ViewWidget; +import java.io.File; + +public class TicTacToeTutorialWidget extends ViewWidget { + + private TState state; + private String[] keys = {"tictactoe1", "tictactoe2"}; + private File[] images = { + new File("app/src/main/resources/assets/images/tictactoe1.png"), + new File("app/src/main/resources/assets/images/tictactoe2.png") + }; + private BaseTutorialWidget tutorialWidget; + + public TicTacToeTutorialWidget() { + System.out.println("Hi, I got here!"); + this.state = new TState(keys.length); + tutorialWidget = new BaseTutorialWidget( + state, + keys[state.getCurrent()], + images[state.getCurrent()], + () -> { + if (state.hasPrevious()) { + state.previous(); + update(); + } + }, + () -> { + if (state.hasNext()) { + state.next(); + update(); + } + } + ); + System.out.println("Hi, I got to the end!"); + add(Pos.CENTER, tutorialWidget); + } + + private void update() { + tutorialWidget.update(keys[state.getCurrent()], images[state.getCurrent()]); + } +} diff --git a/app/src/main/java/org/toop/app/widget/view/GameView.java b/app/src/main/java/org/toop/app/widget/view/GameView.java index 82778b9..df1b411 100644 --- a/app/src/main/java/org/toop/app/widget/view/GameView.java +++ b/app/src/main/java/org/toop/app/widget/view/GameView.java @@ -16,11 +16,10 @@ public final class GameView extends ViewWidget { private final Text currentPlayerHeader; private final Text currentMoveHeader; private final Text nextPlayerHeader; - private final Button forfeitButton; private final Button exitButton; - private final TextField chatInput; + private final TextField chatInput; public GameView(Runnable onForfeit, Runnable onExit, Consumer onMessage) { currentPlayerHeader = Primitive.header(""); diff --git a/app/src/main/java/org/toop/app/widget/view/LocalMultiplayerView.java b/app/src/main/java/org/toop/app/widget/view/LocalMultiplayerView.java index 9ddd5f3..de5c9fd 100644 --- a/app/src/main/java/org/toop/app/widget/view/LocalMultiplayerView.java +++ b/app/src/main/java/org/toop/app/widget/view/LocalMultiplayerView.java @@ -1,19 +1,23 @@ package org.toop.app.widget.view; +import javafx.application.Platform; import org.toop.app.GameInformation; import org.toop.app.game.Connect4Game; import org.toop.app.game.ReversiGame; import org.toop.app.game.TicTacToeGameThread; import org.toop.app.widget.Primitive; +import org.toop.app.widget.WidgetContainer; import org.toop.app.widget.complex.PlayerInfoWidget; import org.toop.app.widget.complex.ViewWidget; import org.toop.app.widget.popup.ErrorPopup; +import org.toop.app.widget.tutorial.BaseTutorialWidget; +import org.toop.app.widget.tutorial.TicTacToeTutorialWidget; import org.toop.local.AppContext; import javafx.geometry.Pos; import javafx.scene.control.ScrollPane; import javafx.scene.layout.VBox; - +import org.toop.local.AppSettings; public class LocalMultiplayerView extends ViewWidget { private final GameInformation information; @@ -32,9 +36,39 @@ public class LocalMultiplayerView extends ViewWidget { } switch (information.type) { - case TICTACTOE -> new TicTacToeGameThread(information); - case REVERSI -> new ReversiGame(information); - case CONNECT4 -> new Connect4Game(information); + case TICTACTOE: + System.out.println(AppSettings.getSettings().getTutorialFlag()); + System.out.println(AppSettings.getSettings().getFirstTTT()); + if (AppSettings.getSettings().getTutorialFlag() && AppSettings.getSettings().getFirstTTT()) { + BaseTutorialWidget a = new BaseTutorialWidget( + "tutorial", + () -> { + AppSettings.getSettings().setFirstTTT(false); + Platform.runLater(() -> { + new TicTacToeGameThread(information); + }); + }, + () -> { + Platform.runLater(() -> { + ViewWidget c = new TicTacToeTutorialWidget(); + transitionNext(c); + WidgetContainer.setCurrentView(c); + }); + }, + () -> { + AppSettings.getSettings().setTutorialFlag(false); + Platform.runLater(() -> { + new TicTacToeGameThread(information); + }); + } + ); + transitionNext(a); + break; + } + new TicTacToeGameThread(information); + break; + case REVERSI: new ReversiGame(information); + case CONNECT4: new Connect4Game(information); // case BATTLESHIP -> new BattleshipGame(information); } }); diff --git a/app/src/main/java/org/toop/app/widget/view/MainView.java b/app/src/main/java/org/toop/app/widget/view/MainView.java index ff7a710..15e5c03 100644 --- a/app/src/main/java/org/toop/app/widget/view/MainView.java +++ b/app/src/main/java/org/toop/app/widget/view/MainView.java @@ -3,7 +3,6 @@ package org.toop.app.widget.view; import org.toop.app.App; import org.toop.app.widget.Primitive; import org.toop.app.widget.complex.ViewWidget; - import javafx.geometry.Pos; public class MainView extends ViewWidget { diff --git a/app/src/main/java/org/toop/local/AppSettings.java b/app/src/main/java/org/toop/local/AppSettings.java index 2e26fbe..7a49fdf 100644 --- a/app/src/main/java/org/toop/local/AppSettings.java +++ b/app/src/main/java/org/toop/local/AppSettings.java @@ -21,6 +21,8 @@ public class AppSettings { settingsAsset.load(); } + doDefaultSettings(); + Settings settingsData = settingsAsset.getContent(); AppContext.setLocale(Locale.of(settingsData.locale)); @@ -64,4 +66,43 @@ public class AppSettings { public static SettingsAsset getSettings() { return settingsAsset; } + + public static void checkSettings() { + Settings s = settingsAsset.getContent(); + boolean changed = false; + + if (s.showTutorials == null) { + settingsAsset.setTutorialFlag(true); + changed = true; + } + if (s.firstReversi == null) { + settingsAsset.setFirstReversi(true); + changed = true; + } + if (s.firstTTT == null) { + settingsAsset.setFirstTTT(true); + changed = true; + } + if (s.firstConnect4 == null) { + settingsAsset.setFirstConnect4(true); + changed = true; + } + if (changed) { + getSettings().save(); + } + } + + public static void doDefaultSettings() { + settingsAsset.setFirstConnect4(true); + settingsAsset.setFirstTTT(true); + settingsAsset.setFirstReversi(true); + settingsAsset.setLocale("en"); + settingsAsset.setTheme("dark"); + settingsAsset.setFullscreen(false); + settingsAsset.setVolume(100); + settingsAsset.setFxVolume(20); + settingsAsset.setMusicVolume(15); + settingsAsset.setTutorialFlag(true); + settingsAsset.setLayoutSize("medium"); + } } \ No newline at end of file diff --git a/app/src/main/resources/assets/images/cat.jpg b/app/src/main/resources/assets/images/cat.jpg new file mode 100644 index 0000000..0f557da Binary files /dev/null and b/app/src/main/resources/assets/images/cat.jpg differ diff --git a/app/src/main/resources/assets/images/tictactoe1.png b/app/src/main/resources/assets/images/tictactoe1.png new file mode 100644 index 0000000..ea6ea9a Binary files /dev/null and b/app/src/main/resources/assets/images/tictactoe1.png differ diff --git a/app/src/main/resources/assets/images/tictactoe2.png b/app/src/main/resources/assets/images/tictactoe2.png new file mode 100644 index 0000000..1aed81e Binary files /dev/null and b/app/src/main/resources/assets/images/tictactoe2.png differ diff --git a/app/src/main/resources/assets/localization/localization_ar.properties b/app/src/main/resources/assets/localization/localization_ar.properties index 7a2a9c7..bd29908 100644 --- a/app/src/main/resources/assets/localization/localization_ar.properties +++ b/app/src/main/resources/assets/localization/localization_ar.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=\u062f\u0639\u0645 \u0623\u0639\u0635\u0627\u0628\u064a music-volume=\u0635\u0648\u062a \u0627\u0644\u0645\u0648\u0633\u064a\u0642\u0649 name=\u0627\u0633\u0645 +never=\u0644\u0627\u060c \u0644\u0627 \u0623\u0631\u064A\u062F \u0623\u0646 \u0623\u0631\u0649 \u0623\u064A \u062F\u0631\u0648\u0633 \u0639\u0644\u0649 \u0627\u0644\u0625\u0637\u0644\u0627\u0642. no=\u0644\u0627 ok=\u0645\u0648\u0627\u0641\u0642 online=\u0645\u062a\u0635\u0644 @@ -62,13 +63,18 @@ style=\u0623\u0633\u0644\u0648\u0628 the-game-ended-in-a-draw=\u0627\u0646\u062a\u0647\u062a \u0627\u0644\u0644\u0639\u0628\u0629 \u0628\u062a\u0639\u0627\u062f\u0644 theme=\u0645\u0648\u0636\u0648\u0639 tic-tac-toe=\u062a\u064a\u0643 \u062a\u0627\u0643 \u062a\u0648 +tictactoe1 =\u0645\u0631\u062d\u0628\u064b\u0627 \u0628\u0643 \u0641\u064a \u0644\u0639\u0628\u0629 \u0625\u0643\u0633-\u0623\u0648! \u064a\u0645\u0643\u0646\u0643 \u0627\u0644\u0642\u064a\u0627\u0645 \u0628\u062d\u0631\u0643\u062a\u0643 \u0628\u0627\u0644\u0646\u0642\u0631 \u0639\u0644\u0649 \u0623\u064a \u0645\u0646 \u0627\u0644\u0645\u0631\u0628\u0639\u0627\u062a \u0627\u0644\u062a\u0633\u0639\u0629 \u0639\u0644\u0649 \u0627\u0644\u0644\u0648\u062d\u0629. \u0627\u0644\u0645\u062b\u0627\u0644 \u0623\u0639\u0644\u0627\u0647: +tictactoe2 =\u064a\u0641\u0648\u0632 \u0627\u0644\u0644\u0627\u0639\u0628 \u0639\u0646\u062f\u0645\u0627 \u064a\u062d\u0635\u0644 \u0639\u0644\u0649 \u062b\u0644\u0627\u062b \u0642\u0637\u0639 \u0645\u062a\u062a\u0627\u0644\u064a\u0629 ? \u0623\u0641\u0642\u064a\u064b\u0627 \u0623\u0648 \u0639\u0645\u0648\u062f\u064a\u064b\u0627 \u0623\u0648 \u0642\u0637\u0631\u064a\u064b\u0627. \u0641\u064a \u0627\u0644\u0645\u062b\u0627\u0644 \u0623\u0639\u0644\u0627\u0647\u060c \u064a\u0641\u0648\u0632 \u0627\u0644\u0644\u0627\u0639\u0628 \u0628\u0635\u0641 \u0642\u0637\u0631\u064a \u0645\u0646 \u062b\u0644\u0627\u062b \u0642\u0637\u0639 to-a-game-of=\u0625\u0644\u0649 \u0644\u0639\u0628\u0629 \u0645\u0646 +tutorial=\u0647\u0644 \u062a\u0631\u064a\u062f \u0645\u0634\u0627\u0647\u062f\u0629 \u062f\u0644\u064a\u0644 \u0644\u0647\u0630\u0627 \u0627\u0644\u0644\u0639\u0628\u0629\u061f volume=\u0635\u0648\u062a windowed=\u0641\u064a \u0646\u0641\u0630\u0629 yes=\u0646\u0639\u0645 you-lost-against=\u0623\u0646\u062a \u062e\u0633\u0631\u062a \u0636\u062f you-were-challenged-by=\u062a\u062d\u062f\u064a\u062a \u0645\u0646 you-win=\u0623\u0646\u062a \u062a\u0641\u0648\u0632 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 chinese=\u4e2d\u6587 (\u0627\u0644\u0635\u064a\u0646\u064a\u0629) diff --git a/app/src/main/resources/assets/localization/localization_de.properties b/app/src/main/resources/assets/localization/localization_de.properties index 3d39afa..16e24cd 100644 --- a/app/src/main/resources/assets/localization/localization_de.properties +++ b/app/src/main/resources/assets/localization/localization_de.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=Mentale Unterst\u00fctzung music-volume=Musiklautst\u00e4rke name=Name +never=Nein, ich m\u00f6chte niemals irgendwelche Tutorials sehen. no=Nein ok=Ok online=Online @@ -62,13 +63,19 @@ style=Stil the-game-ended-in-a-draw=Das Spiel endete unentschieden theme=Thema tic-tac-toe=Tic Tac Toe +tictactoe1 =Willkommen beim Spiel Tic Tac Toe! Du kannst deinen Zug machen, indem du auf eines der 9 Felder auf dem Spielfeld klickst. Beispiel oben: +tictactoe2 =Ein Spieler gewinnt, wenn er drei Steine in einer Reihe hat ? horizontal, vertikal oder diagonal. Im obigen Beispiel gewinnt der Spieler mit einer diagonalen Reihe von drei Steinen. to-a-game-of=zu einem Spiel von +tutorial=M\u00f6chtest du ein Tutorial f\u00fcr dieses Spiel sehen? + volume=Lautst\u00e4rke windowed=Fenstermodus yes=Ja you-lost-against=Sie haben gegen ... verloren you-were-challenged-by=Sie wurden herausgefordert von ... you-win=Sie gewinnen +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch) chinese=\u4e2d\u6587 (Chinesisch) diff --git a/app/src/main/resources/assets/localization/localization_en.properties b/app/src/main/resources/assets/localization/localization_en.properties index 48eb167..d19f27e 100644 --- a/app/src/main/resources/assets/localization/localization_en.properties +++ b/app/src/main/resources/assets/localization/localization_en.properties @@ -42,6 +42,7 @@ moral-support=Moral Support music-volume=Music Volume name=Name no=No +never=No, I never wanna see any tutorials ok=Ok online=Online opengl=OpenGL @@ -62,6 +63,9 @@ style=Style the-game-ended-in-a-draw=The game ended in a draw theme=Theme tic-tac-toe=Tic Tac Toe +tictactoe1 =Welcome to the game of Tic Tac Toe! You can make your move by clicking on any of the 9 squares on the board. Example above: +tictactoe2 =A player wins by getting 3 pieces in a row - horizontally, vertically or diagonally. In the example above, the player wins with a diagonal row of three pieces. +tutorial=Do you want a tutorial for this game? connect4=Connect 4 to-a-game-of=to a game of volume=Volume @@ -70,6 +74,8 @@ yes=Yes you-lost-against=You lost against you-were-challenged-by=You were challenged by you-win=You win +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabic) chinese=\u4e2d\u6587 (Chinese) diff --git a/app/src/main/resources/assets/localization/localization_es.properties b/app/src/main/resources/assets/localization/localization_es.properties index 938cf7f..0407d27 100644 --- a/app/src/main/resources/assets/localization/localization_es.properties +++ b/app/src/main/resources/assets/localization/localization_es.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=Apoyo moral music-volume=Volumen de m\u00fasica name=Nombre +never=No, no quiero ver ning\u00fan tutorial nunca. no=No ok=OK online=En l\u00ednea @@ -62,13 +63,18 @@ style=Estilo the-game-ended-in-a-draw=El juego termin\u00f3 en empate theme=Tema tic-tac-toe=Tres en raya +tictactoe1 =\u00a1Bienvenido al juego del Tres en Raya! Puedes hacer tu jugada haciendo clic en cualquiera de los 9 cuadros del tablero. Ejemplo arriba: +tictactoe2 =Un jugador gana al conseguir 3 fichas en l\u00ednea, ya sea horizontal, vertical o diagonalmente. En el ejemplo de arriba, el jugador gana con una fila diagonal de tres fichas. to-a-game-of=a un juego de +tutorial=\u00bfQuieres ver un tutorial para este juego? volume=Volumen windowed=En ventana yes=S\u00ed you-lost-against=Perdiste contra you-were-challenged-by=Fuiste desafiado por you-win=Ganaste +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Ar\u00e1bigo) chinese=\u4e2d\u6587 (Chino) diff --git a/app/src/main/resources/assets/localization/localization_fr.properties b/app/src/main/resources/assets/localization/localization_fr.properties index c00d8a1..91a7f21 100644 --- a/app/src/main/resources/assets/localization/localization_fr.properties +++ b/app/src/main/resources/assets/localization/localization_fr.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=Soutien moral music-volume=Volume de la musique name=Nom +never=Non, je ne veux jamais voir de tutoriels. no=Non ok=OK online=En ligne @@ -62,13 +63,18 @@ style=Style the-game-ended-in-a-draw=La partie s'est termin\u00e9e par un match nul theme=Th\u00e8me tic-tac-toe=Morpion +tictactoe1 =Bienvenue dans le jeu du Tic Tac Toe ! Vous pouvez jouer en cliquant sur l\u2019une des 9 cases du plateau. Exemple ci-dessus : +tictactoe2 =Un joueur gagne en alignant 3 pi\u00e8ces \u2013 horizontalement, verticalement ou en diagonale. Dans l\u2019exemple ci-dessus, le joueur gagne avec une diagonale de trois pi\u00e8ces. to-a-game-of=\u00e0 une partie de +tutorial=Veux-tu voir un tutoriel pour ce jeu\u00a0? volume=Volume windowed=Fen\u00eatrr\u00e9 yes=Oui you-lost-against=Vous avez perdu contre you-were-challenged-by=Vous avez \u00e9t\u00e9 d\u00e9fi\u00e9 par you-win=Vous avez gagn\u00e9 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabe) chinese=\u4e2d\u6587 (Chinois) diff --git a/app/src/main/resources/assets/localization/localization_hi.properties b/app/src/main/resources/assets/localization/localization_hi.properties index b0aa135..559c5ae 100644 --- a/app/src/main/resources/assets/localization/localization_hi.properties +++ b/app/src/main/resources/assets/localization/localization_hi.properties @@ -41,6 +41,7 @@ merge-commander=\u092e\u0930\u094d\u091c \u0915\u092e\u093e\u0902\u0921\u0930 moral-support=\u0928\u0948\u0924\u093f\u0915 \u0938\u0939\u093e\u0930\u093e music-volume=\u0938\u0902\u0917\u0940\u0924 \u0935\u0949\u0932\u094d\u092f\u0942\u092e name=\u0928\u093e\u092e +never=\u0928\u0939\u0940\u0902, \u092e\u0948\u0902 \u0915\u092c\u094d\u0939\u0940 \u092d\u0940 \u0915\u094b\u0908 \u091f\u094d\u092f\u0942\u091f\u094b\u0930\u093f\u092f\u0932 \u0928\u0939\u0940\u0902 \u0926\u0947\u0916\u0928\u093e \u091a\u093e\u0939\u0924\u093e/\u091a\u093e\u0939\u0924\u0940\u0964 no=\u0928\u0939\u0940\u0902 ok=\u0920\u0940\u0915 \u0939\u0948 online=\u0911\u0928\u0932\u093e\u0907\u0928 @@ -62,13 +63,18 @@ style=\u0936\u0948\u0932\u0940 the-game-ended-in-a-draw=\u0916\u0947\u0932 \u091f\u0940\u0915 \u0939\u094b \u0917\u092f\u093e theme=\u0925\u0940\u092e tic-tac-toe=\u091f\u093f\u0915-\u091f\u0948\u0915-\u091f\u094b +tictactoe1 =\u091f\u093f\u0915-\u091f\u0948\u0915-\u091f\u094b \u0915\u0947 \u0916\u0947\u0932 \u092e\u0947\u0902 \u0906\u092a\u0915\u093e \u0938\u094d\u0935\u093e\u0917\u0924 \u0939\u0948! \u0906\u092a \u092c\u094b\u0930\u094d\u0921 \u092a\u0930 \u0915\u093f\u0938\u0940 \u092d\u0940 9 \u0916\u093e\u0928\u0947 \u092a\u0930 \u0915\u094d\u0932\u093f\u0915 \u0915\u0930\u0915\u0947 \u0905\u092a\u0928\u0940 \u091a\u093e\u0932 \u091a\u0932 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902\u0964 \u090a\u092a\u0930 \u0926\u093f\u092f\u093e \u0917\u092f\u093e \u0909\u0926\u093e\u0939\u0930\u0923 \u0926\u0947\u0916\u0947\u0902: +tictactoe2 =\u0915\u094b\u0908 \u0916\u093f\u0932\u093e\u0921\u093c\u0940 \u0924\u092c \u091c\u0940\u0924\u0924\u093e \u0939\u0948 \u091c\u092c \u0935\u0939 \u092a\u0948 \u092a\u0902\u0915\u094d\u0924\u093f \u092e\u0947\u0902 \u0924\u0940\u0928 \u0928\u093f\u0936\u093e\u0928 \u090f\u0915 \u092a\u0902\u0915\u094d\u0924\u093f \u092e\u0947\u0902 \u0932\u0917\u093e \u0926\u0947\u0924\u093e \u0939\u0948 ? \u0915\u094d\u0937\u0948\u0924\u093f\u091c, \u090a\u0930\u094d\u0927\u094d\u0935\u093e\u0927\u0930 \u092f\u093e \u0924\u093f\u0930\u091b\u0947\u0964 \u090a\u092a\u0930 \u0909\u0926\u093e\u0939\u0930\u0923 \u092e\u0947\u0902, \u0916\u093f\u0932\u093e\u0921\u093c\u0940 \u0924\u093f\u0930\u091b\u0940 \u092a\u0902\u0915\u094d\u0924\u093f \u092e\u0947\u0902 \u0924\u093f\u0930\u091b\u0940 \u092a\u0902\u0915\u094d\u0924\u093f \u0938\u0947 \u091c\u0940\u0924\u0924\u093e \u0939\u0948\u0964 to-a-game-of=\u0916\u0947\u0932 \u0915\u0940 \u090f\u0915 \u0916\u0947\u0932 \u0915\u0940 \u0913\u0930 +tutorial=\u0915\u094d\u092f\u093e \u0906\u092a \u0907\u0938 \u0917\u0947\u092e \u0915\u0947 \u0932\u093f\u090f \u0915\u094b\u0908 \u091f\u094d\u092f\u0942\u091f\u094b\u0930\u093f\u092f\u0932 \u0926\u0947\u0916\u0928\u093e \u091a\u093e\u0939\u0924\u0947 \u0939\u0948\u0902? volume=\u0935\u0949\u0932\u094d\u092f\u0942\u092e windowed=\u0935\u093f\u0902\u0921\u094b \u092e\u094b\u0921 yes=\u0939\u093e\u0901 you-lost-against=\u0906\u092a \u0939\u093e\u0930 \u0917\u090f you-were-challenged-by=\u0906\u092a\u0915\u094b \u091a\u0941\u0928\u094c\u0924\u0940 \u0926\u0940 \u0917\u0908 you-win=\u0906\u092a \u091c\u0940\u0924 \u0917\u090f +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0905\u0930\u092c\u0940) chinese=\u4e2d\u6587 (\u091a\u0940\u0928\u0940) diff --git a/app/src/main/resources/assets/localization/localization_it.properties b/app/src/main/resources/assets/localization/localization_it.properties index 4e6b516..a50ffe8 100644 --- a/app/src/main/resources/assets/localization/localization_it.properties +++ b/app/src/main/resources/assets/localization/localization_it.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=Supporto morale music-volume=Volume della musica name=Nome +never=No, non voglio mai vedere alcun tutorial. no=No ok=OK online=Online @@ -62,13 +63,18 @@ style=Stile the-game-ended-in-a-draw=La partita \u00e8 terminata in parit\u00e0 theme=Tema tic-tac-toe=Tris +tictactoe1 =Benvenuto nel gioco del Tris! Puoi fare la tua mossa cliccando su uno dei 9 quadrati della griglia. Esempio sopra: +tictactoe2 =Un giocatore vince mettendo 3 simboli in fila ? orizzontalmente, verticalmente o diagonalmente. Nell?esempio sopra, il giocatore vince con una fila diagonale di tre simboli. to-a-game-of=a una partita di +tutorial=Vuoi vedere un tutorial per questo gioco? volume=Volume windowed=Finestra yes=S\u00ec you-lost-against=Hai perso contro you-were-challenged-by=Sei stato sfidato da you-win=Hai vinto +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabo) chinese=\u4e2d\u6587 (Cinese) diff --git a/app/src/main/resources/assets/localization/localization_ja.properties b/app/src/main/resources/assets/localization/localization_ja.properties index 5c3efe6..560875c 100644 --- a/app/src/main/resources/assets/localization/localization_ja.properties +++ b/app/src/main/resources/assets/localization/localization_ja.properties @@ -41,6 +41,7 @@ merge-commander=\u30de\u30fc\u30b8\u30b3\u30de\u30f3\u30c0\u30fc moral-support=\u30e1\u30f3\u30bf\u30eb\u30b5\u30dd\u30fc\u30c8 music-volume=\u97f3\u697d\u97f3\u91cf name=\u540d\u524d +never=\u3044\u3044\u3048\u3001\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u4e8c\u5ea6\u3068\u898b\u305f\u304f\u3042\u308a\u307e\u305b\u3093\u3002 no=\u3044\u3044\u3048 ok=OK online=\u30aa\u30f3\u30e9\u30a4\u30f3 @@ -62,13 +63,18 @@ style=\u30b9\u30bf\u30a4\u30eb the-game-ended-in-a-draw=\u30b2\u30fc\u30e0\u306f\u5f15\u304d\u5206\u3051\u306b\u7d42\u308f\u308a\u307e\u3057\u305f theme=\u30c6\u30fc\u30de tic-tac-toe=\u4e09\u76ee\u4e26\u3079 +tictactoe1 =\u4e09\u76ee\u4e26\u3079\u306e\u30b2\u30fc\u30e0\u3078\u3088\u3046\u3053\u305d\uff01\u30dc\u30fc\u30c9\u4e0a\u306e9\u3064\u306e\u30de\u30b9\u306e\u3044\u305a\u308c\u304b\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u624b\u3092\u6253\u3061\u307e\u3057\u3087\u3046\u3002\u4e0a\u306e\u4f8b\u3092\u53c2\u7167\uff1a +tictactoe2 =\u30d7\u30ec\u30a4\u30e4\u30fc\u306f\u3001\u6a2a\u30fb\u7e26\u30fb\u65b9\u5411\u306e\u3044\u305a\u308c\u304b\u3067\u30de\u30fc\u30af\u30923\u3064\u4e26\u3079\u308b\u3068\u52dd\u3061\u3067\u3059\u3002\u4e0a\u306e\u4f8b\u3067\u306f\u3001\u30d7\u30ec\u30a4\u30e4\u30fc\u304c\u659c\u3081\u306b3\u3064\u4e26\u3079\u3066\u52dd\u3063\u3066\u3044\u307e\u3059\u3002 to-a-game-of=\u30b2\u30fc\u30e0\u306b +tutorial=\u3053\u306e\u30b2\u30fc\u30e0\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u898b\u305f\u3044\u3067\u3059\u304b\uff1f volume=\u97f3\u91cf windowed=\u30a6\u30a3\u30f3\u30c9\u30a6\u8868\u793a yes=\u306f\u3044 you-lost-against=\u3042\u306a\u305f\u306f ... \u306b\u6557\u308c\u307e\u3057\u305f you-were-challenged-by=\u3042\u306a\u305f\u306f ... \u304b\u3089\u6311\u6226\u3055\u308c\u307e\u3057\u305f you-win=\u52dd\u5229\u3067\u3059 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u30a2\u30e9\u30d3\u30a2\u8a9e) chinese=\u4e2d\u6587 (\u4e2d\u6587) diff --git a/app/src/main/resources/assets/localization/localization_ko.properties b/app/src/main/resources/assets/localization/localization_ko.properties index 70a2d07..4768c9d 100644 --- a/app/src/main/resources/assets/localization/localization_ko.properties +++ b/app/src/main/resources/assets/localization/localization_ko.properties @@ -42,6 +42,7 @@ moral-support=\uC815\uC2E0\uC801 \uC9C0\uC6D0 music-volume=\uC74C\uC545 \uBCFC\uB968 name=\uC774\uB984 no=\uC544\uB2C8\uC624 +never=\uc544\ub2c8\uc694, \uc800\ub294 \ud29c\ud1a0\ub9ac\uc5bc\uc744 \ub2e4\uc2dc\ub294 \ubcf4\uace0 \uc2f6\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. ok=\uD655\uC778 online=\uC628\uB77C\uC778 opengl=OpenGL @@ -62,13 +63,18 @@ style=\uC2A4\uD0C0\uC77C the-game-ended-in-a-draw=\uAC8C\uC784\uC774 \uBB34\uC2B9\uBD80\uB85C \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4 theme=\uC8FC\uC81C tic-tac-toe=\uD2F0\uD06C\uD0D1\uD1A0 +tictactoe1 =\ud2f1\ud0dd\ud1a0 \uac8c\uc784\uc5d0 \uc624\uc2e0 \uac83\uc744 \ud658\uc601\ud569\ub2c8\ub2e4! \ubcf4\ub4dc\uc758 9\uac1c \uce78 \uc911 \ud558\ub098\ub97c \ud074\ub9ad\ud558\uc5ec \uc6c0\uc9c1\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc704\uc758 \uc608\uc2dc\ub97c \ucc38\uace0\ud558\uc138\uc694: +tictactoe2 =\ud50c\ub808\uc774\uc5b4\ub294 \uac00\ub85c, \uc138\ub85c \ub610\ub294 \ub300\uac01\uc120\uc73c\ub85c \ub9d0 3\uac1c\ub97c \uc77c\ub82c\ub85c \ub193\uc73c\uba74 \uc2b9\ub9ac\ud569\ub2c8\ub2e4. \uc704\uc758 \uc608\uc5d0\uc11c \ud50c\ub808\uc774\uc5b4\ub294 \ub300\uac01\uc120\uc73c\ub85c \uc138 \uac1c\ub97c \uc5f0\uacb0\ud558\uc5ec \uc774\uacbc\uc2b5\ub2c8\ub2e4. to-a-game-of=... \uAC8C\uC784\uC5D0 +tutorial=\uc774 \uac8c\uc784\uc758 \ud29c\ud1a0\ub9ac\uc5bc\uc744 \ubcf4\uace0 \uc2f6\ub098\uc694? volume=\uBCFC\uB968 windowed=\uCC3D \uBAA9\uB85D yes=\uB124 you-lost-against=... \uC5D0\uAC8C \uC9C0\uC600\uC2B5\uB2C8\uB2E4 you-were-challenged-by=... \uB85C\uBD80\uD130 \uCC38\uC5EC \uC694\uCCAD\uC744 \uBC1B\uC558\uC2B5\uB2C8\uB2E4 you-win=\uC774\uACBC\uC2B5\uB2C8\uB2E4 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0639\u0631\u0628\u064a\u0629) chinese=\u4e2d\u6587 (\u4e2d\u6587) diff --git a/app/src/main/resources/assets/localization/localization_nl.properties b/app/src/main/resources/assets/localization/localization_nl.properties index 2042468..2648e93 100644 --- a/app/src/main/resources/assets/localization/localization_nl.properties +++ b/app/src/main/resources/assets/localization/localization_nl.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=Morele steun music-volume=Muziekvolume name=Naam +never=Nee, ik wil nooit tutorials zien. no=Nee ok=Oké online=Online @@ -62,14 +63,19 @@ style=Stijl the-game-ended-in-a-draw=Het spel eindigde in een gelijkspel theme=Thema tic-tac-toe=Boter Kaas en Eieren +tictactoe1 =Welkom bij het spel Boter, Kaas en Eieren! Je kunt je zet doen door op een van de 9 vakjes op het bord te klikken. Voorbeeld hierboven: +tictactoe2 =Een speler wint door 3 stukken op een rij te krijgen ? horizontaal, verticaal of diagonaal. In het voorbeeld hierboven wint de speler met een diagonale rij van drie stukken. connect4=Vier op een rij to-a-game-of=voor een spelletje +tutorial=Wil je een tutorial voor dit spel zien? volume=Volume windowed=Venstermodus yes=Ja you-lost-against=Je hebt verloren van you-were-challenged-by=Je bent uitgedaagd door you-win=Je wint +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch) chinese=\u4e2d\u6587 (Chinees) diff --git a/app/src/main/resources/assets/localization/localization_ru.properties b/app/src/main/resources/assets/localization/localization_ru.properties index defc9ba..f5d457b 100644 --- a/app/src/main/resources/assets/localization/localization_ru.properties +++ b/app/src/main/resources/assets/localization/localization_ru.properties @@ -41,6 +41,7 @@ merge-commander=Merge Commander moral-support=\u041c\u043e\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 music-volume=\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c \u043c\u0443\u0437\u044b\u043a\u0438 name=\u0418\u043c\u044f +never=\u041d\u0435\u0442, \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0445\u043e\u0447\u0443 \u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u043b\u0438\u0431\u043e \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0438. no=\u041d\u0435\u0442 ok=OK online=\u0412 \u0441\u0435\u0442\u0438 @@ -62,13 +63,18 @@ style=\u0421\u0442\u0438\u043b\u044c the-game-ended-in-a-draw=\u0418\u0433\u0440\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043d\u0438\u0447\u044c\u0435\u0439 theme=\u0422\u0435\u043c\u0430 tic-tac-toe=\u041a\u0440\u0435\u0441\u0442\u0438\u043a\u043e +tictactoe1 =\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u0432 \u0438\u0433\u0440\u0443 \u041a\u0440\u0435\u0441\u0442\u0438\u043a\u0438-\u043d\u043e\u043b\u0438\u043a\u0438! \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u043e\u0434, \u043d\u0430\u0436\u0430\u0432 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 9 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043e\u0432 \u043d\u0430 \u043f\u043e\u043b\u0435. \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435: +tictactoe2 =\u0418\u0433\u0440\u043e\u043a \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0432\u0438\u0442 3 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u043f\u043e\u0434\u0440\u044f\u0434 ? \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u0438\u043b\u0438 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438. \u0412 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0433\u0440\u043e\u043a \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u043e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 to-a-game-of=\u043a \u0438\u0433\u0440\u0435 \u0432 +tutorial=\u0425\u043e\u0447\u0435\u0448\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0443\u0447\u0435\u0431\u043d\u0438\u043a \u043f\u043e \u044d\u0442\u043e\u0439 \u0438\u0433\u0440\u0435? volume=\u0413\u0440\u043e\u043c\u043a\u043e\u0441\u0442\u044c windowed=\u041e\u043a\u043d\u043e yes=\u0414\u0430 you-lost-against=\u0412\u044b \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b\u0438 \u043a\u043e\u043c\u0443 you-were-challenged-by=\u0412\u0430\u0441 \u0432\u044b\u0437\u0432\u0430\u043b \u043d\u0430 \u0441\u043e\u0440\u0435\u0432\u043d\u0438\u043a you-win=\u0412\u044b \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442\u0435 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0410\u0440\u0430\u0431\u0441\u043a\u0438\u0439) chinese=\u4e2d\u6587 (\u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439) diff --git a/app/src/main/resources/assets/localization/localization_zh.properties b/app/src/main/resources/assets/localization/localization_zh.properties index 3844582..a14aa4b 100644 --- a/app/src/main/resources/assets/localization/localization_zh.properties +++ b/app/src/main/resources/assets/localization/localization_zh.properties @@ -41,6 +41,7 @@ merge-commander=\u5408\u5e76\u6307\u6325 moral-support=\u7cbe\u795e\u652f\u6301 music-volume=\u97f3\u4e50\u97f3\u91cf name=\u540d\u5b57 +never=\u4e0d\uff0c\u6211\u5b8c\u5168\u4e0d\u60f3\u518d\u770b\u5230\u4efb\u4f55\u6559\u7a0b\u3002 no=\u4e0d ok=\u786e\u5b9a online=\u5728\u7ebf @@ -62,13 +63,18 @@ style=\u98ce\u683c the-game-ended-in-a-draw=\u6e38\u620f\u4ee5\u548c\u5c40\u7ed3\u675f theme=\u4e3b\u9898 tic-tac-toe=\u4e09\u5b9a\u7ebf +tictactoe1 =\u6b22\u8fce\u6765\u5230\u4e95\u5b57\u68cb\u6e38\u620f\uff01\u4f60\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u68cb\u76d8\u4e0a\u4efb\u610f\u4e00\u4e2a\u4e5d\u4e2a\u65b9\u683c\u6765\u843d\u5b50\u3002\u4e0a\u65b9\u793a\u4f8b\uff1a +tictactoe2 =\u73a9\u5bb6\u5728\u6a2a\u3001\u7ad6\u6216\u659c\u7ebf\u4e0a\u8fde\u7eed\u653e\u7f6e\u4e09\u4e2a\u68cb\u5b50\u5373\u53ef\u83b7\u80dc\u3002\u5728\u4e0a\u65b9\u7684\u793a\u4f8b\u4e2d\uff0c\u73a9\u5bb6\u901a\u8fc7\u659c\u7ebf\u4e0a\u7684\u4e09\u4e2a\u68cb\u5b50\u83b7\u80dc\u4e86\u6bd4\u8d5b\u3002 to-a-game-of=\u6311\u6218\u4e00\u573a +tutorial=\u4f60\u60f3\u770b\u8fd9\u4e2a\u6e38\u620f\u7684\u6559\u7a0b\u5417\uff1f volume=\u97f3\u91cf windowed=\u7a97\u53e3\u6a21\u5f0f yes=\u662f you-lost-against=\u60a8\u8f93\u7ed9\u4e86 you-were-challenged-by=\u60a8\u88ab\u6311\u6218\u81ea you-win=\u60a8\u83b7\u80dc\u4e86 +>=> +<=< arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u963f\u62c9\u4f2f\u8bed) chinese=\u4e2d\u6587 diff --git a/app/src/main/resources/assets/style/large.css b/app/src/main/resources/assets/style/large.css index f57a7bd..ef89cfa 100644 --- a/app/src/main/resources/assets/style/large.css +++ b/app/src/main/resources/assets/style/large.css @@ -48,4 +48,9 @@ .text { -fx-font-size: 22px; -fx-font-weight: normal; +} + +.image { + -fx-max-width: 200px; + -fx-max-height: 200px; } \ No newline at end of file diff --git a/app/src/main/resources/assets/style/medium.css b/app/src/main/resources/assets/style/medium.css index 94f849d..dfbc668 100644 --- a/app/src/main/resources/assets/style/medium.css +++ b/app/src/main/resources/assets/style/medium.css @@ -48,4 +48,9 @@ .text { -fx-font-size: 16px; -fx-font-weight: normal; +} + +.image { + -fx-max-width: 200px; + -fx-max-height: 200px; } \ No newline at end of file diff --git a/app/src/main/resources/assets/style/small.css b/app/src/main/resources/assets/style/small.css index 7b450d5..6b0e3cc 100644 --- a/app/src/main/resources/assets/style/small.css +++ b/app/src/main/resources/assets/style/small.css @@ -48,4 +48,9 @@ .text { -fx-font-size: 12px; -fx-font-weight: normal; -} \ No newline at end of file +} + +.image { + -fx-max-width: 200px; + -fx-max-height: 200px; +} diff --git a/framework/src/main/java/org/toop/framework/resource/resources/JsonAsset.java b/framework/src/main/java/org/toop/framework/resource/resources/JsonAsset.java index c13849c..f8491af 100644 --- a/framework/src/main/java/org/toop/framework/resource/resources/JsonAsset.java +++ b/framework/src/main/java/org/toop/framework/resource/resources/JsonAsset.java @@ -14,7 +14,7 @@ public class JsonAsset extends BaseResource implements LoadableResource { private T content; private Class type; - private final Gson gson = new GsonBuilder().setPrettyPrinting().create(); + private final Gson gson = new GsonBuilder().serializeNulls().setPrettyPrinting().create(); public JsonAsset(File file, Class type) { super(file); diff --git a/framework/src/main/java/org/toop/framework/resource/resources/SettingsAsset.java b/framework/src/main/java/org/toop/framework/resource/resources/SettingsAsset.java index 7728c9a..d5e0734 100644 --- a/framework/src/main/java/org/toop/framework/resource/resources/SettingsAsset.java +++ b/framework/src/main/java/org/toop/framework/resource/resources/SettingsAsset.java @@ -38,6 +38,22 @@ public class SettingsAsset extends JsonAsset { return getContent().layoutSize; } + public Boolean getTutorialFlag() { + return getContent().showTutorials; + } + + public Boolean getFirstTTT() { + return getContent().firstTTT; + } + + public Boolean getFirstConnect4() { + return getContent().firstConnect4; + } + + public Boolean getFirstReversi() { + return getContent().firstReversi; + } + public void setVolume(int volume) { getContent().volume = volume; save(); @@ -72,4 +88,24 @@ public class SettingsAsset extends JsonAsset { getContent().layoutSize = layoutSize; save(); } + + public void setTutorialFlag(boolean tutorialFlag) { + getContent().showTutorials = tutorialFlag; + save(); + } + + public void setFirstTTT(boolean firstTTT) { + getContent().firstTTT = firstTTT; + save(); + } + + public void setFirstConnect4(boolean firstConnect4) { + getContent().firstConnect4 = firstConnect4; + save(); + } + + public void setFirstReversi(boolean firstReversi) { + getContent().firstReversi = firstReversi; + save(); + } } diff --git a/framework/src/main/java/org/toop/framework/settings/Settings.java b/framework/src/main/java/org/toop/framework/settings/Settings.java index 052107c..d6e6101 100644 --- a/framework/src/main/java/org/toop/framework/settings/Settings.java +++ b/framework/src/main/java/org/toop/framework/settings/Settings.java @@ -8,4 +8,9 @@ public class Settings { public int volume = 100; public int fxVolume = 20; public int musicVolume = 15; + public Boolean showTutorials; + public Boolean firstReversi; + public Boolean firstTTT; + public Boolean firstConnect4; + }