Tutorials to Dev (#264)

* Fixed garbage code

* added a pop button

* Tutorial images now use ImageAsset.java

* Added button to continue and start game. Refactors

* Refactored nextScreen runnable

* Removed unused imports

* Refactored switch statement

* Added documentation

* Removed space

* Added translations

* Added function input for enabling/disabling localization p/text

---------

Co-authored-by: ramollia <>
This commit is contained in:
Bas Antonius de Jong
2025-12-02 10:57:46 +01:00
committed by GitHub
parent c332033a06
commit d9437c1b8a
25 changed files with 224 additions and 281 deletions

View File

@@ -54,8 +54,7 @@ public final class Primitive {
return text(key, true);
}
public static ImageView image(File file) {
ImageAsset imageAsset = new ImageAsset(file);
public static ImageView image(ImageAsset imageAsset) {
ImageView imageView = new ImageView(imageAsset.getImage());
imageView.getStyleClass().add("image");
imageView.setPreserveRatio(true);

View File

@@ -0,0 +1,5 @@
package org.toop.app.widget;
public interface Updatable {
void update();
}

View File

@@ -1,7 +1,21 @@
package org.toop.app.widget.complex;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
public abstract class PopupWidget extends StackWidget {
private final Button popButton;
public PopupWidget() {
super("bg-popup");
popButton = new Button("X");
popButton.setOnAction(_ -> hide());
add(Pos.TOP_RIGHT, popButton);
}
protected void setOnPop(Runnable onPop) {
popButton.setOnAction(_ -> onPop.run());
}
}

View File

@@ -20,5 +20,10 @@ public class QuitPopup extends PopupWidget {
});
add(Pos.CENTER, confirmWidget);
setOnPop(() -> {
App.stopQuit();
hide();
});
}
}

View File

@@ -1,60 +1,115 @@
package org.toop.app.widget.tutorial;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.image.ImageView;
import javafx.scene.text.Text;
import org.apache.maven.surefire.shared.lang3.tuple.ImmutablePair;
import org.toop.app.widget.Primitive;
import org.toop.app.widget.complex.ViewWidget;
import org.toop.app.widget.Updatable;
import org.toop.app.widget.WidgetContainer;
import org.toop.app.widget.complex.PopupWidget;
import javafx.scene.control.Button;
import org.toop.framework.resource.resources.ImageAsset;
import org.toop.local.AppContext;
import java.io.File;
import java.util.List;
public class BaseTutorialWidget extends ViewWidget {
/**
* A widget base for all the tutorial widgets.
*
* <p>Usage example:
*
* <pre>{@code
* public class Connect4TutorialWidget extends BaseTutorialWidget {
* public Connect4TutorialWidget(Runnable nextScreen) {
* super(List.of(
* new ImmutablePair<>("connect4.1", ResourceManager.get("connect41.png")),
* new ImmutablePair<>("connect4.2", ResourceManager.get("connect42.png"))
* ), nextScreen);
* }
* }</pre>
*/
public class BaseTutorialWidget extends PopupWidget implements Updatable {
private TState state;
private Text tutorialText;
private Button previousButton;
private Button nextButton;
private Button noButton;
private Button yesButton;
private Button neverButton;
private ImageView imagery;
private final Text tutorialText;
private final ImageView imagery;
private final Button previousButton;
private final Button nextButton;
private final List<ImmutablePair<String, ImageAsset>> pages;
private final Runnable nextScreen;
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));
}
private int pageIndex = 0;
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(List<ImmutablePair<String, ImageAsset>> pages, Runnable nextScreen) {
this.tutorialText = Primitive.text(pages.getFirst().getKey());
this.imagery = Primitive.image(pages.getFirst().getValue());
this.pages = pages;
this.nextScreen = nextScreen;
previousButton = Primitive.button("goback", () -> { update(false); this.hide(); });
nextButton = Primitive.button(">", () -> update(true));
var w = Primitive.hbox(
previousButton,
nextButton
);
var x = Primitive.vbox(imagery, tutorialText);
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));
WidgetContainer.add(Pos.CENTER, this);
}
public void update(String key, File image) {
@Override
public void update() {
update(true);
}
// TODO Refactor if statements to make code easier to read.
public void update(boolean next) {
pageIndex = next ? pageIndex + 1 : pageIndex - 1;
if (pageIndex >= pages.size()) {
pageIndex--;
return;
} else if (pageIndex < 0) {
pageIndex++;
return;
}
if (pageIndex == pages.size()-1) {
nextButton.textProperty().unbind();
nextButton.setText(AppContext.getString("startgame"));
nextButton.setOnAction((_) -> {
this.hide();
nextScreen.run();
});
} else {
nextButton.textProperty().unbind();
nextButton.setText(AppContext.getString(">"));
nextButton.setOnAction((_) -> this.update(true));
}
if (pageIndex == 0) {
previousButton.textProperty().unbind();
previousButton.setText(AppContext.getString("goback"));
previousButton.setOnAction((_) -> this.hide());
} else {
previousButton.textProperty().unbind();
previousButton.setText(AppContext.getString("<"));
previousButton.setOnAction((_) -> this.update(false));
}
var currentPage = pages.get(pageIndex);
var text = currentPage.getKey();
var image = currentPage.getValue();
tutorialText.textProperty().unbind();
tutorialText.setText(AppContext.getString(key));
tutorialText.setText(AppContext.getString(text));
imagery.setImage(Primitive.image(image).getImage());
}
}

