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 601e544dc..5dc329e39 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java @@ -28,7 +28,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.items.Heap; -import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap; import com.watabou.input.ControllerHandler; import com.watabou.input.GameAction; @@ -145,7 +144,7 @@ public class CellSelector extends ScrollArea { } public void select( int cell, int button ) { - if (enabled && Dungeon.hero.ready && !GameScene.InterfaceBlockingHero() + if (enabled && Dungeon.hero.ready && !GameScene.interfaceBlockingHero() && listener != null && cell != -1) { switch (button){ 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 30617471e..dcadd666b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -1110,7 +1110,7 @@ public class GameScene extends PixelScene { } } - public static boolean InterfaceBlockingHero(){ + public static boolean interfaceBlockingHero(){ if (scene == null) return false; for (Gizmo g : scene.members){ @@ -1227,7 +1227,8 @@ public class GameScene extends PixelScene { cancelCellSelector(); if (scene != null) { - if (scene.inventory != null && scene.inventory.visible){ + //TODO can the inventory pane work in these cases? bad to fallback to mobile window + if (scene.inventory != null && scene.inventory.visible && !interfaceBlockingHero()){ scene.inventory.setSelector(listener); return null; } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java index ef0692a84..50473939e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndBag.java @@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; +import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.PixelScene; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; @@ -374,7 +375,12 @@ public class WndBag extends WndTabbed { @Override protected void onClick( Tab tab ) { hide(); - Game.scene().addToFront(new WndBag(((BagTab) tab).bag, selector)); + Window w = new WndBag(((BagTab) tab).bag, selector); + if (Game.scene() instanceof GameScene){ + GameScene.show(w); + } else { + Game.scene().addToFront(w); + } } @Override