mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add and use DepotInformation
This commit is contained in:
@@ -2045,7 +2045,7 @@ namespace SabreTools.Library.DatFiles
|
||||
});
|
||||
|
||||
// Now find all folders that are empty, if we are supposed to
|
||||
if (!Header.Romba && addBlanks)
|
||||
if (!Header.OutputDepot.IsActive && addBlanks)
|
||||
{
|
||||
List<string> empties = DirectoryExtensions.ListEmpty(basePath);
|
||||
Parallel.ForEach(empties, Globals.ParallelOptions, dir =>
|
||||
@@ -2119,8 +2119,8 @@ namespace SabreTools.Library.DatFiles
|
||||
bool addDate,
|
||||
bool copyFiles)
|
||||
{
|
||||
// Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes)
|
||||
if (Header.Romba)
|
||||
// Special case for if we are in Depot mode (all names are supposed to be SHA-1 hashes)
|
||||
if (Header.OutputDepot.IsActive)
|
||||
{
|
||||
GZipArchive gzarc = new GZipArchive(item);
|
||||
BaseFile baseFile = gzarc.GetTorrentGZFileInfo();
|
||||
@@ -2342,8 +2342,6 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Process the DAT and find all matches in input files and folders assuming they're a depot
|
||||
/// </summary>
|
||||
/// <param name="inputs">List of input files/folders to check</param>
|
||||
/// <param name="indepth">Positive value representing depth of input depot</param>
|
||||
/// <param name="outdepth">Positive value representing depth of output depot</param>
|
||||
/// <param name="outDir">Output directory to use to build to</param>
|
||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise</param>
|
||||
/// <param name="delete">True if input files should be deleted, false otherwise</param>
|
||||
@@ -2353,8 +2351,6 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <returns>True if rebuilding was a success, false otherwise</returns>
|
||||
public bool RebuildDepot(
|
||||
List<string> inputs,
|
||||
int indepth = 4,
|
||||
int outdepth = 4,
|
||||
string outDir = null,
|
||||
bool date = false,
|
||||
bool delete = false,
|
||||
@@ -2463,7 +2459,7 @@ namespace SabreTools.Library.DatFiles
|
||||
Globals.Logger.User($"Checking hash '{hash}'");
|
||||
|
||||
// Get the extension path for the hash
|
||||
string subpath = PathExtensions.GetRombaPath(hash, indepth);
|
||||
string subpath = PathExtensions.GetDepotPath(hash, Header.InputDepot.Depth);
|
||||
|
||||
// Find the first depot that includes the hash
|
||||
string foundpath = null;
|
||||
@@ -2495,9 +2491,9 @@ namespace SabreTools.Library.DatFiles
|
||||
// Otherwise, we rebuild that file to all locations that we need to
|
||||
bool usedInternally;
|
||||
if (Items[hash][0].ItemType == ItemType.Disk)
|
||||
usedInternally = RebuildIndividualFile(new Disk(fileinfo), foundpath, outDir, outdepth, date, inverse, outputFormat, updateDat, false /* isZip */);
|
||||
usedInternally = RebuildIndividualFile(new Disk(fileinfo), foundpath, outDir, date, inverse, outputFormat, updateDat, false /* isZip */);
|
||||
else
|
||||
usedInternally = RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, outdepth, date, inverse, outputFormat, updateDat, false /* isZip */);
|
||||
usedInternally = RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, date, inverse, outputFormat, updateDat, false /* isZip */);
|
||||
|
||||
// If we are supposed to delete the depot file, do so
|
||||
if (delete && usedInternally)
|
||||
@@ -2526,7 +2522,6 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="inputs">List of input files/folders to check</param>
|
||||
/// <param name="outDir">Output directory to use to build to</param>
|
||||
/// <param name="outdepth">Positive value representing depth of output depot</param>
|
||||
/// <param name="quickScan">True to enable external scanning of archives, false otherwise</param>
|
||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise</param>
|
||||
/// <param name="delete">True if input files should be deleted, false otherwise</param>
|
||||
@@ -2538,7 +2533,6 @@ namespace SabreTools.Library.DatFiles
|
||||
public bool RebuildGeneric(
|
||||
List<string> inputs,
|
||||
string outDir = null,
|
||||
int outdepth = 4,
|
||||
bool quickScan = false,
|
||||
bool date = false,
|
||||
bool delete = false,
|
||||
@@ -2626,7 +2620,7 @@ namespace SabreTools.Library.DatFiles
|
||||
if (File.Exists(input))
|
||||
{
|
||||
Globals.Logger.User($"Checking file: {input}");
|
||||
RebuildGenericHelper(input, outDir, outdepth, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles);
|
||||
RebuildGenericHelper(input, outDir, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles);
|
||||
}
|
||||
|
||||
// If the input is a directory
|
||||
@@ -2636,7 +2630,7 @@ namespace SabreTools.Library.DatFiles
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
Globals.Logger.User($"Checking file: {file}");
|
||||
RebuildGenericHelper(file, outDir, outdepth, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles);
|
||||
RebuildGenericHelper(file, outDir, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2663,7 +2657,6 @@ namespace SabreTools.Library.DatFiles
|
||||
/// </summary>
|
||||
/// <param name="file">Name of the file to process</param>
|
||||
/// <param name="outDir">Output directory to use to build to</param>
|
||||
/// <param name="outdepth">Positive value representing depth of output depot</param>
|
||||
/// <param name="quickScan">True to enable external scanning of archives, false otherwise</param>
|
||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise</param>
|
||||
/// <param name="delete">True if input files should be deleted, false otherwise</param>
|
||||
@@ -2674,7 +2667,6 @@ namespace SabreTools.Library.DatFiles
|
||||
private void RebuildGenericHelper(
|
||||
string file,
|
||||
string outDir,
|
||||
int outdepth,
|
||||
bool quickScan,
|
||||
bool date,
|
||||
bool delete,
|
||||
@@ -2702,7 +2694,7 @@ namespace SabreTools.Library.DatFiles
|
||||
else if (externalFileInfo.Type == FileType.None)
|
||||
externalDatItem = new Rom(externalFileInfo);
|
||||
|
||||
usedExternally = RebuildIndividualFile(externalDatItem, file, outDir, outdepth, date, inverse, outputFormat, updateDat, null /* isZip */);
|
||||
usedExternally = RebuildIndividualFile(externalDatItem, file, outDir, date, inverse, outputFormat, updateDat, null /* isZip */);
|
||||
|
||||
// Scan the file internally
|
||||
|
||||
@@ -2735,7 +2727,7 @@ namespace SabreTools.Library.DatFiles
|
||||
else if (internalFileInfo.Type == FileType.None)
|
||||
internalDatItem = new Rom(internalFileInfo);
|
||||
|
||||
usedExternally = RebuildIndividualFile(internalDatItem, file, outDir, outdepth, date, inverse, outputFormat, updateDat, null /* isZip */);
|
||||
usedExternally = RebuildIndividualFile(internalDatItem, file, outDir, date, inverse, outputFormat, updateDat, null /* isZip */);
|
||||
}
|
||||
// Otherwise, loop through the entries and try to match
|
||||
else
|
||||
@@ -2743,7 +2735,7 @@ namespace SabreTools.Library.DatFiles
|
||||
foreach (BaseFile entry in entries)
|
||||
{
|
||||
DatItem internalDatItem = DatItem.Create(entry);
|
||||
usedInternally |= RebuildIndividualFile(internalDatItem, file, outDir, outdepth, date, inverse, outputFormat, updateDat, !isTorrentGzip /* isZip */);
|
||||
usedInternally |= RebuildIndividualFile(internalDatItem, file, outDir, date, inverse, outputFormat, updateDat, !isTorrentGzip /* isZip */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2758,7 +2750,6 @@ namespace SabreTools.Library.DatFiles
|
||||
/// <param name="datItem">Information for the current file to rebuild from</param>
|
||||
/// <param name="file">Name of the file to process</param>
|
||||
/// <param name="outDir">Output directory to use to build to</param>
|
||||
/// <param name="outdepth">Positive value representing depth of output depot</param>
|
||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise</param>
|
||||
/// <param name="inverse">True if the DAT should be used as a filter instead of a template, false otherwise</param>
|
||||
/// <param name="outputFormat">Output format that files should be written to</param>
|
||||
@@ -2769,7 +2760,6 @@ namespace SabreTools.Library.DatFiles
|
||||
DatItem datItem,
|
||||
string file,
|
||||
string outDir,
|
||||
int outdepth,
|
||||
bool date,
|
||||
bool inverse,
|
||||
OutputFormat outputFormat,
|
||||
@@ -2811,7 +2801,7 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
// Get the proper output path
|
||||
if (outputFormat == OutputFormat.TorrentGzipRomba)
|
||||
outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1, outdepth));
|
||||
outDir = Path.Combine(outDir, PathExtensions.GetDepotPath(sha1, Header.OutputDepot.Depth));
|
||||
else
|
||||
outDir = Path.Combine(outDir, sha1 + ".gz");
|
||||
|
||||
@@ -2839,7 +2829,7 @@ namespace SabreTools.Library.DatFiles
|
||||
|
||||
// Get the proper output path
|
||||
if (outputFormat == OutputFormat.TorrentXZRomba)
|
||||
outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1, outdepth));
|
||||
outDir = Path.Combine(outDir, PathExtensions.GetDepotPath(sha1, Header.OutputDepot.Depth));
|
||||
else
|
||||
outDir = Path.Combine(outDir, sha1 + ".xz");
|
||||
|
||||
@@ -2912,7 +2902,7 @@ namespace SabreTools.Library.DatFiles
|
||||
Folder outputArchive = Folder.Create(outputFormat);
|
||||
|
||||
// Now rebuild to the output file
|
||||
outputArchive.Write(fileStream, outDir, (Rom)item, date: date, depth: outdepth);
|
||||
outputArchive.Write(fileStream, outDir, (Rom)item, date: date, depth: Header.OutputDepot.Depth);
|
||||
}
|
||||
|
||||
// Close the input stream
|
||||
@@ -2979,8 +2969,8 @@ namespace SabreTools.Library.DatFiles
|
||||
Folder outputArchive = Folder.Create(outputFormat);
|
||||
|
||||
// Now rebuild to the output file
|
||||
eitherSuccess |= outputArchive.Write(transformStream, outDir, (Rom)item, date: date, depth: outdepth);
|
||||
eitherSuccess |= outputArchive.Write(fileStream, outDir, (Rom)datItem, date: date, depth: outdepth);
|
||||
eitherSuccess |= outputArchive.Write(transformStream, outDir, (Rom)item, date: date, depth: Header.OutputDepot.Depth);
|
||||
eitherSuccess |= outputArchive.Write(fileStream, outDir, (Rom)datItem, date: date, depth: Header.OutputDepot.Depth);
|
||||
|
||||
// Now add the success of either rebuild
|
||||
rebuilt &= eitherSuccess;
|
||||
@@ -3003,10 +2993,9 @@ namespace SabreTools.Library.DatFiles
|
||||
/// Process the DAT and verify from the depots
|
||||
/// </summary>
|
||||
/// <param name="inputs">List of input directories to compare against</param>
|
||||
/// <param name="depth">Positive value representing depot depth, defaults to 4</param>
|
||||
/// <param name="outDir">Optional param for output directory</param>
|
||||
/// <returns>True if verification was a success, false otherwise</returns>
|
||||
public bool VerifyDepot(List<string> inputs, int depth = 4, string outDir = null)
|
||||
public bool VerifyDepot(List<string> inputs, string outDir = null)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -3042,7 +3031,7 @@ namespace SabreTools.Library.DatFiles
|
||||
Globals.Logger.User($"Checking hash '{hash}'");
|
||||
|
||||
// Get the extension path for the hash
|
||||
string subpath = PathExtensions.GetRombaPath(hash, depth);
|
||||
string subpath = PathExtensions.GetDepotPath(hash, Header.InputDepot.Depth);
|
||||
|
||||
// Find the first depot that includes the hash
|
||||
string foundpath = null;
|
||||
@@ -3723,8 +3712,8 @@ namespace SabreTools.Library.DatFiles
|
||||
string pre = CreatePrefixPostfix(item, true);
|
||||
string post = CreatePrefixPostfix(item, false);
|
||||
|
||||
// If we're in Romba mode, take care of that instead
|
||||
if (Header.Romba)
|
||||
// If we're in Depot mode, take care of that instead
|
||||
if (Header.OutputDepot.IsActive)
|
||||
{
|
||||
if (item.ItemType == ItemType.Rom)
|
||||
{
|
||||
@@ -3733,7 +3722,7 @@ namespace SabreTools.Library.DatFiles
|
||||
// We can only write out if there's a SHA-1
|
||||
if (!string.IsNullOrWhiteSpace(romItem.SHA1))
|
||||
{
|
||||
name = PathExtensions.GetRombaPath(romItem.SHA1, Header.RombaDepth).Replace('\\', '/');
|
||||
name = PathExtensions.GetDepotPath(romItem.SHA1, Header.OutputDepot.Depth).Replace('\\', '/');
|
||||
item.Name = $"{pre}{name}{post}";
|
||||
}
|
||||
}
|
||||
@@ -3744,7 +3733,7 @@ namespace SabreTools.Library.DatFiles
|
||||
// We can only write out if there's a SHA-1
|
||||
if (!string.IsNullOrWhiteSpace(diskItem.SHA1))
|
||||
{
|
||||
name = PathExtensions.GetRombaPath(diskItem.SHA1, Header.RombaDepth).Replace('\\', '/');
|
||||
name = PathExtensions.GetDepotPath(diskItem.SHA1, Header.OutputDepot.Depth).Replace('\\', '/');
|
||||
item.Name = pre + name + post;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,16 +211,16 @@ namespace SabreTools.Library.DatFiles
|
||||
public bool RemoveExtension { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Romba output mode
|
||||
/// Input depot information
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool Romba { get; set; }
|
||||
public DepotInformation InputDepot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Romba depth
|
||||
/// Output depot information
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public int RombaDepth { get; set; } = 4;
|
||||
public DepotInformation OutputDepot { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Output the machine name
|
||||
@@ -294,8 +294,8 @@ namespace SabreTools.Library.DatFiles
|
||||
AddExtension = this.AddExtension,
|
||||
RemoveExtension = this.RemoveExtension,
|
||||
GameName = this.GameName,
|
||||
Romba = this.Romba,
|
||||
RombaDepth = this.RombaDepth,
|
||||
InputDepot = this.InputDepot.Clone() as DepotInformation,
|
||||
OutputDepot = this.OutputDepot.Clone() as DepotInformation,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -358,8 +358,8 @@ namespace SabreTools.Library.DatFiles
|
||||
AddExtension = this.AddExtension,
|
||||
RemoveExtension = this.RemoveExtension,
|
||||
GameName = this.GameName,
|
||||
Romba = this.Romba,
|
||||
RombaDepth = this.RombaDepth,
|
||||
InputDepot = this.InputDepot.Clone() as DepotInformation,
|
||||
OutputDepot = this.OutputDepot.Clone() as DepotInformation,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -370,86 +370,86 @@ namespace SabreTools.Library.DatFiles
|
||||
public void ConditionalCopy(DatHeader datHeader)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.FileName))
|
||||
this.FileName = datHeader.FileName;
|
||||
FileName = datHeader.FileName;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Name))
|
||||
this.Name = datHeader.Name;
|
||||
Name = datHeader.Name;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Description))
|
||||
this.Description = datHeader.Description;
|
||||
Description = datHeader.Description;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.RootDir))
|
||||
this.RootDir = datHeader.RootDir;
|
||||
RootDir = datHeader.RootDir;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Category))
|
||||
this.Category = datHeader.Category;
|
||||
Category = datHeader.Category;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Version))
|
||||
this.Version = datHeader.Version;
|
||||
Version = datHeader.Version;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Date))
|
||||
this.Date = datHeader.Date;
|
||||
Date = datHeader.Date;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Author))
|
||||
this.Author = datHeader.Author;
|
||||
Author = datHeader.Author;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Email))
|
||||
this.Email = datHeader.Email;
|
||||
Email = datHeader.Email;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Homepage))
|
||||
this.Homepage = datHeader.Homepage;
|
||||
Homepage = datHeader.Homepage;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Url))
|
||||
this.Url = datHeader.Url;
|
||||
Url = datHeader.Url;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Comment))
|
||||
this.Comment = datHeader.Comment;
|
||||
Comment = datHeader.Comment;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.HeaderSkipper))
|
||||
this.HeaderSkipper = datHeader.HeaderSkipper;
|
||||
HeaderSkipper = datHeader.HeaderSkipper;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Type))
|
||||
this.Type = datHeader.Type;
|
||||
Type = datHeader.Type;
|
||||
|
||||
if (datHeader.ForceMerging != ForceMerging.None)
|
||||
this.ForceMerging = datHeader.ForceMerging;
|
||||
ForceMerging = datHeader.ForceMerging;
|
||||
|
||||
if (datHeader.ForceNodump != ForceNodump.None)
|
||||
this.ForceNodump = datHeader.ForceNodump;
|
||||
ForceNodump = datHeader.ForceNodump;
|
||||
|
||||
if (datHeader.ForcePacking != ForcePacking.None)
|
||||
this.ForcePacking = datHeader.ForcePacking;
|
||||
ForcePacking = datHeader.ForcePacking;
|
||||
|
||||
if (datHeader.DatFormat != 0x00)
|
||||
this.DatFormat = datHeader.DatFormat;
|
||||
DatFormat = datHeader.DatFormat;
|
||||
|
||||
if (datHeader.ExcludeFields != null)
|
||||
this.ExcludeFields = datHeader.ExcludeFields;
|
||||
ExcludeFields = datHeader.ExcludeFields;
|
||||
|
||||
this.OneRomPerGame = datHeader.OneRomPerGame;
|
||||
this.KeepEmptyGames = datHeader.KeepEmptyGames;
|
||||
this.SceneDateStrip = datHeader.SceneDateStrip;
|
||||
this.DedupeRoms = datHeader.DedupeRoms;
|
||||
//this.StripHash = datHeader.StripHash;
|
||||
OneRomPerGame = datHeader.OneRomPerGame;
|
||||
KeepEmptyGames = datHeader.KeepEmptyGames;
|
||||
SceneDateStrip = datHeader.SceneDateStrip;
|
||||
DedupeRoms = datHeader.DedupeRoms;
|
||||
//StripHash = datHeader.StripHash;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Prefix))
|
||||
this.Prefix = datHeader.Prefix;
|
||||
Prefix = datHeader.Prefix;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.Postfix))
|
||||
this.Postfix = datHeader.Postfix;
|
||||
Postfix = datHeader.Postfix;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.AddExtension))
|
||||
this.AddExtension = datHeader.AddExtension;
|
||||
AddExtension = datHeader.AddExtension;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(datHeader.ReplaceExtension))
|
||||
this.ReplaceExtension = datHeader.ReplaceExtension;
|
||||
ReplaceExtension = datHeader.ReplaceExtension;
|
||||
|
||||
this.RemoveExtension = datHeader.RemoveExtension;
|
||||
this.Romba = datHeader.Romba;
|
||||
this.RombaDepth = datHeader.RombaDepth;
|
||||
this.GameName = datHeader.GameName;
|
||||
this.Quotes = datHeader.Quotes;
|
||||
this.UseRomName = datHeader.UseRomName;
|
||||
RemoveExtension = datHeader.RemoveExtension;
|
||||
InputDepot = datHeader.InputDepot.Clone() as DepotInformation;
|
||||
OutputDepot = datHeader.OutputDepot.Clone() as DepotInformation;
|
||||
GameName = datHeader.GameName;
|
||||
Quotes = datHeader.Quotes;
|
||||
UseRomName = datHeader.UseRomName;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
60
SabreTools.Library/DatFiles/DepotInformation.cs
Normal file
60
SabreTools.Library/DatFiles/DepotInformation.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
|
||||
namespace SabreTools.Library.DatFiles
|
||||
{
|
||||
public class DepotInformation : ICloneable
|
||||
{
|
||||
/// <summary>
|
||||
/// Name or path of the Depot
|
||||
/// </summary>
|
||||
public string Name { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether to use this Depot or not
|
||||
/// </summary>
|
||||
public bool IsActive { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Depot byte-depth
|
||||
/// </summary>
|
||||
public int Depth { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="isActive">Set active state</param>
|
||||
/// <param name="depth">Set depth between 0 and SHA-1's byte length</param>
|
||||
public DepotInformation(bool isActive = false, int depth = 4)
|
||||
{
|
||||
IsActive = isActive;
|
||||
Depth = depth;
|
||||
|
||||
// Limit depth value
|
||||
if (Depth == Int32.MinValue)
|
||||
Depth = 4;
|
||||
else if (Depth < 0)
|
||||
Depth = 0;
|
||||
else if (Depth > Constants.SHA1Zero.Length)
|
||||
Depth = Constants.SHA1Zero.Length;
|
||||
}
|
||||
|
||||
#region Cloning
|
||||
|
||||
/// <summary>
|
||||
/// Clone the current object
|
||||
/// </summary>
|
||||
public object Clone()
|
||||
{
|
||||
return new DepotInformation
|
||||
{
|
||||
Name = this.Name,
|
||||
IsActive = this.IsActive,
|
||||
Depth = this.Depth,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace SabreTools.Library.DatFiles
|
||||
ProcessItemName(datItem, false, forceRomName: false);
|
||||
|
||||
// Romba mode automatically uses item name
|
||||
if (Header.Romba || Header.UseRomName)
|
||||
if (Header.OutputDepot.IsActive || Header.UseRomName)
|
||||
{
|
||||
sw.Write($"{datItem.GetField(Field.Name, Header.ExcludeFields)}\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user