Пример #1
0
        // The game menu was clicked, perform the button's action.
        // Parameter: button - The button pressed
        private static void PerformGameMenuAction(int button)
        {
            switch (button)
            {
            case GAME_MENU_RETURN_BUTTON:
                GameController.EndCurrentState();
                break;

            case GAME_MENU_SURRENDER_BUTTON:
                GameController.EndCurrentState();
                // end game menu
                GameController.EndCurrentState();
                // end game
                break;

            case GAME_MENU_QUIT_BUTTON:
                GameController.AddNewState(GameState.Quitting);
                break;

            case GAME_MENU_MUTE_MUSIC_ACTION:
                if (Audio.MusicPlaying())
                {
                    UtilityFunctions.StopMusic();
                }
                else
                {
                    UtilityFunctions.PlayMusic();
                }
                break;

            case GAME_MENU_MUTE_SFX_ACTION:
                if (UtilityFunctions.SFX_ACTIVE)
                {
                    UtilityFunctions.RemoveSFX();
                }
                else
                {
                    UtilityFunctions.LoadSFX();
                }
                break;
            }
        }