private void CreateSubmenu <T>(TextMenu menu, bool inGame) where T : AbstractSubmenu
        {
            TextMenuButtonExt submenu = AbstractSubmenu.BuildOpenMenuButton <T>(menu, inGame);

            if (submenu != null)
            {
                submenu.Visible = Enabled;
                menu.Add(submenu);
            }
        }
예제 #2
0
        private void onCreatePauseMenuButtons(Level level, TextMenu menu, bool minimal)
        {
            int optionsIndex = menu.GetItems().FindIndex(item =>
                                                         item.GetType() == typeof(TextMenu.Button) && ((TextMenu.Button)item).Label == Dialog.Clean("menu_pause_options"));

            // insert ourselves just before Options if required (this is below Variants if variant mode is enabled)
            if (Settings.OptionsOutOfModOptionsMenuEnabled)
            {
                menu.Insert(optionsIndex, AbstractSubmenu.BuildOpenMenuButton <OuiExtendedVariantsSubmenu>(menu, true,
                                                                                                           null /* this is not used when in-game anyway */, new object[] { true }));
            }
        }