summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/game/hud
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-04-13 23:44:53 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-04-13 23:48:54 +0200
commit95d0131cb9733d273b81bf63a8778dc2b8e0a414 (patch)
treebe0bca04dc39f66ce1ffbeb5f22e191123e5facf /core/src/ch/asynk/rustanddust/game/hud
parent513938e9b1731308535ef45336239f9209e2e396 (diff)
downloadRustAndDust-keep.zip
RustAndDust-keep.tar.gz
WIPkeep
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game/hud')
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/ActionButtons.java14
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java4
2 files changed, 9 insertions, 9 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..8b67fb6 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.sendMsg(Ctrl.MsgType.UNIT_DOCK_SELECT, unitDock.selectedUnit);
return true;
}