summaryrefslogtreecommitdiff
path: root/core/src/com/ilotterytea/maxoning/screens
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/screens')
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/AssetLoadingScreen.java2
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/GameScreen.java82
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/MenuScreen.java8
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/SplashScreen.java2
4 files changed, 37 insertions, 57 deletions
diff --git a/core/src/com/ilotterytea/maxoning/screens/AssetLoadingScreen.java b/core/src/com/ilotterytea/maxoning/screens/AssetLoadingScreen.java
index 4c2d876..e61dc90 100644
--- a/core/src/com/ilotterytea/maxoning/screens/AssetLoadingScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/AssetLoadingScreen.java
@@ -52,7 +52,7 @@ public class AssetLoadingScreen implements Screen {
private void update() {
if (game.assetManager.update()) {
- AssetLoading.registerItems(game.assetManager);
+ AssetLoading.registerItems(game.assetManager, game.locale);
game.setScreen(new SplashScreen(game));
dispose();
}
diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
index b9970b0..424000c 100644
--- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
@@ -62,7 +62,7 @@ public class GameScreen implements Screen, InputProcessor {
stage = new Stage(new FillViewport(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()));
skin = new Skin(Gdx.files.internal("main.skin"));
- shopWindow = new Window("Pet Shop", skin);
+ shopWindow = new Window(game.locale.TranslatableText("game.petShop"), skin);
items = new ArrayList<>();
@@ -77,7 +77,7 @@ public class GameScreen implements Screen, InputProcessor {
blackBg = new Image(game.assetManager.get("sprites/black.png", Texture.class));
- shopButton = new SupaIconButton(button, "Pet Shop", skin);
+ shopButton = new SupaIconButton(button, game.locale.TranslatableText("game.petShop"), skin);
bgTile = game.assetManager.get("sprites/menu/tile_1.png", Texture.class);
bgTileAlt = game.assetManager.get("sprites/menu/tile_2.png", Texture.class);
@@ -116,31 +116,7 @@ public class GameScreen implements Screen, InputProcessor {
maxon.addListener(new ClickListener() {
@Override public void clicked(InputEvent event, float x, float y) {
- maxonCat.nextFrame();
- maxon.setDrawable(maxonCat.getDrawable());
- player.points += 1 * player.multiplier;
-
- final TypingLabel label = new TypingLabel("{SHAKE}{RAINBOW}+" + Math.round(1 * player.multiplier) + "{ENDRAINBOW}{ENDSHAKE}", skin, "default");
-
- label.setPosition(
- maxon.getX() + (maxon.getWidth() / 2f) - 8,
- maxon.getY() + maxon.getHeight()
- );
-
- label.addAction(Actions.parallel(
- Actions.fadeOut(5f),
- Actions.moveTo(
- label.getX(), label.getY() + (float) Math.floor(Math.random() * 156), 5f, Interpolation.exp5Out)
- ));
-
- Timer.schedule(new Timer.Task() {
- @Override
- public void run() {
- label.remove();
- }
- }, 10f);
-
- stage.addActor(label);
+ displayPointIncrease();
}
});
@@ -241,7 +217,7 @@ public class GameScreen implements Screen, InputProcessor {
player.points += 1 * itemMultiplier;
- TypingLabel label = new TypingLabel("{SHAKE}{RAINBOW}+" + Math.round(1 * itemMultiplier) + "{ENDRAINBOW}{ENDSHAKE}", skin, "default");
+ TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", String.valueOf(Math.round(1 * itemMultiplier))), skin, "default");
label.setPosition(
maxon.getX() + (maxon.getWidth() / 2f) - 8,
@@ -296,7 +272,7 @@ public class GameScreen implements Screen, InputProcessor {
}
}
- pointsLabel.setText(Math.round(player.points) + " S (x" + player.multiplier + ")");
+ pointsLabel.setText(game.locale.FormattedText("game.points", String.valueOf(Math.round(player.points)), String.valueOf(player.multiplier)));
stage.draw();
stage.act(delta);
@@ -332,33 +308,37 @@ public class GameScreen implements Screen, InputProcessor {
dispose();
}
if (Gdx.input.isKeyPressed(Input.Keys.SPACE) || Gdx.input.isKeyPressed(Input.Keys.UP)) {
- maxonCat.nextFrame();
- maxon.setDrawable(maxonCat.getDrawable());
- player.points += 1 * player.multiplier;
+ displayPointIncrease();
+ }
+ return false;
+ }
- final TypingLabel label = new TypingLabel("{SHAKE}{RAINBOW}+" + Math.round(1 * player.multiplier) + "{ENDRAINBOW}{ENDSHAKE}", skin, "default");
+ private void displayPointIncrease() {
+ maxonCat.nextFrame();
+ maxon.setDrawable(maxonCat.getDrawable());
+ player.points += 1 * player.multiplier;
- label.setPosition(
- maxon.getX() + (maxon.getWidth() / 2f) - 8,
- maxon.getY() + maxon.getHeight()
- );
+ final TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", String.valueOf(Math.round(1 * player.multiplier))), skin, "default");
- label.addAction(Actions.parallel(
- Actions.fadeOut(5f),
- Actions.moveTo(
- label.getX(), label.getY() + (float) Math.floor(Math.random() * 156), 5f, Interpolation.exp5Out)
- ));
+ label.setPosition(
+ maxon.getX() + (maxon.getWidth() / 2f) - 8,
+ maxon.getY() + maxon.getHeight()
+ );
- Timer.schedule(new Timer.Task() {
- @Override
- public void run() {
- label.remove();
- }
- }, 10f);
+ label.addAction(Actions.parallel(
+ Actions.fadeOut(5f),
+ Actions.moveTo(
+ label.getX(), label.getY() + (float) Math.floor(Math.random() * 156), 5f, Interpolation.exp5Out)
+ ));
- stage.addActor(label);
- }
- return false;
+ Timer.schedule(new Timer.Task() {
+ @Override
+ public void run() {
+ label.remove();
+ }
+ }, 10f);
+
+ stage.addActor(label);
}
@Override
diff --git a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
index 2f85558..dc3d8b1 100644
--- a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java
@@ -67,12 +67,12 @@ public class MenuScreen implements Screen, InputProcessor {
this.brandLogo = new Image(game.assetManager.get("sprites/brand.png", Texture.class));
- this.startLabel = new Label("PRESS START", skin, "press");
+ this.startLabel = new Label(game.locale.TranslatableText("menu.pressStart"), skin, "press");
this.infoLabel = new DebugLabel(skin);
- this.playGameButton = new TextButton("PLAY GAME", skin);
- this.optionsButton = new TextButton("OPTIONS", skin);
- this.quitButton = new TextButton("QUIT TO DESKTOP", skin);
+ this.playGameButton = new TextButton(game.locale.TranslatableText("menu.playGame"), skin);
+ this.optionsButton = new TextButton(game.locale.TranslatableText("menu.options"), skin);
+ this.quitButton = new TextButton(game.locale.TranslatableText("menu.quit"), skin);
optionsButton.setDisabled(true);
diff --git a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
index bc3c472..eb067cd 100644
--- a/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/SplashScreen.java
@@ -35,7 +35,7 @@ public class SplashScreen implements InputProcessor, Screen {
this.skin = new Skin(Gdx.files.internal("main.skin"));
this.infoLabel = new DebugLabel(skin);
- this.disclaimer = new Label("This game contains an unbelievable dose of cheeky \"woolbags\". Please, it is not recommended for anyone to play. Any match in real life of the presented images of cats is pure coincidence! All cat images were generated by \"NUT-S\" neural network.", skin, "disclaimer");
+ this.disclaimer = new Label(game.locale.TranslatableText("splash.disclaimer"), skin, "disclaimer");
this.legalLabel = new Label("", skin, "disclaimer");
this.dev = new Image(game.assetManager.get("sprites/ilotterytea.png", Texture.class));