Ejemplo n.º 1
0
        public ConfigTabController(Vector2 pos, Vector2 size, MenuTab tab, ConfigMenu menu) : base(pos, size)
        {
            this.menuTab   = tab;
            this.cfgMenu   = menu;
            this.mode      = TabMode.NULL;
            subElements    = new List <UIelement>();
            this.greyedOut = false;

            OnChange();
        }
Ejemplo n.º 2
0
#pragma warning restore IDE0060
#pragma warning restore CA1822

        public override void Initialize()
        {
            if (this.reason == Reason.TooManyMod)
            {
                ListMods();
                return;
            }

            Tabs    = new OpTab[1];
            Tabs[0] = new OpTab();

            if (this.reason == Reason.NoMod)
            {
                TutoInit();
                return;
            }

            GeneratedOI.AddBasicProfile(Tabs[0], rwMod);

            switch (this.reason)
            {
            case Reason.NoInterface:
                if (rwMod.description != RainWorldMod.authorNull)
                {
                    Tabs[0].AddItems(new OpLabelLong(new Vector2(50f, 200f), new Vector2(500f, 250f), rwMod.description, alignment: FLabelAlignment.Center));
                    labelSluggo0 = new OpLabel(new Vector2(100f, 150f), new Vector2(400f, 20f),
                                               InternalTranslator.Translate(rwMod.type == RainWorldMod.Type.PartialityMod ? "This Partiality Mod has no Option Interface." : "This BepInEx Plugin has no Option Interface."));
                }
                else
                {
                    labelSluggo0 = new OpLabel(new Vector2(100f, 350f), new Vector2(400f, 20f),
                                               InternalTranslator.Translate(rwMod.type == RainWorldMod.Type.PartialityMod ? "This Partiality Mod has no Option Interface." : "This BepInEx Plugin has no Option Interface."));
                }

                Tabs[0].AddItems(labelSluggo0);

                break;

            case Reason.InitError:
                blue = new OpRect(new Vector2(30f, 20f), new Vector2(540f, 420f))
                {
                    alpha = 0.7f, colorFill = new Color(0.121568627f, 0.40392156862f, 0.69411764705f, 1f)
                };

                Color white = Menu.Menu.MenuRGB(Menu.Menu.MenuColors.White);
                oof = new OpLabel(new Vector2(100f, 380f), new Vector2(30f, 40f), ":(", FLabelAlignment.Left, true)
                {
                    color = white
                };
                labelSluggo0 = new OpLabel(new Vector2(150f, 390f), new Vector2(300f, 20f), InternalTranslator.Translate("There was an issue initializing OptionInterface."))
                {
                    color = white
                };
                labelSluggo1 = new OpLabelLong(new Vector2(50f, 40f), new Vector2(500f, 320f), exception)
                {
                    color = white, allowOverflow = false
                };
                labelVersion = new OpLabel(new Vector2(50f, 480f), new Vector2(100f, 20f), string.Concat(Environment.NewLine, "Config Machine ", MenuTab.GetCMVersion()), FLabelAlignment.Left);

                Tabs[0].AddItems(blue, oof, labelSluggo0, labelSluggo1, labelVersion);

                break;
            }
        }
