public void Init()
 {
     Global.Instance.modManager.Load(Content.LayerableFiles);
     SettingsCache.Clear();
     WorldGen.LoadSettings();
     CustomGameSettings.Instance.LoadWorlds();
     Global.Instance.modManager.Report(base.gameObject);
     settings = CustomGameSettings.Instance;
     widgets  = new List <NewGameSettingWidget>();
     foreach (KeyValuePair <string, SettingConfig> qualitySetting in settings.QualitySettings)
     {
         if (!qualitySetting.Value.debug_only || DebugHandler.enabled)
         {
             ListSettingConfig listSettingConfig = qualitySetting.Value as ListSettingConfig;
             if (listSettingConfig != null)
             {
                 NewGameSettingList newGameSettingList = Util.KInstantiateUI <NewGameSettingList>(prefab_cycle_setting, content.gameObject, true);
                 newGameSettingList.Initialize(listSettingConfig);
                 widgets.Add(newGameSettingList);
             }
             else
             {
                 ToggleSettingConfig toggleSettingConfig = qualitySetting.Value as ToggleSettingConfig;
                 if (toggleSettingConfig != null)
                 {
                     NewGameSettingToggle newGameSettingToggle = Util.KInstantiateUI <NewGameSettingToggle>(prefab_checkbox_setting, content.gameObject, true);
                     newGameSettingToggle.Initialize(toggleSettingConfig);
                     widgets.Add(newGameSettingToggle);
                 }
                 else
                 {
                     SeedSettingConfig seedSettingConfig = qualitySetting.Value as SeedSettingConfig;
                     if (seedSettingConfig != null)
                     {
                         NewGameSettingSeed newGameSettingSeed = Util.KInstantiateUI <NewGameSettingSeed>(prefab_seed_input_setting, content.gameObject, true);
                         newGameSettingSeed.Initialize(seedSettingConfig);
                         widgets.Add(newGameSettingSeed);
                     }
                 }
             }
         }
     }
     Refresh();
 }
 public void Initialize(ListSettingConfig config)
 {
     this.config     = config;
     Label.text      = config.label;
     ToolTip.toolTip = config.tooltip;
 }
 public SettingLevel CycleSettingLevel(ListSettingConfig config, int direction)
 {
     SetQualitySetting(config, config.CycleSettingLevelID(CurrentQualityLevelsBySetting[config.id], direction));
     return(config.GetLevel(CurrentQualityLevelsBySetting[config.id]));
 }