1
0
mirror of synced 2024-12-03 03:27:23 +01:00

Fix the batch bntx creator to have a proper folder selector

This commit is contained in:
KillzXGaming 2020-04-23 15:27:47 -04:00
parent 45805b6272
commit 126f462213

View File

@ -101,18 +101,15 @@ namespace FirstPlugin
STToolStripItem[] toolExt = new STToolStripItem[1];
STToolStripItem[] newFileExt = new STToolStripItem[1];
STToolStripItem[] newFromFileExt = new STToolStripItem[1];
STToolStripItem[] newFromFileExt = new STToolStripItem[2];
public MenuExt()
{
toolExt[0] = new STToolStripItem("Textures");
toolExt[0].DropDownItems.Add(new STToolStripItem("Batch All (BNTX)", Export));
newFileExt[0] = new STToolStripItem("BNTX");
newFileExt[0].Click += New;
newFromFileExt[0] = new STToolStripItem("BNTX From Image");
newFromFileExt[0].Click += NewFromFile;
newFileExt[0] = new STToolStripItem("BNTX", New);
newFromFileExt[0] = new STToolStripItem("BNTX From Image", NewFromFile);
}
private void New(object sender, EventArgs args)
@ -143,6 +140,9 @@ namespace FirstPlugin
string folder = Path.GetDirectoryName(ofd.FileNames[0]);
FolderSelectDialog fod = new FolderSelectDialog();
if (fod.ShowDialog() == DialogResult.OK)
{
foreach (var tex in tempBntx.Textures.Values)
{
//Now make one for each texture and import each
@ -160,7 +160,8 @@ namespace FirstPlugin
bntx.RelocationTable = new RelocationTable();
bntx.Flag = 0;
bntx.Textures.Add(tex.Texture);
bntx.Save($"{Path.Combine(folder, tex.Text)}.bntx");
bntx.Save($"{Path.Combine(fod.SelectedPath, tex.Text)}.bntx");
}
}
tempBntx.Unload();