Beispiel #1
0
        // Load all settings.
        public static void LoadSettings()
        {
            foreach (Mod mod in ModLoader.LoadedMods)
            {
                // Check if there is custom settings file (if not, ignore)
                string path = Path.Combine(ModLoader.GetModSettingsFolder(mod), "settings.json");
                if (!File.Exists(path))
                {
                    continue;
                }

                //Load and deserialize
                SettingsList settings       = new SettingsList();
                string       serializedData = File.ReadAllText(path);
                settings       = JsonConvert.DeserializeObject <SettingsList>(serializedData);
                mod.isDisabled = settings.isDisabled;
                if (settings.settings.Count == 0)
                {
                    continue;
                }

                foreach (var kb in settings.settings)
                {
                    Settings set = Settings.modSettings.Find(x => x.Mod == mod && x.ID == kb.ID);
                    if (set == null)
                    {
                        continue;
                    }
                    set.Value = kb.Value;
                }

                mod.ModSettingsLoaded();
            }
        }
Beispiel #2
0
        public void CreateSettingsUI()
        {
            AssetBundle ab = LoadAssets.LoadBundle(this, "settingsui.unity3d");

            UI = ab.LoadAsset("MSCLoader Settings.prefab") as GameObject;

            ModButton         = ab.LoadAsset("ModButton.prefab") as GameObject;
            ModButton_Invalid = ab.LoadAsset("ModButton_Invalid.prefab") as GameObject;
            ModViewLabel      = ab.LoadAsset("ModViewLabel.prefab") as GameObject;

            KeyBind = ab.LoadAsset("KeyBind.prefab") as GameObject;

            Checkbox = ab.LoadAsset("Checkbox.prefab") as GameObject;
            setBtn   = ab.LoadAsset("Button.prefab") as GameObject;
            slider   = ab.LoadAsset("Slider.prefab") as GameObject;

            UI = GameObject.Instantiate(UI);
            UI.AddComponent <ModUIDrag>();
            settings = UI.AddComponent <SettingsView>();
            UI.GetComponent <SettingsView>().settingView          = UI;
            UI.GetComponent <SettingsView>().settingViewContainer = UI.transform.GetChild(0).gameObject;

            UI.GetComponent <SettingsView>().modList = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(3).gameObject;
            UI.GetComponent <SettingsView>().modView = UI.GetComponent <SettingsView>().modList.transform.GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().modInfo = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(2).gameObject;
            GameObject ModSettingsView = UI.GetComponent <SettingsView>().modInfo.transform.GetChild(0).gameObject;

            UI.GetComponent <SettingsView>().ModKeyBinds  = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(1).gameObject;
            UI.GetComponent <SettingsView>().keybindsList = UI.GetComponent <SettingsView>().ModKeyBinds.transform.GetChild(0).GetChild(4).gameObject;

            UI.GetComponent <SettingsView>().modSettings     = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(4).gameObject;
            UI.GetComponent <SettingsView>().modSettingsList = UI.GetComponent <SettingsView>().modSettings.transform.GetChild(0).GetChild(4).gameObject;

            UI.GetComponent <SettingsView>().goBackBtn = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(0).GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().goBackBtn.GetComponent <Button>().onClick.AddListener(() => UI.GetComponent <SettingsView>().goBack());
            UI.GetComponent <SettingsView>().DisableMod = ModSettingsView.transform.GetChild(5).GetComponent <Toggle>();
            UI.GetComponent <SettingsView>().DisableMod.onValueChanged.AddListener(UI.GetComponent <SettingsView>().disableMod);
            ModSettingsView.transform.GetChild(7).GetComponent <Button>().onClick.AddListener(() => UI.GetComponent <SettingsView>().goToKeybinds());
            ModSettingsView.transform.GetChild(9).GetComponent <Button>().onClick.AddListener(() => UI.GetComponent <SettingsView>().goToSettings());

            UI.GetComponent <SettingsView>().ModButton         = ModButton;
            UI.GetComponent <SettingsView>().ModButton_Invalid = ModButton_Invalid;
            UI.GetComponent <SettingsView>().ModViewLabel      = ModViewLabel;
            UI.GetComponent <SettingsView>().KeyBind           = KeyBind;

            UI.GetComponent <SettingsView>().Checkbox = Checkbox;
            UI.GetComponent <SettingsView>().setBtn   = setBtn;
            UI.GetComponent <SettingsView>().slider   = slider;

            UI.GetComponent <SettingsView>().IDtxt      = ModSettingsView.transform.GetChild(0).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Nametxt    = ModSettingsView.transform.GetChild(1).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Versiontxt = ModSettingsView.transform.GetChild(2).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Authortxt  = ModSettingsView.transform.GetChild(3).GetComponent <Text>();

            UI.transform.SetParent(GameObject.Find("MSCLoader Canvas").transform, false);
            settings.setVisibility(false);
            ab.Unload(false);
        }
        public void CreateSettingsUI()
        {
            AssetBundle ab = AssetBundle.CreateFromMemoryImmediate(Properties.Resources.settingsui);

            //AssetBundle ab = LoadAssets.LoadBundle(this, "settingsui.unity3d");

            UI = ab.LoadAsset <GameObject>("MSCLoader Settings.prefab");

            ModButton         = ab.LoadAsset <GameObject>("ModButton.prefab");
            ModButton_Invalid = ab.LoadAsset <GameObject>("ModButton_Invalid.prefab");

            ModLabel = ab.LoadAsset <GameObject>("ModViewLabel.prefab");

            KeyBind = ab.LoadAsset <GameObject>("KeyBind.prefab");

            modSettingsButton = ab.LoadAsset <GameObject>("Button_ms.prefab");
            //For mod settings
            Checkbox = ab.LoadAsset <GameObject>("Checkbox.prefab");
            setBtn   = ab.LoadAsset <GameObject>("Button.prefab");
            slider   = ab.LoadAsset <GameObject>("Slider.prefab");
            textBox  = ab.LoadAsset <GameObject>("TextBox.prefab");
            header   = ab.LoadAsset <GameObject>("Header.prefab");

            UI = UnityEngine.Object.Instantiate(UI);
            UI.AddComponent <ModUIDrag>();
            UI.name = "MSCLoader Settings";

            settings = UI.AddComponent <SettingsView>().Setup(this);

            modUpdateButton      = UnityEngine.Object.Instantiate(modSettingsButton);
            modUpdateButton.name = "MSCLoader Update button";
            modUpdateButton.transform.SetParent(ModUI.GetCanvas().transform, false);
            modUpdateButton.GetComponent <Button>().onClick.AddListener(() => CheckForUpdateButton());
            modUpdateButton.transform.GetChild(0).GetComponent <Text>().text = "Check Updates";
            modUpdateButton.SetActive((bool)modSetButton.GetValue());
            modUpdateButton.AddComponent <SetButtonPos>().button = modUpdateButton;

            modSettingsButton      = UnityEngine.Object.Instantiate(modSettingsButton);
            modSettingsButton.name = "MSCLoader Settings button";
            modSettingsButton.transform.SetParent(ModUI.GetCanvas().transform, false);
            modSettingsButton.GetComponent <Button>().onClick.AddListener(() => settings.ToggleVisibility());
            modSettingsButton.SetActive((bool)modSetButton.GetValue());

            ab.Unload(false);

            // FREDTWEAK
            Transform canvas = GameObject.Find("MSCLoader Canvas").transform.Find("MSCLoader Settings/MSCLoader SettingsContainer/Settings/SettingsView");

            canvas.GetChild(0).gameObject.SetActive(false);
            canvas.GetChild(1).gameObject.SetActive(false);
            canvas.GetChild(2).gameObject.SetActive(false);

            GameObject.Find("MSCLoader Canvas").transform.Find("MSCLoader Settings/MSCLoader SettingsContainer/ModKeyBinds/KeyBindsView/Text").GetComponent <Text>().text = "<color=lime><b>LMB</b></color> - Cancel\n<color=lime><b>RMB</b></color> - Set to None";
        }
