From 6453da8b559f7a88aeed867e02e6e5f9718ab45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 27 Nov 2014 14:45:42 +0100 Subject: Ctrl,Hud: only hit dialogs when in action --- core/src/ch/asynk/tankontank/game/Ctrl.java | 5 +++++ core/src/ch/asynk/tankontank/game/Hud.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 7149d56..3390863 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -259,6 +259,11 @@ public class Ctrl implements Disposable state.touchUp(); } + public boolean isInAnimation() + { + return (this.stateType == StateType.ANIMATION); + } + public void stateTouchUp() { this.state.touchUp(); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 9e680cb..9220925 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -144,6 +144,10 @@ public class Hud implements Disposable return false; } } + + if (ctrl.isInAnimation()) + return false; + if (hit == null) { if (actionButtons.touchDown(x, y)) hit = actionButtons; -- cgit v1.1-2-g2b99