v1.1.0: added safety checks for multiple inputs in the same frame
This commit is contained in:
parent
6d77ed872d
commit
d747590bcf
|
@ -143,7 +143,8 @@ public class CellSelector extends ScrollArea {
|
|||
}
|
||||
|
||||
public void select( int cell ) {
|
||||
if (enabled && listener != null && cell != -1) {
|
||||
if (enabled && Dungeon.hero.ready && !GameScene.isShowingWindow()
|
||||
&& listener != null && cell != -1) {
|
||||
|
||||
listener.onSelect( cell );
|
||||
GameScene.ready();
|
||||
|
|
|
@ -1027,6 +1027,16 @@ public class GameScene extends PixelScene {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isShowingWindow(){
|
||||
if (scene == null) return false;
|
||||
|
||||
for (Gizmo g : scene.members){
|
||||
if (g instanceof Window) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void updateFog(){
|
||||
if (scene != null) {
|
||||
scene.fog.updateFog();
|
||||
|
@ -1097,8 +1107,10 @@ public class GameScene extends PixelScene {
|
|||
cellSelector.listener.onSelect(null);
|
||||
}
|
||||
cellSelector.listener = listener;
|
||||
if (scene != null)
|
||||
scene.prompt( listener.prompt() );
|
||||
cellSelector.enabled = Dungeon.hero.ready;
|
||||
if (scene != null) {
|
||||
scene.prompt(listener.prompt());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean cancelCellSelector() {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class QuickSlotButton extends Button {
|
|||
slot = new ItemSlot() {
|
||||
@Override
|
||||
protected void onClick() {
|
||||
if (!Dungeon.hero.isAlive()){
|
||||
if (!Dungeon.hero.isAlive() || !Dungeon.hero.ready){
|
||||
return;
|
||||
}
|
||||
if (targeting) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user