v0.9.0b: long-pressing item buttons in alchemy now shows a desc window

This commit is contained in:
Evan Debenham 2020-10-13 20:03:43 -04:00
parent 5885359d5a
commit f59073b4b0
2 changed files with 20 additions and 0 deletions

View File

@ -153,6 +153,15 @@ public class AlchemyScene extends PixelScene {
}
AlchemyScene.this.addToFront(WndBag.lastBag( itemSelector, WndBag.Mode.ALCHEMY, Messages.get(AlchemyScene.class, "select")));
}
@Override
protected boolean onLongClick() {
if (item != null){
Game.scene().addToFront(new WndInfoItem(item));
return true;
}
return false;
}
};
inputs[i].setRect(left + 10, pos, BTN_SIZE, BTN_SIZE);
add(inputs[i]);
@ -518,12 +527,20 @@ public class AlchemyScene extends PixelScene {
protected void onClick() {
ItemButton.this.onClick();
}
@Override
protected boolean onLongClick() {
return ItemButton.this.onLongClick();
}
};
slot.enable(true);
add( slot );
}
protected void onClick() {}
protected boolean onLongClick() {
return false;
}
@Override
protected void layout() {

View File

@ -492,6 +492,9 @@ public class WndBag extends WndTabbed {
Dungeon.quickslot.setSlot( 0 , item );
QuickSlotButton.refresh();
return true;
} else if (listener != null) {
Game.scene().addToFront(new WndInfoItem(item));
return true;
} else {
return false;
}