Beispiel #4
0
        public void CreateSettingsUI()
        {
            AssetBundle ab = LoadAssets.LoadBundle(this, "settingsui.unity3d");

            UI = ab.LoadAsset <GameObject>("MSCLoader Settings.prefab");

            ModButton         = ab.LoadAsset <GameObject>("ModButton.prefab");
            ModButton_Invalid = ab.LoadAsset <GameObject>("ModButton_Invalid.prefab");

            ModLabel = ab.LoadAsset <GameObject>("ModViewLabel.prefab");

            KeyBind = ab.LoadAsset <GameObject>("KeyBind.prefab");

            //For mod settings
            Checkbox = ab.LoadAsset <GameObject>("Checkbox.prefab");
            setBtn   = ab.LoadAsset <GameObject>("Button.prefab");
            slider   = ab.LoadAsset <GameObject>("Slider.prefab");
            textBox  = ab.LoadAsset <GameObject>("TextBox.prefab");
            header   = ab.LoadAsset <GameObject>("Header.prefab");

            UI = GameObject.Instantiate(UI);
            UI.AddComponent <ModUIDrag>();

            settings    = UI.AddComponent <SettingsView>();
            settings.ms = this;
            settings.settingViewContainer = UI.transform.GetChild(0).gameObject;
            settings.modList = settings.settingViewContainer.transform.GetChild(3).gameObject;
            settings.modView = settings.modList.transform.GetChild(0).gameObject;
            settings.modInfo = settings.settingViewContainer.transform.GetChild(2).gameObject;
            GameObject ModSettingsView = settings.modInfo.transform.GetChild(0).gameObject;

            settings.ModKeyBinds     = settings.settingViewContainer.transform.GetChild(1).gameObject;
            settings.keybindsList    = settings.ModKeyBinds.transform.GetChild(0).GetChild(4).gameObject;
            settings.modSettings     = settings.settingViewContainer.transform.GetChild(4).gameObject;
            settings.modSettingsList = settings.modSettings.transform.GetChild(0).GetChild(4).gameObject;
            settings.coreModCheckbox = settings.settingViewContainer.transform.GetChild(6).GetChild(0).GetComponent <Toggle>();
            settings.coreModCheckbox.onValueChanged.AddListener(delegate { settings.ToggleCoreCheckbox(); });
            settings.noOfMods  = settings.settingViewContainer.transform.GetChild(6).GetChild(1).GetComponent <Text>();
            settings.goBackBtn = settings.settingViewContainer.transform.GetChild(0).GetChild(1).gameObject;
            settings.goBackBtn.GetComponent <Button>().onClick.AddListener(() => settings.goBack());
            settings.settingViewContainer.transform.GetChild(0).GetChild(2).GetComponent <Button>().onClick.AddListener(() => settings.setVisibility(false));
            settings.DisableMod = ModSettingsView.transform.GetChild(5).GetComponent <Toggle>();
            settings.DisableMod.onValueChanged.AddListener(settings.disableMod);

            settings.IDtxt      = ModSettingsView.transform.GetChild(0).GetComponent <Text>();
            settings.Nametxt    = ModSettingsView.transform.GetChild(1).GetComponent <Text>();
            settings.Versiontxt = ModSettingsView.transform.GetChild(2).GetComponent <Text>();
            settings.Authortxt  = ModSettingsView.transform.GetChild(3).GetComponent <Text>();

            UI.transform.SetParent(GameObject.Find("MSCLoader Canvas").transform, false);
            settings.setVisibility(false);
            ab.Unload(false);
        }
        // Load all settings.
        public static void LoadSettings()
        {
            foreach (Mod mod in ModLoader.LoadedMods)
            {
                // Check if there is custom settings file (if not, ignore)
                string path = Path.Combine(ModLoader.GetModSettingsFolder(mod), "settings.json");
                if (!File.Exists(path))
                {
                    SaveSettings(mod); //create settings file if not exists.
                }
                //Load and deserialize
                SettingsList settings       = new SettingsList();
                string       serializedData = File.ReadAllText(path);
                settings       = JsonConvert.DeserializeObject <SettingsList>(serializedData);
                mod.isDisabled = settings.isDisabled;
                try
                {
                    if (mod.LoadInMenu && !mod.isDisabled && mod.fileName != null)
                    {
                        mod.OnMenuLoad();
                    }
                }
                catch (Exception e)
                {
                    StackFrame frame = new StackTrace(e, true).GetFrame(0);

                    string errorDetails = string.Format("{2}<b>Details: </b>{0} in <b>{1}</b>", e.Message, frame.GetMethod(), Environment.NewLine);
                    ModConsole.Error(string.Format("Mod <b>{0}</b> throw an error!{1}", mod.ID, errorDetails));
                    if (ModLoader.devMode)
                    {
                        ModConsole.Error(e.ToString());
                    }
                    UnityEngine.Debug.Log(e);
                }

                if (settings.settings.Count == 0)
                {
                    continue;
                }

                foreach (var kb in settings.settings)
                {
                    Settings set = Settings.modSettings.Find(x => x.Mod == mod && x.ID == kb.ID);
                    if (set == null)
                    {
                        continue;
                    }
                    set.Value = kb.Value;
                }
                mod.ModSettingsLoaded();
            }
        }
