コード例 #1
0
        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>();
            }));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 private static void OnMainMenu(OuiMainMenu menu, List <MenuButton> buttons)
 {
     UpdateText(CoreModule.Settings.DiscordTextInMenu);
 }
コード例 #5
0
        // 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;