Allow user inputs in diff-against and base-replace (fixes #40)

This commit is contained in:
Matt Nadareski
2021-08-17 12:35:31 -07:00
parent f1b9ae2dd2
commit dd2d2fa86c

View File

@@ -103,8 +103,9 @@ namespace SabreTools.Features
? Header.ReplaceExtension
: $".{Header.ReplaceExtension}");
// If we're in a special update mode and the names aren't set, set defaults
if (updateMode != 0)
// If we're in a non-replacement special update mode and the names aren't set, set defaults
if (updateMode != 0
&& !(updateMode.HasFlag(UpdateMode.DiffAgainst) || updateMode.HasFlag(UpdateMode.BaseReplace)))
{
// Get the values that will be used
if (string.IsNullOrWhiteSpace(Header.Date))
@@ -291,7 +292,7 @@ namespace SabreTools.Features
Parallel.ForEach(inputPaths, Globals.ParallelOptions, inputPath =>
{
// Parse the path to a new DatFile
DatFile repDat = DatFile.Create(userInputDat.Header.CloneFiltering());
DatFile repDat = DatFile.Create(Header);
Parser.ParseInto(repDat, inputPath, indexId: 1, keep: true);
// Perform additional processing steps
@@ -317,7 +318,7 @@ namespace SabreTools.Features
Parallel.ForEach(inputPaths, Globals.ParallelOptions, inputPath =>
{
// Parse the path to a new DatFile
DatFile repDat = DatFile.Create(userInputDat.Header.CloneFiltering());
DatFile repDat = DatFile.Create(Header);
Parser.ParseInto(repDat, inputPath, indexId: 1, keep: true);
// Perform additional processing steps