private void OnBackPauseMenu() { currentContext = mapContext; mapCursorMode = MapCursorMode.MoveCursor; Game1.backSound.Play(); pauseMenu.Active = false; }
public void EnterAttackMode() { mapCursorMode = MapCursorMode.AttackUnit; actionBar.Active = false; currentContext = mapContext; selectedUnit.UpdateAttackTiles(); }
private void OnBackAttackUnit() { selectedUnit.validAttackPoints.Clear(); currentContext = actionBarContext; actionBar.Active = true; Game1.backSound.Play(); }
public void OnConfirm() { if (currentContext == mapContext) { switch (mapCursorMode) { case MapCursorMode.MoveCursor: OnSelectUnit(); break; case MapCursorMode.MoveUnit: OnConfirmMoveUnit(); break; case MapCursorMode.AttackUnit: OnConfirmAttackUnit(); break; } } else if (currentContext == actionBarContext) { actionBar.OnConfirm(); } else if (currentContext == pauseMenuContext) { pauseMenu.OnConfirm(); currentContext = mapContext; } }
private void OnBackActionBar() { selectedUnit.Position = selectionPreviousPos; Position = selectedUnit.Position; currentContext = mapContext; actionBar.Active = false; mapCursorMode = MapCursorMode.MoveUnit; Game1.backSound.Play(); }
private void OnConfirmMoveUnit() { if (validMoveTiles.Contains(position)) { currentContext = actionBarContext; actionBar.Active = true; Game1.confirmSound.Play(); } else { Game1.deniedSound.Play(); } }
public void FinishSelection() { if (selectedUnit != null) { selectedUnit.validAttackPoints.Clear(); } selectedUnit = null; selectionPreviousPos = Position; currentContext = mapContext; actionBar.Active = false; mapCursorMode = MapCursorMode.MoveCursor; validMoveTiles.Clear(); Game1.CheckForEndTurn(); }
public Cursor(Point startingPosition, AnimatedTexture texture, Texture2D moveArrowTexture, ActionBar actionBar, PauseMenu pauseMenu) { currentContext = mapContext; mapCursorMode = MapCursorMode.MoveCursor; this.texture = texture; this.moveArrowTexture = moveArrowTexture; Cursor.actionBar = actionBar; Cursor.pauseMenu = pauseMenu; position = startingPosition; hoveredUnit = Game1.GetUnit(startingPosition); hoveredTile = Level.GetTile(startingPosition); prevKeyboardState = Keyboard.GetState(); prevGamePadState = GamePad.GetState(0); }
public void SwitchContexts(CursorContext newContext) { currentContext = newContext; }
private void OnBackMoveCursor() { currentContext = pauseMenuContext; Game1.menuSound.Play(); pauseMenu.Active = true; }