From 431f1d09b78fbfdfa0416cd89ca89e4d727da2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 14 Dec 2015 11:06:38 +0100 Subject: Unit: show/hideMoveable -> show/hideActiveable, change png too --- android/assets/data/unit-overlays0.atlas | 2 +- android/assets/data/unit-overlays0.png | Bin 50941 -> 49771 bytes assets/unit-overlays0/00_activable.png | Bin 0 -> 15105 bytes assets/unit-overlays0/00_move.png | Bin 16443 -> 0 bytes core/src/ch/asynk/rustanddust/game/Unit.java | 6 +++--- .../ch/asynk/rustanddust/game/map/Map1Units.java | 8 ++++---- .../asynk/rustanddust/game/states/StateCommon.java | 2 +- .../ch/asynk/rustanddust/game/states/StateMove.java | 10 ++++------ .../rustanddust/game/states/StateWithdraw.java | 2 +- 9 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 assets/unit-overlays0/00_activable.png delete mode 100644 assets/unit-overlays0/00_move.png diff --git a/android/assets/data/unit-overlays0.atlas b/android/assets/data/unit-overlays0.atlas index 301b675..96b61d7 100644 --- a/android/assets/data/unit-overlays0.atlas +++ b/android/assets/data/unit-overlays0.atlas @@ -4,7 +4,7 @@ size: 1024,256 format: RGBA8888 filter: Nearest,Nearest repeat: none -00_move +00_activable rotate: false xy: 2, 24 size: 193, 223 diff --git a/android/assets/data/unit-overlays0.png b/android/assets/data/unit-overlays0.png index 4e1bcd0..fc9c41f 100644 Binary files a/android/assets/data/unit-overlays0.png and b/android/assets/data/unit-overlays0.png differ diff --git a/assets/unit-overlays0/00_activable.png b/assets/unit-overlays0/00_activable.png new file mode 100644 index 0000000..58bd6aa Binary files /dev/null and b/assets/unit-overlays0/00_activable.png differ diff --git a/assets/unit-overlays0/00_move.png b/assets/unit-overlays0/00_move.png deleted file mode 100644 index 51d9974..0000000 Binary files a/assets/unit-overlays0/00_move.png and /dev/null differ diff --git a/core/src/ch/asynk/rustanddust/game/Unit.java b/core/src/ch/asynk/rustanddust/game/Unit.java index ed15d4b..cdbcebc 100644 --- a/core/src/ch/asynk/rustanddust/game/Unit.java +++ b/core/src/ch/asynk/rustanddust/game/Unit.java @@ -13,7 +13,7 @@ import ch.asynk.rustanddust.RustAndDust; public class Unit extends HeadedPawn { - public static final int MOVE = 0; + public static final int ACTIVEABLE = 0; public static final int TARGET = 1; public static final int FIRE = 2; public static final int MAY_FIRE = 3; @@ -363,8 +363,8 @@ public class Unit extends HeadedPawn } // SHOW / HIDE - public void showMoveable() { enableOverlay(MOVE, true); } - public void hideMoveable() { enableOverlay(MOVE, false); } + public void showActiveable() { enableOverlay(ACTIVEABLE, true); } + public void hideActiveable() { enableOverlay(ACTIVEABLE, false); } public void showTarget() { enableOverlay(TARGET, true); } public void hideTarget() { enableOverlay(TARGET, false); } public void showAttack() { enableOverlay(FIRE, true); } diff --git a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java index 7812d50..e779660 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map1Units.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map1Units.java @@ -104,10 +104,10 @@ public abstract class Map1Units extends Map0Hex public void unitsTargetHide() { unitsShowOverlay(targetUnits, Unit.TARGET, false); } public void unitsAssistShow() { unitsShowOverlay(assistUnits, Unit.MAY_FIRE, true); } public void unitsAssistHide() { unitsShowOverlay(assistUnits, Unit.MAY_FIRE, false); unitsShowOverlay(assistUnits, Unit.FIRE, false); } - public void unitsMoveableShow() { unitsShowOverlay(moveableUnits, Unit.MOVE, true); } - public void unitsMoveableHide() { unitsShowOverlay(moveableUnits, Unit.MOVE, false); } - public void unitsBreakThroughShow() { unitsShowOverlay(breakthroughUnits, Unit.MOVE, true); } - public void unitsBreakThroughHide() { unitsShowOverlay(breakthroughUnits, Unit.MOVE, false); } + public void unitsMoveableShow() { unitsShowOverlay(moveableUnits, Unit.ACTIVEABLE, true); } + public void unitsMoveableHide() { unitsShowOverlay(moveableUnits, Unit.ACTIVEABLE, false); } + public void unitsBreakThroughShow() { unitsShowOverlay(breakthroughUnits, Unit.ACTIVEABLE, true); } + public void unitsBreakThroughHide() { unitsShowOverlay(breakthroughUnits, Unit.ACTIVEABLE, false); } private void unitsShowOverlay(UnitList units, int overlay, boolean on) { diff --git a/core/src/ch/asynk/rustanddust/game/states/StateCommon.java b/core/src/ch/asynk/rustanddust/game/states/StateCommon.java index fdb797c..97aecfc 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateCommon.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateCommon.java @@ -55,7 +55,7 @@ public abstract class StateCommon implements State if (cfg.showMoves && unit.canMove()) map.movesShow(); if (cfg.showTargets && unit.canEngage()) map.unitsTargetShow(); if (cfg.showMoveAssists && unit.canMove()) map.unitsMoveableShow(); - unit.enableOverlay(Unit.MOVE, false); + unit.hideActiveable(); } protected void hidePossibilities() diff --git a/core/src/ch/asynk/rustanddust/game/states/StateMove.java b/core/src/ch/asynk/rustanddust/game/states/StateMove.java index d89ee44..8c3c68e 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateMove.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateMove.java @@ -26,7 +26,6 @@ public class StateMove extends StateCommon if (prevState == StateType.SELECT) { // use selectedHex and selectedUnit activeUnit = selectedUnit; - activeUnit.showMoveable(); map.pathsInit(activeUnit); map.collectUpdate(activeUnit); if (to != null) { @@ -44,7 +43,7 @@ public class StateMove extends StateCommon } } - activeUnit.enableOverlay(Unit.MOVE, false); + activeUnit.hideActiveable(); } @Override @@ -54,7 +53,7 @@ public class StateMove extends StateCommon return; // hide all but assists : want them when in rotation - activeUnit.hideMoveable(); + activeUnit.hideActiveable(); map.movesHide(); map.hexUnselect(activeUnit.getHex()); if (to != null) @@ -138,17 +137,16 @@ public class StateMove extends StateCommon if (activeUnit != null ) { map.hexUnselect(activeUnit.getHex()); if (activeUnit.canMove()) - activeUnit.enableOverlay(Unit.MOVE, true); + activeUnit.showActiveable(); } activeUnit = unit; + activeUnit.hideActiveable(); Hex hex = activeUnit.getHex(); map.pathsInit(activeUnit, hex); - activeUnit.showMoveable(); map.movesHide(); map.movesCollect(activeUnit); map.movesShow(); map.hexSelect(hex); - activeUnit.enableOverlay(Unit.MOVE, false); ctrl.hud.notify(activeUnit.toString(), Position.TOP_CENTER); checkExit(activeUnit, hex); } diff --git a/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java b/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java index ed4251e..a17f58b 100644 --- a/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java +++ b/core/src/ch/asynk/rustanddust/game/states/StateWithdraw.java @@ -58,7 +58,7 @@ public class StateWithdraw extends StateCommon map.pathsSetExit(exitZone.orientation); - unit.hideMoveable(); + unit.hideActiveable(); if (to != null) map.pathHide(to); map.movesHide(); -- cgit v1.1-2-g2b99