Ejemplo n.º 1
0
 public ModConfig(IManifest manifest, Action revertToDefault, Action saveToFile)
 {
     ModManifest     = manifest;
     RevertToDefault = revertToDefault;
     SaveToFile      = saveToFile;
     Options.Add("", ActiveRegisteringPage = new ModPage(""));
 }
Ejemplo n.º 2
0
 //Goes to Mod-Page
 public static void GoToModPage(ModPage modPage)
 {
     optionsMenu.ShowPage(OptionsMenu.Page.Gameplay);
     CleanUpPage();
     AddModPageToModMenu(modPage);
     optionsMenu.screenTitle.text = modPage.modName;
 }
Ejemplo n.º 3
0
 private void CachePages()
 {
     homePage               = new HomePage();
     customSongPage         = new CustomSongPage();
     modPage                = new ModPage();
     customEnvironmentsPage = new CustomEnvironmentsPage();
     uploadPage             = new UploadPage();
     userProfilePage        = new UserProfilePage();
     settingsPage           = new SettingsPage();
 }
Ejemplo n.º 4
0
        public static void AddModPageToModMenu(ModPage modPage)
        {
            int buttonCol = 0;

            foreach (EntryType entryType in modPage.entryType)
            {
                switch (entryType)
                {
                case EntryType.Header:
                    optionsMenu.AddHeader(0, modPage.headers[0]);
                    modPage.headers.RemoveAt(0);
                    buttonCol = 0;
                    break;

                case EntryType.Button:
                    ModButton         b   = modPage.buttons[0];
                    OptionsMenuButton omb = optionsMenu.AddButton(buttonCol, b.label, new System.Action(() => {
                        b.onSelectedDelegate.Invoke();
                    }), null, b.helpText);
                    omb.label.text = b.initialButtonText;
                    modPage.buttons.RemoveAt(0);
                    if (buttonCol == 0)
                    {
                        buttonCol = 1;
                    }
                    else
                    {
                        buttonCol = 0;
                    }
                    break;

                case EntryType.Slider:
                    ModSlider         s   = modPage.sliders[0];
                    OptionsMenuSlider oms = optionsMenu.AddSlider(buttonCol, s.label, s.numberFormat, s.onAdjustAction, null);
                    oms.label.text = s.initialSliderText;
                    modPage.sliders.RemoveAt(0);
                    if (buttonCol == 0)
                    {
                        buttonCol = 1;
                    }
                    else
                    {
                        buttonCol = 0;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 5
0
 public static void RegisterModPage(ModPage modPage)
 {
     modPages.Add(modPage);
 }