Ejemplo n.º 3
0
        public void Initialize() //UI
        {
            if (vanillaMenu != null)
            {
                vanillaMenu.ShutDownProcess();
                vanillaMenu = null;
            }

            instance = this;
            mute     = true;

#pragma warning disable CS0162 // 접근할 수 없는 코드가 있습니다.
            if (!OptionMod.testing)
            {
                if (!redUnlocked)
                {
                    this.scene = new InteractiveMenuScene(this, this.pages[0], (MenuScene.SceneID)(bgList[Mathf.FloorToInt(UnityEngine.Random.value * (bgList.Length))]));
                }
                else
                {
                    this.scene = new InteractiveMenuScene(this, this.pages[0], (MenuScene.SceneID)(bgListRed[Mathf.FloorToInt(UnityEngine.Random.value * (bgListRed.Length))]));
                }
                Debug.Log(string.Concat("Chosen Background : " + this.scene.sceneID.ToString()));
                this.pages[0].subObjects.Add(this.scene);
            }
            else
            {
                this.scene = new SlideShowMenuScene(this, this.pages[0], MenuScene.SceneID.Intro_4_Walking);
                this.pages[0].subObjects.Add(this.scene);
            }
#pragma warning restore CS0162

            this.fadeSprite.RemoveFromContainer();
            this.pages[0].Container.AddChild(this.fadeSprite); //reset fadeSprite

            this.darkSprite = new FSprite("pixel", true)
            {
                color   = new Color(0f, 0f, 0f),
                anchorX = 0f,
                anchorY = 0f,
                scaleX  = 1368f,
                scaleY  = 770f,
                x       = -1f,
                y       = -1f,
                alpha   = 0.6f
            };
            this.pages[0].Container.AddChild(this.darkSprite);

            modListBound = new OpRect(new Vector2(193f, 240f) - UIelement._offset, new Vector2(280f, 495f), 0.3f);
            //modCanvasBound = new OpRect(new Vector2(553f, 105f), new Vector2(630f, 630f), 0.4f);
            modCanvasBound = new OpRect(new Vector2(543f, 105f) - UIelement._offset, new Vector2(630f, 630f), 0.4f);
            //Base: new Vector2(468f, 120f);
            menuTab.AddItems(modListBound, modCanvasBound);
            this.pages[0].subObjects.Add(modListBound.rect);
            this.pages[0].subObjects.Add(modCanvasBound.rect);

            this.backButton = new SimpleButton(this, this.pages[0], InternalTranslator.Translate("BACK"), "CANCEL", new Vector2(450f, 50f), new Vector2(110f, 30f));
            this.pages[0].subObjects.Add(this.backButton);
            this.saveButton = new SimpleButton(this, this.pages[0], InternalTranslator.Translate("APPLY"), "APPLY", new Vector2(600f, 50f), new Vector2(110f, 30f));
            this.pages[0].subObjects.Add(this.saveButton);
            base.MutualHorizontalButtonBind(saveButton, backButton);
            this.resetButton = new HoldButton(this, this.pages[0], InternalTranslator.Translate("RESET CONFIG"), "RESET CONFIG", new Vector2(300f, 110f), 30f);
            this.pages[0].subObjects.Add(this.resetButton);
            this.alertLabel = new MenuLabel(this, this.pages[0], "", new Vector2(383f, 735f), new Vector2(600f, 30f), false);
            this.pages[0].subObjects.Add(this.alertLabel);
            this.alertLabelFade = 0f; this.lastAlertLabelFade = 0f; this.alertLabelSin = 0f;

            //Dark Box for ModList & Canvas
            //modlist x200 y400 w240 h600
            //canvas  x568 y120 w600 h600

            this.resetButton.nextSelectable[2] = this.backButton;
            this.backButton.nextSelectable[0]  = this.resetButton;
            this.backButton.nextSelectable[2]  = this.saveButton;
            this.saveButton.nextSelectable[0]  = this.backButton;

            menuTab.lblInfoButton           = new OpLabel(new Vector2(233f, 215f) - UIelement._offset, new Vector2(200f, 20f), "Config Machine " + MenuTab.GetCMVersion());
            menuTab.lblInfoButton.bumpBehav = new BumpBehaviour(menuTab.lblInfoButton);
            menuTab.AddItems(menuTab.lblInfoButton);
            this.pages[0].subObjects.Add(menuTab.lblInfoButton.label);

            List <OptionInterface> itfs = new List <OptionInterface>();

            // Initialize
            OptionScript.loadedInterfaceDict.Remove(InternalTranslator.Translate("Mod List")); // Remove old Mod List
            List <UnconfiguableOI> replacedOIs = new List <UnconfiguableOI>();
            foreach (string id in OptionScript.loadedInterfaceDict.Keys)
            {
                OptionInterface itf = OptionScript.loadedInterfaceDict[id];
                Debug.Log(string.Concat("OptionInterface Initializing: " + id));

#pragma warning disable CS0612
                try { itf.Initialize(); }
                catch (Exception ex)
                { itf = new UnconfiguableOI(itf.mod, new GeneralInitializeException(ex)); goto replaced; }

                if (itf.Tabs == null || itf.Tabs.Length < 1)
                {
                    itf = new UnconfiguableOI(itf.mod, new NoTabException(id)); goto replaced;
                }
                else if (itf.Tabs.Length > 20)
                {
                    itf = new UnconfiguableOI(itf.mod, new TooManyTabsException()); goto replaced;
                }

                try { itf.LoadConfig(); itf.ShowConfig(); }
                catch (Exception ex)
                {
                    itf = new UnconfiguableOI(itf.mod, new LoadDataException(string.Concat("OILoad/ShowConfigError: ", id, " had a problem in Load/ShowConfig()\nAre you editing LoadConfig()/ShowConfig()? That could cause serious error.",
                                                                                           Environment.NewLine, ex
                                                                                           )));
                    goto replaced;
                }
#pragma warning restore CS0612

                itfs.Add(itf);
                continue;

replaced:
                itf.Initialize();
                itfs.Add(itf);
                replacedOIs.Add(itf as UnconfiguableOI);
            }
            foreach (UnconfiguableOI itf in replacedOIs)
            {
                OptionScript.loadedInterfaceDict.Remove(itf.rwMod.ModID);
                OptionScript.loadedInterfaceDict.Add(itf.rwMod.ModID, itf);
            }

            // Remove Excess
            int                 priority    = (int)OptionInterface.Priority.NoInterface;
            UnconfiguableOI     listItf     = null;
            List <RainWorldMod> listIgnored = new List <RainWorldMod>();
            while (itfs.Count > 16 && priority < (int)OptionInterface.Priority.Inconfiguable) // 1
            {
                Debug.Log(string.Concat("Mod Count: ", itfs.Count, "! Discarding priority ", priority));

                /* if (priority == -2)
                 * {
                 *  List<OptionInterface> temp2 = new List<OptionInterface>();
                 *  foreach (OptionInterface oi in itfs) { if (oi.GetPriority() > -2) { temp2.Add(oi); } }
                 *  itfs = temp2; priority++; continue;
                 * } */
                if (priority == (int)OptionInterface.Priority.NoInterface)
                {
                    PartialityMod blankMod = new PartialityMod
                    {
                        ModID   = InternalTranslator.Translate("Mod List"),
                        Version = "XXXX",
                        author  = RainWorldMod.authorNull
                    };
                    listItf = new UnconfiguableOI(blankMod, UnconfiguableOI.Reason.TooManyMod);
                }
                List <OptionInterface> temp = new List <OptionInterface>();
                foreach (OptionInterface oi in itfs)
                {
                    if (oi.GetPriority() > priority)
                    {
                        temp.Add(oi);
                    }
                    else
                    {
                        listIgnored.Add(oi.rwMod);
                    }
                }
                itfs = temp;
                priority++;
            }

            // Sorting
            {
                List <OptionInterface>[] sortTemp = new List <OptionInterface> [(int)OptionInterface.Priority.Error + 2];
                for (int p = 0; p < sortTemp.Length; p++)
                {
                    sortTemp[p] = new List <OptionInterface>();
                }
                foreach (OptionInterface oi in itfs)
                {
                    sortTemp[oi.GetPriority() + 1].Add(oi);
                }
                int cmCount = 0;
                for (int p = 0; p < sortTemp.Length; p++)
                {
                    cmCount += sortTemp[p].Count; sortTemp[p].Sort(CompareOIModID);
                }

                itfs = new List <OptionInterface>();
                if (priority > (int)OptionInterface.Priority.NoInterface)
                {
                    OptionScript.loadedInterfaceDict.Add(InternalTranslator.Translate("Mod List"), listItf);
                    listItf.SetIgnoredModList(listIgnored);
                    if (cmCount > 15)
                    {
                        listItf.SetConfiguableModList(sortTemp);
                    }
                    else
                    {
                        listItf.SetConfiguableModList(null);
                    }
                    listItf.Initialize();
                    itfs.Add(listItf);
                }
                for (int p = sortTemp.Length - 1; p >= 0; p--)
                {
                    for (int i = 0; i < sortTemp[p].Count; i++)
                    {
                        itfs.Add(sortTemp[p][i]);
                    }
                }
            }

            // Add Buttons
            modButtons = new SelectOneButton[Math.Min(16, itfs.Count)];
            Dictionary <int, string> dictionary = new Dictionary <int, string>(itfs.Count);
            selectedModIndex = 0;
            for (int i = 0; i < itfs.Count; i++)
            {
                OptionInterface itf = itfs[i];
#pragma warning disable CS0162
                if (OptionMod.testing)
                {
                    Debug.Log(string.Concat("Mod(" + i + ") : " + itf.rwMod.ModID));
                }
#pragma warning restore CS0162
                for (int t = 0; t < itf.Tabs.Length; t++)
                {
                    OptionScript.tabs.Add(string.Concat(i.ToString("D3") + "_" + t.ToString("D2")), itf.Tabs[t]);
                    foreach (UIelement element in itf.Tabs[t].items)
                    {
                        foreach (MenuObject obj in element.subObjects)
                        {
                            this.pages[0].subObjects.Add(obj);
                        }
                        this.pages[0].Container.AddChild(element.myContainer);
                    }
                    itf.Tabs[t].Hide();
                }
                dictionary.Add(i, itf.rwMod.ModID);

                if (i > 15)
                {
                    continue;
                }
                modButtons[i] = new SelectOneButton(this, this.pages[0], itf.rwMod.ModID, "ModSelect", new Vector2(208f, 700f - 30f * i), new Vector2(250f, 24f), modButtons, i);
                this.pages[0].subObjects.Add(modButtons[i]);
            }
            modList    = dictionary;
            scrollMode = false;
            if (itfs.Count > 16)
            {
                scrollMode = true;
                scrollTop  = 1;
                modButtons[1].menuLabel.text  = InternalTranslator.Translate("Scroll Up");
                modButtons[1].signalText      = "ScrollUp";
                modButtons[15].menuLabel.text = InternalTranslator.Translate("Scroll Down");
                modButtons[15].signalText     = "ScrollDown";
                ScrollButtons();
            }

            if (this.modButtons.Length > 1)
            {
                for (int m = 0; m < this.modButtons.Length - 1; m++)
                {
                    this.modButtons[m].nextSelectable[3]     = this.modButtons[m + 1];
                    this.modButtons[m + 1].nextSelectable[1] = this.modButtons[m];
                }
                if (listItf != null)
                {
                    this.modButtons[0].menuLabel.text = listItf.rwMod.ModID;
                }
            }
            this.resetButton.nextSelectable[1] = this.modButtons[this.modButtons.Length - 1];
            this.backButton.nextSelectable[1]  = this.modButtons[this.modButtons.Length - 1];
            this.saveButton.nextSelectable[1]  = this.modButtons[this.modButtons.Length - 1];
            this.modButtons[this.modButtons.Length - 1].nextSelectable[3] = this.saveButton;

            //Load Tab
            selectedTabIndex = 0;
            currentInterface = OptionScript.loadedInterfaceDict[modList[0]];
            currentTab       = OptionScript.tabs[string.Concat(selectedModIndex.ToString("D3") + "_" + selectedTabIndex.ToString("D2"))];

            currentTab.Show();
            if (currentInterface.Configuable())
            {
                saveButton.buttonBehav.greyedOut  = false;
                resetButton.buttonBehav.greyedOut = false;
            }
            else
            {
                saveButton.buttonBehav.greyedOut  = true;
                resetButton.buttonBehav.greyedOut = true;
            }

            tabCtrler = new ConfigTabController(new Vector2(503f, 120f) - UIelement._offset, new Vector2(40f, 600f), menuTab, this);
            menuTab.AddItems(tabCtrler);
            foreach (MenuObject obj in tabCtrler.subObjects)
            {
                this.pages[0].subObjects.Add(obj);
            }

            this.selectedObject = this.backButton;

            OptionScript.configChanged = false;

            mute = false;
        }
