mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add proper DAT addition and merging
This commit is contained in:
@@ -34,7 +34,7 @@ namespace SabreTools
|
|||||||
Build.Start("DiffDat");
|
Build.Start("DiffDat");
|
||||||
|
|
||||||
List<String> inputs = new List<String>();
|
List<String> inputs = new List<String>();
|
||||||
bool tofile = false, help = false, merge = false; ;
|
bool tofile = false, help = false, merge = false, diff = false;
|
||||||
foreach (string arg in args)
|
foreach (string arg in args)
|
||||||
{
|
{
|
||||||
switch (arg)
|
switch (arg)
|
||||||
@@ -48,6 +48,10 @@ namespace SabreTools
|
|||||||
case "--log":
|
case "--log":
|
||||||
tofile = true;
|
tofile = true;
|
||||||
break;
|
break;
|
||||||
|
case "-d":
|
||||||
|
case "--diff":
|
||||||
|
diff = true;
|
||||||
|
break;
|
||||||
case "-m":
|
case "-m":
|
||||||
case "--merge":
|
case "--merge":
|
||||||
merge = true;
|
merge = true;
|
||||||
@@ -80,13 +84,20 @@ namespace SabreTools
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, read in the files, diff them, and write the result to the file type that the first one is
|
// Otherwise, read in the files, process them and write the result to the file type that the first one is
|
||||||
List<RomData> A = new List<RomData>();
|
List<RomData> A = new List<RomData>();
|
||||||
foreach (string input in inputs)
|
foreach (string input in inputs)
|
||||||
{
|
{
|
||||||
logger.Log("Adding DAT: " + input);
|
logger.Log("Adding DAT: " + input);
|
||||||
List<RomData> B = RomManipulation.Parse(input, 0, 0, logger);
|
List<RomData> B = RomManipulation.Parse(input, 0, 0, logger);
|
||||||
A = RomManipulation.Diff(A, B);
|
if (diff)
|
||||||
|
{
|
||||||
|
A = RomManipulation.Diff(A, B);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
A.AddRange(B);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we want a merged list, send it for merging before outputting
|
// If we want a merged list, send it for merging before outputting
|
||||||
|
|||||||
Reference in New Issue
Block a user