public void WeaponSelectAction() { ConfirmMenu confirmMenu = (ConfirmMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.CONFIRM); Action onYesAction = () => { string currentScene = SceneTracker.CurrentSceneName; Action loadWeaponSelectAction = () => { WeaponSelectMenu weaponMenu = (WeaponSelectMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.WEAPON_SELECT); weaponMenu.DefineNavigation(Strings.MenuStrings.MAIN, Strings.MenuStrings.LOAD); LoadMenu lm = (LoadMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.LOAD); lm.SetNavigation(currentScene); MenuManager.Instance.DoTransition(weaponMenu, Transition.SHOW, new Effect[] { Effect.EXCLUSIVE }); }; MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { }); LoadMenu loadMenu = (LoadMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.LOAD); loadMenu.SetNavigation(Strings.Scenes.ScenePaths.MainMenu, loadWeaponSelectAction); MenuManager.Instance.DoTransition(loadMenu, Transition.SHOW, new Effect[] { Effect.EXCLUSIVE }); }; Action onNoAction = () => { MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); SelectInitialButton(); }; confirmMenu.DefineActions("This will end your current game. Are you sure?", onYesAction, onNoAction); MenuManager.Instance.DoTransition(confirmMenu, Transition.SHOW, new Effect[] { Effect.INSTANT }); }
public void OpenSaveAction() { SelectMenuItem(PLEMenuType.SAVE); SaveMenu saveMenu = GetMenu(PLEMenuType.SAVE) as SaveMenu; ConfirmMenu confirmMenu = (ConfirmMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.CONFIRM); confirmMenu.SetYesButtonText("SAVE"); confirmMenu.SetNoButtonText("SAVE AS"); //set interactibility of buttons bool isSaveButtonInteractable = saveMenu.IsOverwriteButtonInteractable(); confirmMenu.SetYesButtonInteractibility(isSaveButtonInteractable); Action saveAction = () => { MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); saveMenu.Save(); }; Action saveAsAction = () => { saveMenu.CanvasGroup.alpha = 1; saveMenu.CanvasGroup.interactable = true; saveMenu.CanvasGroup.blocksRaycasts = true; MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); }; Action cancelAction = () => { BackAction(); MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); }; confirmMenu.DefineActions("Save?", saveAction, saveAsAction, cancelAction); MenuManager.Instance.DoTransition(confirmMenu, Transition.SHOW, new Effect[] { Effect.INSTANT }); }
public void DeleteSelectedLevel() { ConfirmMenu confirmMenu = (ConfirmMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.CONFIRM); Action onYesAction = () => { levelDataManager.TryDeleteLevel(SelectedLevelUI.levelData.UniqueSteamName); SetButtonsInteractabilityAndNavigation(); ClearAndGenerateLevelUI(); }; Action onNoAction = () => { MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); SelectInitialButton(); }; string confirmationMessage = SelectedLevelUI.levelData.isDownloaded ? "Unsubscribe from this Steam Workshop item to permanently remove. Are you sure?" : "This cannot be undone. Are you sure?"; confirmMenu.DefineActions(confirmationMessage, onYesAction, onNoAction); MenuManager.Instance.DoTransition(confirmMenu, Transition.SHOW, new Effect[] { Effect.INSTANT }); }
public void QuitAction() { SelectMenuItem(PLEMenuType.EXIT); ConfirmMenu confirmMenu = (ConfirmMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.CONFIRM); Action onYesAction = () => { Menu menu = MenuManager.Instance.GetMenuByName(Strings.MenuStrings.LOAD); LoadMenu loadMenu = (LoadMenu)menu; loadMenu.SetNavigation(Strings.Scenes.ScenePaths.MainMenu); MenuManager.Instance.DoTransition(loadMenu, Transition.SHOW, new Effect[] { Effect.EXCLUSIVE }); }; Action onNoAction = () => { MenuManager.Instance.DoTransition(Strings.MenuStrings.CONFIRM, Transition.HIDE, new Effect[] { Effect.INSTANT }); MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); OpenFloorSystemAction(); }; confirmMenu.DefineActions("You will lose any unsaved data. Are you sure?", onYesAction, onNoAction); MenuManager.Instance.DoTransition(confirmMenu, Transition.SHOW, new Effect[] { Effect.INSTANT }); }
public void LoadLevel() { if (SceneTracker.IsCurrentSceneEditor) { ConfirmMenu confirmMenu = (ConfirmMenu)MenuManager.Instance.GetMenuByName(Strings.MenuStrings.CONFIRM); Action onYesAction = () => { TryLoadSelectedLevel(); }; Action onNoAction = () => { MenuManager.Instance.DoTransition(confirmMenu, Transition.HIDE, new Effect[] { Effect.INSTANT }); SelectInitialButton(); }; confirmMenu.DefineActions("You will lose any unsaved data. Are you sure?", onYesAction, onNoAction); MenuManager.Instance.DoTransition(confirmMenu, Transition.SHOW, new Effect[] { Effect.INSTANT }); } else { TryLoadSelectedLevel(); } }