View File

@@ -1,39 +1,15 @@
package org.toop.app.widget.tutorial;
import javafx.geometry.Pos;
import org.toop.app.widget.complex.ViewWidget;
import org.apache.maven.surefire.shared.lang3.tuple.ImmutablePair;
import org.toop.framework.resource.ResourceManager;
import java.io.File;
import java.util.List;
public class Connect4TutorialWidget extends ViewWidget {
private TState state;
private String[] keys = {"connect4.1", "connect4.2"};
private File[] images = {new File("app/src/main/resources/assets/images/connect41.png"), new File("app/src/main/resources/assets/images/connect42.png")};
private BaseTutorialWidget tutorialWidget;
public Connect4TutorialWidget() {
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();
}
}
);
add(Pos.CENTER, tutorialWidget);
}
private void update() {
tutorialWidget.update(keys[state.getCurrent()], images[state.getCurrent()]);
public class Connect4TutorialWidget extends BaseTutorialWidget {
public Connect4TutorialWidget(Runnable nextScreen) {
super(List.of(
new ImmutablePair<>("connect4.1", ResourceManager.get("connect41.png")),
new ImmutablePair<>("connect4.2", ResourceManager.get("connect42.png"))
), nextScreen);
}
}

View File

@@ -1,39 +1,17 @@
package org.toop.app.widget.tutorial;
import javafx.geometry.Pos;
import org.toop.app.widget.complex.ViewWidget;
import org.apache.maven.surefire.shared.lang3.tuple.ImmutablePair;
import org.toop.framework.resource.ResourceManager;
import java.io.File;
import java.util.List;
public class ReversiTutorialWidget extends ViewWidget {
private TState state;
private String[] keys = {"reversi1", "reversi2", "reversi3", "reversi4"};
private File[] images = {new File("app/src/main/resources/assets/images/reversi1.png"), new File("app/src/main/resources/assets/images/reversi2.png"), new File("app/src/main/resources/assets/images/cat.jpg"), new File("app/src/main/resources/assets/images/cat.jpg")};
private BaseTutorialWidget tutorialWidget;
public ReversiTutorialWidget() {
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();
}
}
);
add(Pos.CENTER, tutorialWidget);
}
private void update() {
tutorialWidget.update(keys[state.getCurrent()], images[state.getCurrent()]);
public class ReversiTutorialWidget extends BaseTutorialWidget {
public ReversiTutorialWidget(Runnable nextScreen) {
super(List.of(
new ImmutablePair<>("reversi1", ResourceManager.get("reversi1.png")),
new ImmutablePair<>("reversi2", ResourceManager.get("reversi2.png")),
new ImmutablePair<>("reversi3", ResourceManager.get("cat.jpg")),
new ImmutablePair<>("reversi4", ResourceManager.get("cat.jpg"))
), nextScreen);
}
}

View File

@@ -0,0 +1,22 @@
package org.toop.app.widget.tutorial;
import javafx.geometry.Pos;
import org.toop.app.widget.Primitive;
import org.toop.app.widget.WidgetContainer;
import org.toop.app.widget.complex.PopupWidget;
import org.toop.local.AppSettings;
public class ShowEnableTutorialWidget extends PopupWidget {
public ShowEnableTutorialWidget(Runnable tutorial, Runnable nextScreen, Runnable appSettingsSetter) {
var a = Primitive.hbox(
Primitive.button("ok", () -> { appSettingsSetter.run(); tutorial.run(); this.hide(); }),
Primitive.button("no", () -> { appSettingsSetter.run(); nextScreen.run(); this.hide(); }),
Primitive.button("never", () -> { AppSettings.getSettings().setTutorialFlag(false); nextScreen.run(); this.hide(); })
);
var txt = Primitive.text("tutorial");
add(Pos.CENTER, Primitive.vbox(txt, a));
WidgetContainer.add(Pos.CENTER, this);
}
}

View File

@@ -1,44 +0,0 @@
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;
}
}

