mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-02 05:46:47 -05:00
Add unpacking files for main form
No need to open Tools for unpacking (packing obviously requires)
This commit is contained in:
@@ -188,6 +188,14 @@ private void openQuick(string path)
|
||||
{
|
||||
Util.Alert("RomFS unpacking not implemented.");
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult dr = Util.Prompt(MessageBoxButtons.YesNo, "Unpack sub-files?", "Cancel: Abort");
|
||||
if (dr == DialogResult.Cancel)
|
||||
return;
|
||||
bool recurse = dr == DialogResult.Yes;
|
||||
ToolsUI.openARC(path, pBar1, recurse);
|
||||
}
|
||||
}
|
||||
else // Directory
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ private void tabMain_DragDrop(object sender, DragEventArgs e)
|
||||
string path = files[0]; // open first D&D
|
||||
|
||||
if (sender == PB_Unpack)
|
||||
openARC(path);
|
||||
openARC(path, pBar1);
|
||||
else if (sender == PB_BCLIM)
|
||||
openIMG(path);
|
||||
else if (sender == PB_Repack)
|
||||
@@ -67,8 +67,8 @@ private void openIMG(string path)
|
||||
PB_BCLIM.BackgroundImage = img;
|
||||
}
|
||||
|
||||
private int threads;
|
||||
private void openARC(string path, bool recursing = false)
|
||||
internal static volatile int threads;
|
||||
internal static void openARC(string path, ProgressBar pBar1, bool recursing = false)
|
||||
{
|
||||
string newFolder = "";
|
||||
try
|
||||
@@ -101,7 +101,7 @@ private void openARC(string path, bool recursing = false)
|
||||
if (Directory.Exists(newFolder))
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(newFolder))
|
||||
openARC(file, true);
|
||||
openARC(file, pBar1, true);
|
||||
batchRenameExtension(newFolder);
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,7 @@ private void B_Reset_Click(object sender, EventArgs e)
|
||||
PB_BCLIM.Size = CLIMWindow;
|
||||
}
|
||||
|
||||
private void batchRenameExtension(string Folder)
|
||||
private static void batchRenameExtension(string Folder)
|
||||
{
|
||||
if (!Directory.Exists(Folder))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user