From 689ab7866e25a7c6a02c35e29e89498889b9d9e5 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Wed, 28 Sep 2022 21:55:49 +0600 Subject: как заверяет м-р. greddyss это должно пофиксить (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/com/ilotterytea/maxoning/MaxonConstants.java | 4 ++++ core/src/com/ilotterytea/maxoning/screens/GameScreen.java | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'core/src/com/ilotterytea/maxoning') diff --git a/core/src/com/ilotterytea/maxoning/MaxonConstants.java b/core/src/com/ilotterytea/maxoning/MaxonConstants.java index 6db18a9..9790f80 100644 --- a/core/src/com/ilotterytea/maxoning/MaxonConstants.java +++ b/core/src/com/ilotterytea/maxoning/MaxonConstants.java @@ -4,6 +4,8 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.ilotterytea.maxoning.utils.OsUtils; +import java.text.DecimalFormat; + public class MaxonConstants { public static final String GAME_NAME = "Maxon Petting Simulator"; public static final String GAME_VERSION = "Alpha 1.2"; @@ -16,4 +18,6 @@ public class MaxonConstants { public static final FileHandle FILE_EN_US = Gdx.files.internal("i18n/en_us.json"); public static final FileHandle FILE_RU_RU = Gdx.files.internal("i18n/ru_ru.json"); + + public static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###,###.##"); } diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java index ce3bbed..bb55484 100644 --- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java @@ -14,6 +14,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Timer; import com.badlogic.gdx.utils.viewport.FillViewport; +import com.ilotterytea.maxoning.MaxonConstants; import com.ilotterytea.maxoning.MaxonGame; import com.ilotterytea.maxoning.anim.SpriteUtils; import com.ilotterytea.maxoning.inputprocessors.CrossProcessor; @@ -246,7 +247,7 @@ public class GameScreen implements Screen, InputProcessor { player.points += multiplier; - final TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", String.valueOf(1 * player.multiplier)), skin, "default"); + final TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", MaxonConstants.DECIMAL_FORMAT.format(1 * player.multiplier)), skin, "default"); label.setPosition( mainTable.getX() + actor.getActorX(), @@ -314,8 +315,8 @@ public class GameScreen implements Screen, InputProcessor { // Update the points label: pointsLabel.setText(game.locale.FormattedText("game.points", - String.valueOf(player.points), - String.valueOf(player.multiplier) + MaxonConstants.DECIMAL_FORMAT.format(player.points), + MaxonConstants.DECIMAL_FORMAT.format(player.multiplier) )); stage.draw(); @@ -406,7 +407,7 @@ public class GameScreen implements Screen, InputProcessor { player.points += 1 * player.multiplier; - final TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", String.valueOf(1 * player.multiplier)), skin, "default"); + final TypingLabel label = new TypingLabel(game.locale.FormattedText("game.newPoint", MaxonConstants.DECIMAL_FORMAT.format(1 * player.multiplier)), skin, "default"); label.setPosition( mainTable.getX() + actor.getActorX(), -- cgit v1.2.3