public override void OnEnter() { if (previousScreen == "") previousScreen = GameStateManager.previousState; activeOptionState = null; }
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(); } } }
public void LeaveSubState() { activeOptionState = null; }