diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 21 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 4 |
2 files changed, 14 insertions, 11 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 341292b..11b20a8 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -107,16 +107,17 @@ public class Ctrl implements Disposable public void animationDone() { animationCount -= 1; - if (animationCount == 0) { - animationCount = map.animationsDone(); - if (animationCount == 0) { - StateType tmp = stateAfterAnimation; - stateAfterAnimation = StateType.DONE; - setState(tmp); - } - } - if (animationCount < 0) - TankOnTank.debug(" animationCount < 0"); + if (animationCount > 0) + return; + animationCount = map.animationsDone(); + if (animationCount > 0) + return; + if (hud.dialogActive()) + return; + + StateType tmp = stateAfterAnimation; + stateAfterAnimation = StateType.DONE; + setState(tmp); } private void startPlayerTurn() diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 7de65db..f1e6424 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -180,7 +180,9 @@ public class Hud implements Disposable closeOkCancel(); else if (dialog == stats) ctrl.endGame(); - // else if (dialog == engagement) + else if (dialog == engagement) { + ctrl.animationDone(); + } if (dialogs.size() > 0) dialogs.getFirst().visible = true; |