From f36447921f11d651503bf38f3d2533f286cf569c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 18 Nov 2014 16:34:37 +0100 Subject: Hud: factorize closeDialog() --- core/src/ch/asynk/tankontank/game/Hud.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 09f2408..57d96fb 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -162,23 +162,23 @@ public class Hud implements Disposable private void closeDialog() { + boolean ok = okCancel.ok; switch(dialogAction) { case END_TURN: - if (okCancel.ok) + if (ok) ctrl.abortPlayerTurn(); - okCancel.visible = false; break; case END_DEPLOYMENT: - if (okCancel.ok) + if (ok) ctrl.endDeployment(); - okCancel.visible = false; break; case END_GAME: stats.visible = false; ctrl.endGame(); break; } + okCancel.visible = false; ctrl.blockMap = false; } -- cgit v1.1-2-g2b99