summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-28 11:58:03 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-28 11:58:03 +0100
commitc4b0863771366681a309f406762fc20bee5eee86 (patch)
treed2ec34c4fb820c4513d66552cbcc58cac2c111b0
parentd3e88db809130b0599ddb2bdf54ef30ec13be987 (diff)
downloadRustAndDust-c4b0863771366681a309f406762fc20bee5eee86.zip
RustAndDust-c4b0863771366681a309f406762fc20bee5eee86.tar.gz
StateMove/Common: do not show MOVE overlay on selected Unit
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateCommon.java1
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java10
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)