diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-28 11:58:03 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-28 11:58:03 +0100 |
commit | c4b0863771366681a309f406762fc20bee5eee86 (patch) | |
tree | d2ec34c4fb820c4513d66552cbcc58cac2c111b0 /core | |
parent | d3e88db809130b0599ddb2bdf54ef30ec13be987 (diff) | |
download | RustAndDust-c4b0863771366681a309f406762fc20bee5eee86.zip RustAndDust-c4b0863771366681a309f406762fc20bee5eee86.tar.gz |
StateMove/Common: do not show MOVE overlay on selected Unit
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateCommon.java | 1 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/states/StateMove.java | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java index 6361eb7..725e86a 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java +++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java @@ -69,6 +69,7 @@ public abstract class StateCommon implements State if (ctrl.cfg.showMoves && unit.canMove()) map.showPossibleMoves(); if (ctrl.cfg.showTargets && unit.canEngage()) map.showPossibleTargets(); if (ctrl.cfg.showMoveAssists && unit.canMove()) map.showMoveableUnits(); + unit.enableOverlay(Unit.MOVE, false); } protected void hidePossibilities() diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index 0b90188..0e83782 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -41,6 +41,7 @@ public class StateMove extends StateCommon changeUnit(map.moveableUnits.get(0)); } } + activeUnit.enableOverlay(Unit.MOVE, false); } @Override @@ -125,17 +126,20 @@ public class StateMove extends StateCommon private void changeUnit(Unit unit) { - if (activeUnit != null ) + if (activeUnit != null ) { map.unselectHex(activeUnit.getHex()); + activeUnit.enableOverlay(Unit.MOVE, true); + } activeUnit = unit; Hex hex = activeUnit.getHex(); map.possiblePaths.init(activeUnit, hex); - map.selectHex(hex); activeUnit.showMoveable(); map.hidePossibleMoves(); map.collectPossibleMoves(activeUnit); map.showPossibleMoves(); - checkExit(activeUnit, activeUnit.getHex()); + map.selectHex(hex); + activeUnit.enableOverlay(Unit.MOVE, false); + checkExit(activeUnit, hex); } private int collectPaths(Hex hex) |