summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-02-19 16:21:10 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-02-19 16:21:10 +0100
commit9c3b6f234c918d36b13b7a9818cc3696d83915e4 (patch)
tree3ac5dd1ab0be2f20293ac04ac58666394dca210e /core/src/ch/asynk/tankontank
parent48f89c3783c2a08fcc0bbce88f06421dd93344de (diff)
downloadRustAndDust-9c3b6f234c918d36b13b7a9818cc3696d83915e4.zip
RustAndDust-9c3b6f234c918d36b13b7a9818cc3696d83915e4.tar.gz
Ctrl: leave Animation state when engagement panel is closed and animations are done
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java10
-rw-r--r--core/src/ch/asynk/tankontank/game/Hud.java5
2 files changed, 12 insertions, 3 deletions
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;