Example #1
0
 private void OnBackPauseMenu()
 {
     currentContext = mapContext;
     mapCursorMode  = MapCursorMode.MoveCursor;
     Game1.backSound.Play();
     pauseMenu.Active = false;
 }
Example #2
0
 public void EnterAttackMode()
 {
     mapCursorMode    = MapCursorMode.AttackUnit;
     actionBar.Active = false;
     currentContext   = mapContext;
     selectedUnit.UpdateAttackTiles();
 }
Example #3
0
 private void OnBackAttackUnit()
 {
     selectedUnit.validAttackPoints.Clear();
     currentContext   = actionBarContext;
     actionBar.Active = true;
     Game1.backSound.Play();
 }
Example #4
0
        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;
            }
        }
Example #5
0
 private void OnBackActionBar()
 {
     selectedUnit.Position = selectionPreviousPos;
     Position         = selectedUnit.Position;
     currentContext   = mapContext;
     actionBar.Active = false;
     mapCursorMode    = MapCursorMode.MoveUnit;
     Game1.backSound.Play();
 }
Example #6
0
 private void OnConfirmMoveUnit()
 {
     if (validMoveTiles.Contains(position))
     {
         currentContext   = actionBarContext;
         actionBar.Active = true;
         Game1.confirmSound.Play();
     }
     else
     {
         Game1.deniedSound.Play();
     }
 }
Example #7
0
 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();
 }
Example #8
0
        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);
        }
Example #9
0
 public void SwitchContexts(CursorContext newContext)
 {
     currentContext = newContext;
 }
Example #10
0
 private void OnBackMoveCursor()
 {
     currentContext = pauseMenuContext;
     Game1.menuSound.Play();
     pauseMenu.Active = true;
 }