v1.2.0: fixed keyboard/controller input not cancelling resting

This commit is contained in:
Evan Debenham 2022-02-19 20:40:48 -05:00 committed by Evan Debenham
parent c0ead7c841
commit 8cf519d3e1
2 changed files with 7 additions and 1 deletions

View File

@ -305,6 +305,7 @@ public class CellSelector extends ScrollArea {
} else if (directionFromAction(action) != 0) { } else if (directionFromAction(action) != 0) {
Dungeon.hero.resting = false;
lastCellMoved = -1; lastCellMoved = -1;
if (heldAction1 == SPDAction.NONE){ if (heldAction1 == SPDAction.NONE){
heldAction1 = action; heldAction1 = action;
@ -316,6 +317,9 @@ public class CellSelector extends ScrollArea {
heldAction3 = action; heldAction3 = action;
} }
return true;
} else if (Dungeon.hero.resting){
Dungeon.hero.resting = false;
return true; return true;
} }
@ -335,6 +339,7 @@ public class CellSelector extends ScrollArea {
if (newLeftStick != leftStickAction){ if (newLeftStick != leftStickAction){
if (leftStickAction == SPDAction.NONE){ if (leftStickAction == SPDAction.NONE){
heldDelay = 0.05f; heldDelay = 0.05f;
Dungeon.hero.resting = false;
} else if (newLeftStick == SPDAction.NONE && heldDelay > 0f){ } else if (newLeftStick == SPDAction.NONE && heldDelay > 0f){
heldDelay = 0f; heldDelay = 0f;
moveFromActions(leftStickAction); moveFromActions(leftStickAction);

View File

@ -126,7 +126,8 @@ public class Toolbar extends Component {
@Override @Override
public GameAction keyAction() { public GameAction keyAction() {
return SPDAction.REST; if (btnWait.active) return SPDAction.REST;
else return null;
} }
}); });