public static void GoToMenu(MenuNames menuName) { switch (menuName) { case MenuNames.MainMenu: AudioManager.Play(AudioClipName.ButtonSelect); SceneManager.LoadScene("MainMenu"); break; case MenuNames.HelpMenu: AudioManager.Play(AudioClipName.ButtonSelect); SceneManager.LoadScene("HelpMenu"); break; case MenuNames.PauseMenu: AudioManager.Play(AudioClipName.ButtonSelect); Object.Instantiate(Resources.Load("PauseMenu")); break; case MenuNames.GameOverMenu: AudioManager.Play(AudioClipName.GameOver); Object.Instantiate(Resources.Load("GameOverMenu")); break; } }
internal void AddMenu(MenuNames menuname) { var menu = MainMenu.GetMenu("cm_" + ObjectManager.Player.ChampionName.ToLower()); var newmenu = menu.AddSubMenu(menuname.ToString().Replace("_", " "), "cm_" + menuname.ToString().ToLower(), "CarryMe " + ObjectManager.Player.ChampionName + " - " + menuname); MenuDictionary.Add(menuname.ToString(), newmenu); }
protected IMenuBarItem ExportODEForRMenuItem(TSimulation simulation) { return(CreateMenuButton.WithCaption(MenuNames.AsDeveloperOnly(MenuNames.ExportODEForR)) .WithCommandFor <ExportODEForRUICommand, Simulation>(simulation) .WithIcon(ApplicationIcons.R) .ForDeveloper()); }
public void ShowMenu(MenuNames currentName) { switch (currentName) { case MenuNames.gameActions: gameActionsUI.ShowMenu(true); //inGameUI.ShowMenu(false); gameDifficultUI.ShowMenu(false); break; case MenuNames.gameDifficult: gameActionsUI.ShowMenu(false); //inGameUI.ShowMenu(false); gameDifficultUI.ShowMenu(true); break; case MenuNames.inGame: //gameActionsUI.ShowMenu(false); inGameUI.ShowMenu(true); //gameDifficultUI.ShowMenu(false); break; } if (GameController.instance.currentGameState != GameController.GameState.gamePlay) { inGameUI.ShowMenu(false); } else { inGameUI.ShowMenu(true); } }
public ToolbarView Menus(List <string> menuNames) { this.MenuNames = menuNames; // empty this.MenuSelected = MenuNames.Select(menuName => new Action <string>((str => { }))).ToList(); return(this); }
public DelegateCheckedMenuItem(string text, MenuNames name, Func <bool> initDelegate, Action <bool> changedDelegate) : base(text) { base.Name = name.ToString(); _initDelegate = initDelegate; _changedDelegate = changedDelegate; }
private IMenuBarItem createExportODEForRItem(IMoBiSimulation simulation) { return(CreateMenuButton.WithCaption(MenuNames.AsDeveloperOnly(MenuNames.ExportODEForR)) .WithCommandFor <ExportODEForRUICommand, IMoBiSimulation>(simulation) .WithIcon(ApplicationIcons.R) .ForDeveloper()); }
private static IMenuBarButton comparisonNotPossibleMenu(IReadOnlyList <TBuildingBlock> buildingBlocks, IExecutionContext executionContext) { var buildingBlockType = executionContext.TypeFor(buildingBlocks[0]); return(CreateMenuButton.WithCaption(MenuNames.CompareObjects(executionContext.TypeFor(buildingBlocks[0]))) .WithIcon(ApplicationIcons.Comparison) .WithActionCommand(() => throw new PKSimException(PKSimConstants.Error.ComparisonBetweenBuildingBLocksNotSupportedForBuildingBlockOfType(buildingBlockType)))); }
public void setCurrentMenu(string menuName) { if (!menuExists(menuName)) { throw new MenuDoesNotExistException("The given menu does not exist!"); } MenuNames.Push(menuName); CurrentMenu = Menus[menuName]; }
// public IMenuType getMenu(string menuName) // { // if(!menuNames.Contains(menuName)) throw new MenuDoesNotExistException("Menu doesn't exist in the MenuManager!"); // // return menus[menuName]; // } public void restorePreviousMenu() { if (MenuNames.Count == 1) { throw new MenuStackEmptyException("There is no menu to revert to!"); } MenuNames.Pop(); CurrentMenu = Menus[MenuNames.Peek()]; }
public void addMenu(string menuName, IMenuType menuToAdd) { if (MenuNames.Contains(menuName)) { return; } Menus.Add(menuName, menuToAdd); MenuNames.Push(menuName); CurrentMenu = menuToAdd; }
public DelegateMenuItem(string text, MenuNames name, Action click) : base(text) { EventHandler value = delegate { click(); }; base.Click += value; base.Name = name.ToString(); }
internal bool IsChecked(MenuNames menuname, string identifier) { try { return(MenuDictionary[menuname.ToString()][identifier].Cast <CheckBox>().CurrentValue); } catch (Exception) { // checkbox not exist return(false); } }
public static void GoToMenu(MenuNames menu) { switch (menu) { case MenuNames.Main: SceneManager.LoadScene(SceneNames.Main.ToString()); break; case MenuNames.Chapters: break; } }
public IToolbar AddMenu(string name, Action <string> onMenuSelected = null) { MenuNames.Add(name); if (onMenuSelected == null) { MenuSelected.Add((item) => { }); } else { MenuSelected.Add(onMenuSelected); } return(this); }
/// <summary> /// Selects which menu should be displayed to the player /// </summary> /// <param name="toMenu">Menu that will be brought up</param> public static void GotoMenu(MenuNames toMenu) { switch (toMenu) { case MenuNames.Gameplay1: SceneManager.LoadScene("GameplayScene1"); break; case MenuNames.Gameplay2: SceneManager.LoadScene("GameplayScene2"); break; case MenuNames.Gameplay3: SceneManager.LoadScene("GameplayScene3"); break; case MenuNames.MainMenu: SceneManager.LoadScene("MainMenuScene"); break; case MenuNames.HelpMenu: isInHelpMenu = true; Object.Instantiate(Resources.Load("Menus/MenuHelp")); break; case MenuNames.PauseMenu: isGamePaused = true; Object.Instantiate(Resources.Load("Menus/MenuPause")); break; case MenuNames.GameOver: GameObject gameOverMenu = Object.Instantiate(Resources.Load("Menus/MenuGameOver")) as GameObject; GameEndedController menuOverScript = gameOverMenu.GetComponent <GameEndedController>(); //Configures the required fields menuOverScript.SetupMenu(true); break; case MenuNames.LevelEnded: GameObject gameEndedMenu = Object.Instantiate(Resources.Load("Menus/MenuLevelComplete")) as GameObject; GameEndedController menuEndedScript = gameEndedMenu.GetComponent <GameEndedController>(); //Configures the required fields menuEndedScript.SetupMenu(false); break; default: break; } }
internal void AddLabel(MenuNames menuname, string label, bool header = false) { MenuDictionary[menuname.ToString()].Add("sep_" + SeperatorCount, new Separator(header ? 10 : 5)); ++SeperatorCount; if (header) { MenuDictionary[menuname.ToString()].AddGroupLabel(label); } else { MenuDictionary[menuname.ToString()].AddLabel(label); } MenuDictionary[menuname.ToString()].Add("sep_" + SeperatorCount, new Separator(header ? 10 : 5)); ++SeperatorCount; }
/// <summary> /// Goes to menu with given name /// </summary> /// <param name="name">name of menu to go to</param> public static void GoToMenu(MenuNames name) { switch (name) { case MenuNames.scene0: SceneManager.LoadScene("scene0"); break; case MenuNames.Menu: SceneManager.LoadScene("Menu"); break; case MenuNames.HelpMenu: SceneManager.LoadScene("HelpMenu"); break; } }
/// <summary> /// Goes to menu with given name /// </summary> /// <param name="name">name of menu to go to</param> public static void GoToMenu(MenuNames name) { // switch to load scences based on desired case switch (name) { case MenuNames.TestRoom: SceneManager.LoadScene("TestRoom"); break; case MenuNames.Main: SceneManager.LoadScene("Main"); break; case MenuNames.StartMenu: SceneManager.LoadScene("StartMenu"); break; } }
internal void AddRadioBox(MenuNames menuname, bool oneMustStayAktive, RadioBox Box1, RadioBox Box2) { var checkbox1 = MenuDictionary[menuname.ToString()].Add(Box1.Identifier, new CheckBox(Box1.Name, Box1.DefaultValue)); var checkbox2 = MenuDictionary[menuname.ToString()].Add(Box2.Identifier, new CheckBox(Box2.Name, Box2.DefaultValue)); RandioboxDictionary.Add(Box1.Name, checkbox2); RandioboxDictionary.Add(Box2.Name, checkbox1); if (oneMustStayAktive) { checkbox1.OnValueChange += CheckBoxChanged_OneStayActive; checkbox2.OnValueChange += CheckBoxChanged_OneStayActive; } else { checkbox1.OnValueChange += CheckBoxChanged_JustDisable; checkbox2.OnValueChange += CheckBoxChanged_JustDisable; } }
public static IMenuBarButton CompareObjectsMenu(IReadOnlyList <IObjectBase> objectsToCompare, IReadOnlyList <string> objectNames, IOSPSuiteExecutionContext context) { if (objectsToCompare.Count != 2) { return(null); } if (objectsToCompare.Count != objectNames.Count) { return(null); } var menu = CreateMenuButton.WithCaption(MenuNames.CompareObjects(context.TypeFor(objectsToCompare[0]))) .WithCommandFor <CompareObjectsUICommand, IReadOnlyList <IObjectBase> >(objectsToCompare) .WithIcon(ApplicationIcons.Comparison); var compareObjectCommand = menu.Command.DowncastTo <CompareObjectsUICommand>(); compareObjectCommand.ObjectNames = objectNames; return(menu); }
public static void GoToMenu(MenuNames menuName) { switch (menuName) { case MenuNames.MainMenu: SceneManager.LoadScene("MainMenu"); break; case MenuNames.Gameplay: SceneManager.LoadScene("Gameplay"); break; case MenuNames.PauseMenu: //Object.Instantiate(Resources.Load("PauseMenu")); break; case MenuNames.ShopMenu: //Object.Instantiate(Resources.Load("ShopMenu")); break; } }
public void ActivateMenu(MenuNames menuName) { //Debug.Log("Deactivating Menus " + menuName); //Deactivate any active menus for (int i = 0; i < menuScripts.Length; i++) { if (menuScripts[i].menuActive) { menuScripts[i].DeactivateMenu(); } } //Activate the menuName menu //Debug.Log("Activating Menu " + menuName); switch (menuName) { case MenuNames.main: menuScripts[0].gameObject.SetActive(true); menuScripts[0].ActivateMenu(); break; case MenuNames.options: menuScripts[1].gameObject.SetActive(true); menuScripts[1].ActivateMenu(); break; case MenuNames.levelSelect: menuScripts[2].gameObject.SetActive(true); menuScripts[2].ActivateMenu(); break; case MenuNames.quit: Debug.Log("Quitting"); Application.Quit(); break; } }
internal int GetValue(MenuNames menuname, string identifier) { return(MenuDictionary[menuname.ToString()][identifier].Cast <Slider>().CurrentValue); }
public DelegateMenuItem(string text, MenuNames name, string shortcut, Action click) : this(text, name, click) { base.ShortcutKeyDisplayString = shortcut; }
public ToolbarView AddMenu(string name, Action <string> onMenuSelected) { MenuNames.Add(name); MenuSelected.Add(onMenuSelected); return(this); }
public SelectedNodeMenuItem(string text, MenuNames name, string shortcut, Action <T> action) : this(text, name, action) { base.ShortcutKeyDisplayString = shortcut; }
public SelectedNodeMenuItem(string text, MenuNames name, Action <T> action) : base(text) { base.Name = name.ToString(); _action = action; }
internal void AddSlider(MenuNames menuname, string displayName, string identifier, int defaultValue, int min, int max) { MenuDictionary[menuname.ToString()].Add(identifier, new Slider(displayName, defaultValue, min, max)); }
internal void AddCheckBox(MenuNames menuname, string displayName, string identifier, bool defaultValue) { MenuDictionary[menuname.ToString()].Add(identifier, new CheckBox(displayName, defaultValue)); }