mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatTools] Merge did some preprocessing before
This commit is contained in:
@@ -1532,10 +1532,27 @@ namespace SabreTools.Helper
|
|||||||
// If we're in merging or diffing mode, use the full list of inputs
|
// If we're in merging or diffing mode, use the full list of inputs
|
||||||
if (merge || diff)
|
if (merge || diff)
|
||||||
{
|
{
|
||||||
|
// Create a new list of inputs that are only files
|
||||||
|
List<string> newInputFileNames = new List<string>();
|
||||||
|
foreach (string input in inputFileNames)
|
||||||
|
{
|
||||||
|
if (File.Exists(input))
|
||||||
|
{
|
||||||
|
newInputFileNames.Add(Path.GetFullPath(input));
|
||||||
|
}
|
||||||
|
else if (Directory.Exists(input))
|
||||||
|
{
|
||||||
|
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||||
|
{
|
||||||
|
newInputFileNames.Add(Path.GetFullPath(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Create a dictionary of all ROMs from the input DATs
|
// Create a dictionary of all ROMs from the input DATs
|
||||||
datdata.FileName = datdata.Description;
|
datdata.FileName = datdata.Description;
|
||||||
Dat userData;
|
Dat userData;
|
||||||
List<Dat> datHeaders = PopulateUserData(inputFileNames, inplace, clean, outputDirectory, datdata, out userData, logger);
|
List<Dat> datHeaders = PopulateUserData(newInputFileNames, inplace, clean, outputDirectory, datdata, out userData, logger);
|
||||||
|
|
||||||
// If we want to filter, apply it to the userData now
|
// If we want to filter, apply it to the userData now
|
||||||
userData = Filter(userData, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, logger);
|
userData = Filter(userData, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, logger);
|
||||||
@@ -1543,17 +1560,17 @@ namespace SabreTools.Helper
|
|||||||
// Modify the Dictionary if necessary and output the results
|
// Modify the Dictionary if necessary and output the results
|
||||||
if (diff && !cascade)
|
if (diff && !cascade)
|
||||||
{
|
{
|
||||||
DiffNoCascade(outputDirectory, userData, inputFileNames, logger);
|
DiffNoCascade(outputDirectory, userData, newInputFileNames, logger);
|
||||||
}
|
}
|
||||||
// If we're in cascade and diff, output only cascaded diffs
|
// If we're in cascade and diff, output only cascaded diffs
|
||||||
else if (diff && cascade)
|
else if (diff && cascade)
|
||||||
{
|
{
|
||||||
DiffCascade(outputDirectory, inplace, userData, inputFileNames, datHeaders, logger);
|
DiffCascade(outputDirectory, inplace, userData, newInputFileNames, datHeaders, logger);
|
||||||
}
|
}
|
||||||
// Output all entries with user-defined merge
|
// Output all entries with user-defined merge
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MergeNoDiff(outputDirectory, userData, inputFileNames, datHeaders, logger);
|
MergeNoDiff(outputDirectory, userData, newInputFileNames, datHeaders, logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Otherwise, loop through all of the inputs individually
|
// Otherwise, loop through all of the inputs individually
|
||||||
|
|||||||
Reference in New Issue
Block a user