public void CreateMainMenuButtons(OuiMainMenu menu, List <MenuButton> buttons) { if (Everest.Flags.IsDisabled) { return; } int index; // Find the options button and place our button below it. index = buttons.FindIndex(_ => { MainMenuSmallButton other = (_ as MainMenuSmallButton); if (other == null) { return(false); } return(other.GetLabelName() == "menu_options" && other.GetIconName() == "menu/options"); }); if (index != -1) { index++; } // Otherwise, place it above the exit button. else { index = buttons.Count - 1; } buttons.Insert(index, new MainMenuModOptionsButton("menu_modoptions", "menu/modoptions_new", menu, Vector2.Zero, Vector2.Zero, () => { Audio.Play(SFX.ui_main_button_select); Audio.Play(SFX.ui_main_whoosh_large_in); menu.Overworld.Goto <OuiModOptions>(); })); }
private void CreateMainMenuButton(OuiMainMenu menu, System.Collections.Generic.List <MenuButton> buttons) { MainMenuSmallButton btn = new MainMenuSmallButton("MODOPTIONS_RANDOMIZER_TOPMENU", "menu/randomizer", menu, Vector2.Zero, Vector2.Zero, () => { Audio.Play(SFX.ui_main_button_select); Audio.Play(SFX.ui_main_whoosh_large_in); menu.Overworld.Goto <OuiRandoSettings>(); }); buttons.Insert(1, btn); }
private int findButtonIndex(string labelName, string iconName) { return(buttons.FindIndex(_ => { MainMenuSmallButton other = (_ as MainMenuSmallButton); if (other == null) { return false; } return other.GetLabelName() == labelName && other.GetIconName() == iconName; })); }
private void CreateMainMenuButton(OuiMainMenu menu, System.Collections.Generic.List <MenuButton> buttons) { MainMenuSmallButton btn = new MainMenuSmallButton("MODOPTIONS_RANDOMIZER_TOPMENU", "menu/randomizer", menu, Vector2.Zero, Vector2.Zero, () => { Audio.Play(SFX.ui_main_button_select); Audio.Play(SFX.ui_main_whoosh_large_in); if (this.SavedData.FastMenu ^ (Input.MenuJournal.Check || MInput.Keyboard.Check(Keys.LeftShift))) { menu.Overworld.Goto <OuiRandoSettings>(); } else { menu.Overworld.Goto <OuiRandoMode>(); } }); buttons.Insert(1, btn); }
public static Wiggler GetWiggler(this MainMenuSmallButton self) { return(((patch_MainMenuSmallButton)self).Wiggler); }
public static float GetEase(this MainMenuSmallButton self) { return(((patch_MainMenuSmallButton)self).Ease); }
/// <summary> /// Get the original GUI atlas icon path. Useful when inserting your own button between others. /// </summary> public static string GetIconName(this MainMenuSmallButton self) => ((patch_MainMenuSmallButton)self).IconName;
// Mods can't access patch_ classes directly. // We thus expose any new members through extensions. /// <summary> /// Get the original label name dialog key. Useful when inserting your own button between others. /// </summary> public static string GetLabelName(this MainMenuSmallButton self) => ((patch_MainMenuSmallButton)self).LabelName;