Exemple #1
0
 private static void DevMode()
 {
     if ((bool)ConfigMgr.GetValue(ConfigMgr.Key.DevelopmentMode))
     {
         string text  = PathMgr.Temp("dev");
         string text2 = PathMgr.Temp("dev", "raw");
         string path  = PathMgr.Local("raw.zip");
         if (Directory.Exists(text))
         {
             Utils.Rmdir(text);
         }
         if (File.Exists(path))
         {
             File.Delete(path);
         }
         Directory.CreateDirectory(text);
         Directory.CreateDirectory(text2);
         foreach (KeyValuePair <Mods, bool> keyValuePair in Program.ListOfMod)
         {
             if (keyValuePair.Value)
             {
                 string name  = "scripts-" + keyValuePair.Key.ToString().ToLower().Replace("_", "-");
                 string path2 = keyValuePair.Key.ToString().ToLower().Replace("_", "-");
                 Directory.CreateDirectory(Path.Combine(text2, path2));
                 foreach (string text3 in Directory.GetFiles(PathMgr.Assets(name), "*.*", SearchOption.AllDirectories))
                 {
                     File.Copy(text3, Path.Combine(Path.Combine(text2, path2), Path.GetFileName(text3)));
                 }
             }
         }
         ZipFile.CreateFromDirectory(text, "raw.zip");
     }
 }