Пример #1
0
 public void ModSettingsShow(Mod selected)
 {
     goBackBtn.SetActive(true);
     selected_mod = selected;
     RemoveChildren(modSettingsList.transform);
     for (int i = 0; i < Settings.Get(selected).ToArray().Length; i++)
     {
         SettingsList(Settings.Get(selected).ToArray()[i]);
     }
     if (Settings.GetDefault(selected).Count == 0 ||
         Settings.GetDefault(selected).Find(
             x => x.ID == "MSCL_HideResetAllButton") != null)
     {
         modSettings.transform.GetChild(0).GetChild(6).gameObject.SetActive(false);
     }
     else
     {
         modSettings.transform.GetChild(0).GetChild(6).gameObject.SetActive(true);
         modSettings.transform.GetChild(0)
         .GetChild(6)
         .GetComponent <Button>()
         .onClick.RemoveAllListeners();
         modSettings.transform.GetChild(0)
         .GetChild(6)
         .GetComponent <Button>()
         .onClick.AddListener(delegate {
             ModSettings_menu.ResetSettings(selected);
             ModSettingsShow(selected);
             selected.ModSettingsLoaded();
         });
     }
     goToSettings();
 }
Пример #2
0
        public void ModSettingsShow(Mod selected)
        {
            backButton.SetActive(true);
            selectedMod = selected;
            RemoveChildren(settingsList.transform);

            foreach (Settings set in Settings.modSettings.Where(set => set.Mod == selected))
            {
                SettingsList(set);
            }

            if (Settings.GetDefault(selected).Count == 0 || Settings.GetDefault(selected).Find(x => x.ID == "MSCL_HideResetAllButton") != null)
            {
                modSettings.transform.GetChild(0).GetChild(6).gameObject.SetActive(false);
            }
            else
            {
                modSettings.transform.GetChild(0).GetChild(6).gameObject.SetActive(true);
                modSettings.transform.GetChild(0).GetChild(6).GetComponent <Button>().onClick.RemoveAllListeners();
                modSettings.transform.GetChild(0).GetChild(6).GetComponent <Button>().onClick.AddListener(delegate
                {
                    ModSettings_menu.ResetSettings(selected);
                    ModSettingsShow(selected);
                    selected.ModSettingsLoaded();
                });
            }

            GoToSettings();
        }