diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java index 6f6dbea4a..c65b6713c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java @@ -143,7 +143,8 @@ public class CellSelector extends ScrollArea { } public void select( int cell ) { - if (enabled && listener != null && cell != -1) { + if (enabled && Dungeon.hero.ready && !GameScene.isShowingWindow() + && listener != null && cell != -1) { listener.onSelect( cell ); GameScene.ready(); 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 f44ad1e64..e2be04b01 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -1027,6 +1027,16 @@ public class GameScene extends PixelScene { } } + public static boolean isShowingWindow(){ + if (scene == null) return false; + + for (Gizmo g : scene.members){ + if (g instanceof Window) return true; + } + + return false; + } + public static void updateFog(){ if (scene != null) { scene.fog.updateFog(); @@ -1097,8 +1107,10 @@ public class GameScene extends PixelScene { cellSelector.listener.onSelect(null); } cellSelector.listener = listener; - if (scene != null) - scene.prompt( listener.prompt() ); + cellSelector.enabled = Dungeon.hero.ready; + if (scene != null) { + scene.prompt(listener.prompt()); + } } private static boolean cancelCellSelector() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java index e28f32f27..4ae8dae88 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/QuickSlotButton.java @@ -79,7 +79,7 @@ public class QuickSlotButton extends Button { slot = new ItemSlot() { @Override protected void onClick() { - if (!Dungeon.hero.isAlive()){ + if (!Dungeon.hero.isAlive() || !Dungeon.hero.ready){ return; } if (targeting) {