Exemple #1
0
 public static void Load()
 {
     if (Directory.Exists(OldConfigFolderPath))
     {
         if (File.Exists(OldConfigPath))
         {
             VanillaTweaks.Log("Found config file in old folder! Moving config...");
             File.Move(OldConfigPath, ConfigPath);
         }
         if (File.Exists(OldConfigVersionPath))
         {
             File.Delete(OldConfigVersionPath);
         }
         if (Directory.GetFiles(OldConfigFolderPath).Length == 0 && Directory.GetDirectories(OldConfigFolderPath).Length == 0)
         {
             Directory.Delete(OldConfigFolderPath);
         }
         else
         {
             VanillaTweaks.Log("Old config folder still cotains some files/directories. They will not get deleted.");
         }
     }
     if (!ReadConfig())
     {
         SetDefaults();
         VanillaTweaks.Log("Failed to read config file! Creating config...");
     }
     SaveConfig();
 }
Exemple #2
0
        public override void Load()
        {
            Instance             = this;
            MiscellaniaLoaded    = ModLoader.GetMod("GoldensMisc") != null;
            FKtModSettingsLoaded = ModLoader.GetMod("FKTModSettings") != null;

            Config.Load();
            if (FKtModSettingsLoaded && !Main.dedServ)
            {
                Config.LoadFKConfig();
            }

            LanguageManager.Instance.OnLanguageChanged += LangTweaks.EditNames;
            LanguageManager.Instance.OnLanguageChanged += LangTweaks.EditTooltips;
        }