diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-19 10:00:13 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-12-19 10:00:13 +0100 |
commit | e6f762fd2914e9a3f8a88d2a04f6e0ab3b445556 (patch) | |
tree | 6e60400c29149e5c317b2b20dfe8bcb0bc3eb49b /core/src | |
parent | 648fe1ef85fa3b201d5642e41cfdfcbc3c70d6a6 (diff) | |
download | RustAndDust-e6f762fd2914e9a3f8a88d2a04f6e0ab3b445556.zip RustAndDust-e6f762fd2914e9a3f8a88d2a04f6e0ab3b445556.tar.gz |
Hud,Ctrl: add askEndDeployment() calls setState(DONE)
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Hud.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/OkCancel.java | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 612e4cb..e8b6fd7 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -283,7 +283,10 @@ public class Ctrl implements Disposable public boolean checkDeploymentDone() { - return battle.deploymentDone(player); + boolean done = battle.deploymentDone(player); + if (done) + hud.askEndDeployment(); + return done; } public void reinforcementHit() @@ -296,6 +299,11 @@ public class Ctrl implements Disposable // Hud callbacks + public void endDeployment() + { + setState(StateType.DONE); + } + public void endGame() { game.setScreen(new OptionsScreen(game)); diff --git a/core/src/ch/asynk/tankontank/game/Hud.java b/core/src/ch/asynk/tankontank/game/Hud.java index 91215d0..6d8961a 100644 --- a/core/src/ch/asynk/tankontank/game/Hud.java +++ b/core/src/ch/asynk/tankontank/game/Hud.java @@ -234,6 +234,10 @@ public class Hud implements Disposable, Animation if (ok) ctrl.endPlayerTurn(true); break; + case END_DEPLOYMENT: + if (ok) + ctrl.endDeployment(); + break; } } @@ -276,6 +280,12 @@ public class Hud implements Disposable, Animation pushDialog(okCancel); } + public void askEndDeployment() + { + okCancel.show("Deployment unit count reached.\nEnd Deployment phase ?", OkCancel.Action.END_DEPLOYMENT); + pushDialog(okCancel); + } + public void engagementSummary(Map.Engagement e, float volume) { engagement.show(e, Position.BOTTOM_CENTER, volume); diff --git a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java index 0b05d6e..f48bcd4 100644 --- a/core/src/ch/asynk/tankontank/game/hud/OkCancel.java +++ b/core/src/ch/asynk/tankontank/game/hud/OkCancel.java @@ -22,6 +22,7 @@ public class OkCancel extends Patch EXIT_BOARD, ABORT_TURN, END_TURN, + END_DEPLOYMENT, } public OkCancel(BitmapFont font, TextureAtlas atlas) |