From 8cf519d3e13084824b1145c0f52ff8cbd8379ee0 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 19 Feb 2022 20:40:48 -0500 Subject: [PATCH] v1.2.0: fixed keyboard/controller input not cancelling resting --- .../shatteredpixeldungeon/scenes/CellSelector.java | 5 +++++ .../com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java index edc88c2bc..442ce7822 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/scenes/CellSelector.java @@ -305,6 +305,7 @@ public class CellSelector extends ScrollArea { } else if (directionFromAction(action) != 0) { + Dungeon.hero.resting = false; lastCellMoved = -1; if (heldAction1 == SPDAction.NONE){ heldAction1 = action; @@ -316,6 +317,9 @@ public class CellSelector extends ScrollArea { heldAction3 = action; } + return true; + } else if (Dungeon.hero.resting){ + Dungeon.hero.resting = false; return true; } @@ -335,6 +339,7 @@ public class CellSelector extends ScrollArea { if (newLeftStick != leftStickAction){ if (leftStickAction == SPDAction.NONE){ heldDelay = 0.05f; + Dungeon.hero.resting = false; } else if (newLeftStick == SPDAction.NONE && heldDelay > 0f){ heldDelay = 0f; moveFromActions(leftStickAction); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java index ad6fa9c51..4082e435f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/Toolbar.java @@ -126,7 +126,8 @@ public class Toolbar extends Component { @Override public GameAction keyAction() { - return SPDAction.REST; + if (btnWait.active) return SPDAction.REST; + else return null; } });