Пример #1
0
        void IState.Update()
        {
            Cmd.Checkbinds();

            _keys[_cursor].Tick();

            if (Input.IsKeyPressed(SFML.Window.Keyboard.Key.Down))
            {
                int pc = _cursor;
                _cursor = (_cursor + 1).Clamp(0, _keys.Count - 1);
                if (pc != _cursor)
                {
                    Audio.PlaySound2D("sound/ui/hover");
                }
            }
            if (Input.IsKeyPressed(SFML.Window.Keyboard.Key.Up))
            {
                int pc = _cursor;
                _cursor = (_cursor - 1).Clamp(0, _keys.Count - 1);
                if (pc != _cursor)
                {
                    Audio.PlaySound2D("sound/ui/hover");
                }
            }

            if (Input.IsKeyPressed(SFML.Window.Keyboard.Key.Escape))
            {
                if (Statemanager.history.Peek() != null)
                {
                    Statemanager.GoBack();
                }
            }
        }