Beispiel #6
0
        public void CreateSettingsUI()
        {
            //ModConsole.Print(UI.name);
            UI = GameObject.Instantiate(UI);
            UI.AddComponent <ModUIDrag>();
            settings = UI.AddComponent <SettingsView>();
            UI.GetComponent <SettingsView>().settingView          = UI;
            UI.GetComponent <SettingsView>().settingViewContainer = UI.transform.GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().modList         = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(2).gameObject;
            UI.GetComponent <SettingsView>().modView         = UI.GetComponent <SettingsView>().modList.transform.GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().modSettings     = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(1).gameObject;
            UI.GetComponent <SettingsView>().ModSettingsView = UI.GetComponent <SettingsView>().modSettings.transform.GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().goBackBtn       = UI.GetComponent <SettingsView>().settingViewContainer.transform.GetChild(0).GetChild(0).gameObject;
            UI.GetComponent <SettingsView>().goBackBtn.GetComponent <Button>().onClick.AddListener(() => UI.GetComponent <SettingsView>().goBack());
            UI.GetComponent <SettingsView>().keybindsList = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(8).gameObject;
            UI.GetComponent <SettingsView>().DisableMod   = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(4).GetComponent <Toggle>();
            UI.GetComponent <SettingsView>().DisableMod.onValueChanged.AddListener(UI.GetComponent <SettingsView>().disableMod);

            UI.GetComponent <SettingsView>().ModButton         = ModButton;
            UI.GetComponent <SettingsView>().ModButton_Pre     = ModButton_Pre;
            UI.GetComponent <SettingsView>().ModButton_Invalid = ModButton_Invalid;
            UI.GetComponent <SettingsView>().ModViewLabel      = ModViewLabel;
            UI.GetComponent <SettingsView>().KeyBind           = KeyBind;

            UI.GetComponent <SettingsView>().HasAssets      = HasAssets;
            UI.GetComponent <SettingsView>().PluginOk       = PluginOk;
            UI.GetComponent <SettingsView>().PluginDisabled = PluginDisabled;
            UI.GetComponent <SettingsView>().InMenu         = InMenu;
            UI.GetComponent <SettingsView>().update         = update;

            UI.GetComponent <SettingsView>().IDtxt      = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(0).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Nametxt    = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(1).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Versiontxt = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(2).GetComponent <Text>();
            UI.GetComponent <SettingsView>().Authortxt  = UI.GetComponent <SettingsView>().ModSettingsView.transform.GetChild(3).GetComponent <Text>();

            UI.transform.SetParent(GameObject.Find("MSCLoader Canvas").transform, false);
            settings.setVisibility(false);
        }