View File

@@ -1,42 +1,16 @@
package org.toop.app.widget.tutorial;
import javafx.geometry.Pos;
import org.toop.app.widget.complex.ViewWidget;
import java.io.File;
import org.apache.maven.surefire.shared.lang3.tuple.ImmutablePair;
import org.toop.framework.resource.ResourceManager;
public class TicTacToeTutorialWidget extends ViewWidget {
import java.util.List;
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() {
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();
}
}
);
add(Pos.CENTER, tutorialWidget);
public class TicTacToeTutorialWidget extends BaseTutorialWidget {
public TicTacToeTutorialWidget(Runnable nextScreen) {
super(List.of(
new ImmutablePair<>("tictactoe1", ResourceManager.get("tictactoe1.png")),
new ImmutablePair<>("tictactoe2", ResourceManager.get("tictactoe2.png"))
), nextScreen);
}
private void update() {
tutorialWidget.update(keys[state.getCurrent()], images[state.getCurrent()]);
}
}

View File

@@ -53,23 +53,13 @@ public final class GameView extends ViewWidget {
switch(gameType) {
case "TicTacToe":
this.tutorialButton = Primitive.button("tutorialstring", () -> {
transitionNext(new TicTacToeTutorialWidget());
});
break;
this.tutorialButton = Primitive.button("tutorialstring", () -> new TicTacToeTutorialWidget(() -> {})); break;
case "Reversi":
this.tutorialButton = Primitive.button("tutorialstring", () -> {
transitionNext(new ReversiTutorialWidget());
});
break;
this.tutorialButton = Primitive.button("tutorialstring", () -> new ReversiTutorialWidget(() -> {})); break;
case "Connect4":
this.tutorialButton = Primitive.button("tutorialstring", () -> {
transitionNext(new Connect4TutorialWidget());
});
break;
this.tutorialButton = Primitive.button("tutorialstring", () -> new Connect4TutorialWidget(() -> {})); break;
default:
this.tutorialButton = null;
break;
this.tutorialButton = null; break;
}
setupLayout();

View File

@@ -10,10 +10,7 @@ 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.Connect4TutorialWidget;
import org.toop.app.widget.tutorial.ReversiTutorialWidget;
import org.toop.app.widget.tutorial.TicTacToeTutorialWidget;
import org.toop.app.widget.tutorial.*;
import org.toop.local.AppContext;
import javafx.geometry.Pos;
@@ -40,91 +37,40 @@ public class LocalMultiplayerView extends ViewWidget {
switch (information.type) {
case TICTACTOE:
if (AppSettings.getSettings().getTutorialFlag() && AppSettings.getSettings().getFirstTTT()) {
BaseTutorialWidget a = new BaseTutorialWidget(
"tutorial",
() -> {
AppSettings.getSettings().setFirstTTT(false);
Platform.runLater(() -> {
new TicTacToeGameThread(information);
});
},
() -> {
ViewWidget c = new TicTacToeTutorialWidget();
transitionNext(c);
WidgetContainer.setCurrentView(c);
AppSettings.getSettings().setFirstTTT(false);
},
() -> {
AppSettings.getSettings().setTutorialFlag(false);
Platform.runLater(() -> {
new TicTacToeGameThread(information);
});
}
);
transitionNext(a);
break;
new ShowEnableTutorialWidget(
() -> new TicTacToeTutorialWidget(() -> new TicTacToeGameThread(information)),
() -> Platform.runLater(() -> new TicTacToeGameThread(information)),
() -> AppSettings.getSettings().setFirstTTT(false)
);
} else {
new TicTacToeGameThread(information);
}
new TicTacToeGameThread(information);
break;
case REVERSI:
if (AppSettings.getSettings().getTutorialFlag() && AppSettings.getSettings().getFirstReversi()) {
BaseTutorialWidget a = new BaseTutorialWidget(
"tutorial",
() -> { Platform.runLater(() -> {
AppSettings.getSettings().setFirstReversi(false);
new ReversiGame(information);
});
},
() -> {
Platform.runLater(() -> {
ViewWidget c = new ReversiTutorialWidget();
transitionNext(c);
WidgetContainer.setCurrentView(c);
AppSettings.getSettings().setFirstReversi(false);
});
},
() -> {
Platform.runLater(() -> {
AppSettings.getSettings().setTutorialFlag(false);
new ReversiGame(information);
});
});
transitionNext(a);
break;
new ShowEnableTutorialWidget(
() -> new ReversiTutorialWidget(() -> new ReversiGame(information)),
() -> Platform.runLater(() -> new ReversiGame(information)),
() -> AppSettings.getSettings().setFirstReversi(false)
);
} else {
new ReversiGame(information);
}
new ReversiGame(information);
break;
case CONNECT4:
if (AppSettings.getSettings().getTutorialFlag() && AppSettings.getSettings().getFirstConnect4()) {
BaseTutorialWidget a = new BaseTutorialWidget(
"tutorial",
() -> { Platform.runLater(() -> {
AppSettings.getSettings().setFirstConnect4(false);
new Connect4Game(information);
});
},
() -> {
Platform.runLater(() -> {
ViewWidget c = new Connect4TutorialWidget();
transitionNext(c);
WidgetContainer.setCurrentView(c);
AppSettings.getSettings().setFirstConnect4(false);
});
},
() -> {
Platform.runLater(() -> {
AppSettings.getSettings().setTutorialFlag(false);
new Connect4Game(information);
});
});
transitionNext(a);
break;
new ShowEnableTutorialWidget(
() -> new Connect4TutorialWidget(() -> new Connect4Game(information)),
() -> Platform.runLater(() -> new Connect4Game(information)),
() -> AppSettings.getSettings().setFirstConnect4(false)
);
} else {
new Connect4Game(information);
}
new Connect4Game(information);
break;
}
}
// case BATTLESHIP -> new BattleshipGame(information);
});
});
var playerSection = setupPlayerSections();

