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 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); }
private static void OnMainMenu(OuiMainMenu menu, List <MenuButton> buttons) { UpdateText(CoreModule.Settings.DiscordTextInMenu); }
// Mods can't access patch_ classes directly. // We thus expose any new members through extensions. public static List <MenuButton> GetButtons(this OuiMainMenu self) => ((patch_OuiMainMenu)self).Buttons;