Beispiel #7
0
        public void CreateSettingsUI()
        {
            AssetBundle ab = LoadAssets.LoadBundle(this, "settingsui.unity3d");

            UI = ab.LoadAsset <GameObject>("MSCLoader Settings.prefab");

            ModButton         = ab.LoadAsset <GameObject>("ModButton.prefab");
            ModButton_Invalid = ab.LoadAsset <GameObject>("ModButton_Invalid.prefab");

            ModLabel = ab.LoadAsset <GameObject>("ModViewLabel.prefab");

            KeyBind = ab.LoadAsset <GameObject>("KeyBind.prefab");

            Button_ms = ab.LoadAsset <GameObject>("Button_ms.prefab");
            // For mod settings
            Checkbox = ab.LoadAsset <GameObject>("Checkbox.prefab");
            setBtn   = ab.LoadAsset <GameObject>("Button.prefab");
            slider   = ab.LoadAsset <GameObject>("Slider.prefab");
            textBox  = ab.LoadAsset <GameObject>("TextBox.prefab");
            header   = ab.LoadAsset <GameObject>("Header.prefab");

            UI = GameObject.Instantiate(UI);
            UI.AddComponent <ModUIDrag>();
            UI.name = "MSCLoader Settings";

            settings    = UI.AddComponent <SettingsView>();
            settings.ms = this;
            settings.settingViewContainer = UI.transform.GetChild(0).gameObject;
            settings.modList =
                settings.settingViewContainer.transform.GetChild(3).gameObject;
            settings.modView = settings.modList.transform.GetChild(0).gameObject;
            settings.modInfo =
                settings.settingViewContainer.transform.GetChild(2).gameObject;
            GameObject ModSettingsView = settings.modInfo.transform.GetChild(0).gameObject;

            settings.ModKeyBinds =
                settings.settingViewContainer.transform.GetChild(1).gameObject;
            settings.keybindsList =
                settings.ModKeyBinds.transform.GetChild(0).GetChild(4).gameObject;
            settings.modSettings =
                settings.settingViewContainer.transform.GetChild(4).gameObject;
            settings.modSettingsList =
                settings.modSettings.transform.GetChild(0).GetChild(4).gameObject;
            settings.coreModCheckbox = settings.settingViewContainer.transform.GetChild(6)
                                       .GetChild(0)
                                       .GetComponent <Toggle>();
            settings.coreModCheckbox.onValueChanged.AddListener(
                delegate { settings.ToggleCoreCheckbox(); });
            settings.noOfMods = settings.settingViewContainer.transform.GetChild(6)
                                .GetChild(1)
                                .GetComponent <Text>();
            settings.goBackBtn =
                settings.settingViewContainer.transform.GetChild(0).GetChild(1).gameObject;
            settings.goBackBtn.GetComponent <Button>().onClick.AddListener(
                () => settings.goBack());
            settings.settingViewContainer.transform.GetChild(0)
            .GetChild(2)
            .GetComponent <Button>()
            .onClick.AddListener(() => settings.toggleVisibility());
            settings.DisableMod =
                ModSettingsView.transform.GetChild(2).GetComponent <Toggle>();
            settings.DisableMod.onValueChanged.AddListener(settings.disableMod);

            settings.InfoTxt        = ModSettingsView.transform.GetChild(0).GetComponent <Text>();
            settings.descriptionTxt =
                ModSettingsView.transform.GetChild(8).GetComponent <Text>();

            settings.nexusLink =
                ModSettingsView.transform.GetChild(4).GetComponent <Button>();
            settings.rdLink = ModSettingsView.transform.GetChild(5).GetComponent <Button>();
            settings.ghLink = ModSettingsView.transform.GetChild(6).GetComponent <Button>();

            UI.transform.SetParent(ModUI.GetCanvas().transform, false);
            settings.SetVisibility(false);
            Button_ms      = GameObject.Instantiate(Button_ms);
            Button_ms.name = "MSCLoader Settings button";
            Button_ms.transform.SetParent(ModUI.GetCanvas().transform, false);
            Button_ms.GetComponent <Button>().onClick.AddListener(
                () => settings.toggleVisibility());
            Button_ms.SetActive(true);
            if (!(bool)modSetButton.GetValue())
            {
                Button_ms.SetActive(false);
            }
            ab.Unload(false);
        }
