1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Fixes for TRPAK implementation (#554)

Fix wrong detection of GFMDL files. wont be detected as Fileformat for finding File Extensions for unknown Hashes.
Don't add the detected file extension to known file names.
Added Quick Access folder for .tranm files for feature parity with GFPAK.
This commit is contained in:
Teras 2022-12-07 23:01:57 +01:00 committed by GitHub
parent 314a880213
commit 022fcc61cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ namespace FirstPlugin
{ ".trmsh", "Models" },
{ ".trmtr", "Models" },
{ ".trskl", "Models" },
{ ".tranm", "Animations" },
};
}
}
@ -142,6 +143,8 @@ namespace FirstPlugin
folder = new TextureFolder(this, "Textures");
if (folderName == "Models")
folder = new GFPAK.QuickAccessFileFolder("Models");
if (folderName == "Animations")
folder = new GFPAK.QuickAccessFileFolder("Animations");
node.Nodes.Add(folder);
folders.Add(folderName, folder);
@ -198,7 +201,7 @@ namespace FirstPlugin
{
fileFormat.FileName = FileName;
if (fileFormat.Identify(new MemoryStream(f)))
if (fileFormat.Identify(new MemoryStream(f)) && fileFormat.GetType() != typeof(GFBMDL))
{
return fileFormat.Extension[0].Replace("*", "");
}
@ -243,7 +246,7 @@ namespace FirstPlugin
{
if (fileHashName != "")
{
return $"{fileHashName}{ext}";
return $"{fileHashName}";
}
else
return $"{fileHash.ToString("X")}{ext}";