Ejemplo n.º 4
0
        public ConfigMenu(ProcessManager manager) : base(manager, ProcessManager.ProcessID.OptionsMenu)
        {
            Debug.Log("ConfigMenu ctor!");
            this.manager.currentMainLoop = this; //duplicate
            this.manager.upcomingProcess = null;

            this.pages.Add(new Page(this, null, "hub", 0));
            OptionScript.configMenu = this;
            OptionScript.tabs       = new Dictionary <string, OpTab>();

            if (this.manager.musicPlayer == null)
            {
                this.manager.musicPlayer = new MusicPlayer(this.manager);
                this.manager.sideProcesses.Add(this.manager.musicPlayer);
            }
            this.manager.musicPlayer.MenuRequestsSong(GetRandomSong(), 1f, 2f);
            //this.manager.musicPlayer.song = new MenuOrSlideShowSong(this.manager.musicPlayer, randomSong, 1f, 2f);
            //this.manager.musicPlayer.song.playWhenReady = true;

            redUnlocked = (this.manager.rainWorld.progression.miscProgressionData.redUnlocked ||
                           File.Exists(string.Concat(Custom.RootFolderDirectory(), "unlockred.txt")) ||
                           this.manager.rainWorld.progression.miscProgressionData.redMeatEatTutorial > 2
                           );

            opened           = false;
            selectedModIndex = 0;
            menuTab          = new MenuTab();

            List <string> allLevels = new List <string>();

            this.multiplayerUnlocks = new MultiplayerUnlocks(manager.rainWorld.progression, allLevels);
            currentInterface        = null;

            OptionScript.soundFill = 0;
            freezeMenu             = false;
            BoundKey = new Dictionary <string, string>();
            //Get Vanilla Keys
            for (int i = 0; i < OptionScript.rw.options.controls.Length; i++)
            {
                Options.ControlSetup setup = OptionScript.rw.options.controls[i];
                if (setup.preset == Options.ControlSetup.Preset.KeyboardSinglePlayer)
                {
                    for (int p = 0; p < setup.keyboardKeys.Length; p++)
                    {
                        if (!BoundKey.ContainsValue(setup.keyboardKeys[p].ToString()))
                        {
                            BoundKey.Add(string.Concat("Vanilla_", i.ToString(), "_", p.ToString()), setup.keyboardKeys[p].ToString());
                        }
                    }
                }
                else
                {
                    for (int p = 0; p < setup.gamePadButtons.Length; p++)
                    {
                        string key = setup.gamePadButtons[p].ToString();
                        if (key.Length > 9 && int.TryParse(key.Substring(8, 1), out int _))
                        {
                        }
                        else
                        {
                            key = key.Substring(0, 8) + i.ToString() + key.Substring(8);
                        }
                        if (!BoundKey.ContainsValue(key))
                        {
                            BoundKey.Add(string.Concat("Vanilla_", i.ToString(), "_", p.ToString()), key);
                        }
                    }
                }
            }

            LabelTest.Initialize(this);
        }
