diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-28 17:02:21 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-28 17:02:21 +0100 |
commit | 84d6668649f125642224b8c99a509b817e68b9a3 (patch) | |
tree | 97400d6574335321ac26a48fe11f007bf4478141 /core/src/ch/asynk/tankontank/game/states | |
parent | 030ccaa70136f2e1dd98416f98a29632a981a389 (diff) | |
download | RustAndDust-84d6668649f125642224b8c99a509b817e68b9a3.zip RustAndDust-84d6668649f125642224b8c99a509b817e68b9a3.tar.gz |
ActionButtons: use Bg instead of buttons, less buttons
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/states')
5 files changed, 7 insertions, 16 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java index 3a6f2a5..aad241c 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateDeployment.java +++ b/core/src/ch/asynk/tankontank/game/states/StateDeployment.java @@ -117,8 +117,7 @@ public class StateDeployment extends StateCommon map.selectHex(selectedHex); map.showDirections(selectedHex); ctrl.hud.playerInfo.unitDock.hide(); - ctrl.hud.actionButtons.show(Buttons.ROTATE.b | Buttons.ABORT.b); - ctrl.hud.actionButtons.setOn(Buttons.ROTATE); + ctrl.hud.actionButtons.show(Buttons.ABORT.b); } private void doRotation(Orientation o) diff --git a/core/src/ch/asynk/tankontank/game/states/StateEngage.java b/core/src/ch/asynk/tankontank/game/states/StateEngage.java index 85e6c30..55adac4 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateEngage.java +++ b/core/src/ch/asynk/tankontank/game/states/StateEngage.java @@ -11,8 +11,7 @@ public class StateEngage extends StateCommon public void enter(StateType prevState) { map.possibleTargets.clear(); - ctrl.hud.actionButtons.show(Buttons.ENGAGE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); - ctrl.hud.actionButtons.setOn(Buttons.ENGAGE); + ctrl.hud.actionButtons.show(ctrl.cfg.canCancel ? Buttons.ABORT.b : 0); // activeUnit is the target if (prevState == StateType.SELECT) { @@ -89,7 +88,7 @@ public class StateEngage extends StateCommon activeUnit.showTarget(); map.collectAttackAssists(selectedUnit, activeUnit, ctrl.player.units); map.showAttackAssists(); - ctrl.hud.actionButtons.show(Buttons.ENGAGE.b | Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); + ctrl.hud.actionButtons.show(Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); } else if (unit == activeUnit) { ctrl.setState(StateType.DONE); diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index 0e83782..f7103a8 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -10,8 +10,7 @@ public class StateMove extends StateCommon public void enter(StateType prevState) { boolean moreThanOne = ((map.moveableUnits.size() + map.activatedUnits.size()) > 1); - ctrl.hud.actionButtons.show(Buttons.ROTATE.b | Buttons.MOVE.b | ((moreThanOne) ? Buttons.DONE.b : 0) | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); - ctrl.hud.actionButtons.setOn(Buttons.MOVE); + ctrl.hud.actionButtons.show((moreThanOne ? Buttons.DONE.b : 0) | (ctrl.cfg.canCancel ? Buttons.ABORT.b : 0)); if (prevState == StateType.ESCAPE) { if (map.possiblePaths.size() == 1) diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java index 88505dc..aa427ab 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java @@ -14,8 +14,7 @@ public class StateRotate extends StateCommon @Override public void enter(StateType prevState) { - ctrl.hud.actionButtons.show(Buttons.ROTATE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); - ctrl.hud.actionButtons.setOn(Buttons.ROTATE); + ctrl.hud.actionButtons.show(ctrl.cfg.canCancel ? Buttons.ABORT.b : 0); if (activeUnit == null) activeUnit = selectedUnit; @@ -95,7 +94,7 @@ public class StateRotate extends StateCommon if (ctrl.cfg.mustValidate) { map.hideDirections(to); map.showOrientation(to, o); - ctrl.hud.actionButtons.show(Buttons.ROTATE.b | Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); + ctrl.hud.actionButtons.show(Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); } else { doRotation(o); ctrl.setState(StateType.ANIMATION); diff --git a/core/src/ch/asynk/tankontank/game/states/StateSelect.java b/core/src/ch/asynk/tankontank/game/states/StateSelect.java index 46b73c0..86139b7 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateSelect.java +++ b/core/src/ch/asynk/tankontank/game/states/StateSelect.java @@ -83,12 +83,7 @@ public class StateSelect extends StateCommon if (moves > 0) map.collectMoveableUnits(selectedUnit); showPossibilities(selectedUnit); - ctrl.hud.actionButtons.show( - ((ctrl.player.canPromote(selectedUnit)) ? Buttons.PROMOTE.b : 0 ) | - ((selectedUnit.canMove()) ? Buttons.ROTATE.b : 0 ) | - ((moves > 0) ? Buttons.MOVE.b : 0 ) | - ((targets > 0) ? Buttons.ENGAGE.b : 0) - ); + ctrl.hud.actionButtons.show((ctrl.player.canPromote(selectedUnit)) ? Buttons.PROMOTE.b : 0 ); } else { ctrl.hud.actionButtons.hide(); map.clearAll(); |