diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-03 15:31:32 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-05-03 15:31:32 +0200 |
commit | 79793cf2dd5cad2af5fa513a7213292d2ee53f86 (patch) | |
tree | 306e849be86d992a543e42c8e8ddec80d24795a6 /core/src/ch/asynk/rustanddust/game/hud | |
parent | cff800a98e8aec4e454c5dc84fd4249b7127a1fd (diff) | |
download | RustAndDust-79793cf2dd5cad2af5fa513a7213292d2ee53f86.zip RustAndDust-79793cf2dd5cad2af5fa513a7213292d2ee53f86.tar.gz |
OMG: add event queue, messages, replay, bounce animation, complete states rewrite ...
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/hud')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java b/core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java index 90ec017..e992867 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java +++ b/core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer; import ch.asynk.rustanddust.RustAndDust; import ch.asynk.rustanddust.game.Ctrl; -import ch.asynk.rustanddust.game.State.StateType; +import ch.asynk.rustanddust.game.Ctrl.MsgType; import ch.asynk.rustanddust.ui.Widget; import ch.asynk.rustanddust.ui.Bg; import ch.asynk.rustanddust.ui.Position; @@ -36,7 +36,7 @@ public class ActionButtons extends Widget private Sprite bg; private Bg buttons []; - private StateType states []; + private MsgType msgs []; public ActionButtons(RustAndDust game) { @@ -50,10 +50,10 @@ public class ActionButtons extends Widget this.buttons[Buttons.ABORT.i] = new Bg(game.factory.getHudRegion(game.factory.ACT_ABORT)); this.buttons[Buttons.PROMOTE.i] = new Bg(game.factory.getHudRegion(game.factory.ACT_PROMOTE)); - this.states = new StateType[Buttons.LAST.i]; - this.states[Buttons.DONE.i] = StateType.DONE; - this.states[Buttons.ABORT.i] = StateType.ABORT; - this.states[Buttons.PROMOTE.i] = StateType.PROMOTE; + this.msgs = new MsgType[Buttons.LAST.i]; + this.msgs[Buttons.DONE.i] = MsgType.OK; + this.msgs[Buttons.ABORT.i] = MsgType.CANCEL; + this.msgs[Buttons.PROMOTE.i] = MsgType.PROMOTE; } @Override @@ -135,7 +135,7 @@ public class ActionButtons extends Widget for (int i = 0; i < Buttons.LAST.i; i++) { if (buttons[i].hit(x, y)) { - ctrl.post(states[i]); + ctrl.sendMsg(msgs[i]); return true; } } diff --git a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java index e96856f..9f86b13 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java @@ -141,12 +141,12 @@ public class PlayerInfo implements Disposable, Drawable, Animation return true; } else if (reinforcement.hit(x, y)) { - ctrl.postEvent(Ctrl.EventType.UNIT_DOCK_TOGGLE); + ctrl.sendMsg(Ctrl.MsgType.UNIT_DOCK_TOGGLE); return true; } else if (unitDock.hit(x, y)) { - ctrl.hud.notify(unitDock.selectedUnit.toString(), Position.TOP_CENTER); - ctrl.postEvent(Ctrl.EventType.UNIT_DOCK_SELECT, unitDock.selectedUnit); + ctrl.hud.notify(unitDock.selectedUnit.toString()); + ctrl.sendMsg(Ctrl.MsgType.UNIT_DOCK_SELECT, unitDock.selectedUnit); return true; } |