Esempio n. 1
0
        //Attach to the modded dll
        public override void Initialize()
        {
            Log("Randomizer Mod initializing!");

            instance = this;

            ModHooks.Instance.GetPlayerBoolHook += Randomizer.GetPlayerDataBool;
            ModHooks.Instance.SetPlayerBoolHook += Randomizer.SetPlayerDataBool;
            ModHooks.Instance.GetPlayerIntHook  += Randomizer.GetPlayerDataInt;
            ModHooks.Instance.SetPlayerIntHook  += Randomizer.SetPlayerDataInt;
            ModHooks.Instance.SavegameLoadHook  += LogSetting;
            ModHooks.Instance.SavegameClearHook += Randomizer.DeleteGame;
            ModHooks.Instance.NewGameHook       += Randomizer.NewGame;

            UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneHandler.CheckForChanges;

            ModHooks.Instance.LanguageGetHook += LanguageHandler.Get;
            UnityEngine.GameObject UIObj = new UnityEngine.GameObject();
            UIObj.AddComponent <GUIController>();
            UnityEngine.GameObject.DontDestroyOnLoad(UIObj);

            //Get version from XML
            if (File.Exists(@"Randomizer\randomizer.xml"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(@"Randomizer\randomizer.xml");
                XmlAttribute ver = doc.SelectSingleNode("randomizer").Attributes["version"];
                if (ver != null)
                {
                    xmlVer = ver.Value;
                }
            }

            try
            {
                Randomizer.LoadEntriesFromXML();
                Randomizer.xmlLoaded = true;
            }
            catch (Exception e)
            {
                LogError("Failed to load XML:\n" + e);
            }

            Log("Randomizer Mod initialized!");
        }
        public static void AddItem(string item, string location)
        {
            if (canvas == null)
            {
                Create();
            }

            item = RandomizerMod.Instance.Settings.GetEffectiveItem(item);

            string itemName = Language.Language.Get(LogicManager.GetItemDef(item).nameKey, "UI");
            string areaName = LogicManager.ShopNames.Contains(location)
                ? location.Replace('_', ' ')
                : RandoLogger.CleanAreaName(LogicManager.GetItemDef(location).areaName);

            string msg = itemName + "\nfrom " + areaName;

            GameObject basePanel = CanvasUtil.CreateBasePanel(canvas,
                                                              new CanvasUtil.RectData(new Vector2(200, 50), Vector2.zero,
                                                                                      new Vector2(0.9f, 0.9f), new Vector2(0.9f, 0.9f)));

            string spriteKey = LogicManager.GetItemDef(item).shopSpriteKey;

            CanvasUtil.CreateImagePanel(basePanel, RandomizerMod.GetSprite(spriteKey),
                                        new CanvasUtil.RectData(new Vector2(50, 50), Vector2.zero, new Vector2(0f, 0.5f),
                                                                new Vector2(0f, 0.5f)));
            CanvasUtil.CreateTextPanel(basePanel, msg, 24, TextAnchor.MiddleLeft,
                                       new CanvasUtil.RectData(new Vector2(400, 100), Vector2.zero,
                                                               new Vector2(1.2f, 0.5f), new Vector2(1.2f, 0.5f)),
                                       CanvasUtil.GetFont("Perpetua"));

            items.Enqueue(basePanel);
            if (items.Count > MaxItems)
            {
                Object.Destroy(items.Dequeue());
            }

            UpdatePositions();
        }
        public static void EditUI()
        {
            // Reset settings
            RandomizerMod.Instance.Settings = new SaveSettings();

            // Fetch data from vanilla screen
            MenuScreen playScreen = Ref.UI.playModeMenuScreen;

            playScreen.title.gameObject.transform.localPosition = new Vector3(0, 520.56f);

            Object.Destroy(playScreen.topFleur.gameObject);

            MenuButton classic = (MenuButton)playScreen.defaultHighlight;
            MenuButton steel   = (MenuButton)classic.FindSelectableOnDown();
            MenuButton back    = (MenuButton)steel.FindSelectableOnDown();

            GameObject parent = steel.transform.parent.gameObject;

            Object.Destroy(parent.GetComponent <VerticalLayoutGroup>());

            // Create new buttons
            MenuButton startRandoBtn = classic.Clone("StartRando", MenuButton.MenuButtonType.Proceed,
                                                     new Vector2(0, 0), "Start Game", "Randomizer", RandomizerMod.GetSprite("UI.logo"));

            /*
             * MenuButton startNormalBtn = classic.Clone("StartNormal", MenuButton.MenuButtonType.Proceed,
             *  new Vector2(0, -200), "Start Game", "Non-Randomizer");
             * MenuButton startSteelRandoBtn = steel.Clone("StartSteelRando", MenuButton.MenuButtonType.Proceed,
             *  new Vector2(10000, 10000), "Steel Soul", "Randomizer", RandomizerMod.GetSprite("UI.logo2"));
             * MenuButton startSteelNormalBtn = steel.Clone("StartSteelNormal", MenuButton.MenuButtonType.Proceed,
             *  new Vector2(10000, 10000), "Steel Soul", "Non-Randomizer");
             *
             * startNormalBtn.transform.localScale =
             *  startSteelNormalBtn.transform.localScale =
             *      startSteelRandoBtn.transform.localScale = */
            startRandoBtn.transform.localScale = new Vector2(0.75f, 0.75f);
            startRandoBtn.GetComponent <StartGameEventTrigger>().bossRush = true;
            MenuButton backBtn = back.Clone("Back", MenuButton.MenuButtonType.Proceed, new Vector2(0, -100), "Back");


            //RandoMenuItem<string> gameTypeBtn = new RandoMenuItem<string>(back, new Vector2(0, 600), "Game Type", "Normal", "Steel Soul");

            RandoMenuItem <string> presetPoolsBtn    = new RandoMenuItem <string>(back, new Vector2(900, 1040), "Preset", "Progressive", "Completionist", "Junk Pit", "Custom");
            RandoMenuItem <bool>   RandoDreamersBtn  = new RandoMenuItem <bool>(back, new Vector2(700, 960), "Dreamers", true, false);
            RandoMenuItem <bool>   RandoSkillsBtn    = new RandoMenuItem <bool>(back, new Vector2(1100, 960), "Skills", true, false);
            RandoMenuItem <bool>   RandoCharmsBtn    = new RandoMenuItem <bool>(back, new Vector2(700, 880), "Charms", true, false);
            RandoMenuItem <bool>   RandoKeysBtn      = new RandoMenuItem <bool>(back, new Vector2(1100, 880), "Keys", true, false);
            RandoMenuItem <bool>   RandoGeoChestsBtn = new RandoMenuItem <bool>(back, new Vector2(900, 800), "Geo Chests", false, true);
            RandoMenuItem <bool>   RandoMaskBtn      = new RandoMenuItem <bool>(back, new Vector2(700, 720), "Mask Shards", false, true);
            RandoMenuItem <bool>   RandoVesselBtn    = new RandoMenuItem <bool>(back, new Vector2(1100, 720), "Vessel Fragments", false, true);
            RandoMenuItem <bool>   RandoOreBtn       = new RandoMenuItem <bool>(back, new Vector2(700, 640), "Pale Ore", false, true);
            RandoMenuItem <bool>   RandoNotchBtn     = new RandoMenuItem <bool>(back, new Vector2(1100, 640), "Charm Notches", false, true);
            RandoMenuItem <bool>   RandoEggBtn       = new RandoMenuItem <bool>(back, new Vector2(700, 560), "Rancid Eggs", false, true);
            RandoMenuItem <bool>   RandoRelicsBtn    = new RandoMenuItem <bool>(back, new Vector2(1100, 560), "Relics", false, true);
            RandoMenuItem <bool>   RandoMapBtn       = new RandoMenuItem <bool>(back, new Vector2(700, 480), "Maps", false, true);
            RandoMenuItem <bool>   RandoStagBtn      = new RandoMenuItem <bool>(back, new Vector2(1100, 480), "Stags", false, true);
            RandoMenuItem <bool>   RandoGrubBtn      = new RandoMenuItem <bool>(back, new Vector2(700, 400), "Grubs", false, true);
            RandoMenuItem <bool>   RandoRootsBtn     = new RandoMenuItem <bool>(back, new Vector2(1100, 400), "Whispering Roots", false, true);

            RandoMenuItem <bool>   RandoStartItemsBtn         = new RandoMenuItem <bool>(back, new Vector2(900, 160), "Randomize Start Items", false, true);
            RandoMenuItem <string> RandoStartLocationsModeBtn = new RandoMenuItem <string>(back, new Vector2(900, 80), "Start Location Setting", "Select", "Random");
            RandoMenuItem <string> StartLocationsListBtn      = new RandoMenuItem <string>(back, new Vector2(900, 0), "Start Location", LogicManager.StartLocations);

            RandoMenuItem <string> presetSkipsBtn   = new RandoMenuItem <string>(back, new Vector2(-900, 1040), "Preset", "Easy", "Medium", "Hard", "Custom");
            RandoMenuItem <bool>   mildSkipsBtn     = new RandoMenuItem <bool>(back, new Vector2(-900, 960), "Mild Skips", false, true);
            RandoMenuItem <bool>   shadeSkipsBtn    = new RandoMenuItem <bool>(back, new Vector2(-900, 880), "Shade Skips", false, true);
            RandoMenuItem <bool>   fireballSkipsBtn = new RandoMenuItem <bool>(back, new Vector2(-900, 800), "Fireball Skips", false, true);
            RandoMenuItem <bool>   acidSkipsBtn     = new RandoMenuItem <bool>(back, new Vector2(-900, 720), "Acid Skips", false, true);
            RandoMenuItem <bool>   spikeTunnelsBtn  = new RandoMenuItem <bool>(back, new Vector2(-900, 640), "Spike Tunnels", false, true);
            RandoMenuItem <bool>   darkRoomsBtn     = new RandoMenuItem <bool>(back, new Vector2(-900, 560), "Dark Rooms", false, true);
            RandoMenuItem <bool>   spicySkipsBtn    = new RandoMenuItem <bool>(back, new Vector2(-900, 480), "Spicy Skips", false, true);

            RandoMenuItem <bool> charmNotchBtn = new RandoMenuItem <bool>(back, new Vector2(-900, 300), "Salubra Notches", true, false);
            RandoMenuItem <bool> lemmBtn       = new RandoMenuItem <bool>(back, new Vector2(-900, 220), "Lemm Sell All", true, false);
            RandoMenuItem <bool> EarlyGeoBtn   = new RandoMenuItem <bool>(back, new Vector2(-900, 140), "Early Geo", true, false);
            RandoMenuItem <bool> jijiBtn       = new RandoMenuItem <bool>(back, new Vector2(-900, 60), "Jiji Hints", true, false);
            RandoMenuItem <bool> quirrelBtn    = new RandoMenuItem <bool>(back, new Vector2(-900, -20), "Quirrel Hints", true, false);
            RandoMenuItem <bool> leverBtn      = new RandoMenuItem <bool>(back, new Vector2(-900, -100), "1.2.2.1 Levers", true, false);

            RandoMenuItem <string> modeBtn         = new RandoMenuItem <string>(back, new Vector2(0, 1040), "Mode", "Item Randomizer", "Area Randomizer", "Connected-Area Room Randomizer", "Room Randomizer", "Open Mode");
            RandoMenuItem <string> cursedBtn       = new RandoMenuItem <string>(back, new Vector2(0, 960), "Cursed", "no", "noo", "noooo", "noooooooo", "noooooooooooooooo", "Oh yeah");
            RandoMenuItem <bool>   RandoSpoilerBtn = new RandoMenuItem <bool>(back, new Vector2(0, 0), "Create Spoiler Log", true, false);

            // Vanilla charms does not currently work
            RandoCharmsBtn.SetSelection(true);
            RandoCharmsBtn.Lock();

            // Create seed entry field
            GameObject seedGameObject = back.Clone("Seed", MenuButton.MenuButtonType.Activate, new Vector2(0, 1130),
                                                   "Click to type a custom seed").gameObject;

            Object.DestroyImmediate(seedGameObject.GetComponent <MenuButton>());
            Object.DestroyImmediate(seedGameObject.GetComponent <EventTrigger>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <AutoLocalizeTextUI>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <FixVerticalAlign>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <ContentSizeFitter>());

            RectTransform seedRect = seedGameObject.transform.Find("Text").GetComponent <RectTransform>();

            seedRect.anchorMin = seedRect.anchorMax = new Vector2(0.5f, 0.5f);
            seedRect.sizeDelta = new Vector2(337, 63.2f);

            InputField customSeedInput = seedGameObject.AddComponent <InputField>();

            customSeedInput.transform.localPosition = new Vector3(0, 1240);
            customSeedInput.textComponent           = seedGameObject.transform.Find("Text").GetComponent <Text>();

            RandomizerMod.Instance.Settings.Seed = new Random().Next(999999999);
            customSeedInput.text = RandomizerMod.Instance.Settings.Seed.ToString();

            customSeedInput.caretColor  = Color.white;
            customSeedInput.contentType = InputField.ContentType.IntegerNumber;
            customSeedInput.onEndEdit.AddListener(ParseSeedInput);
            customSeedInput.navigation     = Navigation.defaultNavigation;
            customSeedInput.caretWidth     = 8;
            customSeedInput.characterLimit = 9;

            customSeedInput.colors = new ColorBlock
            {
                highlightedColor = Color.yellow,
                pressedColor     = Color.red,
                disabledColor    = Color.black,
                normalColor      = Color.white,
                colorMultiplier  = 2f
            };

            // Create some labels
            CreateLabel(back, new Vector2(-900, 1130), "Required Skips");
            CreateLabel(back, new Vector2(-900, 380), "Quality of Life");
            CreateLabel(back, new Vector2(900, 1130), "Randomization");
            CreateLabel(back, new Vector2(900, 240), "Open Mode");
            CreateLabel(back, new Vector2(0, 200), "Area/Room Randomizer expect use of Benchwarp");
            CreateLabel(back, new Vector2(0, 1300), "Seed:");

            // We don't need these old buttons anymore
            Object.Destroy(classic.gameObject);
            Object.Destroy(steel.gameObject);
            Object.Destroy(parent.FindGameObjectInChildren("GGButton"));
            Object.Destroy(back.gameObject);

            // Gotta put something here, we destroyed the old default
            playScreen.defaultHighlight = startRandoBtn;

            // Apply navigation info (up, right, down, left)
            //startNormalBtn.SetNavigation(gameTypeBtn.Button, presetPoolsBtn.Button, backBtn, presetSkipsBtn.Button);
            startRandoBtn.SetNavigation(modeBtn.Button, presetPoolsBtn.Button, backBtn, presetSkipsBtn.Button);
            //startSteelNormalBtn.SetNavigation(gameTypeBtn.Button, presetPoolsBtn.Button, backBtn, presetSkipsBtn.Button);
            //startSteelRandoBtn.SetNavigation(modeBtn.Button, presetPoolsBtn.Button, gameTypeBtn.Button, presetSkipsBtn.Button);
            modeBtn.Button.SetNavigation(backBtn, modeBtn.Button, startRandoBtn, modeBtn.Button);
            //gameTypeBtn.Button.SetNavigation(startRandoBtn, presetPoolsBtn.Button, startRandoBtn, presetSkipsBtn.Button);
            backBtn.SetNavigation(startRandoBtn, backBtn, modeBtn.Button, backBtn);
            RandoSpoilerBtn.Button.SetNavigation(RandoRelicsBtn.Button, RandoSpoilerBtn.Button, presetPoolsBtn.Button, startRandoBtn);

            presetSkipsBtn.Button.SetNavigation(leverBtn.Button, startRandoBtn, shadeSkipsBtn.Button, presetSkipsBtn.Button);
            mildSkipsBtn.Button.SetNavigation(presetSkipsBtn.Button, startRandoBtn, mildSkipsBtn.Button, mildSkipsBtn.Button);
            shadeSkipsBtn.Button.SetNavigation(mildSkipsBtn.Button, startRandoBtn, fireballSkipsBtn.Button, shadeSkipsBtn.Button);
            fireballSkipsBtn.Button.SetNavigation(shadeSkipsBtn.Button, startRandoBtn, acidSkipsBtn.Button, fireballSkipsBtn.Button);
            acidSkipsBtn.Button.SetNavigation(fireballSkipsBtn.Button, startRandoBtn, spikeTunnelsBtn.Button, acidSkipsBtn.Button);
            spikeTunnelsBtn.Button.SetNavigation(acidSkipsBtn.Button, startRandoBtn, darkRoomsBtn.Button, spikeTunnelsBtn.Button);
            darkRoomsBtn.Button.SetNavigation(spikeTunnelsBtn.Button, startRandoBtn, spicySkipsBtn.Button, darkRoomsBtn.Button);
            spicySkipsBtn.Button.SetNavigation(darkRoomsBtn.Button, startRandoBtn, charmNotchBtn.Button, spicySkipsBtn.Button);

            charmNotchBtn.Button.SetNavigation(spicySkipsBtn.Button, startRandoBtn, lemmBtn.Button, charmNotchBtn.Button);
            lemmBtn.Button.SetNavigation(charmNotchBtn.Button, startRandoBtn, EarlyGeoBtn.Button, lemmBtn.Button);
            EarlyGeoBtn.Button.SetNavigation(lemmBtn.Button, startRandoBtn, jijiBtn.Button, EarlyGeoBtn.Button);
            jijiBtn.Button.SetNavigation(EarlyGeoBtn.Button, startRandoBtn, quirrelBtn.Button, jijiBtn.Button);
            quirrelBtn.Button.SetNavigation(jijiBtn.Button, startRandoBtn, leverBtn.Button, quirrelBtn.Button);
            leverBtn.Button.SetNavigation(quirrelBtn.Button, startRandoBtn, presetSkipsBtn.Button, leverBtn.Button);

            presetPoolsBtn.Button.SetNavigation(RandoSpoilerBtn.Button, presetPoolsBtn.Button, RandoDreamersBtn.Button, startRandoBtn);
            RandoDreamersBtn.Button.SetNavigation(presetPoolsBtn.Button, RandoDreamersBtn.Button, RandoSkillsBtn.Button, startRandoBtn);
            RandoSkillsBtn.Button.SetNavigation(RandoDreamersBtn.Button, RandoSkillsBtn.Button, RandoCharmsBtn.Button, startRandoBtn);
            RandoCharmsBtn.Button.SetNavigation(RandoSkillsBtn.Button, RandoCharmsBtn.Button, RandoKeysBtn.Button, startRandoBtn);
            RandoKeysBtn.Button.SetNavigation(RandoCharmsBtn.Button, RandoKeysBtn.Button, RandoGeoChestsBtn.Button, startRandoBtn);
            RandoGeoChestsBtn.Button.SetNavigation(RandoKeysBtn.Button, RandoGeoChestsBtn.Button, RandoMaskBtn.Button, startRandoBtn);
            RandoMaskBtn.Button.SetNavigation(RandoGeoChestsBtn.Button, RandoMaskBtn.Button, RandoVesselBtn.Button, startRandoBtn);
            RandoVesselBtn.Button.SetNavigation(RandoMaskBtn.Button, RandoVesselBtn.Button, RandoOreBtn.Button, startRandoBtn);
            RandoOreBtn.Button.SetNavigation(RandoVesselBtn.Button, RandoOreBtn.Button, RandoNotchBtn.Button, startRandoBtn);
            RandoNotchBtn.Button.SetNavigation(RandoOreBtn.Button, RandoNotchBtn.Button, RandoEggBtn.Button, startRandoBtn);
            RandoEggBtn.Button.SetNavigation(RandoNotchBtn.Button, RandoEggBtn.Button, RandoRelicsBtn.Button, startRandoBtn);
            RandoRelicsBtn.Button.SetNavigation(RandoEggBtn.Button, RandoRelicsBtn.Button, RandoSpoilerBtn.Button, startRandoBtn);

            RandoStartItemsBtn.Button.SetNavigation(RandoRelicsBtn.Button, RandoStartLocationsModeBtn.Button, RandoStartItemsBtn.Button, startRandoBtn);
            RandoStartLocationsModeBtn.Button.SetNavigation(RandoStartItemsBtn.Button, RandoStartLocationsModeBtn.Button, StartLocationsListBtn.Button, startRandoBtn);
            StartLocationsListBtn.Button.SetNavigation(RandoStartLocationsModeBtn.Button, RandoStartLocationsModeBtn.Button, StartLocationsListBtn.Button, startRandoBtn);

            // Setup event for changing difficulty settings buttons
            void ModeSettingChanged(RandoMenuItem <string> item)
            {
                //"Item Randomizer", "Area Randomizer", "Connected-Area Room Randomizer", "Room Randomizer"
                if (item.CurrentSelection == "Item Randomizer")
                {
                    RandoDreamersBtn.Unlock();
                    RandoSkillsBtn.Unlock();
                    //RandoCharmsBtn.Unlock();
                    RandoKeysBtn.Unlock();
                }
                else
                {
                    RandoDreamersBtn.SetSelection(true);
                    RandoSkillsBtn.SetSelection(true);
                    RandoCharmsBtn.SetSelection(true);
                    RandoKeysBtn.SetSelection(true);
                    RandoDreamersBtn.Lock();
                    RandoSkillsBtn.Lock();
                    RandoCharmsBtn.Lock();
                    RandoKeysBtn.Lock();
                }
                if (item.CurrentSelection == "Open Mode")
                {
                    startRandoBtn.GetComponent <StartGameEventTrigger>().bossRush = true;
                }
                else
                {
                    //   startRandoBtn.GetComponent<StartGameEventTrigger>().bossRush = false;
                }
            }

            void UpdateSkipsButtons(RandoMenuItem <string> item)
            {
                switch (item.CurrentSelection)
                {
                case "Easy":
                    SetShadeSkips(false);
                    mildSkipsBtn.SetSelection(false);
                    acidSkipsBtn.SetSelection(false);
                    spikeTunnelsBtn.SetSelection(false);
                    spicySkipsBtn.SetSelection(false);
                    fireballSkipsBtn.SetSelection(false);
                    darkRoomsBtn.SetSelection(false);
                    break;

                case "Medium":
                    SetShadeSkips(true);
                    mildSkipsBtn.SetSelection(true);
                    acidSkipsBtn.SetSelection(false);
                    spikeTunnelsBtn.SetSelection(false);
                    spicySkipsBtn.SetSelection(false);
                    fireballSkipsBtn.SetSelection(false);
                    darkRoomsBtn.SetSelection(false);
                    break;

                case "Hard":
                    SetShadeSkips(true);
                    mildSkipsBtn.SetSelection(true);
                    acidSkipsBtn.SetSelection(true);
                    spikeTunnelsBtn.SetSelection(true);
                    spicySkipsBtn.SetSelection(true);
                    fireballSkipsBtn.SetSelection(true);
                    darkRoomsBtn.SetSelection(true);
                    break;

                case "Custom":
                    item.SetSelection("Easy");
                    goto case "Easy";

                default:
                    LogWarn("Unknown value in preset button: " + item.CurrentSelection);
                    break;
                }
            }

            void UpdatePoolPreset(RandoMenuItem <string> item)
            {
                switch (item.CurrentSelection)
                {
                case "Progressive":
                    RandoDreamersBtn.SetSelection(true);
                    RandoSkillsBtn.SetSelection(true);
                    RandoCharmsBtn.SetSelection(true);
                    RandoKeysBtn.SetSelection(true);
                    RandoGeoChestsBtn.SetSelection(false);
                    RandoMaskBtn.SetSelection(false);
                    RandoVesselBtn.SetSelection(false);
                    RandoOreBtn.SetSelection(false);
                    RandoNotchBtn.SetSelection(false);
                    RandoEggBtn.SetSelection(false);
                    RandoRelicsBtn.SetSelection(false);
                    break;

                case "Completionist":
                    RandoDreamersBtn.SetSelection(true);
                    RandoSkillsBtn.SetSelection(true);
                    RandoCharmsBtn.SetSelection(true);
                    RandoKeysBtn.SetSelection(true);
                    RandoGeoChestsBtn.SetSelection(true);
                    RandoMaskBtn.SetSelection(true);
                    RandoVesselBtn.SetSelection(true);
                    RandoOreBtn.SetSelection(true);
                    RandoNotchBtn.SetSelection(true);
                    RandoEggBtn.SetSelection(false);
                    RandoRelicsBtn.SetSelection(false);
                    break;

                case "Junk Pit":
                    RandoDreamersBtn.SetSelection(true);
                    RandoSkillsBtn.SetSelection(true);
                    RandoCharmsBtn.SetSelection(true);
                    RandoKeysBtn.SetSelection(true);
                    RandoGeoChestsBtn.SetSelection(true);
                    RandoMaskBtn.SetSelection(true);
                    RandoVesselBtn.SetSelection(true);
                    RandoOreBtn.SetSelection(true);
                    RandoNotchBtn.SetSelection(true);
                    RandoEggBtn.SetSelection(true);
                    RandoRelicsBtn.SetSelection(true);
                    break;

                case "Custom":
                    item.SetSelection("Progressive");
                    goto case "Progressive";
                }
            }

            void UpdateStartLocationColor()
            {
                // cf. TestStartLocation in PreRandomizer. Note that color is checked in StartGame to determine if a selected start was valid
                if (LogicManager.GetStartLocation(StartLocationsListBtn.CurrentSelection) is StartDef startDef)
                {
                    if (RandoStartItemsBtn.CurrentSelection)
                    {
                        StartLocationsListBtn.SetColor(Color.white);
                    }
                    else if (modeBtn.CurrentSelection.EndsWith("Room Randomizer"))
                    {
                        if (startDef.roomSafe)
                        {
                            StartLocationsListBtn.SetColor(Color.white);
                        }
                        else
                        {
                            StartLocationsListBtn.SetColor(Color.red);
                        }
                    }
                    else if (modeBtn.CurrentSelection == "Area Randomizer")
                    {
                        if (startDef.areaSafe)
                        {
                            StartLocationsListBtn.SetColor(Color.white);
                        }
                        else
                        {
                            StartLocationsListBtn.SetColor(Color.red);
                        }
                    }
                    else if (startDef.itemSafe)
                    {
                        StartLocationsListBtn.SetColor(Color.white);
                    }
                    else
                    {
                        StartLocationsListBtn.SetColor(Color.red);
                    }
                }
            }

            void SetShadeSkips(bool enabled)
            {
                if (enabled)
                {
                    //gameTypeBtn.SetSelection("Normal");
                    //SwitchGameType(false);
                }

                shadeSkipsBtn.SetSelection(enabled);
            }

            void SkipsSettingChanged(RandoMenuItem <bool> item)
            {
                presetSkipsBtn.SetSelection("Custom");
            }

            void PoolSettingChanged(RandoMenuItem <bool> item)
            {
                presetPoolsBtn.SetSelection("Custom");
            }

            modeBtn.Changed += ModeSettingChanged;

            presetSkipsBtn.Changed += UpdateSkipsButtons;
            presetPoolsBtn.Changed += UpdatePoolPreset;

            mildSkipsBtn.Changed     += SkipsSettingChanged;
            shadeSkipsBtn.Changed    += SkipsSettingChanged;
            shadeSkipsBtn.Changed    += SaveShadeVal;
            acidSkipsBtn.Changed     += SkipsSettingChanged;
            spikeTunnelsBtn.Changed  += SkipsSettingChanged;
            spicySkipsBtn.Changed    += SkipsSettingChanged;
            fireballSkipsBtn.Changed += SkipsSettingChanged;
            darkRoomsBtn.Changed     += SkipsSettingChanged;

            RandoDreamersBtn.Changed  += PoolSettingChanged;
            RandoSkillsBtn.Changed    += PoolSettingChanged;
            RandoCharmsBtn.Changed    += PoolSettingChanged;
            RandoKeysBtn.Changed      += PoolSettingChanged;
            RandoGeoChestsBtn.Changed += PoolSettingChanged;
            RandoMaskBtn.Changed      += PoolSettingChanged;
            RandoVesselBtn.Changed    += PoolSettingChanged;
            RandoOreBtn.Changed       += PoolSettingChanged;
            RandoNotchBtn.Changed     += PoolSettingChanged;
            RandoEggBtn.Changed       += PoolSettingChanged;
            RandoRelicsBtn.Changed    += PoolSettingChanged;

            RandoStartItemsBtn.Changed         += (RandoMenuItem <bool> Item) => UpdateStartLocationColor();
            RandoStartLocationsModeBtn.Changed += (RandoMenuItem <string> Item) => UpdateStartLocationColor();
            StartLocationsListBtn.Changed      += (RandoMenuItem <string> Item) => UpdateStartLocationColor();
            modeBtn.Changed += (RandoMenuItem <string> Item) => UpdateStartLocationColor();

            // Setup game type button changes
            void SaveShadeVal(RandoMenuItem <bool> item)
            {
                SetShadeSkips(shadeSkipsBtn.CurrentSelection);
            }

            /*void SwitchGameType(bool steelMode)
             * {
             *  if (!steelMode)
             *  {
             *      // Normal mode
             *      startRandoBtn.transform.localPosition = new Vector2(0, 200);
             *      startNormalBtn.transform.localPosition = new Vector2(0, -200);
             *      startSteelRandoBtn.transform.localPosition = new Vector2(10000, 10000);
             *      startSteelNormalBtn.transform.localPosition = new Vector2(10000, 10000);
             *
             *      //backBtn.SetNavigation(startNormalBtn, startNormalBtn, modeBtn.Button, startRandoBtn);
             *     //magolorBtn.Button.SetNavigation(fireballSkipsBtn.Button, gameTypeBtn.Button, startNormalBtn, lemmBtn.Button);
             *      //lemmBtn.Button.SetNavigation(charmNotchBtn.Button, shadeSkipsBtn.Button, startRandoBtn, allSkillsBtn.Button);
             *  }
             *  else
             *  {
             *      // Steel Soul mode
             *      startRandoBtn.transform.localPosition = new Vector2(10000, 10000);
             *      startNormalBtn.transform.localPosition = new Vector2(10000, 10000);
             *      startSteelRandoBtn.transform.localPosition = new Vector2(0, 200);
             *      startSteelNormalBtn.transform.localPosition = new Vector2(0, -200);
             *
             *      SetShadeSkips(false);
             *
             *      //backBtn.SetNavigation(startSteelNormalBtn, startSteelNormalBtn, modeBtn.Button, startSteelRandoBtn);
             *      //magolorBtn.Button.SetNavigation(fireballSkipsBtn.Button, gameTypeBtn.Button, startSteelNormalBtn, lemmBtn.Button);
             *      //lemmBtn.Button.SetNavigation(charmNotchBtn.Button, shadeSkipsBtn.Button, startSteelRandoBtn, allSkillsBtn.Button);
             *  }
             * }
             *
             * gameTypeBtn.Button.AddEvent(EventTriggerType.Submit,
             *  garbage => SwitchGameType(gameTypeBtn.CurrentSelection != "Normal"));
             */

            // Setup start game button events
            void StartGame(bool rando)
            {
                RandomizerMod.Instance.Settings.CharmNotch = charmNotchBtn.CurrentSelection;
                RandomizerMod.Instance.Settings.Lemm       = lemmBtn.CurrentSelection;
                RandomizerMod.Instance.Settings.EarlyGeo   = EarlyGeoBtn.CurrentSelection;


                if (rando)
                {
                    RandomizerMod.Instance.Settings.Jiji       = jijiBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.Quirrel    = quirrelBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.LeverSkips = leverBtn.CurrentSelection;

                    RandomizerMod.Instance.Settings.RandomizeDreamers        = RandoDreamersBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeSkills          = RandoSkillsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeCharms          = RandoCharmsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeKeys            = RandoKeysBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeGeoChests       = RandoGeoChestsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeMaskShards      = RandoMaskBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeVesselFragments = RandoVesselBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizePaleOre         = RandoOreBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeCharmNotches    = RandoNotchBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeRancidEggs      = RandoEggBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeRelics          = RandoRelicsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeMaps            = RandoMapBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeStags           = RandoStagBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeGrubs           = RandoGrubBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeWhisperingRoots = RandoRootsBtn.CurrentSelection;


                    RandomizerMod.Instance.Settings.CreateSpoilerLog = RandoSpoilerBtn.CurrentSelection;

                    RandomizerMod.Instance.Settings.Cursed = cursedBtn.CurrentSelection.StartsWith("O");

                    RandomizerMod.Instance.Settings.Randomizer     = rando;
                    RandomizerMod.Instance.Settings.RandomizeAreas = modeBtn.CurrentSelection == "Area Randomizer";
                    RandomizerMod.Instance.Settings.RandomizeRooms = modeBtn.CurrentSelection.EndsWith("Room Randomizer");
                    RandomizerMod.Instance.Settings.ConnectAreas   = modeBtn.CurrentSelection.StartsWith("Connected-Area");

                    RandomizerMod.Instance.Settings.MildSkips     = mildSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.ShadeSkips    = shadeSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.FireballSkips = fireballSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.AcidSkips     = acidSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.SpikeTunnels  = spikeTunnelsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.DarkRooms     = darkRoomsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.SpicySkips    = spicySkipsBtn.CurrentSelection;

                    RandomizerMod.Instance.Settings.RandomizeStartItems    = RandoStartItemsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.RandomizeStartLocation = RandoStartLocationsModeBtn.CurrentSelection == "Random";
                    RandomizerMod.Instance.Settings.StartName = StartLocationsListBtn.GetColor() == Color.red ? "King's Pass" : StartLocationsListBtn.CurrentSelection;
                }

                RandomizerMod.Instance.StartNewGame();
            }

            //startNormalBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(false));
            startRandoBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(true));
            //startSteelNormalBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(false));
            //startSteelRandoBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(true));
        }
        public static void EditUI()
        {
            // Reset settings
            RandomizerMod.Instance.Settings = new SaveSettings();

            // Fetch data from vanilla screen
            MenuScreen playScreen = Ref.UI.playModeMenuScreen;

            playScreen.title.gameObject.transform.localPosition = new Vector3(0, 520.56f);

            Object.Destroy(playScreen.topFleur.gameObject);

            MenuButton classic = (MenuButton)playScreen.defaultHighlight;
            MenuButton steel   = (MenuButton)classic.FindSelectableOnDown();
            MenuButton back    = (MenuButton)steel.FindSelectableOnDown();

            GameObject parent = steel.transform.parent.gameObject;

            Object.Destroy(parent.GetComponent <VerticalLayoutGroup>());

            // Create new buttons
            MenuButton startRandoBtn = classic.Clone("StartRando", MenuButton.MenuButtonType.Proceed,
                                                     new Vector2(650, -480), "Start Game", "Randomizer v2", RandomizerMod.GetSprite("UI.logo"));
            MenuButton startNormalBtn = classic.Clone("StartNormal", MenuButton.MenuButtonType.Proceed,
                                                      new Vector2(-650, -480), "Start Game", "Non-Randomizer");
            MenuButton startSteelRandoBtn = steel.Clone("StartSteelRando", MenuButton.MenuButtonType.Proceed,
                                                        new Vector2(10000, 10000), "Steel Soul", "Randomizer v2", RandomizerMod.GetSprite("UI.logo2"));
            MenuButton startSteelNormalBtn = steel.Clone("StartSteelNormal", MenuButton.MenuButtonType.Proceed,
                                                         new Vector2(10000, 10000), "Steel Soul", "Non-Randomizer");

            startNormalBtn.transform.localScale             = startRandoBtn.transform.localScale =
                startSteelNormalBtn.transform.localScale    =
                    startSteelRandoBtn.transform.localScale = new Vector2(0.75f, 0.75f);

            MenuButton backBtn = back.Clone("Back", MenuButton.MenuButtonType.Proceed, new Vector2(0, -100), "Back");

            RandoMenuItem <bool> allBossesBtn =
                new RandoMenuItem <bool>(back, new Vector2(0, 850), "All Bosses", false, true);
            RandoMenuItem <bool> allSkillsBtn =
                new RandoMenuItem <bool>(back, new Vector2(0, 760), "All Skills", false, true);
            RandoMenuItem <bool> allCharmsBtn =
                new RandoMenuItem <bool>(back, new Vector2(0, 670), "All Charms", false, true);

            RandoMenuItem <string> gameTypeBtn =
                new RandoMenuItem <string>(back, new Vector2(0, 400), "Game Type", "Normal", "Steel Soul");

            RandoMenuItem <bool> charmNotchBtn =
                new RandoMenuItem <bool>(back, new Vector2(900, 850), "Salubra Notches", true, false);
            RandoMenuItem <bool> lemmBtn =
                new RandoMenuItem <bool>(back, new Vector2(900, 760), "Lemm Sell All", true, false);

            RandoMenuItem <string> presetBtn = new RandoMenuItem <string>(back, new Vector2(-900, 850), "Preset", "Easy",
                                                                          "Hard", "Moglar", "Custom");
            RandoMenuItem <bool> shadeSkipsBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 760), "Shade Skips", false, true);
            RandoMenuItem <bool> acidSkipsBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 670), "Acid Skips", false, true);
            RandoMenuItem <bool> spikeTunnelsBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 580), "Spike Tunnels", false, true);
            RandoMenuItem <bool> miscSkipsBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 490), "Misc Skips", false, true);
            RandoMenuItem <bool> fireballSkipsBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 400), "Fireball Skips", false, true);
            RandoMenuItem <bool> magolorBtn =
                new RandoMenuItem <bool>(back, new Vector2(-900, 310), "Mag Skips", false, true);

            RandoMenuItem <string> modeBtn =
                new RandoMenuItem <string>(back, new Vector2(0, 1040), "Mode", "Standard", "No Claw");

            // Create seed entry field
            GameObject seedGameObject = back.Clone("Seed", MenuButton.MenuButtonType.Activate, new Vector2(0, 1130),
                                                   "Click to type a custom seed").gameObject;

            Object.DestroyImmediate(seedGameObject.GetComponent <MenuButton>());
            Object.DestroyImmediate(seedGameObject.GetComponent <EventTrigger>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <AutoLocalizeTextUI>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <FixVerticalAlign>());
            Object.DestroyImmediate(seedGameObject.transform.Find("Text").GetComponent <ContentSizeFitter>());

            RectTransform seedRect = seedGameObject.transform.Find("Text").GetComponent <RectTransform>();

            seedRect.anchorMin = seedRect.anchorMax = new Vector2(0.5f, 0.5f);
            seedRect.sizeDelta = new Vector2(337, 63.2f);

            InputField customSeedInput = seedGameObject.AddComponent <InputField>();

            customSeedInput.transform.localPosition = new Vector3(0, 1240);
            customSeedInput.textComponent           = seedGameObject.transform.Find("Text").GetComponent <Text>();

            RandomizerMod.Instance.Settings.Seed = new Random().Next(999999999);
            customSeedInput.text = RandomizerMod.Instance.Settings.Seed.ToString();

            customSeedInput.caretColor  = Color.white;
            customSeedInput.contentType = InputField.ContentType.IntegerNumber;
            customSeedInput.onEndEdit.AddListener(ParseSeedInput);
            customSeedInput.navigation     = Navigation.defaultNavigation;
            customSeedInput.caretWidth     = 8;
            customSeedInput.characterLimit = 9;

            customSeedInput.colors = new ColorBlock
            {
                highlightedColor = Color.yellow,
                pressedColor     = Color.red,
                disabledColor    = Color.black,
                normalColor      = Color.white,
                colorMultiplier  = 2f
            };

            // Create some labels
            CreateLabel(back, new Vector2(-900, 960), "Required Skips");
            CreateLabel(back, new Vector2(0, 960), "Restrictions");
            CreateLabel(back, new Vector2(900, 960), "Quality of Life");
            CreateLabel(back, new Vector2(0, 1300), "Seed:");

            // We don't need these old buttons anymore
            Object.Destroy(classic.gameObject);
            Object.Destroy(steel.gameObject);
            Object.Destroy(parent.FindGameObjectInChildren("GGButton"));
            Object.Destroy(back.gameObject);

            // Gotta put something here, we destroyed the old default
            playScreen.defaultHighlight = startRandoBtn;

            // Apply navigation info (up, right, down, left)
            startNormalBtn.SetNavigation(magolorBtn.Button, startRandoBtn, backBtn, startRandoBtn);
            startRandoBtn.SetNavigation(lemmBtn.Button, startNormalBtn, backBtn, startNormalBtn);
            startSteelNormalBtn.SetNavigation(magolorBtn.Button, startSteelRandoBtn, backBtn, startSteelRandoBtn);
            startSteelRandoBtn.SetNavigation(lemmBtn.Button, startSteelNormalBtn, backBtn, startSteelNormalBtn);
            backBtn.SetNavigation(startNormalBtn, startNormalBtn, modeBtn.Button, startRandoBtn);
            allBossesBtn.Button.SetNavigation(modeBtn.Button, charmNotchBtn.Button, allSkillsBtn.Button,
                                              presetBtn.Button);
            allSkillsBtn.Button.SetNavigation(allBossesBtn.Button, lemmBtn.Button, allCharmsBtn.Button,
                                              shadeSkipsBtn.Button);
            allCharmsBtn.Button.SetNavigation(allSkillsBtn.Button, lemmBtn.Button, gameTypeBtn.Button,
                                              acidSkipsBtn.Button);
            charmNotchBtn.Button.SetNavigation(modeBtn.Button, presetBtn.Button, lemmBtn.Button, allBossesBtn.Button);
            lemmBtn.Button.SetNavigation(charmNotchBtn.Button, shadeSkipsBtn.Button, startRandoBtn,
                                         allSkillsBtn.Button);
            presetBtn.Button.SetNavigation(modeBtn.Button, allBossesBtn.Button, shadeSkipsBtn.Button,
                                           charmNotchBtn.Button);
            shadeSkipsBtn.Button.SetNavigation(presetBtn.Button, allSkillsBtn.Button, acidSkipsBtn.Button,
                                               lemmBtn.Button);
            acidSkipsBtn.Button.SetNavigation(shadeSkipsBtn.Button, allCharmsBtn.Button, spikeTunnelsBtn.Button,
                                              lemmBtn.Button);
            spikeTunnelsBtn.Button.SetNavigation(acidSkipsBtn.Button, allCharmsBtn.Button, miscSkipsBtn.Button,
                                                 lemmBtn.Button);
            miscSkipsBtn.Button.SetNavigation(spikeTunnelsBtn.Button, gameTypeBtn.Button, fireballSkipsBtn.Button,
                                              lemmBtn.Button);
            fireballSkipsBtn.Button.SetNavigation(miscSkipsBtn.Button, gameTypeBtn.Button, magolorBtn.Button,
                                                  lemmBtn.Button);
            magolorBtn.Button.SetNavigation(fireballSkipsBtn.Button, gameTypeBtn.Button, startNormalBtn,
                                            lemmBtn.Button);
            modeBtn.Button.SetNavigation(backBtn, modeBtn.Button, allBossesBtn.Button, modeBtn.Button);
            gameTypeBtn.Button.SetNavigation(allCharmsBtn.Button, lemmBtn.Button, backBtn, fireballSkipsBtn.Button);

            // Setup event for changing difficulty settings buttons
            void UpdateButtons(RandoMenuItem <string> item)
            {
                switch (item.CurrentSelection)
                {
                case "Easy":
                    SetShadeSkips(false);
                    acidSkipsBtn.SetSelection(false);
                    spikeTunnelsBtn.SetSelection(false);
                    miscSkipsBtn.SetSelection(false);
                    fireballSkipsBtn.SetSelection(false);
                    magolorBtn.SetSelection(false);
                    break;

                case "Hard":
                    SetShadeSkips(true);
                    acidSkipsBtn.SetSelection(true);
                    spikeTunnelsBtn.SetSelection(true);
                    miscSkipsBtn.SetSelection(true);
                    fireballSkipsBtn.SetSelection(true);
                    magolorBtn.SetSelection(false);
                    break;

                case "Moglar":
                    SetShadeSkips(true);
                    acidSkipsBtn.SetSelection(true);
                    spikeTunnelsBtn.SetSelection(true);
                    miscSkipsBtn.SetSelection(true);
                    fireballSkipsBtn.SetSelection(true);
                    magolorBtn.SetSelection(true);
                    break;

                case "Custom":
                    item.SetSelection("Easy");
                    goto case "Easy";

                default:
                    LogWarn("Unknown value in preset button: " + item.CurrentSelection);
                    break;
                }
            }

            // Event for setting stuff to hard mode on no claw selected
            void SetNoClaw(RandoMenuItem <string> item)
            {
                if (item.CurrentSelection == "No Claw")
                {
                    SetShadeSkips(true);
                    acidSkipsBtn.SetSelection(true);
                    spikeTunnelsBtn.SetSelection(true);
                    miscSkipsBtn.SetSelection(true);
                    fireballSkipsBtn.SetSelection(true);

                    presetBtn.SetSelection(magolorBtn.CurrentSelection ? "Moglar" : "Hard");
                }
            }

            void SetShadeSkips(bool enabled)
            {
                if (enabled)
                {
                    gameTypeBtn.SetSelection("Normal");
                    SwitchGameType(false);
                }
                else
                {
                    modeBtn.SetSelection("Standard");
                }

                shadeSkipsBtn.SetSelection(enabled);
            }

            void SettingChanged(RandoMenuItem <bool> item)
            {
                presetBtn.SetSelection("Custom");

                if (!item.CurrentSelection && item.Name != "Mag Skips")
                {
                    modeBtn.SetSelection("Standard");
                }
            }

            presetBtn.Changed += UpdateButtons;
            modeBtn.Changed   += SetNoClaw;

            shadeSkipsBtn.Changed    += SettingChanged;
            shadeSkipsBtn.Changed    += SaveShadeVal;
            acidSkipsBtn.Changed     += SettingChanged;
            spikeTunnelsBtn.Changed  += SettingChanged;
            miscSkipsBtn.Changed     += SettingChanged;
            fireballSkipsBtn.Changed += SettingChanged;
            magolorBtn.Changed       += SettingChanged;

            // Setup game type button changes
            void SaveShadeVal(RandoMenuItem <bool> item)
            {
                SetShadeSkips(shadeSkipsBtn.CurrentSelection);
            }

            void SwitchGameType(bool steelMode)
            {
                if (!steelMode)
                {
                    // Normal mode
                    startRandoBtn.transform.localPosition       = new Vector2(650, -480);
                    startNormalBtn.transform.localPosition      = new Vector2(-650, -480);
                    startSteelRandoBtn.transform.localPosition  = new Vector2(10000, 10000);
                    startSteelNormalBtn.transform.localPosition = new Vector2(10000, 10000);

                    backBtn.SetNavigation(startNormalBtn, startNormalBtn, modeBtn.Button, startRandoBtn);
                    magolorBtn.Button.SetNavigation(fireballSkipsBtn.Button, gameTypeBtn.Button, startNormalBtn,
                                                    lemmBtn.Button);
                    lemmBtn.Button.SetNavigation(charmNotchBtn.Button, shadeSkipsBtn.Button, startRandoBtn,
                                                 allSkillsBtn.Button);
                }
                else
                {
                    // Steel Soul mode
                    startRandoBtn.transform.localPosition       = new Vector2(10000, 10000);
                    startNormalBtn.transform.localPosition      = new Vector2(10000, 10000);
                    startSteelRandoBtn.transform.localPosition  = new Vector2(650, -480);
                    startSteelNormalBtn.transform.localPosition = new Vector2(-650, -480);

                    SetShadeSkips(false);

                    backBtn.SetNavigation(startSteelNormalBtn, startSteelNormalBtn, modeBtn.Button, startSteelRandoBtn);
                    magolorBtn.Button.SetNavigation(fireballSkipsBtn.Button, gameTypeBtn.Button, startSteelNormalBtn,
                                                    lemmBtn.Button);
                    lemmBtn.Button.SetNavigation(charmNotchBtn.Button, shadeSkipsBtn.Button, startSteelRandoBtn,
                                                 allSkillsBtn.Button);
                }
            }

            gameTypeBtn.Button.AddEvent(EventTriggerType.Submit,
                                        garbage => SwitchGameType(gameTypeBtn.CurrentSelection != "Normal"));

            // Setup start game button events
            void StartGame(bool rando)
            {
                RandomizerMod.Instance.Settings.CharmNotch = charmNotchBtn.CurrentSelection;
                RandomizerMod.Instance.Settings.Lemm       = lemmBtn.CurrentSelection;

                RandomizerMod.Instance.Settings.AllBosses = allBossesBtn.CurrentSelection;
                RandomizerMod.Instance.Settings.AllCharms = allCharmsBtn.CurrentSelection;
                RandomizerMod.Instance.Settings.AllSkills = allSkillsBtn.CurrentSelection;

                RandomizerMod.Instance.Settings.Randomizer = rando;

                if (RandomizerMod.Instance.Settings.Randomizer)
                {
                    RandomizerMod.Instance.Settings.NoClaw = modeBtn.CurrentSelection == "No Claw";

                    RandomizerMod.Instance.Settings.ShadeSkips =
                        gameTypeBtn.CurrentSelection == "Normal" && shadeSkipsBtn.CurrentSelection;

                    RandomizerMod.Instance.Settings.AcidSkips     = acidSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.SpikeTunnels  = spikeTunnelsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.MiscSkips     = miscSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.FireballSkips = fireballSkipsBtn.CurrentSelection;
                    RandomizerMod.Instance.Settings.MagSkips      = magolorBtn.CurrentSelection;
                }

                RandomizerMod.Instance.StartNewGame();
            }

            startNormalBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(false));
            startRandoBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(true));
            startSteelNormalBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(false));
            startSteelRandoBtn.AddEvent(EventTriggerType.Submit, garbage => StartGame(true));
        }