summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()
{