v1.2.0: fixed various issues caused by new inventory pane
This commit is contained in:
parent
41dc5c90af
commit
dfdd0648de
|
@ -490,8 +490,7 @@ public class Item implements Bundlable {
|
|||
}
|
||||
|
||||
public static void updateQuickslot() {
|
||||
QuickSlotButton.refresh();
|
||||
InventoryPane.refresh();
|
||||
GameScene.updateItemDisplays = true;
|
||||
}
|
||||
|
||||
private static final String QUANTITY = "quantity";
|
||||
|
|
|
@ -143,7 +143,7 @@ public class CellSelector extends ScrollArea {
|
|||
}
|
||||
|
||||
public void select( int cell ) {
|
||||
if (enabled && Dungeon.hero.ready && !GameScene.isShowingWindow()
|
||||
if (enabled && Dungeon.hero.ready && !GameScene.InterfaceBlockingHero()
|
||||
&& listener != null && cell != -1) {
|
||||
|
||||
listener.onSelect( cell );
|
||||
|
|
|
@ -665,10 +665,18 @@ public class GameScene extends PixelScene {
|
|||
//this caps the speed of resting for higher refresh rate displays
|
||||
private float notifyDelay = 1/60f;
|
||||
|
||||
public static boolean updateItemDisplays = false;
|
||||
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
lastOffset = null;
|
||||
|
||||
if (updateItemDisplays){
|
||||
updateItemDisplays = false;
|
||||
QuickSlotButton.refresh();
|
||||
InventoryPane.refresh();
|
||||
}
|
||||
|
||||
if (Dungeon.hero == null || scene == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -1084,13 +1092,17 @@ public class GameScene extends PixelScene {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isShowingWindow(){
|
||||
public static boolean InterfaceBlockingHero(){
|
||||
if (scene == null) return false;
|
||||
|
||||
for (Gizmo g : scene.members){
|
||||
if (g instanceof Window) return true;
|
||||
}
|
||||
|
||||
if (scene.inventory != null && scene.inventory.isSelecting()){
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -348,6 +348,10 @@ public class InventoryPane extends Component {
|
|||
updateInventory();
|
||||
}
|
||||
|
||||
public boolean isSelecting(){
|
||||
return selector != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void update() {
|
||||
super.update();
|
||||
|
|
|
@ -42,11 +42,15 @@ public class WndTradeItem extends WndInfoItem {
|
|||
|
||||
private WndBag owner;
|
||||
|
||||
private boolean selling = false;
|
||||
|
||||
//selling
|
||||
public WndTradeItem( final Item item, WndBag owner ) {
|
||||
|
||||
super(item);
|
||||
|
||||
selling = true;
|
||||
|
||||
this.owner = owner;
|
||||
|
||||
float pos = height;
|
||||
|
@ -102,6 +106,8 @@ public class WndTradeItem extends WndInfoItem {
|
|||
|
||||
super(heap);
|
||||
|
||||
selling = false;
|
||||
|
||||
Item item = heap.peek();
|
||||
|
||||
float pos = height;
|
||||
|
@ -167,7 +173,7 @@ public class WndTradeItem extends WndInfoItem {
|
|||
if (owner != null) {
|
||||
owner.hide();
|
||||
}
|
||||
Shopkeeper.sell();
|
||||
if (selling) Shopkeeper.sell();
|
||||
}
|
||||
|
||||
public static void sell( Item item ) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user