View File

@@ -83,6 +83,8 @@ reversi2=\u0639\u0646\u062f\u0645\u0627 \u062a\u0646\u0642\u0631 \u0639\u0644\u0
reversi3=\u0645\u0631\u062a\u0643 \u0642\u062f \u064a\u062a\u063a\u0627\u0637 \u0625\u0630\u0627 \u0644\u0645 \u064a\u0643\u0646 \u0647\u0646\u0627\u0643 \u062d\u0631\u0643 \u0642\u0627\u0646\u0648\u0646\u064a.
reversi4=\u0627\u0644\u0644\u0627\u0639\u0628 \u0627\u0644\u0630\u064a \u064a\u0641\u0648\u0632 \u0641\u064a \u0646\u0647\u0627\u064a\u0629 \u0627\u0644\u0644\u0639\u0628 \u0647\u0648 \u0627\u0644\u0630\u064a \u064a\u0643\u0648\u0646 \u0644\u062f\u064a\u0647 \u0627\u0644\u0623\u0643\u062b\u0631 \u0645\u0646 \u0627\u0644\u0644\u0648\u0639\u0627\u0628 \u0639\u0644\u0649 \u0627\u0644\u0644\u0648\u062d\u0629.
tutorialstring=\u0627\u0644\u062f\u0631\u0633 \u0627\u0644\u062a\u0648\u0636\u064a\u062d\u064a
startgame=\u0627\u0628\u062f\u0623 \u0627\u0644\u0644\u0639\u0628\u0629!
goback=\u0627\u0631\u062c\u0639
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629
chinese=\u4e2d\u6587 (\u0627\u0644\u0635\u064a\u0646\u064a\u0629)

