diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index c740db99..fc0515c5 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index 09a25ca6..062a8645 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index d22cd757..026f14c1 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs b/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs index d83b8cf5..e3630384 100644 --- a/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs +++ b/Switch_FileFormatsMain/FileFormats/Font/BFFNT.cs @@ -42,6 +42,8 @@ namespace FirstPlugin } FFNT bffnt; + public BNTX BinaryTextureFile; + public void Load(System.IO.Stream stream) { Text = FileName; @@ -58,6 +60,7 @@ namespace FirstPlugin var bntx = STFileLoader.OpenFileFormat("Sheet_0", Utils.CombineByteArray(tglp.SheetDataList.ToArray())); if (bntx != null) { + BinaryTextureFile = (BNTX)bntx; textureFolder.Nodes.Add((BNTX)bntx); } else diff --git a/Switch_FileFormatsMain/FileFormats/Texture/BNTX.cs b/Switch_FileFormatsMain/FileFormats/Texture/BNTX.cs index 86983951..20472cae 100644 --- a/Switch_FileFormatsMain/FileFormats/Texture/BNTX.cs +++ b/Switch_FileFormatsMain/FileFormats/Texture/BNTX.cs @@ -124,7 +124,16 @@ namespace FirstPlugin if (FileFormat == null) continue; - SearchBinary(FileFormat, folderDialog.SelectedPath, Extension); + if (FileFormat is SARC) + { + string ArchiveFilePath = Path.Combine(folderDialog.SelectedPath, Path.GetFileNameWithoutExtension(file)); + if (!Directory.Exists(ArchiveFilePath)) + Directory.CreateDirectory(ArchiveFilePath); + + SearchBinary(FileFormat, ArchiveFilePath, Extension); + } + else + SearchBinary(FileFormat, folderDialog.SelectedPath, Extension); } } } @@ -171,6 +180,17 @@ namespace FirstPlugin bntx.Unload(); } } + if (FileFormat is BFFNT) + { + var bntx = ((BFFNT)FileFormat).BinaryTextureFile; + if (bntx != null) + { + foreach (var texture in bntx.Textures.Values) + texture.Export(Path.Combine(Folder, $"{FileFormat.FileName}_{texture.Text}{Extension}")); + + bntx.Unload(); + } + } FileFormat.Unload(); GC.Collect(); diff --git a/Switch_FileFormatsMain/Main.cs b/Switch_FileFormatsMain/Main.cs index d6858aa8..f9868b26 100644 --- a/Switch_FileFormatsMain/Main.cs +++ b/Switch_FileFormatsMain/Main.cs @@ -335,7 +335,7 @@ namespace FirstPlugin Formats.Add(typeof(NCA)); Formats.Add(typeof(RARC)); Formats.Add(typeof(ME01)); - // Formats.Add(typeof(LM2_DICT)); + Formats.Add(typeof(LM2_DICT)); //Formats.Add(typeof(GFA)); //Unfinished wip formats not ready for use diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 2f3e89cc..51c53dd6 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