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