Beispiel #1
0
 public static void LoadArchives(List <string> archives, bool setLoadFinishedToTrue = false)
 {
     foreach (var element1 in config.dlc)
     {
         foreach (var element in archives)
         {
             var fil = Path.Combine(config.game_dir, element1, element);
             if (File.Exists(fil))
             {
                 DBPFFile.LoadResource(fil);
             }
             else
             {
                 if (Directory.Exists(fil))
                 {
                     DirectoryInfo folderInfo = new DirectoryInfo(fil);
                     foreach (var file in folderInfo.GetFiles("*.package"))
                     {
                         DBPFFile.LoadResource(file.FullName);
                     }
                 }
             }
         }
     }
     if (setLoadFinishedToTrue)
     {
         LoadFinished = true;
     }
 }
Beispiel #2
0
 public static void ThreadedInit()
 {
     if (config.enable_mods)
     {
         var mods_folder = Path.Combine(config.user_dir, "Downloads");
         if (Directory.Exists(mods_folder))
         {
             DirectoryInfo modInfo = new DirectoryInfo(mods_folder);
             foreach (var file in modInfo.GetFiles("*.package", SearchOption.AllDirectories))
             {
                 DBPFFile.LoadResource(file.FullName, true);
             }
         }
     }
     LoadArchives(config.archives_main);
     LoadFinished = true;
 }