From 084ee193ddc9de462c5f53339b842c3255e10c52 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 12 Sep 2022 13:25:28 -0400 Subject: [PATCH] v1.4.0: various further improvements to new tutorial --- .../scenes/GameScene.java | 20 ++++++++------ .../scenes/WelcomeScene.java | 3 ++- .../ui/InventoryPane.java | 27 +++++++++++++++++++ .../ui/InventorySlot.java | 6 +++++ .../shatteredpixeldungeon/ui/ItemSlot.java | 1 + 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index cce30a2f2..844c389fb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -581,9 +581,9 @@ public class GameScene extends PixelScene { } else { GLog.p(Messages.get(GameScene.class, "tutorial_move_desktop")); } - toolbar.visible = false; - status.visible = false; - if (inventory != null) inventory.visible = false; + toolbar.visible = toolbar.active = false; + status.visible = status.active = false; + if (inventory != null) inventory.visible = inventory.active = false; } if (Rankings.INSTANCE.totalNumber > 0 && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_DIEING)){ @@ -1058,17 +1058,21 @@ public class GameScene extends PixelScene { protected void updateValues(float progress) { if (progress <= 0.5f) { scene.status.alpha(2*progress); - scene.status.visible = true; - scene.toolbar.visible = false; + scene.status.visible = scene.status.active = true; + scene.toolbar.visible = scene.toolbar.active = false; + if (scene.inventory != null) scene.inventory.visible = scene.inventory.active = false; } else { scene.status.alpha(1f); - scene.status.visible = true; + scene.status.visible = scene.status.active = true; scene.toolbar.alpha((progress - 0.5f)*2); - scene.toolbar.visible = true; + scene.toolbar.visible = scene.toolbar.active = true; + if (scene.inventory != null){ + scene.inventory.visible = scene.inventory.active = true; + scene.inventory.alpha((progress - 0.5f)*2); + } } } }); - if (scene.inventory != null) scene.inventory.visible = true; GameLog.wipe(); if (SPDSettings.interfaceSize() == 0){ GLog.p(Messages.get(GameScene.class, "tutorial_ui_mobile")); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java index eaa983d0a..e56670eef 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/WelcomeScene.java @@ -157,7 +157,8 @@ public class WelcomeScene extends PixelScene { GamesInProgress.selectedClass = null; GamesInProgress.curSlot = GamesInProgress.firstEmpty(); if (GamesInProgress.curSlot == -1){ - ShatteredPixelDungeon.switchScene(StartScene.class); + SPDSettings.intro(false); + ShatteredPixelDungeon.switchScene(TitleScene.class); } else { ShatteredPixelDungeon.switchScene(HeroSelectScene.class); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java index f48356d77..4fdc479c1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java @@ -263,6 +263,27 @@ public class InventoryPane extends Component { super.layout(); } + + public void alpha( float value ){ + bg.alpha( value ); + bg2.alpha( value ); + + for (InventorySlot slot : equipped){ + slot.alpha( value ); + } + for (InventorySlot slot : bagItems){ + slot.alpha( value ); + } + + gold.alpha(value); + goldTxt.alpha(value); + energy.alpha(value); + energyTxt.alpha(value); + + for (BagButton bag : bags){ + bag.alpha( value ); + } + } public static void refresh(){ if (instance != null) instance.updateInventory(); @@ -614,6 +635,12 @@ public class InventoryPane extends Component { bgBottom.y = y+1; bgBottom.x = x; } + + public void alpha( float value ){ + bgTop.alpha(value); + bgBottom.alpha(value); + icon.alpha(value); + } @Override protected void onClick() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventorySlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventorySlot.java index 2c8e82770..d86962127 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventorySlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventorySlot.java @@ -64,6 +64,12 @@ public class InventorySlot extends ItemSlot { super.layout(); } + @Override + public void alpha(float value) { + super.alpha(value); + bg.alpha(value); + } + @Override public void item( Item item ) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java index dd21b2fb0..b30ac0ffa 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/ItemSlot.java @@ -167,6 +167,7 @@ public class ItemSlot extends Button { } public void alpha( float value ){ + if (!active) value *= 0.3f; if (sprite != null) sprite.alpha(value); if (extra != null) extra.alpha(value); if (status != null) status.alpha(value);