mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-10 07:04:36 +00:00
Fix exporting multiple arrays
This commit is contained in:
parent
d50379879f
commit
14fa40193a
1 changed files with 16 additions and 23 deletions
|
@ -969,34 +969,27 @@ namespace Toolbox.Library
|
||||||
progressBar.Show();
|
progressBar.Show();
|
||||||
progressBar.Refresh();
|
progressBar.Refresh();
|
||||||
|
|
||||||
if (ArrayCount > 1 && !ExportSurfaceLevel && false)
|
if (ArrayCount > 1 && !ExportSurfaceLevel)
|
||||||
{
|
{
|
||||||
progressBar.Task = "Select dialog option... ";
|
string ext = Path.GetExtension(FileName);
|
||||||
|
|
||||||
var result = MessageBox.Show("Multiple image surfaces found! Would you like to export them all?", "Image Exporter",
|
int index = FileName.LastIndexOf('.');
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
|
string name = index == -1 ? FileName : FileName.Substring(0, index);
|
||||||
if (result == DialogResult.Yes)
|
|
||||||
|
for (int i = 0; i < ArrayCount; i++)
|
||||||
{
|
{
|
||||||
string ext = Path.GetExtension(FileName);
|
progressBar.Task = $"Decoding Surface [{i}] for image {Text}... ";
|
||||||
|
progressBar.Value = (i * 100) / (int)ArrayCount;
|
||||||
|
progressBar.Refresh();
|
||||||
|
|
||||||
int index = FileName.LastIndexOf('.');
|
Bitmap arrayBitMap = GetBitmap(i, 0);
|
||||||
string name = index == -1 ? FileName : FileName.Substring(0, index);
|
arrayBitMap.Save($"{name}_Slice_{i}_{ext}");
|
||||||
|
arrayBitMap.Dispose();
|
||||||
for (int i = 0; i < ArrayCount; i++)
|
|
||||||
{
|
|
||||||
progressBar.Task = $"Decoding Surface [{i}] for image {Text}... ";
|
|
||||||
progressBar.Value = (i * 100) / (int)ArrayCount;
|
|
||||||
progressBar.Refresh();
|
|
||||||
|
|
||||||
Bitmap arrayBitMap = GetBitmap(i, 0);
|
|
||||||
arrayBitMap.Save($"{name}_Slice_{i}_{ext}");
|
|
||||||
arrayBitMap.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
progressBar.Value = 100;
|
|
||||||
progressBar.Close();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
progressBar.Value = 100;
|
||||||
|
progressBar.Close();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
progressBar.Task = $"Decoding image {Text}... ";
|
progressBar.Task = $"Decoding image {Text}... ";
|
||||||
|
|
Loading…
Reference in a new issue