Beispiel #8
0
        /// <summary>
        /// Create Settings UI using UnityEngine.UI
        /// </summary>
        public void CreateSettingsUI()
        {
            GameObject settingsView = ModUI.CreateParent("MSCLoader Settings", true);

            settingsView.GetComponent <RectTransform>().sizeDelta = new Vector2(300, 450);
            settingsView.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
            settingsView.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
            settingsView.GetComponent <RectTransform>().pivot     = new Vector2(0.5f, 0.5f);

            settings = settingsView.AddComponent <SettingsView>();
            settingsView.GetComponent <SettingsView>().settingView = settingsView;

            GameObject settingsViewC = ModUI.CreateUIBase("MSCLoader SettingsContainer", settingsView);

            settingsViewC.GetComponent <RectTransform>().sizeDelta = new Vector2(300, 450);
            settingsViewC.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0.5f);
            settingsViewC.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0.5f);
            settingsViewC.GetComponent <RectTransform>().pivot     = new Vector2(0.5f, 0.5f);
            settingsViewC.AddComponent <Image>().color             = Color.black;

            settingsView.GetComponent <SettingsView>().settingViewContainer = settingsViewC;

            GameObject title = ModUI.CreateTextBlock("Title", "Loaded Mods:", settingsViewC, TextAnchor.MiddleCenter, Color.white, false);

            title.GetComponent <RectTransform>().sizeDelta = new Vector2(300, 20);
            title.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 1);
            title.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 1);
            title.GetComponent <RectTransform>().pivot     = new Vector2(0.5f, 1);
            title.GetComponent <Text>().fontSize           = 16;
            title.GetComponent <Text>().fontStyle          = FontStyle.Bold;

            GameObject goBack = ModUI.CreateUIBase("GoBackButton", title);

            goBack.GetComponent <RectTransform>().sizeDelta = new Vector2(80, 20);
            goBack.GetComponent <RectTransform>().anchorMin = new Vector2(0, 0.5f);
            goBack.GetComponent <RectTransform>().anchorMax = new Vector2(0, 0.5f);
            goBack.GetComponent <RectTransform>().pivot     = new Vector2(0, 0.5f);
            goBack.AddComponent <Image>();
            goBack.AddComponent <Button>().targetGraphic = goBack.GetComponent <Image>();
            ColorBlock cb = goBack.GetComponent <Button>().colors;

            cb.normalColor      = Color.black;
            cb.highlightedColor = Color.red;
            goBack.GetComponent <Button>().colors        = cb;
            goBack.GetComponent <Button>().targetGraphic = goBack.GetComponent <Image>();
            goBack.GetComponent <Button>().onClick.AddListener(() => settingsView.GetComponent <SettingsView>().goBack());

            settingsView.GetComponent <SettingsView>().goBackBtn = goBack;

            GameObject BtnTxt = ModUI.CreateTextBlock("Text", " < Back", goBack, TextAnchor.MiddleLeft, Color.white);

            BtnTxt.GetComponent <RectTransform>().anchorMin = new Vector2(0, 1);
            BtnTxt.GetComponent <RectTransform>().anchorMax = new Vector2(0, 1);
            BtnTxt.GetComponent <RectTransform>().pivot     = new Vector2(0, 1);
            BtnTxt.GetComponent <RectTransform>().sizeDelta = new Vector2(80, 20);
            BtnTxt.GetComponent <Text>().fontSize           = 16;
            goBack.SetActive(false);
            //modList
            GameObject modList = ModUI.CreateUIBase("ModList", settingsViewC);

            modList.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0);
            modList.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0);
            modList.GetComponent <RectTransform>().pivot     = new Vector2(0.5f, 0);
            modList.GetComponent <RectTransform>().sizeDelta = new Vector2(300, 430);
            modList.AddComponent <Image>().color             = Color.black;
            modList.AddComponent <Mask>().showMaskGraphic    = true;

            settingsView.GetComponent <SettingsView>().modList = modList;

            //ModView
            GameObject scrollbar = ModUI.CreateScrollbar(settingsViewC, 450, 10, 90);

            scrollbar.GetComponent <RectTransform>().anchorMin = new Vector2(1, 1);
            scrollbar.GetComponent <RectTransform>().anchorMax = new Vector2(1, 1);
            scrollbar.GetComponent <RectTransform>().pivot     = new Vector2(1, 1);

            GameObject modView = ModListS(modList, scrollbar, "ModView");

            settingsView.GetComponent <SettingsView>().modView = modView;

            GameObject modSettings = ModUI.CreateUIBase("ModSettings", settingsViewC);

            modSettings.GetComponent <RectTransform>().anchorMin = new Vector2(0.5f, 0);
            modSettings.GetComponent <RectTransform>().anchorMax = new Vector2(0.5f, 0);
            modSettings.GetComponent <RectTransform>().pivot     = new Vector2(0.5f, 0);
            modSettings.GetComponent <RectTransform>().sizeDelta = new Vector2(300, 430);
            modSettings.AddComponent <Image>().color             = Color.black;
            modSettings.AddComponent <Mask>().showMaskGraphic    = true;

            GameObject modSettingsView = ModListS(modSettings, scrollbar, "ModSettingsView");

            settingsView.GetComponent <SettingsView>().modSettings     = modSettings;
            settingsView.GetComponent <SettingsView>().ModSettingsView = modSettingsView;
            settingsView.GetComponent <SettingsView>().IDtxt           = ModUI.CreateTextBlock("ID", "", modSettingsView).GetComponent <Text>();
            settingsView.GetComponent <SettingsView>().Nametxt         = ModUI.CreateTextBlock("Name", "", modSettingsView).GetComponent <Text>();
            settingsView.GetComponent <SettingsView>().Versiontxt      = ModUI.CreateTextBlock("Version", "", modSettingsView).GetComponent <Text>();
            settingsView.GetComponent <SettingsView>().Authortxt       = ModUI.CreateTextBlock("Author", "", modSettingsView).GetComponent <Text>();

            //keybinds
            ModUI.Separator(modSettingsView, "Key Bindings");

            GameObject keybinds = ModUI.CreateUIBase("Keybinds", modSettingsView);

            keybinds.AddComponent <VerticalLayoutGroup>().spacing   = 5;
            settingsView.GetComponent <SettingsView>().keybindsList = keybinds;

            ModUI.Separator(modSettingsView);

            modSettings.SetActive(false);
        }