From bbf50c07ff6ed5e0cf1e4120c7a7079025d6d9e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 9 Dec 2015 09:33:15 +0100 Subject: Ctrl,Hud: automatically close engagementPanel at the end of animations --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 4 ++-- core/src/ch/asynk/rustanddust/game/Hud.java | 7 +++++++ 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); -- cgit v1.1-2-g2b99