View File

@@ -85,6 +85,8 @@ reversi2=Wenn du auf einen Punkt klickst, werden alle Spielsteine dazwischen umg
reversi3=Dein Zug kann <20>bersprungen werden, wenn es keinen legalen Zug gibt. Dein Gegner spielt dann weiter, bis du einen legalen Zug machen kannst.
reversi4=Der Spieler, der am Ende die meisten Steine auf dem Brett hat, gewinnt.
tutorialstring=Tutorial
startgame=Spiel starten!
goback=Zur<EFBFBD>ck
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch)
chinese=\u4e2d\u6587 (Chinesisch)

View File

@@ -84,6 +84,8 @@ reversi2=Clicking on a dot will flip all the moves between where you place the d
reversi3=Your turn may be skipped if there is no legal move. This will let your opponent play again until you get an opportunity at a legal move.
reversi4=The player who wins at the end of the game is the one who has the most pieces on the board.
tutorialstring=Tutorial
startgame=Start game!
goback=Go back
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabic)

View File

@@ -84,6 +84,8 @@ reversi2=Al hacer clic en un punto, se voltear
reversi3=Tu turno puede ser saltado si no hay un movimiento legal. Esto permitir<69> que tu oponente juegue nuevamente hasta que tengas una oportunidad legal.
reversi4=El jugador que gane al final del juego es quien tenga m<>s fichas en el tablero.
tutorialstring=Tutorial
startgame=\u00a1Iniciar juego!
goback=Volver
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Ar\u00e1bigo)

View File

@@ -84,6 +84,8 @@ reversi2=Cliquer sur un point retournera tous les pions entre le point plac
reversi3=Votre tour peut <20>tre saut<75> s'il n'y a pas de coup l<>gal. Cela permettra <20> votre adversaire de jouer jusqu'<27> ce que vous ayez un coup l<>gal.
reversi4=Le joueur qui a le plus de pions <20> la fin du jeu gagne.
tutorialstring=Tutoriel
startgame=D\u00e9marrer le jeu!
goback=Retour
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabe)
chinese=\u4e2d\u6587 (Chinois)

View File

