Add "AB" mode

Basically, this will output the information that's in each DAT but not in the merged and also the data that's only in every DAT. This needs testing, but it's a good start.
This commit is contained in:
Matt Nadareski
2016-04-22 13:51:37 -07:00
parent 373eb78324
commit 2d5bf0145b
4 changed files with 113 additions and 17 deletions

View File

@@ -51,6 +51,7 @@ namespace SabreTools
// Set all default values
bool help = false,
ad = false,
add = false,
bare = false,
convertMiss = false,
@@ -109,6 +110,10 @@ namespace SabreTools
case "--add":
add = true;
break;
case "-ad":
case "--all-diff":
ad = true;
break;
case "-b":
case "--bare":
bare = true;
@@ -435,7 +440,7 @@ namespace SabreTools
// Merge, diff, and dedupe at least 2 DATs
else if (merge)
{
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old);
InitMergeDiff(inputs, name, desc, cat, version, author, ad, diff, dedup, bare, forceunpack, old);
}
logger.Close();
@@ -854,7 +859,7 @@ Make a selection:
private static void MergeDiffMenu()
{
string selection = "", input = "", name = "", desc = "", cat = "", version = "", author = "";
bool dedup = false, diff = false, bare = false, forceunpack = false, old = false;
bool ad = false, dedup = false, diff = false, bare = false, forceunpack = false, old = false;
while (selection.ToLowerInvariant() != "b")
{
Console.Clear();
@@ -869,12 +874,13 @@ Make a selection:
4) Category" + (cat != "" ? ":\t" + cat : "") + @"
5) Version" + (version != "" ? ":\t" + version : "") + @"
6) Author" + (author != "" ? ":\t" + author : "") + @"
7) " + (dedup ? "Don't dedup files in output" : "Dedup files in output") + @"
8) " + (diff ? "Only merge the input files" : "Diff the input files") + @"
9) " + (bare ? "Don't append the date to the name" : "Append the date to the name") + @"
10) " + (forceunpack ? "Remove 'forcepacking=\"unzip\"' from output" : "Add 'forcepacking=\"unzip\"' to output") + @"
11) " + (old ? "Enable XML output" : "Enable ClrMamePro output") + @"
12) Merge the DATs
7) " + (ad ? "Only output normal diff" : "Output all diff variants") + @"
8) " + (dedup ? "Don't dedup files in output" : "Dedup files in output") + @"
9) " + (diff ? "Only merge the input files" : "Diff the input files") + @"
10) " + (bare ? "Don't append the date to the name" : "Append the date to the name") + @"
11) " + (forceunpack ? "Remove 'forcepacking=\"unzip\"' from output" : "Add 'forcepacking=\"unzip\"' to output") + @"
12) " + (old ? "Enable XML output" : "Enable ClrMamePro output") + @"
13) Merge the DATs
B) Go back to the previous menu
");
Console.Write("Enter selection: ");
@@ -912,24 +918,27 @@ Make a selection:
author = Console.ReadLine();
break;
case "7":
dedup = !dedup;
ad = !ad;
break;
case "8":
diff = !diff;
dedup = !dedup;
break;
case "9":
bare = !bare;
diff = !diff;
break;
case "10":
forceunpack = !forceunpack;
bare = !bare;
break;
case "11":
old = !old;
forceunpack = !forceunpack;
break;
case "12":
old = !old;
break;
case "13":
Console.Clear();
List<string> inputs = new List<string>(input.Split(';'));
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old);
InitMergeDiff(inputs, name, desc, cat, version, author, ad, diff, dedup, bare, forceunpack, old);
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
@@ -1364,7 +1373,7 @@ Make a selection:
/// <param name="bare">True if the date should be omitted from the DAT, false otherwise</param>
/// <param name="forceunpack">True if the forcepacking="unzip" tag is to be added, false otherwise</param>
/// <param name="old">True if a old-style DAT should be output, false otherwise</param>
private static void InitMergeDiff(List<string> inputs, string name, string desc, string cat, string version, string author, bool diff, bool dedup, bool bare, bool forceunpack, bool old)
private static void InitMergeDiff(List<string> inputs, string name, string desc, string cat, string version, string author, bool ad, bool diff, bool dedup, bool bare, bool forceunpack, bool old)
{
// Make sure there are no folders in inputs
List<string> newInputs = new List<string>();
@@ -1383,7 +1392,7 @@ Make a selection:
}
}
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, logger);
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, ad, diff, dedup, bare, forceunpack, old, logger);
md.Process();
}