summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-04-01 01:00:10 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-04-01 01:00:10 +0200
commit9b55cf33c8765b97138472a41754203fb062020e (patch)
treeb676080101528e876ef5dc4ca91dbe3a5d7199d5 /core/src/ch/asynk
parentd6f4843180642976aa4a92ca8c0162c782d550ef (diff)
downloadRustAndDust-9b55cf33c8765b97138472a41754203fb062020e.zip
RustAndDust-9b55cf33c8765b97138472a41754203fb062020e.tar.gz
Ctrl: add EventType.UNIT_DOCK_SELECT
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java8
-rw-r--r--core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index ff33e7f..4d73c17 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -35,7 +35,8 @@ public abstract class Ctrl implements Disposable
STATE_CHANGE,
HUD_ANSWER,
ANIMATIONS_DONE,
- UNIT_DOCK_TOGGLE;
+ UNIT_DOCK_TOGGLE,
+ UNIT_DOCK_SELECT;
}
class Event
@@ -226,6 +227,9 @@ public abstract class Ctrl implements Disposable
case UNIT_DOCK_TOGGLE:
unitDockToggle();
break;
+ case UNIT_DOCK_SELECT:
+ unitDockSelect((Unit) evt.data);
+ break;
default:
RustAndDust.error(String.format("Unhandled Event Type : %s %s", evt.type, evt.data));
}
@@ -327,7 +331,7 @@ public abstract class Ctrl implements Disposable
}
}
- public void showEntryZone()
+ private void unitDockSelect(Unit unit)
{
if ((stateType == StateType.DEPLOYMENT) || (stateType == StateType.REINFORCEMENT))
state.touch(null);
diff --git a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java
index 9701cf3..e96856f 100644
--- a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java
+++ b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java
@@ -146,7 +146,7 @@ public class PlayerInfo implements Disposable, Drawable, Animation
}
else if (unitDock.hit(x, y)) {
ctrl.hud.notify(unitDock.selectedUnit.toString(), Position.TOP_CENTER);
- ctrl.showEntryZone();
+ ctrl.postEvent(Ctrl.EventType.UNIT_DOCK_SELECT, unitDock.selectedUnit);
return true;
}