diff --git a/src/Blaze-Brigade/Blaze_Brigade/Game.cs b/src/Blaze-Brigade/Blaze_Brigade/Game.cs index fa32d847c32219b33e2475d1181386316a7eceac..2dc60ca4fd4fe0381ebdbfa46280bebc1d0964d5 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/Game.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/Game.cs @@ -203,13 +203,18 @@ namespace Controller if (GameState.isPlayableUnitSelected()) { Unit unit = GameState.getSelectedUnit(); + if (!GameState.getIsAnimating()) + { + + if (GameState.getBeforeMove()) + { #region Highlight nodes //Highlight movable nodes in blue LinkedList<Node> moveableNodes = GameFunction.getMovableNodes(graph, unit); - foreach(Node move in moveableNodes) + foreach (Node move in moveableNodes) { - spriteBatch.Draw(moveableNode, move.getPosition(), null, Color.White*0.2f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f); + spriteBatch.Draw(moveableNode, move.getPosition(), null, Color.White * 0.2f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f); } //Highlight attackable nodes in red @@ -218,13 +223,17 @@ namespace Controller { if (!moveableNodes.Contains(attack)) { - spriteBatch.Draw(attackableNode, attack.getPosition(), null, Color.White*0.2f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f); + spriteBatch.Draw(attackableNode, attack.getPosition(), null, Color.White * 0.2f, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.9f); } } - #endregion + #endregion + }else + { + + } #region Drop Down menu - if ((GameState.getMenuOpen())&&(!GameState.getIsAnimating())) // if dropDowMenu should be opened, draw dropDownMenu + if (GameState.getMenuOpen()) // if dropDowMenu should be opened, draw dropDownMenu { foreach (MenuButton button in unit.getMenuButtons()) { @@ -232,6 +241,7 @@ namespace Controller } } #endregion + } #region Character Info Screen Vector2 statLocation = new Vector2(180, 533); //starting location for first stat diff --git a/src/Blaze-Brigade/Blaze_Brigade/GameState.cs b/src/Blaze-Brigade/Blaze_Brigade/GameState.cs index 2abc4801dd450ebade663cc99bf67f21389260a2..1fff4ed150a0aca8cba5f2a103600a31d7ee9c25 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/GameState.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/GameState.cs @@ -15,7 +15,8 @@ namespace Model private static Unit selectedUnit; // the currently selected unit private static Player currentPlayer; // player of the current turn private static bool isAnimating = false; // indicates whether an animation sequence is on screen - private static bool dropDownMenuOpen; + private static bool dropDownMenuOpen; // indicates whether drop down menu should be open + private static bool beforeMove; // true before unit moves, false after it moves. Used to determine what tiles are highlighted // indicates if a unit is currently selected public static bool isPlayableUnitSelected() @@ -70,6 +71,16 @@ namespace Model { return dropDownMenuOpen; } + + public static void setBeforeMove(bool hasMove) + { + beforeMove = hasMove; + } + + public static bool getBeforeMove() + { + return beforeMove; + } } enum GameMenuState // enumerated list for different possible Game States diff --git a/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs b/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs index 595a505c42d8c81cdff422a2eac3f04737d45ff5..e529e994da718041b603aed433e00c415eb5ca3d 100644 --- a/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs +++ b/src/Blaze-Brigade/Blaze_Brigade/MouseHandler.cs @@ -92,6 +92,7 @@ namespace Controller { setSelectedUnit(unit, true); GameState.setMenuOpen(true); + GameState.setBeforeMove(true); } } @@ -143,6 +144,7 @@ namespace Controller } GameState.setIsAnimating(false); + GameState.setBeforeMove(false); } // returns a menu button that was clicked; if no menu button was clicked, returns null