v1.2.0: fixed inventory windows on desktop interface when selling

This commit is contained in:
Evan Debenham 2022-02-23 19:40:28 -05:00
parent f339ee1691
commit 033d0f725c
2 changed files with 16 additions and 8 deletions

View File

@ -117,8 +117,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndTradeItem.sell(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnSell.setRect(0, pos + GAP, width, BTN_HEIGHT);
@ -134,8 +134,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndTradeItem.sellOne(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnSell1.setRect(0, pos + GAP, width, BTN_HEIGHT);
@ -145,8 +145,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndTradeItem.sell(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnSellAll.setRect(0, btnSell1.bottom() + 1, width, BTN_HEIGHT);
@ -165,8 +165,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndEnergizeItem.energize(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnEnergize.setRect(0, pos + GAP, width, BTN_HEIGHT);
@ -182,8 +182,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndEnergizeItem.energizeOne(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnEnergize1.setRect(0, pos + GAP, width, BTN_HEIGHT);
@ -193,8 +193,8 @@ public class Alchemize extends Spell {
@Override
protected void onClick() {
WndEnergizeItem.energize(item);
consumeAlchemize();
hide();
consumeAlchemize();
}
};
btnEnergizeAll.setRect(0, btnEnergize1.bottom() + 1, width, BTN_HEIGHT);

View File

@ -1110,13 +1110,21 @@ public class GameScene extends PixelScene {
}
}
public static boolean interfaceBlockingHero(){
public static boolean showingWindow(){
if (scene == null) return false;
for (Gizmo g : scene.members){
if (g instanceof Window) return true;
}
return false;
}
public static boolean interfaceBlockingHero(){
if (scene == null) return false;
if (showingWindow()) return true;
if (scene.inventory != null && scene.inventory.isSelecting()){
return true;
}
@ -1235,7 +1243,7 @@ public class GameScene extends PixelScene {
if (scene != null) {
//TODO can the inventory pane work in these cases? bad to fallback to mobile window
if (scene.inventory != null && scene.inventory.visible && !interfaceBlockingHero()){
if (scene.inventory != null && scene.inventory.visible && !showingWindow()){
scene.inventory.setSelector(listener);
return null;
} else {