From 9c3b6f234c918d36b13b7a9818cc3696d83915e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 19 Feb 2015 16:21:10 +0100 Subject: Ctrl: leave Animation state when engagement panel is closed and animations are done --- TODO | 1 - core/src/ch/asynk/tankontank/game/Ctrl.java | 10 ++++++++++ core/src/ch/asynk/tankontank/game/Hud.java | 5 ++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/TODO b/TODO index 39baa63..c6a9cf4 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,5 @@ BUGS: - unitDock click issues - - possible to select units before the end of engagement animation TODO: - GameModeMenu diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 24f496c..3609fee 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -120,6 +120,11 @@ public class Ctrl implements Disposable return; if (hud.dialogActive()) return; + leaveAnimationState(); + } + + private void leaveAnimationState() + { StateType tmp = stateAfterAnimation; stateAfterAnimation = StateType.DONE; @@ -306,6 +311,11 @@ public class Ctrl implements Disposable } // Hud callbacks + public void engagementPanelClosed() + { + if (animationCount == 0) + leaveAnimationState(); + } public void endDeployment() { diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 63996fe..b1d2dd6 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -202,9 +202,8 @@ public class Hud implements Disposable, Animation closeOkCancel(); else if (dialog == stats) ctrl.endGame(); - else if (dialog == engagement) { - ctrl.animationDone(); - } + else if (dialog == engagement) + ctrl.engagementPanelClosed(); if (dialogs.size() > 0) dialogs.getFirst().visible = true; -- cgit v1.1-2-g2b99