[SabreTools, DatFile] Use "base" instead of "restore" for level split

This commit is contained in:
Matt Nadareski
2016-10-31 15:37:39 -07:00
parent c65d1cbdf8
commit dd3768cbbb
4 changed files with 15 additions and 10 deletions

View File

@@ -204,7 +204,7 @@ namespace SabreTools.Helper.Data
helptext.Add(" -ls, --lvl-split Split a SuperDAT or folder by internal path");
helptext.Add(" -out= Output directory");
helptext.Add(" -s, --short Use short output names");
helptext.Add(" -r, --restore Restore original filename to each output DAT");
helptext.Add(" -ba, --base Use source DAT as base name for outputs");
// Sort
helptext.Add(" -ss, --sort Sort input files by a set of DATs");

View File

@@ -5026,10 +5026,10 @@ namespace SabreTools.Helper.Dats
/// <param name="outDir">Name of the directory to write the DATs out to</param>
/// <param name="basepath">Parent path for replacement</param>
/// <param name="shortname">True if short names should be used, false otherwise</param>
/// <param name="restore">True if original filenames should be used as the base for output filename, false otherwise</param>
/// <param name="basedat">True if original filenames should be used as the base for output filename, false otherwise</param>
/// <param name="logger">Logger object for console and file writing</param>
/// <returns>True if split succeeded, false otherwise</returns>
public bool SplitByLevel(string outDir, string basepath, bool shortname, bool restore, Logger logger)
public bool SplitByLevel(string outDir, string basepath, bool shortname, bool basedat, Logger logger)
{
// Sanitize the basepath to be more predictable
basepath = (basepath.EndsWith(Path.DirectorySeparatorChar.ToString()) ? basepath : basepath + Path.DirectorySeparatorChar);
@@ -5052,7 +5052,7 @@ namespace SabreTools.Helper.Dats
if (tempDat.Name != null && tempDat.Name != Style.GetDirectoryName(key))
{
// Process and output the DAT
SplitByLevelHelper(tempDat, outDir, shortname, restore, logger);
SplitByLevelHelper(tempDat, outDir, shortname, basedat, logger);
// Reset the DAT for the next items
tempDat = (DatFile)CloneHeader();
@@ -5079,7 +5079,7 @@ namespace SabreTools.Helper.Dats
}
// Then we write the last DAT out since it would be skipped otherwise
SplitByLevelHelper(tempDat, outDir, shortname, restore, logger);
SplitByLevelHelper(tempDat, outDir, shortname, basedat, logger);
return true;
}