Skip to content
Snippets Groups Projects
Commit 20dac996 authored by Trandinh Thien's avatar Trandinh Thien
Browse files

Character info screen now no longer shows up during attack screen

parent 548da1e2
No related branches found
No related tags found
No related merge requests found
......@@ -322,7 +322,7 @@ namespace Controller
#region Character Info Screen player1
//if player 1, prints info screen for player 1
if (GameState.currentPlayer == player1)
if ((GameState.currentPlayer == player1)&&(!GameState.attackConfirmOpen))
{
Vector2 statLocation = new Vector2(180, 533); //starting location for first stat
Vector2 increment = new Vector2(0, 11.5f); //increment downwards for each stat
......@@ -340,6 +340,8 @@ namespace Controller
//else, info screen for player 2
else
{
if (!GameState.attackConfirmOpen)
{
Vector2 statLocation = new Vector2(795, 533); //starting location for first stat
Vector2 increment = new Vector2(0, 11.5f); //increment downwards for each stat
Vector2 infoLocation = new Vector2(635, 513);
......@@ -351,6 +353,7 @@ namespace Controller
}
spriteBatch.DrawString(largeFont, unit.Hp.ToString(), new Vector2(864, 512), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.6f); //draws each stat
spriteBatch.Draw(unit.getCharInfo(), infoLocation, null, Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0.7f); //draw charInfoBackground texture
}
}
#endregion
......
......@@ -58,7 +58,7 @@ namespace Controller
if (getMenuButtonClicked(mouseClickCoordinates) != null)
{
MenuButton menuButton = getMenuButtonClicked(mouseClickCoordinates);
//Debug.WriteLine(getMenuButtonClicked(mouseClickCoordinates).getButtonType());
Debug.WriteLine(getMenuButtonClicked(mouseClickCoordinates).getButtonType());
buttonAction(menuButton);
return;
}
......@@ -78,8 +78,6 @@ namespace Controller
{
updateUnitPosition(graph, mouseClickCoordinates, path);
}
turnState = TurnState.Wait;
}
if(turnState==TurnState.Attack) //if a unit is clicked after attack is clicked
......@@ -87,10 +85,9 @@ namespace Controller
Unit unit = getPlayableUnitOnNodeClicked(graph.getNode(mouseClickCoordinates), mouseClickCoordinates, GameState.currentPlayer);
if (unit != null)
{
setAttackedUnit(unit, true);
setAttackedUnit(unit, true);
GameState.attackConfirmOpen = true; //opens attack confirm button
unit.getAttackConfirmButton().setActive(true);
}
}
}
......@@ -335,7 +332,6 @@ namespace Controller
button.setActive(false);
break;
case MenuButtonType.AttackConfirm: // if confirm attack clicked
turnState = TurnState.AttackMenu;
button.setActive(false);
unit.getMenuButtonAt(1).setActive(false);
int attackDirection=0;
......@@ -369,7 +365,6 @@ namespace Controller
GameState.dropDownMenuOpen = false;
break;
case MenuButtonType.Wait: // if wait is clicked
turnState = TurnState.Wait;
GameState.dropDownMenuOpen = false;
GameState.playableUnitSelected = false;
button.setActive(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment