mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Make get format invocation simpler
This commit is contained in:
@@ -52,11 +52,13 @@ namespace SabreTools.DatFiles
|
|||||||
: Path.GetFileNameWithoutExtension(filename))
|
: Path.GetFileNameWithoutExtension(filename))
|
||||||
: datFile.Header.GetStringFieldValue(DatHeader.FileNameKey));
|
: datFile.Header.GetStringFieldValue(DatHeader.FileNameKey));
|
||||||
|
|
||||||
// If the output type isn't set already, get the internal output type
|
// If the output type isn't set already, try to derive one
|
||||||
DatFormat datFormat = GetDatFormat(filename);
|
DatFormat datFormat = datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey);
|
||||||
datFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey) == 0
|
if (datFormat == 0)
|
||||||
? datFormat
|
datFormat = GetDatFormat(filename);
|
||||||
: datFile.Header.GetFieldValue<DatFormat>(DatHeader.DatFormatKey));
|
|
||||||
|
// Set the output type back to the header and set bucketing
|
||||||
|
datFile.Header.SetFieldValue<DatFormat>(DatHeader.DatFormatKey, datFormat);
|
||||||
datFile.Items.SetBucketedBy(ItemKey.CRC); // Setting this because it can reduce issues later
|
datFile.Items.SetBucketedBy(ItemKey.CRC); // Setting this because it can reduce issues later
|
||||||
|
|
||||||
InternalStopwatch watch = new($"Parsing '{filename}' into internal DAT");
|
InternalStopwatch watch = new($"Parsing '{filename}' into internal DAT");
|
||||||
|
|||||||
Reference in New Issue
Block a user