diff --git a/SabreTools/Partials/SabreTools_Inits.cs b/SabreTools/Partials/SabreTools_Inits.cs index 0b8de865..c14f57f8 100644 --- a/SabreTools/Partials/SabreTools_Inits.cs +++ b/SabreTools/Partials/SabreTools_Inits.cs @@ -410,7 +410,72 @@ namespace SabreTools Files = new Dictionary>(), }; - /* + DATFromDir dfd = new DATFromDir(inputs, datdata, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, tempDir, _logger); + bool success = dfd.Start(); + + // If we failed, show the help + if (!success) + { + Console.WriteLine(); + Build.Help(); + } + } + + /// + /// Wrap creating a DAT file from files or a directory in parallel + /// + /// List of innput filenames + /// New filename + /// New name + /// New description + /// New category + /// New version + /// New author + /// True to set forcepacking="unzip" on the created file, false otherwise + /// True to output in CMP format, false to output in Logiqx XML + /// True to enable reading a directory like a Romba depot, false otherwise + /// True to enable SuperDAT-style reading, false otherwise + /// True to disable getting MD5 hash, false otherwise + /// True to disable getting SHA-1 hash, false otherwise + /// True if the date should be omitted from the DAT, false otherwise + /// True if archives should be treated as files, false otherwise + /// True if GZIP archives should be treated as files, false otherwise + /// Name of the directory to create a temp folder in (blank is current directory + private static void InitDatFromDirParallel(List inputs, + string filename, + string name, + string description, + string category, + string version, + string author, + bool forceunpack, + bool old, + bool romba, + bool superdat, + bool noMD5, + bool noSHA1, + bool bare, + bool archivesAsFiles, + bool enableGzip, + string tempDir) + { + // Create a new DATFromDir object and process the inputs + Dat datdata = new Dat + { + FileName = filename, + Name = name, + Description = description, + Category = category, + Version = version, + Date = DateTime.Now.ToString("yyyy-MM-dd"), + Author = author, + ForcePacking = (forceunpack ? ForcePacking.Unzip : ForcePacking.None), + OutputFormat = (old ? OutputFormat.ClrMamePro : OutputFormat.Xml), + Romba = romba, + Type = (superdat ? "SuperDAT" : ""), + Files = new Dictionary>(), + }; + // For each input directory, create a DAT foreach (string path in inputs) { @@ -431,17 +496,6 @@ namespace SabreTools } } } - */ - - DATFromDir dfd = new DATFromDir(inputs, datdata, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, tempDir, _logger); - bool success = dfd.Start(); - - // If we failed, show the help - if (!success) - { - Console.WriteLine(); - Build.Help(); - } } ///