Exemple #1
0
        private void ButtonActions()
        {
            if (Game.menuBGController.DisplayButtons)
            {
                previousOptionState = activeOptionState;

                switch (buttons[buttonIndex].name.ToLower())
                {
                case "game options":
                    activeOptionState = gameOptionsSubState;

                    PlaySelectSound();
                    break;

                case "control options":
                    activeOptionState = controlOptionsSubState;

                    PlaySelectSound();
                    break;

                case "visual options":
                    activeOptionState = visualOptionsSubState;

                    PlaySelectSound();
                    break;

                case "sound options":
                    activeOptionState = soundOptionsSubState;

                    PlaySelectSound();
                    break;

                case "back":
                    if (previousScreen == "MainMenuState")
                    {
                        Game.menuBGController.SetPreferredBackdropPosition(new Vector2(-101, -703), "MainMenuState");
                    }
                    else if (previousScreen == "OverworldState")
                    {
                        Game.stateManager.ChangeState("OverworldState");
                    }

                    previousScreen = "";
                    buttonIndex    = 0;

                    PlayLowPitchSelectSound();
                    break;
                }

                if (activeOptionState != null)
                {
                    if (previousOptionState != null)
                    {
                        previousOptionState.OnLeave();
                    }

                    activeOptionState.OnDisplay();
                }
            }
        }
Exemple #2
0
        public override void OnEnter()
        {
            if (previousScreen == "")
            {
                previousScreen = GameStateManager.previousState;
            }

            activeOptionState = null;
        }
Exemple #3
0
 public void LeaveSubState()
 {
     activeOptionState = null;
 }