From 6ee56c8306a5ad83e895b587bf005837a1e908ae Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 8 Nov 2015 21:57:05 -0800 Subject: [PATCH] Add LZSS/BLZ decompression by dropping on ToolsUI Tools UI now has the same functionality as GARCTool. --- pk3DS/Tools/ToolsUI.Designer.cs | 4 ++-- pk3DS/Tools/ToolsUI.cs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pk3DS/Tools/ToolsUI.Designer.cs b/pk3DS/Tools/ToolsUI.Designer.cs index cc8b942..57815aa 100644 --- a/pk3DS/Tools/ToolsUI.Designer.cs +++ b/pk3DS/Tools/ToolsUI.Designer.cs @@ -57,9 +57,9 @@ private void InitializeComponent() this.L_DARCMini.AutoSize = true; this.L_DARCMini.Location = new System.Drawing.Point(9, 9); this.L_DARCMini.Name = "L_DARCMini"; - this.L_DARCMini.Size = new System.Drawing.Size(145, 13); + this.L_DARCMini.Size = new System.Drawing.Size(294, 13); this.L_DARCMini.TabIndex = 1; - this.L_DARCMini.Text = "GARC, DARC && Mini Unpack"; + this.L_DARCMini.Text = "GARC, DARC && Mini Unpack (CTRL to Skip Decompression)"; // // CHK_PNG // diff --git a/pk3DS/Tools/ToolsUI.cs b/pk3DS/Tools/ToolsUI.cs index e8d875b..bf396db 100644 --- a/pk3DS/Tools/ToolsUI.cs +++ b/pk3DS/Tools/ToolsUI.cs @@ -41,6 +41,11 @@ private void tabMain_DragDrop(object sender, DragEventArgs e) openIMG(path); else if (sender == PB_Repack) saveARC(path); + else try { + CTR.LZSS.Decompress(path, Path.Combine(Path.GetDirectoryName(path), "dec_" + Path.GetFileName(path))); + } catch { try { + new Thread(() => { threads++; new CTR.BLZCoder(new[] { "-d", path }, pBar1); threads--; Util.Alert("Decompressed!"); }).Start(); + } catch { Util.Error("Unable to process file."); } } } private void dropHover(object sender, EventArgs e) {