From 4b8ddabfde8b81a3ae4e8038c0d315747c73eaa7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 5 Feb 2022 18:58:48 -0500 Subject: [PATCH] v1.2.0: fixed errors with inventory pane selector cancel logic --- .../shatteredpixeldungeon/ui/InventoryPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 922309a50..c3a98621d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/InventoryPane.java @@ -114,7 +114,11 @@ public class InventoryPane extends Component { blocker = new PointerArea(0, 0, PixelScene.uiCamera.width, PixelScene.uiCamera.height){ @Override protected void onClick(PointerEvent event) { - if (selector != null){ + if (selector != null && !bg.overlapsScreenPoint((int)event.current.x, (int)event.current.y)){ + //any windows opened as a consequence of this should be centered on the inventory + GameScene.lastOffset = new Point((int)InventoryPane.this.centerX() - camera.width/2, + (int)InventoryPane.this.centerY() - camera.height/2); + selector.onSelect(null); selector = null; updateInventory(); }