From 57c6abd7302345ccfaa645a20bfdb07de1d50788 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 10 Aug 2016 19:04:09 -0400 Subject: [PATCH] v0.4.1a: corrections to inventory window logic --- .../shatteredpixeldungeon/scenes/GameScene.java | 6 +++--- .../shatteredpixeldungeon/windows/WndItem.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java index 49fb5a44c..40afdd33b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/scenes/GameScene.java @@ -570,7 +570,7 @@ public class GameScene extends PixelScene { banner.camera = uiCamera; banner.x = align( uiCamera, (uiCamera.width - banner.width) / 2 ); banner.y = align( uiCamera, (uiCamera.height - banner.height) / 3 ); - add( banner ); + addToFront( banner ); } // ------------------------------------------------------- @@ -689,7 +689,7 @@ public class GameScene extends PixelScene { public static void show( Window wnd ) { cancelCellSelector(); - scene.add( wnd ); + scene.addToFront( wnd ); } public static void afterObserve() { @@ -756,7 +756,7 @@ public class GameScene extends PixelScene { WndBag.getBag( WandHolster.class, listener, mode, title ) : WndBag.lastBag( listener, mode, title ); - scene.add( wnd ); + scene.addToFront( wnd ); return wnd; } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java index 1b1279b5e..0cf140810 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/windows/WndItem.java @@ -79,7 +79,7 @@ public class WndItem extends Window { @Override protected void onClick() { hide(); - if (owner != null) owner.hide(); + if (owner != null && owner.parent != null) owner.hide(); item.execute( Dungeon.hero, action ); }; };