From 022fcc61ccc4595c83f7140c1b87ed5dffc533e2 Mon Sep 17 00:00:00 2001 From: Teras <35451366+Terasol@users.noreply.github.com> Date: Wed, 7 Dec 2022 23:01:57 +0100 Subject: [PATCH] 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. --- File_Format_Library/FileFormats/Archives/TRPAK/TRPAK.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/File_Format_Library/FileFormats/Archives/TRPAK/TRPAK.cs b/File_Format_Library/FileFormats/Archives/TRPAK/TRPAK.cs index 56a20baf..baf942a2 100644 --- a/File_Format_Library/FileFormats/Archives/TRPAK/TRPAK.cs +++ b/File_Format_Library/FileFormats/Archives/TRPAK/TRPAK.cs @@ -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}";