@@ -84,6 +84,8 @@ reversi2=\u0915\u093f\u0938 \u092a\u0930 \u092a\u093f\u0938 \u092a\u0948\u0918 \
reversi3=\u092f\u0939 \u092a\u0930\u094d\u092f \u0938\u0947 \u0938\u0947\u091a \u0915\u0940 \u091c\u093e\u0902\u091c \u0928\u0939\u0940\u0902 \u0939\u0948 \u0914\u0938\u0924\u0947 \u0915\u0948 \u092a\u0948\u0928 \u092a\u0930\u094d\u092f \u0939\u0948 \u0914\u092a\u0915\u0940 \u0915\u0940 \u092a\u0932\u0947 \u092d\u0942\u0924 \u0915\u0940 \u0906\u0927\u093e \u092a\u0948\u0928 \u091c\u093e\u0902\u091c \u0915\u0930 \u0938\u0915\u0924\u0947 \u0939\u0948\u0902.
reversi4=\u0916\u0941\u092f \u0915\u093f \u0915\u0940 \u0928\u093f\u092e\u0940 \u092e\u0947\u0902 \u091a\u093e\u0932 \u0938\u092c\u0938\u0947 \u091a\u0942\u0928\u094d\u0928\u0947 \u0939\u0948, \u0935\u0949 \u0915\u0947 \u092e\u093e\u0924\u094d\u0930 \u091c\u0940\u0924\u0947 \u0939\u0948.
tutorialstring=\u0924\u0942\u091f\u0949\u0930\u093f\u092f\u0932
startgame=\u0916\u0947\u0932 \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902!
goback=\u0935\u093e\u092a\u0938 \u091c\u093e\u090f\u0901
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0905\u0930\u092c\u0940)
chinese=\u4e2d\u6587 (\u091a\u0940\u0928\u0940)

View File

@@ -83,6 +83,8 @@ reversi2=Cliccando su un punto, tutti i pezzi tra dove metti il punto e il pross
reversi3=Il tuo turno pu<70> essere saltato se non ci sono mosse legali. Questo permetter<65> al tuo avversario di giocare fino a quando non avrai un'opportunit<69> legale.
reversi4=Il giocatore che alla fine del gioco ha pi<70> pezzi sulla scacchiera vince.
tutorialstring=Tutorial
startgame=Avvia il gioco!
goback=Indietro
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabo)
chinese=\u4e2d\u6587 (Cinese)

View File

@@ -83,6 +83,8 @@ reversi2=\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u3064\u306a\u304c\u308
reversi3=\u6b21\u306e\u52d5\u304b\u3057\u304c\u306a\u3044\u5834\u5408\u3001\u8a8d\u5b9a\u3055\u308c\u305f\u52d5\u304b\u3057\u306e\u6642\u9593\u306f\u62d2\u7d76\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002
reversi4=\u672c\u6b21\u306b\u30dc\u30fc\u30c9\u4e0a\u3067\u6700\u591a\u306e\u8ca0\u3051\u3092\u6301\u3064\u30d7\u30ec\u30a4\u30e4\u30fc\u304c\u52dd\u3061\u307e\u3059\u3002
tutorialstring=\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb
startgame=\u30b2\u30fc\u30e0\u3092\u958b\u59cb\uff01
goback=\u623b\u308b
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u30a2\u30e9\u30d3\u30a2\u8a9e)
chinese=\u4e2d\u6587 (\u4e2d\u6587)

View File

@@ -83,6 +83,8 @@ reversi2=\ud074\ub9ad \ud558\uba70, \ub2e4\ub978 \ud648 \uc704\ub85c \ucd5c\uc2e
reversi3=\uc0ac\uc6a9\uc790\uc758 \ud648\uc744 \ud074 \uc218 \uc5c6\uc2b5\uc2b5\ub2c8\ub2e4. \uc0ac\uc6a9\uc790 \ub2f5\uc5d0 \ub300\ud574 \uc811\ub2c8\ub2e4.
reversi4=\uacbd\uc6b0 \uc5d0\uc11c \ucd5c\ub300 \ud648\uc744 \uac00\uc838\ub294 \uc0ac\uc6a9\uc790\uc774 \uc52c\uc544\uc624\uba70 \uc0ac\uc6a9\uc790\uc758 \ud648\uc744 \uc54c\ub824\ud569\ub2c8\ub2e4.
tutorialstring=\ud14c\ud2b8\ub9ad
startgame=\uac8c\uc784 \uc2dc\uc791!
goback=\ub4a4\ub85c \uac00\uae30
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u0639\u0631\u0628\u064a\u0629)
chinese=\u4e2d\u6587 (\u4e2d\u6587)

