예제 #1
0
 public override void Update()
 {
     base.Update();
     if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Escape))
     {
         StateManager.OptionsState = OptionStates.Overview;
     }
 }
예제 #2
0
 public override void Update()
 {
     base.Update();
     if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Escape))
     {
         StateManager.GameState = GameStates.Title;
     }
 }
예제 #3
0
 public static void HandleGeneralInput()
 {
     if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Escape))
     {
         StateManager.MenuState  = MenuStates.Ingame;
         StateManager.GamePaused = true;
         StateManager.InputLock  = true;
     }
 }
예제 #4
0
 public override void Update()
 {
     base.Update();
     if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Escape))
     {
         if (StateManager.GamePaused)
         {
             StateManager.MenuState = MenuStates.Ingame;
         }
         else
         {
             StateManager.MenuState = MenuStates.Main;
         }
     }
 }
예제 #5
0
 public override void Update()
 {
     base.Update();
     if (StateManager.InputLock)
     {
         StateManager.InputLock = false;
     }
     else
     {
         if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Escape))
         {
             StateManager.GamePaused = false;
             StateManager.MenuState  = MenuStates.Null;
         }
     }
 }
예제 #6
0
        public override void Update()
        {
            if (Confirmation)
            {
                confirmDialog.Update();
                return;
            }

            if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Down))
            {
                NextMenuItem();
            }

            if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Up))
            {
                PreviousMenuItem();
            }

            ResolveMouseSelection();

            if (ShortcutProvider.KeyPressedNowButNotLastFrame(Keys.Enter) || ShortcutProvider.LeftButtonClickedNowButNotLastFrame())
            {
                SelectMenuItem();
            }

            foreach (MenuItem menuItem in menuItems)
            {
                menuItem.Update();
            }
            if (InputMapper.STRICTCANCEL)
            {
                StateManager.MenuState = MenuStates.Main;
            }
            if (TextBuffer.Length == 0)
            {
                menuItems[0].IsSelected = false;
                menuItems[1].IsSelected = true;
            }
        }