From 8c890750433d12df785dad5d4f4ac60d2ae8d5e3 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 10 Jul 2018 23:24:57 -0400 Subject: [PATCH] v0.7.0: added a version indicator to the main game UI and debug functionality to the starting scene --- .../shatteredpixeldungeon/scenes/TitleScene.java | 11 +++++++++++ .../shatteredpixeldungeon/ui/StatusPane.java | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java index b2ab4cc82..7be3ba576 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/TitleScene.java @@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.scenes; import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.BuildConfig; import com.shatteredpixel.shatteredpixeldungeon.GamesInProgress; import com.shatteredpixel.shatteredpixeldungeon.SPDSettings; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; @@ -122,6 +123,16 @@ public class TitleScene extends PixelScene { ShatteredPixelDungeon.switchNoFade( StartScene.class ); } } + + @Override + protected boolean onLongClick() { + //making it easier to start runs quickly while debugging + if (BuildConfig.DEBUG) { + TitleScene.this.add( new WndStartGame(1) ); + return true; + } + return super.onLongClick(); + } }; add( btnPlay ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java index 66b0cbbeb..dbb53a6a7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/StatusPane.java @@ -73,6 +73,8 @@ public class StatusPane extends Component { private MenuButton btnMenu; private Toolbar.PickedUpItem pickedUp; + + private BitmapText version; @Override protected void createChildren() { @@ -135,6 +137,10 @@ public class StatusPane extends Component { add( buffs ); add( pickedUp = new Toolbar.PickedUpItem()); + + version = new BitmapText( "v" + Game.version, PixelScene.pixelFont); + version.hardlight( 0xCCCCCC ); + add(version); } @Override @@ -168,6 +174,12 @@ public class StatusPane extends Component { btnJournal.setPos( width - 42, 1 ); btnMenu.setPos( width - btnMenu.width(), 1 ); + + version.scale.set(PixelScene.align(0.5f)); + version.measure(); + version.x = width - version.width(); + version.y = btnMenu.bottom() + (4 - version.baseLine()); + PixelScene.align(version); } private static final int[] warningColors = new int[]{0x660000, 0xCC0000, 0x660000};