summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-02-02 15:06:46 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-02-02 15:06:46 +0100
commit08596cf6cb7ee5871932eecdbb5a2e4251cf92a3 (patch)
tree247590e03bdab328e45f419318568cbcb437d42e
parent619bc54eb1d6f84937f35f00c55de74d22797d50 (diff)
downloadRustAndDust-08596cf6cb7ee5871932eecdbb5a2e4251cf92a3.zip
RustAndDust-08596cf6cb7ee5871932eecdbb5a2e4251cf92a3.tar.gz
Hud: better fix for optionsBtn handling
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hud.java4
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java7
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()
{