Example #1
0
        /// <summary>
        /// Handles the  processing of user input when the Hotkeys menu is showing
        /// </summary>
        public static void HandleHotkeysMenuInput()
        {
            if (SwinGame.KeyTyped(UtilityFunctions.EscapeKey))
            {
                GameController.SwitchState(GameState.ViewingGameMenu);
            }
            if (SwinGame.AnyKeyPressed())
            {
                // Escape key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 100, 50, 25))
                {
                    UtilityFunctions.EscapeKey = UtilityFunctions.KeyTyped(UtilityFunctions.EscapeKey);
                }

                // Up key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 150, 50, 25))
                {
                    UtilityFunctions.UpKey = UtilityFunctions.KeyTyped(UtilityFunctions.UpKey);
                }

                // Down key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 200, 50, 25))
                {
                    UtilityFunctions.DownKey = UtilityFunctions.KeyTyped(UtilityFunctions.DownKey);
                }

                // Left key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 250, 50, 25))
                {
                    UtilityFunctions.LeftKey = UtilityFunctions.KeyTyped(UtilityFunctions.LeftKey);
                }

                // Random key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 300, 50, 25))
                {
                    UtilityFunctions.RandomKey = UtilityFunctions.KeyTyped(UtilityFunctions.RandomKey);
                }

                // Blue key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 350, 50, 25))
                {
                    UtilityFunctions.BlueKey = UtilityFunctions.KeyTyped(UtilityFunctions.BlueKey);
                }

                // Pink key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 400, 50, 25))
                {
                    UtilityFunctions.PinkKey = UtilityFunctions.KeyTyped(UtilityFunctions.PinkKey);
                }

                // Cheats key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 450, 50, 25))
                {
                    UtilityFunctions.CheatsKey = UtilityFunctions.KeyTyped(UtilityFunctions.CheatsKey);
                }

                // Maximise screen key
                if (SwinGame.PointInRect(SwinGame.MousePosition(), SwinGame.ScreenWidth() - HOTKEYS_BIND, 450, 50, 25))
                {
                    UtilityFunctions.MaxKey = UtilityFunctions.KeyTyped(UtilityFunctions.MaxKey);
                }
            }
        }