From b23dc623abcee4ca5d74c3ffb00a37183ff7e9ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 9 Dec 2015 21:52:16 +0100 Subject: Ctrl: reduce exchanges between Hud and Ctrl during engagement --- core/src/ch/asynk/rustanddust/game/Ctrl.java | 19 +++++-------------- core/src/ch/asynk/rustanddust/game/Hud.java | 2 -- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 5edadaf..4179ccd 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -106,15 +106,11 @@ public class Ctrl implements Disposable { if (hud.dialogActive()) hud.notifyAnimationsEnd(); - else if (stateType == StateType.ANIMATION) - leaveAnimationState(); - } - - private void leaveAnimationState() - { - StateType tmp = stateAfterAnimation; - stateAfterAnimation = StateType.DONE; - setState(tmp); + if (stateType == StateType.ANIMATION) { + StateType tmp = stateAfterAnimation; + stateAfterAnimation = StateType.DONE; + setState(tmp); + } } private StateType actionAborted() @@ -280,11 +276,6 @@ public class Ctrl implements Disposable } // Hud callbacks - public void engagementPanelClosed() - { - if (animationCount == 0) - leaveAnimationState(); - } public void endDeployment() { diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java index b1750f8..68b2eb5 100644 --- a/core/src/ch/asynk/rustanddust/game/Hud.java +++ b/core/src/ch/asynk/rustanddust/game/Hud.java @@ -216,8 +216,6 @@ public class Hud implements Disposable, Animation closeOkCancel(); else if (dialog == stats) ctrl.endGame(); - else if (dialog == engagement) - ctrl.engagementPanelClosed(); if (dialogs.size() > 0) dialogs.getFirst().visible = true; -- cgit v1.1-2-g2b99