diff --git a/File_Format_Library/FileFormats/Archives/GFPAK.cs b/File_Format_Library/FileFormats/Archives/GFPAK.cs index a0f98566..2ce08118 100644 --- a/File_Format_Library/FileFormats/Archives/GFPAK.cs +++ b/File_Format_Library/FileFormats/Archives/GFPAK.cs @@ -24,6 +24,8 @@ namespace FirstPlugin public string FilePath { get; set; } public IFileInfo IFileInfo { get; set; } + static bool shownOodleError = false; + public Dictionary CategoryLookup { get { @@ -843,6 +845,15 @@ namespace FirstPlugin Padding = reader.ReadUInt32(); ulong FileOffset = reader.ReadUInt64(); + if (Type == CompressionType.Oodle) + { + if (!shownOodleError && !File.Exists($"{Runtime.ExecutableDir}\\oo2core_6_win64.dll")) + { + MessageBox.Show("'oo2core_6_win64.dll' not found in the executable folder! User must provide their own copy!"); + shownOodleError = true; + } + } + using (reader.TemporarySeek((long)FileOffset, SeekOrigin.Begin)) { if (Type == CompressionType.Lz4) @@ -852,7 +863,7 @@ namespace FirstPlugin } else if (Type == CompressionType.None) FileData = reader.ReadBytes((int)DecompressedFileSize); - else if (Type == CompressionType.Oodle) + else if (Type == CompressionType.Oodle && !shownOodleError) { FileData = reader.ReadBytes((int)CompressedFileSize); FileData = STLibraryCompression.Type_Oodle.Decompress(FileData, (int)DecompressedFileSize); diff --git a/Switch_Toolbox_Library/Compression/STLibraryCompression.cs b/Switch_Toolbox_Library/Compression/STLibraryCompression.cs index fd2657a2..75fe38b3 100644 --- a/Switch_Toolbox_Library/Compression/STLibraryCompression.cs +++ b/Switch_Toolbox_Library/Compression/STLibraryCompression.cs @@ -717,11 +717,6 @@ namespace Toolbox.Library.IO { public static byte[] Decompress(byte[] data, int decompressedSize) { - if (!File.Exists($"{Runtime.ExecutableDir}\\oo2core_6_win64.dll")) - { - MessageBox.Show("'oo2core_6_win64.dll' not found in the executable folder! User must provide their own copy!"); - return data; - } return Toolbox.Library.Compression.Oodle.Decompress(data, decompressedSize); }