diff options
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Hud.java | 20 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java | 10 |
2 files changed, 20 insertions, 10 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java index e59cae2..56b76dd 100644 --- a/core/src/ch/asynk/rustanddust/game/Hud.java +++ b/core/src/ch/asynk/rustanddust/game/Hud.java @@ -67,7 +67,7 @@ public class Hud implements Disposable, Animation actionButtons = new ActionButtons(game); actionButtons.hide(); msg = new Msg(game.font, game.bgPatch, 20f); - okCancel = new OkCancel(game.font, game.bgPatch, game.factory.getHudRegion(game.factory.ACT_DONE), game.factory.getHudRegion(game.factory.ACT_ABORT), game.typeSnd); + okCancel = new OkCancel(game.font, game.bgPatch, game.factory.getHudRegion(game.factory.ACT_DONE), game.factory.getHudRegion(game.factory.ACT_ABORT)); optionsBtn = new Bg(game.factory.getHudRegion(game.factory.ACT_OPTIONS)); optionsPanel = new OptionsPanel(game); stats = new StatisticsPanel(game); @@ -185,7 +185,7 @@ public class Hud implements Disposable, Animation public boolean hit(float x, float y, boolean isInAnimation) { if (optionsBtn.hit(x, y)) { - game.typeSnd.play(); + game.playType(); toggleOptionsPanel(); return true; } @@ -202,10 +202,13 @@ public class Hud implements Disposable, Animation if (isInAnimation) return false; - if (actionButtons.hit(x, y)) + if (actionButtons.hit(x, y)) { + game.playType(); return true; - else if (playerInfo.hit(x, y)) + } else if (playerInfo.hit(x, y)) { + game.playType(); return true; + } return false; } @@ -217,7 +220,10 @@ public class Hud implements Disposable, Animation if (dialog == okCancel) closeOkCancel(); - else if (dialog == stats) + else + game.playType(); + + if (dialog == stats) ctrl.endGame(); if (dialogs.size() > 0) @@ -229,6 +235,10 @@ public class Hud implements Disposable, Animation private void closeOkCancel() { boolean ok = okCancel.ok; + if (ok) + game.playEnter(); + else + game.playType(); switch(okCancelAction) { case EXIT_BOARD: diff --git a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java index ea175c9..ba0f395 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java +++ b/core/src/ch/asynk/rustanddust/game/hud/OptionsPanel.java @@ -139,7 +139,7 @@ public class OptionsPanel extends Patch public boolean hit(float x, float y) { if (objectivesPanel.hit(x, y)) { - game.typeSnd.play(); + game.playType(); objectivesPanel.visible = false; this.visible = true; return false; @@ -148,21 +148,21 @@ public class OptionsPanel extends Patch if (!visible) return false; if (fxVolume.hit(x, y) || fxVolumeValue.hit(x, y)) { - game.typeSnd.play(); cycleFxVolume(); + game.playType((fxVolumeIdx / 10.0f)); } else if (quit.hit(x, y)) { - game.typeSnd.play(); + game.playType(); game.ctrl.hud.askQuitBattle(); return false; } else if (objectives.hit(x, y)) { - game.typeSnd.play(); + game.playType(); this.visible = false; objectivesPanel.show(game.config.battle); return false; } else { for (int i = 0; i < checkLabels.length; i++) { if (checkLabels[i].hit(x, y)) { - game.typeSnd.play(); + game.playType(); checkValues[i] =! checkValues[i]; } } |