v1.2.0: fixed inventory windows on desktop interface when selling
This commit is contained in:
parent
f339ee1691
commit
033d0f725c
|
@ -117,8 +117,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndTradeItem.sell(item);
|
WndTradeItem.sell(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnSell.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
btnSell.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
||||||
|
@ -134,8 +134,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndTradeItem.sellOne(item);
|
WndTradeItem.sellOne(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnSell1.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
btnSell1.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
||||||
|
@ -145,8 +145,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndTradeItem.sell(item);
|
WndTradeItem.sell(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnSellAll.setRect(0, btnSell1.bottom() + 1, width, BTN_HEIGHT);
|
btnSellAll.setRect(0, btnSell1.bottom() + 1, width, BTN_HEIGHT);
|
||||||
|
@ -165,8 +165,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndEnergizeItem.energize(item);
|
WndEnergizeItem.energize(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnEnergize.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
btnEnergize.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
||||||
|
@ -182,8 +182,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndEnergizeItem.energizeOne(item);
|
WndEnergizeItem.energizeOne(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnEnergize1.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
btnEnergize1.setRect(0, pos + GAP, width, BTN_HEIGHT);
|
||||||
|
@ -193,8 +193,8 @@ public class Alchemize extends Spell {
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
WndEnergizeItem.energize(item);
|
WndEnergizeItem.energize(item);
|
||||||
consumeAlchemize();
|
|
||||||
hide();
|
hide();
|
||||||
|
consumeAlchemize();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
btnEnergizeAll.setRect(0, btnEnergize1.bottom() + 1, width, BTN_HEIGHT);
|
btnEnergizeAll.setRect(0, btnEnergize1.bottom() + 1, width, BTN_HEIGHT);
|
||||||
|
|
|
@ -1110,13 +1110,21 @@ public class GameScene extends PixelScene {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean interfaceBlockingHero(){
|
public static boolean showingWindow(){
|
||||||
if (scene == null) return false;
|
if (scene == null) return false;
|
||||||
|
|
||||||
for (Gizmo g : scene.members){
|
for (Gizmo g : scene.members){
|
||||||
if (g instanceof Window) return true;
|
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()){
|
if (scene.inventory != null && scene.inventory.isSelecting()){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1235,7 +1243,7 @@ public class GameScene extends PixelScene {
|
||||||
|
|
||||||
if (scene != null) {
|
if (scene != null) {
|
||||||
//TODO can the inventory pane work in these cases? bad to fallback to mobile window
|
//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);
|
scene.inventory.setSelector(listener);
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user