From 08596cf6cb7ee5871932eecdbb5a2e4251cf92a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 2 Feb 2016 15:06:46 +0100 Subject: Hud: better fix for optionsBtn handling --- core/src/ch/asynk/rustanddust/game/Hud.java | 4 ++-- core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java index 2bf44ac..0e1ddec 100644 --- a/core/src/ch/asynk/rustanddust/game/Hud.java +++ b/core/src/ch/asynk/rustanddust/game/Hud.java @@ -285,8 +285,8 @@ public class Hud implements Disposable, Animation private void toggleOptionsPanel() { if (dialogs.size() > 0) { - if (optionsPanel.visible && (dialogs.peek() == optionsPanel)) { - optionsPanel.apply(); + if (dialogs.peek() == optionsPanel) { + optionsPanel.close(); closeDialog(); } } else { diff --git a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java index ddb2aea..e7a4377 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java +++ b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java @@ -180,6 +180,13 @@ public class OptionsPanel extends Patch { } + public void close() + { + apply(); + objectivesPanel.visible = false; + this.visible = false; + } + @Override public void dispose() { -- cgit v1.1-2-g2b99