Convert DAT type to a key

This commit is contained in:
Matt Nadareski
2024-03-10 21:54:07 -04:00
parent 8ef1ba6293
commit 1d1cbc3357
9 changed files with 93 additions and 101 deletions

View File

@@ -102,7 +102,9 @@ namespace SabreTools.DatTools
// If the output type isn't set already, get the internal output type
DatFormat currentPathFormat = GetDatFormat(currentPath);
datFile.Header.DatFormat = datFile.Header.DatFormat == 0 ? currentPathFormat : datFile.Header.DatFormat;
datFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey) == 0
? currentPathFormat
: datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey));
datFile.Items.SetBucketedBy(ItemKey.CRC); // Setting this because it can reduce issues later
InternalStopwatch watch = new($"Parsing '{currentPath}' into internal DAT");