mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Rename OutputFormatFlag to OutputFormat
Since the original OutputFormat doesn't exist anymore, adding "Flag" to the var name isn't necessary
This commit is contained in:
@@ -62,7 +62,7 @@ namespace SabreTools
|
||||
FileName = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
Name = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
Description = Path.GetFileName(inputs[0]) + " Dir2Dat",
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace SabreTools.Helper
|
||||
/// Determines the DAT output format
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum OutputFormatFlag
|
||||
public enum OutputFormat
|
||||
{
|
||||
Xml = 0x001,
|
||||
ClrMamePro = 0x002,
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace SabreTools.Helper
|
||||
public ForceMerging ForceMerging;
|
||||
public ForceNodump ForceNodump;
|
||||
public ForcePacking ForcePacking;
|
||||
public OutputFormatFlag OutputFormatFlag;
|
||||
public OutputFormat OutputFormat;
|
||||
public bool MergeRoms;
|
||||
public List<HashData> Hashes;
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace SabreTools.Helper
|
||||
public ForceMerging ForceMerging;
|
||||
public ForceNodump ForceNodump;
|
||||
public ForcePacking ForcePacking;
|
||||
public OutputFormatFlag OutputFormatFlag;
|
||||
public OutputFormat OutputFormat;
|
||||
public bool MergeRoms;
|
||||
public Dictionary<string, List<Rom>> Files;
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = this.ForceMerging,
|
||||
ForceNodump = this.ForceNodump,
|
||||
ForcePacking = this.ForcePacking,
|
||||
OutputFormatFlag = this.OutputFormatFlag,
|
||||
OutputFormat = this.OutputFormat,
|
||||
MergeRoms = this.MergeRoms,
|
||||
Files = this.Files,
|
||||
UseGame = this.UseGame,
|
||||
@@ -406,7 +406,7 @@ namespace SabreTools.Helper
|
||||
ForceMerging = this.ForceMerging,
|
||||
ForceNodump = this.ForceNodump,
|
||||
ForcePacking = this.ForcePacking,
|
||||
OutputFormatFlag = this.OutputFormatFlag,
|
||||
OutputFormat = this.OutputFormat,
|
||||
MergeRoms = this.MergeRoms,
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
UseGame = this.UseGame,
|
||||
|
||||
@@ -115,13 +115,13 @@ namespace SabreTools
|
||||
else
|
||||
{
|
||||
// Create and open the output file for writing
|
||||
FileStream fs = File.Create(Style.CreateOutfileNames(Environment.CurrentDirectory, _datdata)[_datdata.OutputFormatFlag]);
|
||||
FileStream fs = File.Create(Style.CreateOutfileNames(Environment.CurrentDirectory, _datdata)[_datdata.OutputFormat]);
|
||||
sw = new StreamWriter(fs, Encoding.UTF8);
|
||||
sw.AutoFlush = true;
|
||||
}
|
||||
|
||||
// Write out the initial file header
|
||||
DatTools.WriteHeader(sw, _datdata.OutputFormatFlag, _datdata, _logger);
|
||||
DatTools.WriteHeader(sw, _datdata.OutputFormat, _datdata, _logger);
|
||||
|
||||
// Loop over each of the found paths, if any
|
||||
string lastparent = null;
|
||||
@@ -265,7 +265,7 @@ namespace SabreTools
|
||||
Rom rom = roms[i];
|
||||
|
||||
// If we're in a mode that doesn't allow for actual empty folders, add the blank info
|
||||
if ((_datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) == 0 && (_datdata.OutputFormatFlag & OutputFormatFlag.MissFile) == 0)
|
||||
if ((_datdata.OutputFormat & OutputFormat.SabreDat) == 0 && (_datdata.OutputFormat & OutputFormat.MissFile) == 0)
|
||||
{
|
||||
rom.Type = ItemType.Rom;
|
||||
rom.Name = "-";
|
||||
@@ -295,19 +295,19 @@ namespace SabreTools
|
||||
int last = 0;
|
||||
if (lastparent != null && lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormat, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
}
|
||||
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastparent == null || lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormat, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
}
|
||||
|
||||
// Write out the rom data
|
||||
if ((_datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) == 0 && (_datdata.OutputFormatFlag & OutputFormatFlag.MissFile) == 0)
|
||||
if ((_datdata.OutputFormat & OutputFormat.SabreDat) == 0 && (_datdata.OutputFormat & OutputFormat.MissFile) == 0)
|
||||
{
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormatFlag, rom, lastparent, _datdata, 0, _logger);
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormat, rom, lastparent, _datdata, 0, _logger);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Now write the final piece and close the output stream
|
||||
DatTools.WriteFooter(sw, _datdata.OutputFormatFlag, _datdata, 0, _logger);
|
||||
DatTools.WriteFooter(sw, _datdata.OutputFormat, _datdata, 0, _logger);
|
||||
sw.Close();
|
||||
|
||||
return true;
|
||||
@@ -369,9 +369,9 @@ namespace SabreTools
|
||||
}
|
||||
else
|
||||
{
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), "", 0, 0, _logger);
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormatFlag, rom, "", _datdata, 0, _logger);
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), "", 0, out last, _logger);
|
||||
DatTools.WriteStartGame(sw, _datdata.OutputFormat, rom, new List<string>(), "", 0, 0, _logger);
|
||||
DatTools.WriteRomData(sw, _datdata.OutputFormat, rom, "", _datdata, 0, _logger);
|
||||
DatTools.WriteEndGame(sw, _datdata.OutputFormat, rom, new List<string>(), new List<string>(), "", 0, out last, _logger);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -548,17 +548,17 @@ namespace SabreTools
|
||||
int last = 0;
|
||||
if (lastparent != null && lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteEndGame(sw, datdata.OutputFormatFlag, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
DatTools.WriteEndGame(sw, datdata.OutputFormat, rom, new List<string>(), new List<string>(), lastparent, 0, out last, _logger);
|
||||
}
|
||||
|
||||
// If we have a new game, output the beginning of the new item
|
||||
if (lastparent == null || lastparent.ToLowerInvariant() != rom.Machine.Name.ToLowerInvariant())
|
||||
{
|
||||
DatTools.WriteStartGame(sw, datdata.OutputFormatFlag, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
DatTools.WriteStartGame(sw, datdata.OutputFormat, rom, new List<string>(), lastparent, 0, last, _logger);
|
||||
}
|
||||
|
||||
// Write out the rom data
|
||||
DatTools.WriteRomData(sw, datdata.OutputFormatFlag, rom, lastparent, datdata, 0, _logger);
|
||||
DatTools.WriteRomData(sw, datdata.OutputFormat, rom, lastparent, datdata, 0, _logger);
|
||||
}
|
||||
_logger.User("File added: " + actualitem + Environment.NewLine);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace SabreTools
|
||||
Category = "The Wizard of DATz",
|
||||
Author = "The Wizard of DATz",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = (_old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
OutputFormat = (_old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
Files = dict,
|
||||
};
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace SabreTools
|
||||
Category = "SabreTools",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = (_old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
OutputFormat = (_old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
MergeRoms = true,
|
||||
};
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = netNew,
|
||||
};
|
||||
@@ -317,7 +317,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = unneeded,
|
||||
};
|
||||
@@ -330,7 +330,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = newMissing,
|
||||
};
|
||||
@@ -343,7 +343,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
@@ -417,7 +417,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
@@ -487,7 +487,7 @@ namespace SabreTools
|
||||
Category = "",
|
||||
Author = "SabreTools",
|
||||
ForcePacking = ForcePacking.None,
|
||||
OutputFormatFlag = OutputFormatFlag.Xml,
|
||||
OutputFormat = OutputFormat.Xml,
|
||||
MergeRoms = true,
|
||||
Files = have,
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace SabreTools.Helper
|
||||
datdata.FileName = (String.IsNullOrEmpty(datdata.FileName) ? (keepext ? Path.GetFileName(filename) : Path.GetFileNameWithoutExtension(filename)) : datdata.FileName);
|
||||
|
||||
// If the output type isn't set already, get the internal output type
|
||||
datdata.OutputFormatFlag = (datdata.OutputFormatFlag == 0 ? DatTools.GetOutputFormat(filename, logger) : datdata.OutputFormatFlag);
|
||||
datdata.OutputFormat = (datdata.OutputFormat == 0 ? DatTools.GetOutputFormat(filename, logger) : datdata.OutputFormat);
|
||||
|
||||
// Make sure there's a dictionary to read to
|
||||
if (datdata.Hashes == null)
|
||||
@@ -50,12 +50,12 @@ namespace SabreTools.Helper
|
||||
// Now parse the correct type of DAT
|
||||
switch (DatTools.GetOutputFormat(filename, logger))
|
||||
{
|
||||
case OutputFormatFlag.ClrMamePro:
|
||||
case OutputFormat.ClrMamePro:
|
||||
return ParseCMP(filename, sysid, srcid, datdata, logger, keep, clean);
|
||||
case OutputFormatFlag.RomCenter:
|
||||
case OutputFormat.RomCenter:
|
||||
return ParseRC(filename, sysid, srcid, datdata, logger, clean);
|
||||
case OutputFormatFlag.SabreDat:
|
||||
case OutputFormatFlag.Xml:
|
||||
case OutputFormat.SabreDat:
|
||||
case OutputFormat.Xml:
|
||||
return ParseXML(filename, sysid, srcid, datdata, logger, keep, clean, softlist);
|
||||
default:
|
||||
return datdata;
|
||||
|
||||
@@ -154,10 +154,10 @@ namespace SabreTools.Helper
|
||||
/// <param name="datdata">DAT information</param>
|
||||
/// <param name="overwrite">True if we ignore existing files (default), false otherwise</param>
|
||||
/// <returns>Dictionary of output formats mapped to file names</returns>
|
||||
public static Dictionary<OutputFormatFlag, string> CreateOutfileNames(string outDir, Dat datdata, bool overwrite = true)
|
||||
public static Dictionary<OutputFormat, string> CreateOutfileNames(string outDir, Dat datdata, bool overwrite = true)
|
||||
{
|
||||
// Create the output dictionary
|
||||
Dictionary<OutputFormatFlag, string> outfileNames = new Dictionary<OutputFormatFlag, string>();
|
||||
Dictionary<OutputFormat, string> outfileNames = new Dictionary<OutputFormat, string>();
|
||||
|
||||
// Double check the outdir for the end delim
|
||||
if (!outDir.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
@@ -166,41 +166,41 @@ namespace SabreTools.Helper
|
||||
}
|
||||
|
||||
// Get the extensions from the output type
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.Xml) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.Xml) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.Xml, CreateOutfileNamesHelper(outDir, ".xml", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.Xml, CreateOutfileNamesHelper(outDir, ".xml", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.ClrMamePro) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.ClrMamePro) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.ClrMamePro, CreateOutfileNamesHelper(outDir, ".dat", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.ClrMamePro, CreateOutfileNamesHelper(outDir, ".dat", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RomCenter) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.RomCenter) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RomCenter, CreateOutfileNamesHelper(outDir, ".rc.dat", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.RomCenter, CreateOutfileNamesHelper(outDir, ".rc.dat", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.DOSCenter) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.DOSCenter) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.DOSCenter, CreateOutfileNamesHelper(outDir, ".dc.dat", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.MissFile) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.MissFile) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.MissFile, CreateOutfileNamesHelper(outDir, ".txt", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.MissFile, CreateOutfileNamesHelper(outDir, ".txt", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.SabreDat) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.SabreDat) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.SabreDat, CreateOutfileNamesHelper(outDir, ".sd.xml", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.SabreDat, CreateOutfileNamesHelper(outDir, ".sd.xml", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpMD5) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.RedumpMD5) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpMD5, CreateOutfileNamesHelper(outDir, ".md5", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.RedumpMD5, CreateOutfileNamesHelper(outDir, ".md5", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpSHA1) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.RedumpSHA1) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpSHA1, CreateOutfileNamesHelper(outDir, ".sha1", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.RedumpSHA1, CreateOutfileNamesHelper(outDir, ".sha1", datdata, overwrite));
|
||||
};
|
||||
if ((datdata.OutputFormatFlag & OutputFormatFlag.RedumpSFV) != 0)
|
||||
if ((datdata.OutputFormat & OutputFormat.RedumpSFV) != 0)
|
||||
{
|
||||
outfileNames.Add(OutputFormatFlag.RedumpSFV, CreateOutfileNamesHelper(outDir, ".sfv", datdata, overwrite));
|
||||
outfileNames.Add(OutputFormat.RedumpSFV, CreateOutfileNamesHelper(outDir, ".sfv", datdata, overwrite));
|
||||
};
|
||||
|
||||
return outfileNames;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace SabreTools
|
||||
/// <param name="forcemerge">None, Split, Full</param>
|
||||
/// <param name="forcend">None, Obsolete, Required, Ignore</param>
|
||||
/// <param name="forcepack">None, Zip, Unzip</param>
|
||||
/// <param name="outputFormatFlag">Non-zero flag for output format, zero otherwise for default</param>
|
||||
/// <param name="outputFormat">Non-zero flag for output format, zero otherwise for default</param>
|
||||
/// /* Missfile-specific DAT info */
|
||||
/// <param name="usegame">True if games are to be used in output, false if roms are</param>
|
||||
/// <param name="prefix">Generic prefix to be added to each line</param>
|
||||
@@ -152,7 +152,7 @@ namespace SabreTools
|
||||
string forcemerge,
|
||||
string forcend,
|
||||
string forcepack,
|
||||
OutputFormatFlag outputFormatFlag,
|
||||
OutputFormat outputFormat,
|
||||
|
||||
/* Missfile-specific DAT info */
|
||||
bool usegame,
|
||||
@@ -303,7 +303,7 @@ namespace SabreTools
|
||||
ForceNodump = fn,
|
||||
ForcePacking = fp,
|
||||
MergeRoms = dedup,
|
||||
OutputFormatFlag = outputFormatFlag,
|
||||
OutputFormat = outputFormat,
|
||||
|
||||
UseGame = usegame,
|
||||
Prefix = prefix,
|
||||
@@ -316,7 +316,7 @@ namespace SabreTools
|
||||
XSV = tsv,
|
||||
};
|
||||
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outputFormatFlag, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
DatTools.UpdateParallel(inputs, userInputDat, outputFormat, outdir, merge, diffMode, cascade, inplace, skip, bare, clean, softlist,
|
||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace SabreTools
|
||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Author = author,
|
||||
ForcePacking = (forceunpack ? ForcePacking.Unzip : ForcePacking.None),
|
||||
OutputFormatFlag = (old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
OutputFormat = (old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
Romba = romba,
|
||||
Type = (superdat ? "SuperDAT" : ""),
|
||||
Files = new Dictionary<string, List<Rom>>(),
|
||||
@@ -437,7 +437,7 @@ namespace SabreTools
|
||||
Date = DateTime.Now.ToString("yyyy-MM-dd"),
|
||||
Author = author,
|
||||
ForcePacking = (forceunpack ? ForcePacking.Unzip : ForcePacking.None),
|
||||
OutputFormatFlag = (old ? OutputFormatFlag.ClrMamePro : OutputFormatFlag.Xml),
|
||||
OutputFormat = (old ? OutputFormat.ClrMamePro : OutputFormat.Xml),
|
||||
Romba = romba,
|
||||
Type = (superdat ? "SuperDAT" : ""),
|
||||
};
|
||||
|
||||
@@ -241,7 +241,7 @@ Make a selection:
|
||||
private static void ConvertMenu()
|
||||
{
|
||||
string selection = "", input = "", outdir = "";
|
||||
OutputFormatFlag outputFormatFlag = OutputFormatFlag.Xml;
|
||||
OutputFormat outputFormat = OutputFormat.Xml;
|
||||
while (selection.ToLowerInvariant() != "b")
|
||||
{
|
||||
Console.Clear();
|
||||
@@ -252,7 +252,7 @@ Make a selection:
|
||||
|
||||
1) File or folder to convert" + (input == "" ? "" : ":\n" + input) + @"
|
||||
2) New output folder" + (outdir == "" ? " (blank means source directory)" : ":\n" + outdir) + @"
|
||||
3) Current output type: " + (outputFormatFlag.ToString()) + @"
|
||||
3) Current output type: " + (outputFormat.ToString()) + @"
|
||||
4) Process file or folder
|
||||
B) Go back to the previous menu
|
||||
");
|
||||
@@ -287,16 +287,16 @@ Make a selection:
|
||||
switch (subsel)
|
||||
{
|
||||
case "1":
|
||||
outputFormatFlag = OutputFormatFlag.Xml;
|
||||
outputFormat = OutputFormat.Xml;
|
||||
break;
|
||||
case "2":
|
||||
outputFormatFlag = OutputFormatFlag.ClrMamePro;
|
||||
outputFormat = OutputFormat.ClrMamePro;
|
||||
break;
|
||||
case "3":
|
||||
outputFormatFlag = OutputFormatFlag.RomCenter;
|
||||
outputFormat = OutputFormat.RomCenter;
|
||||
break;
|
||||
case "4":
|
||||
outputFormatFlag = OutputFormatFlag.SabreDat;
|
||||
outputFormat = OutputFormat.SabreDat;
|
||||
break;
|
||||
default:
|
||||
subsel = "";
|
||||
@@ -310,14 +310,14 @@ Make a selection:
|
||||
temp.Add(input);
|
||||
/*
|
||||
InitUpdate(temp, "", "", "", "", "", "", "", "", "", "", "", "", false, "", "", "",
|
||||
(outputFormatFlag == OutputFormatFlag.ClrMamePro), (outputFormatFlag == OutputFormatFlag.MissFile), (outputFormatFlag == OutputFormatFlag.RomCenter),
|
||||
(outputFormatFlag == OutputFormatFlag.SabreDat), (outputFormatFlag == OutputFormatFlag.Xml), false, "", "", false, "", "", false, false, false,
|
||||
(outputFormat == OutputFormat.ClrMamePro), (outputFormat == OutputFormat.MissFile), (outputFormat == OutputFormat.RomCenter),
|
||||
(outputFormat == OutputFormat.SabreDat), (outputFormat == OutputFormat.Xml), false, "", "", false, "", "", false, false, false,
|
||||
false, false, false, false, false, "", "", "", -1, -1, -1, "", "", "", null, outdir, false, false);
|
||||
*/
|
||||
Console.Write("\nPress any key to continue...");
|
||||
Console.ReadKey();
|
||||
input = ""; outdir = "";
|
||||
outputFormatFlag = OutputFormatFlag.Xml;
|
||||
outputFormat = OutputFormat.Xml;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace SabreTools
|
||||
long sgt = -1,
|
||||
slt = -1,
|
||||
seq = -1;
|
||||
OutputFormatFlag outputFormatFlag = 0x0;
|
||||
OutputFormat outputFormat = 0x0;
|
||||
string addext = "",
|
||||
author = "",
|
||||
category = "",
|
||||
@@ -189,19 +189,19 @@ namespace SabreTools
|
||||
break;
|
||||
case "-cc":
|
||||
case "--convert-cmp":
|
||||
outputFormatFlag |= OutputFormatFlag.ClrMamePro;
|
||||
outputFormat |= OutputFormat.ClrMamePro;
|
||||
break;
|
||||
case "-cm":
|
||||
case "--convert-miss":
|
||||
outputFormatFlag |= OutputFormatFlag.MissFile;
|
||||
outputFormat |= OutputFormat.MissFile;
|
||||
break;
|
||||
case "-cr":
|
||||
case "--convert-rc":
|
||||
outputFormatFlag |= OutputFormatFlag.RomCenter;
|
||||
outputFormat |= OutputFormat.RomCenter;
|
||||
break;
|
||||
case "-cs":
|
||||
case "--convert-sd":
|
||||
outputFormatFlag |= OutputFormatFlag.SabreDat;
|
||||
outputFormat |= OutputFormat.SabreDat;
|
||||
break;
|
||||
case "-csv":
|
||||
case "--csv":
|
||||
@@ -209,7 +209,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-cx":
|
||||
case "--convert-xml":
|
||||
outputFormatFlag |= OutputFormatFlag.Xml;
|
||||
outputFormat |= OutputFormat.Xml;
|
||||
break;
|
||||
case "-clean":
|
||||
case "--clean":
|
||||
@@ -327,7 +327,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-oc":
|
||||
case "--output-cmp":
|
||||
outputFormatFlag |= OutputFormatFlag.ClrMamePro;
|
||||
outputFormat |= OutputFormat.ClrMamePro;
|
||||
break;
|
||||
case "-ol":
|
||||
case "--offmerge":
|
||||
@@ -335,31 +335,31 @@ namespace SabreTools
|
||||
break;
|
||||
case "-om":
|
||||
case "--output-miss":
|
||||
outputFormatFlag |= OutputFormatFlag.MissFile;
|
||||
outputFormat |= OutputFormat.MissFile;
|
||||
break;
|
||||
case "-omd5":
|
||||
case "--output-md5":
|
||||
outputFormatFlag |= OutputFormatFlag.RedumpMD5;
|
||||
outputFormat |= OutputFormat.RedumpMD5;
|
||||
break;
|
||||
case "-or":
|
||||
case "--output-rc":
|
||||
outputFormatFlag |= OutputFormatFlag.RomCenter;
|
||||
outputFormat |= OutputFormat.RomCenter;
|
||||
break;
|
||||
case "-os":
|
||||
case "--output-sd":
|
||||
outputFormatFlag |= OutputFormatFlag.SabreDat;
|
||||
outputFormat |= OutputFormat.SabreDat;
|
||||
break;
|
||||
case "-osfv":
|
||||
case "--output-sfv":
|
||||
outputFormatFlag |= OutputFormatFlag.RedumpSFV;
|
||||
outputFormat |= OutputFormat.RedumpSFV;
|
||||
break;
|
||||
case "-osha1":
|
||||
case "--output-sha1":
|
||||
outputFormatFlag |= OutputFormatFlag.RedumpSHA1;
|
||||
outputFormat |= OutputFormat.RedumpSHA1;
|
||||
break;
|
||||
case "-ox":
|
||||
case "--output-xml":
|
||||
outputFormatFlag |= OutputFormatFlag.Xml;
|
||||
outputFormat |= OutputFormat.Xml;
|
||||
break;
|
||||
case "-q":
|
||||
case "--quotes":
|
||||
@@ -623,7 +623,7 @@ namespace SabreTools
|
||||
|
||||
// If more than one switch is enabled, show the help screen
|
||||
if (!(add ^ datfromdir ^ datfromdirparallel ^ extsplit ^ generate ^ genall ^ hashsplit ^ import ^ listsrc ^ listsys ^
|
||||
(merge || diffMode != 0 || update || outputFormatFlag != 0 || tsv != null|| trim) ^ offlineMerge ^ rem ^ stats ^ typesplit))
|
||||
(merge || diffMode != 0 || update || outputFormat != 0 || tsv != null|| trim) ^ offlineMerge ^ rem ^ stats ^ typesplit))
|
||||
{
|
||||
_logger.Error("Only one feature switch is allowed at a time");
|
||||
Build.Help();
|
||||
@@ -632,7 +632,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// If a switch that requires a filename is set and no file is, show the help screen
|
||||
if (inputs.Count == 0 && (update || outputFormatFlag != 0 || tsv != null || extsplit || hashsplit || datfromdir
|
||||
if (inputs.Count == 0 && (update || outputFormat != 0 || tsv != null || extsplit || hashsplit || datfromdir
|
||||
|| datfromdirparallel || (merge || diffMode != 0) || stats || trim || typesplit))
|
||||
{
|
||||
_logger.Error("This feature requires at least one input");
|
||||
@@ -676,10 +676,10 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Convert, update, merge, diff, and filter a DAT or folder of DATs
|
||||
else if (update || tsv != null || outputFormatFlag != 0 || merge || diffMode != 0)
|
||||
else if (update || tsv != null || outputFormat != 0 || merge || diffMode != 0)
|
||||
{
|
||||
InitUpdate(inputs, filename, name, description, rootdir, category, version, date, author, email, homepage, url, comment, header,
|
||||
superdat, forcemerge, forcend, forcepack, outputFormatFlag, usegame, prefix,
|
||||
superdat, forcemerge, forcend, forcepack, outputFormat, usegame, prefix,
|
||||
postfix, quotes, repext, addext, datprefix, romba, tsv, merge, diffMode, cascade, inplace, skip, bare, gamename, romname,
|
||||
romtype, sgt, slt, seq, crc, md5, sha1, nodump, trim, single, root, outdir, clean, softlist, dedup, maxParallelism);
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ namespace SabreTools
|
||||
_matched.FileName = "fixDat_" + _matched.FileName;
|
||||
_matched.Name = "fixDat_" + _matched.Name;
|
||||
_matched.Description = "fixDat_" + _matched.Description;
|
||||
_matched.OutputFormatFlag = OutputFormatFlag.Xml;
|
||||
_matched.OutputFormat = OutputFormat.Xml;
|
||||
|
||||
// Now that all files are parsed, get only files found in directory
|
||||
bool found = false;
|
||||
@@ -476,7 +476,7 @@ namespace SabreTools
|
||||
_datdata.FileName = "fixDat_" + _datdata.FileName;
|
||||
_datdata.Name = "fixDat_" + _datdata.Name;
|
||||
_datdata.Description = "fixDat_" + _datdata.Description;
|
||||
_datdata.OutputFormatFlag = OutputFormatFlag.Xml;
|
||||
_datdata.OutputFormat = OutputFormat.Xml;
|
||||
DatTools.WriteDatfile(_datdata, "", _logger);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user