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