summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-09 09:33:15 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-09 09:33:15 +0100
commitbbf50c07ff6ed5e0cf1e4120c7a7079025d6d9e4 (patch)
treec9dfad2da7597675643e5dc3482d6977928375e5 /core/src
parent6724b48b61826455733dd3492014aee3de031845 (diff)
downloadRustAndDust-bbf50c07ff6ed5e0cf1e4120c7a7079025d6d9e4.zip
RustAndDust-bbf50c07ff6ed5e0cf1e4120c7a7079025d6d9e4.tar.gz
Ctrl,Hud: automatically close engagementPanel at the end of animations
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hud.java7
2 files changed, 9 insertions, 2 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index c5fbe44..6c9f0b1 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -105,8 +105,8 @@ public class Ctrl implements Disposable
public void animationsOver()
{
if (hud.dialogActive())
- return;
- if (stateType == StateType.ANIMATION)
+ hud.notifyAnimationsEnd();
+ else if (stateType == StateType.ANIMATION)
leaveAnimationState();
}
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java
index 6d82ac8..b1750f8 100644
--- a/core/src/ch/asynk/rustanddust/game/Hud.java
+++ b/core/src/ch/asynk/rustanddust/game/Hud.java
@@ -248,6 +248,13 @@ public class Hud implements Disposable, Animation
}
}
+ public void notifyAnimationsEnd()
+ {
+ Widget dialog = dialogs.getFirst();
+ if (dialog == engagement)
+ closeDialog();
+ }
+
public boolean dialogActive()
{
return (dialogs.size() > 0);