mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-22 20:43:09 +00:00
Batch export with archive directories and extract bntx textures from bffnt
This commit is contained in:
parent
7df5effdc2
commit
b3dacf8dbd
7 changed files with 25 additions and 2 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -124,6 +124,15 @@ namespace FirstPlugin
|
|||
if (FileFormat == null)
|
||||
continue;
|
||||
|
||||
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();
|
||||
|
|
|
@ -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
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue