diff options
| author | ilotterytea <iltsu@alright.party> | 2022-12-10 13:41:54 +0600 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2022-12-10 13:41:54 +0600 |
| commit | af41b7e39b4227bef2817ffc1c2fea221440b141 (patch) | |
| tree | a1b396f99ae2c19951bb070eb4bb67fab44429c0 /core/src/com/ilotterytea/maxoning/screens | |
| parent | 640a8c0bee92dae0e2e1b42ffe0551683cfe979e (diff) | |
Debug info can now be disabled/enabled
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/screens')
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/screens/GameScreen.java | 8 | ||||
| -rw-r--r-- | core/src/com/ilotterytea/maxoning/screens/MenuScreen.java | 12 |
2 files changed, 12 insertions, 8 deletions
diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java index 3382456..96adaf3 100644 --- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java @@ -180,14 +180,14 @@ public class GameScreen implements Screen, InputProcessor { stage.addActor(maxon); - DebugLabel debugLabel = new DebugLabel(skin); + DebugInfo debugInfo = new DebugInfo(skin, game.locale); - debugLabel.setPosition( + debugInfo.setPosition( 8, - (Gdx.graphics.getHeight() - debugLabel.getHeight()) - 8 + (Gdx.graphics.getHeight() - debugInfo.getHeight()) - 8 ); - stage.addActor(debugLabel); + if (game.prefs.getBoolean("debug")) stage.addActor(debugInfo); notEnoughPointsDialog = new Dialog(game.locale.TranslatableText("dialogs.not_enough_points"), skin, "dialog"); diff --git a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java index 6c40ecd..c5706ad 100644 --- a/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java +++ b/core/src/com/ilotterytea/maxoning/screens/MenuScreen.java @@ -48,6 +48,7 @@ public class MenuScreen implements Screen { TextButton startBtn; ImageButton rArrowBtn, lArrowBtn; Label savLabel; + final DebugInfo debugInfo; MaxonSavegame sav; @@ -145,10 +146,10 @@ public class MenuScreen implements Screen { stage.addActor(brandLogo); - // Debug label: - DebugLabel debug = new DebugLabel(skin); - debug.setPosition(4, stage.getHeight() - debug.getHeight() - 4); - stage.addActor(debug); + // Debug info: + debugInfo = new DebugInfo(skin, game.locale); + debugInfo.setPosition(4, stage.getHeight() - debugInfo.getHeight() - 4); + if (game.prefs.getBoolean("debug")) stage.addActor(debugInfo); Gdx.input.setInputProcessor(new InputMultiplexer(stage)); @@ -284,6 +285,9 @@ public class MenuScreen implements Screen { value = !value; + if (value) stage.addActor(debugInfo); + else debugInfo.remove(); + debButton.getLabel().setText((value) ? "ON" : "OFF"); } }); |