View File

@@ -83,6 +83,8 @@ reversi2=Door op een stip te klikken draai je alle stukken om tussen de plaats w
reversi3=Je beurt kan worden overgeslagen als er geen legale zet is. Hierdoor kan je tegenstander doorgaan tot jij een legale zet kunt doen.
reversi4=De speler die aan het einde van het spel de meeste stukken op het bord heeft, wint.
tutorialstring=Tutorial
startgame=Spel starten!
goback=Ga terug
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (Arabisch)
chinese=\u4e2d\u6587 (Chinees)

View File

@@ -83,6 +83,8 @@ reversi2=\u041d043 \u043d043 \u0430043 \u043a043 \u0430043 \u043a043 \u043e043 \
reversi3=\u0412043 \u0430043 \u0436043 \u0434043 \u0430043 \u043d043 \u0438043 \u043d043 \u0435043 \u0435043 \u0432043 \u0430043.
reversi4=\u0418043 \u0433043 \u0440043 \u043e043 \u043a043 \u043e043 \u0442043 \u043e043 \u0442043 \u043e043 \u0435043 \u0435043 \u0430043 \u0435043 \u043d043 \u0438043 \u0435043 \u0435043 \u043c043 \u0430043.
tutorialstring=\u0423\u0447\u0435\u0431\u043d\u0438\u043a
startgame=\u041d\u0430\u0447\u0430\u0442\u044c \u0438\u0433\u0440\u0443!
goback=\u041d\u0430\u0437\u0430\u0434
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)

View File

@@ -83,6 +83,8 @@ reversi2=\u70b9\u51fb\u4e00\u4e2a\u70b9\u65f6\u5c06\u5c06\u6240\u6709\u4e2d\u95f
reversi3=\u5982\u679c\u6ca1\u6709\u5408\u6cd5\u64cd\u4f5c\u4f60\u7684\u8fdb\u6b65\u53ef\u80fd\u88ab\u5ffd\u7565. \u8fd9\u4f1a\u8ba9\u5bf9\u624b\u518d\u6b21\u64cd\u4f5c\u5230\u4f60\u6709\u5408\u6cd5\u64cd\u4f5c\u65f6.
reversi4=\u672c\u6e38\u620f\u7ed3\u675f\u65f6\u8d62\u5f97\u6ee1\u8fc7\u76d8\u9762\u7684\u4ee3\u7406\u6570\u6700\u591a\u7684\u4eba\u5c31\u80dc.
tutorialstring=\u6559\u7a0b
startgame=\u5f00\u59cb\u6e38\u620f\uff01
goback=\u8fd4\u56de
arabic=\u0627\u0644\u0639\u0631\u0628\u064a\u0629 (\u963f\u62c9\u4f2f\u8bed)
chinese=\u4e2d\u6587

View File

@@ -8,7 +8,7 @@ import org.toop.framework.resource.types.LoadableResource;
@FileExtension({"png", "jpg", "jpeg"})
public class ImageAsset extends BaseResource implements LoadableResource {
private Image image;
private Image image = null;
public ImageAsset(final File file) {
super(file);
@@ -40,8 +40,7 @@ public class ImageAsset extends BaseResource implements LoadableResource {
public Image getImage() {
if (!this.isLoaded) {
this.load();
return image;
}
return null;
return image;
}
}