Ejemplo n.º 5
0
        public override void Initialize()
        {
            #region init

            base.Initialize();
            this.Tabs    = new OpTab[3];
            this.Tabs[0] = new OpTab("TEST0");
            this.Tabs[1] = new OpTab("TEST1");
            this.Tabs[2] = new OpTab("TESTSCROLL");

            Tabs[0].AddItems(new OpLabel(new Vector2(100f, 540f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true),
                             new OpLabel(new Vector2(420f, 510f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right));
            Tabs[1].AddItems(new OpLabel(new Vector2(100f, 540f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true),
                             new OpLabel(new Vector2(420f, 510f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right));

            #endregion init

            //OpColorPicker cpk = new OpColorPicker(new Vector2(100f, 100f), "_TEST", "CCCCCC") { colorEdge = Color.yellow };
            //Tabs[0].AddItems(cpk, new OpLabel(new Vector2(100f, 260f), new Vector2(150f, 20f), "OpColorPicker Test") { bumpBehav = cpk.bumpBehav });

            Texture2D t = new Texture2D(64, 64);
            Color[]   n = new Color[64 * 64];
            int       y = 0;
            while (y < 64)
            {
                int x = 0;
                while (x < 64)
                {
                    float s = Mathf.PerlinNoise(x * 0.1f, y * 0.1f);
                    //float s = UnityEngine.Random.value;
                    n[y * 64 + x] = s > 0.5f ? Color.white : Color.clear;
                    x++;
                }
                y++;
            }
            t.SetPixels(n); t.Apply();

            //Tabs[0].AddItems(new OpSpriteEditor(new Vector2(300f, 100f), new Vector2(100f, 100f), "_TEST", t));
            OpScrollBox scb = new OpScrollBox(new Vector2(100f, 100f), new Vector2(240f, 150f), 400f);
            Tabs[0].AddItems(scb);
            scb.AddItems(new OpLabelLong(new Vector2(20f, 20f), new Vector2(120f, 200f)),
                         new OpSlider(new Vector2(160f, 30f), "_", new IntVector2(-20, 20), length: 180, true, 10));

            OpCheckBox chk = new OpCheckBox(new Vector2(100f, 420f), "_", true);
            Tabs[1].AddItems(chk, new OpLabel(new Vector2(100f, 470f), new Vector2(50f, 15f), "CheckBox")
            {
                bumpBehav = chk.bumpBehav
            });
            OpUpdown ud = new OpUpdown(new Vector2(20f, 220f), 150f, "_", 10);
            ud.SetRange(-10000000, 10000000);
            Tabs[1].AddItems(ud);
            ud = new OpUpdown(new Vector2(220f, 220f), 150f, "_", 20.5f, 2);
            ud.SetRange(-10000f, 10000f);
            Tabs[1].AddItems(ud);
            Tabs[1].AddItems(new OpTextBox(new Vector2(420f, 220f), 150f, "_", "30", OpTextBox.Accept.Int));

            // For canvas-sized ScrollBox
            OpScrollBox sb = new OpScrollBox(Tabs[2], 2400f, false);
            // Use OpScrollBox.AddItems instead of OpTab.AddItems.
            sb.AddItems(new OpLabel(new Vector2(100f, 540f + 1800f), new Vector2(400f, 50f), "ConfigMachine Internal Test", FLabelAlignment.Center, true),
                        new OpLabel(new Vector2(420f, 510f + 1800f), new Vector2(100f, 20f), MenuTab.GetCMVersion(), FLabelAlignment.Right));
            sb.AddItems(new OpImage(new Vector2(420f, 50f), t));
            //sb.AddItems(new OpImage(new Vector2(420f, 120f), "gateSymbol0"));
            //Tabs[2].AddItems(new OpImage(new Vector2(420f, 120f), "gateSymbol0"));
            OpColorPicker cpk0 = new OpColorPicker(new Vector2(100f, 100f), "_TEST", "CCCCCC")
            {
                colorEdge = Color.red
            };
            sb.AddItems(cpk0, new OpLabel(new Vector2(300f, 100f), new Vector2(100f, 20f), "Red Colorpicker")
            {
                bumpBehav = cpk0.bumpBehav, color = Color.red
            });
            OpColorPicker cpk1 = new OpColorPicker(new Vector2(100f, 2000f), "_TEST", "AAAAAA")
            {
                colorEdge = Color.blue
            };
            sb.AddItems(cpk1, new OpLabel(new Vector2(300f, 2000f), new Vector2(100f, 20f), "Blue Colorpicker")
            {
                bumpBehav = cpk1.bumpBehav, color = Color.blue
            });
            sb.AddItems(new OpSlider(new Vector2(100f, 1800f), "", new IntVector2(0, 100), 300));
            sb.AddItems(new OpSlider(new Vector2(500f, 1700f), "", new IntVector2(0, 100), 300, true));
            sb.AddItems(new OpSliderSubtle(new Vector2(100f, 1400f), "", new IntVector2(0, 20), 200));
            sb.AddItems(new OpSliderSubtle(new Vector2(500f, 1300f), "", new IntVector2(0, 20), 200, true));

            /*
             * sb.AddItems(new OpRect(new Vector2(25f, 1000f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(225f, 1000f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(425f, 1000f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpLabel(new Vector2(25f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Top });
             * sb.AddItems(new OpLabel(new Vector2(225f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Center });
             * sb.AddItems(new OpLabel(new Vector2(425f, 1000f), new Vector2(150f, 150f), bigText: true) { verticalAlignment = OpLabel.LabelVAlignment.Bottom });
             * sb.AddItems(new OpRect(new Vector2(25f, 800f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(225f, 800f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(425f, 800f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpLabel(new Vector2(25f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Top });
             * sb.AddItems(new OpLabel(new Vector2(225f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Center });
             * sb.AddItems(new OpLabel(new Vector2(425f, 800f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Bottom });
             * sb.AddItems(new OpRect(new Vector2(25f, 600f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(225f, 600f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpRect(new Vector2(425f, 600f), new Vector2(150f, 150f)));
             * sb.AddItems(new OpLabelLong(new Vector2(25f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Top });
             * sb.AddItems(new OpLabelLong(new Vector2(225f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Center });
             * sb.AddItems(new OpLabelLong(new Vector2(425f, 600f), new Vector2(150f, 150f)) { verticalAlignment = OpLabel.LabelVAlignment.Bottom });
             */

            OpComboBox cb = new OpComboBox(new Vector2(100f, 1000f), 150f, "", new List <ListItem>()
            {
                new ListItem("Slugcat"), new ListItem("Is"), new ListItem("HalfSlug"),
                new ListItem("And"), new ListItem("HalfBunny"), new ListItem("Creature")
            }, "Slugcat");
            sb.AddItems(cb, new OpLabel(100f, 1050f, "AutoSort")
            {
                bumpBehav = cb.bumpBehav
            });
            cb = new OpComboBox(new Vector2(350f, 1000f), 150f, "", new List <ListItem>()
            {
                new ListItem("The0", 0), new ListItem("quick1", 1), new ListItem("brown2", 2),
                new ListItem("fox3", 3), new ListItem("jumps4", 4), new ListItem("over5", 5),
                new ListItem("the6", 6), new ListItem("lazy7", 7), new ListItem("dog8", 8)
            }, "brown2");
            sb.AddItems(cb, new OpLabel(350f, 1050f, "DefinedOrder")
            {
                bumpBehav = cb.bumpBehav
            });
            sb.AddItems(new OpResourceList(new Vector2(70f, 600f), 200f, "", typeof(CreatureTemplate.Type), OpListBox.GetLineCountFromHeight(300f)));
            // sb.AddItems(new OpResourceList(new Vector2(330f, 600f), 200f, "", typeof(AbstractPhysicalObject.AbstractObjectType), 10, downward: false));
            sb.AddItems(new OpListBox(new Vector2(330f, 600f), 200f, "", new List <ListItem>()
            {
                new ListItem("The Survivor", 0), new ListItem("The Monk", 1), new ListItem("The Hunter", 2),
                new ListItem("The Sporecat", 3), new ListItem("The Electric Cat", 4), new ListItem("The Programmer Cat", 5)
            }, OpListBox.GetLineCountFromHeight(200f)));
            sb.AddItems(new OpLabel(330f, 780f, "Player 2 plays as", true));
            // Use OpScrollBox.AddItems instead of OpTab.AddItems.

            /*
             * OpResourceSelector rs = new OpResourceSelector(new Vector2(100f, 1600f), new Vector2(200f, 30f), "", typeof(CreatureTemplate.Type));
             * sb.AddItems(rs, new OpLabel(100f, 1630f, "CreatureTemplate.Type") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1500f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Decals);
             * sb.AddItems(rs, new OpLabel(100f, 1530f, "Decals") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1400f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Illustrations);
             * sb.AddItems(rs, new OpLabel(100f, 1430f, "Illustrations") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1300f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Palettes);
             * sb.AddItems(rs, new OpLabel(100f, 1330f, "Palettes") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1200f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Regions);
             * sb.AddItems(rs, new OpLabel(100f, 1230f, "Regions") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1100f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Shaders);
             * sb.AddItems(rs, new OpLabel(100f, 1130f, "Shaders") { bumpBehav = rs.bumpBehav });
             * rs = new OpResourceSelector(new Vector2(100f, 1000f), new Vector2(200f, 30f), "", OpResourceSelector.SpecialEnum.Songs);
             * sb.AddItems(rs, new OpLabel(100f, 1030f, "Songs") { bumpBehav = rs.bumpBehav });*/
        }