From 4959f98bcd50b1cb0a1591387be89cad399d663a Mon Sep 17 00:00:00 2001 From: Asval Date: Mon, 8 Jul 2019 15:40:15 +0200 Subject: [PATCH] uncommon rarity but with less saturation + uplugin to json + added folder extract by right clicking on a folder --- FModel/MainWindow.Designer.cs | 48 +++++++++++++++------- FModel/MainWindow.cs | 73 ++++++++++++++++++++++++++++------ FModel/MainWindow.resx | 5 ++- FModel/Methods/VarApp.cs | 1 + FModel/Resources/U512.png | Bin 4025 -> 4298 bytes 5 files changed, 100 insertions(+), 27 deletions(-) diff --git a/FModel/MainWindow.Designer.cs b/FModel/MainWindow.Designer.cs index 82fe7f90..1c2e3c38 100644 --- a/FModel/MainWindow.Designer.cs +++ b/FModel/MainWindow.Designer.cs @@ -53,6 +53,8 @@ namespace FModel this.autoSaveImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.mergeImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); + this.tweetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutFModelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.panel1 = new System.Windows.Forms.Panel(); @@ -80,8 +82,8 @@ namespace FModel this.copyFilePathWithoutExtensionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.copyFileNameWithoutExtensionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsJSONToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); - this.tweetToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components); + this.extractFolderContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.panel1.SuspendLayout(); @@ -89,6 +91,7 @@ namespace FModel this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.contextMenuStrip1.SuspendLayout(); + this.contextMenuStrip2.SuspendLayout(); this.SuspendLayout(); // // statusStrip1 @@ -263,7 +266,7 @@ namespace FModel // saveImageToolStripMenuItem // this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem"; - this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(168, 22); this.saveImageToolStripMenuItem.Text = "Save Image"; this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click); // @@ -271,21 +274,33 @@ namespace FModel // this.autoSaveImagesToolStripMenuItem.CheckOnClick = true; this.autoSaveImagesToolStripMenuItem.Name = "autoSaveImagesToolStripMenuItem"; - this.autoSaveImagesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.autoSaveImagesToolStripMenuItem.Size = new System.Drawing.Size(168, 22); this.autoSaveImagesToolStripMenuItem.Text = "Auto Save Images"; // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(165, 6); // // mergeImagesToolStripMenuItem // this.mergeImagesToolStripMenuItem.Name = "mergeImagesToolStripMenuItem"; - this.mergeImagesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.mergeImagesToolStripMenuItem.Size = new System.Drawing.Size(168, 22); this.mergeImagesToolStripMenuItem.Text = "Merge Images"; this.mergeImagesToolStripMenuItem.Click += new System.EventHandler(this.mergeImagesToolStripMenuItem_Click); // + // toolStripSeparator4 + // + this.toolStripSeparator4.Name = "toolStripSeparator4"; + this.toolStripSeparator4.Size = new System.Drawing.Size(165, 6); + // + // tweetToolStripMenuItem + // + this.tweetToolStripMenuItem.Name = "tweetToolStripMenuItem"; + this.tweetToolStripMenuItem.Size = new System.Drawing.Size(168, 22); + this.tweetToolStripMenuItem.Text = "Tweet"; + this.tweetToolStripMenuItem.Click += new System.EventHandler(this.TweetToolStripMenuItem_Click); + // // helpToolStripMenuItem // this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -558,17 +573,19 @@ namespace FModel this.saveAsJSONToolStripMenuItem1.Text = "Save as JSON"; this.saveAsJSONToolStripMenuItem1.Click += new System.EventHandler(this.saveAsJSONToolStripMenuItem1_Click); // - // toolStripSeparator4 + // contextMenuStrip2 // - this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6); + this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.extractFolderContentsToolStripMenuItem}); + this.contextMenuStrip2.Name = "contextMenuStrip2"; + this.contextMenuStrip2.Size = new System.Drawing.Size(197, 48); // - // tweetToolStripMenuItem + // extractFolderContentsToolStripMenuItem // - this.tweetToolStripMenuItem.Name = "tweetToolStripMenuItem"; - this.tweetToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.tweetToolStripMenuItem.Text = "Tweet"; - this.tweetToolStripMenuItem.Click += new System.EventHandler(this.TweetToolStripMenuItem_Click); + this.extractFolderContentsToolStripMenuItem.Name = "extractFolderContentsToolStripMenuItem"; + this.extractFolderContentsToolStripMenuItem.Size = new System.Drawing.Size(196, 22); + this.extractFolderContentsToolStripMenuItem.Text = "Extract Folder Contents"; + this.extractFolderContentsToolStripMenuItem.Click += new System.EventHandler(this.ExtractFolderContentsToolStripMenuItem_Click); // // MainWindow // @@ -597,6 +614,7 @@ namespace FModel this.tableLayoutPanel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.contextMenuStrip1.ResumeLayout(false); + this.contextMenuStrip2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -656,6 +674,8 @@ namespace FModel private System.Windows.Forms.ToolStripMenuItem saveAsJSONToolStripMenuItem1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; private System.Windows.Forms.ToolStripMenuItem tweetToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip2; + private System.Windows.Forms.ToolStripMenuItem extractFolderContentsToolStripMenuItem; } } diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index 8650d37e..c8eeb4da 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -1018,9 +1018,18 @@ namespace FModel //EVENTS private async void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { - await Task.Run(() => { - GetFilesAndFill(e); - }); + if (e.Node != null && e.Button == MouseButtons.Right) + { + Checking.currentSelectedNodePartialPath = e.Node.FullPath + "\\"; + extractFolderContentsToolStripMenuItem.Text = "Extract " + e.Node.Text + " Folder Contents"; + contextMenuStrip2.Show(Cursor.Position); + } + else + { + await Task.Run(() => { + GetFilesAndFill(e); + }); + } } private async void FilterTextBox_TextChanged(object sender, EventArgs e) { @@ -1118,9 +1127,9 @@ namespace FModel })); } if (Checking.ExtractedFilePath.Contains(".locres") && !Checking.ExtractedFilePath.Contains("EngineOverrides")) - { SerializeLocRes(); - } + if (Checking.ExtractedFilePath.Contains(".uplugin")) + uPluginConvertToJson(Checking.ExtractedFilePath); } else { throw new ArgumentException("Error while extracting " + ThePak.CurrentUsedItem); } } @@ -1249,7 +1258,7 @@ namespace FModel DrawText.DrawTexts(theItem, g, specialMode); - if (autoSaveImagesToolStripMenuItem.Checked || updateModeToolStripMenuItem.Checked) + if (autoSaveImagesToolStripMenuItem.Checked || Checking.UmWorking) { bmp.Save(App.DefaultOutputPath + "\\Icons\\" + ThePak.CurrentUsedItem + ".png", ImageFormat.Png); @@ -1356,7 +1365,7 @@ namespace FModel } UpdateConsole(theItem.DisplayName.SourceString, Color.FromArgb(255, 66, 244, 66), "Success"); - if (autoSaveImagesToolStripMenuItem.Checked || updateModeToolStripMenuItem.Checked) + if (autoSaveImagesToolStripMenuItem.Checked || Checking.UmWorking) { Invoke(new Action(() => { @@ -1450,8 +1459,21 @@ namespace FModel /// private void ConvertToTtf(string file) { - File.Move(file, Path.ChangeExtension(file, ".ttf") ?? throw new InvalidOperationException()); - UpdateConsole(ThePak.CurrentUsedItem + " successfully converter to a font", Color.FromArgb(255, 66, 244, 66), "Success"); + if (File.Exists(Path.ChangeExtension(file, ".ttf"))) File.Delete(Path.ChangeExtension(file, ".ttf")); + + File.Move(file, Path.ChangeExtension(file, ".ttf")); + UpdateConsole(ThePak.CurrentUsedItem + " successfully converted to a font", Color.FromArgb(255, 66, 244, 66), "Success"); + } + private void uPluginConvertToJson(string file) + { + if (File.Exists(Path.ChangeExtension(file, ".json"))) File.Delete(Path.ChangeExtension(file, ".json")); + + File.Move(file, Path.ChangeExtension(file, ".json")); + Invoke(new Action(() => + { + scintilla1.Text = File.ReadAllText(Path.ChangeExtension(file, ".json")); + })); + UpdateConsole(ThePak.CurrentUsedItem + " successfully converter to JSON", Color.FromArgb(255, 66, 244, 66), "Success"); } //EVENTS @@ -1779,17 +1801,14 @@ namespace FModel { CopySelectedFile(); } - private void copyFileNameToolStripMenuItem_Click(object sender, EventArgs e) { CopySelectedFile(true); } - private void copyFilePathWithoutExtensionToolStripMenuItem_Click(object sender, EventArgs e) { CopySelectedFile(false, false); } - private void copyFileNameWithoutExtensionToolStripMenuItem_Click(object sender, EventArgs e) { CopySelectedFile(true, false); @@ -1804,6 +1823,36 @@ namespace FModel { SaveAsJSON(); } + + private void ExtractFolderContentsToolStripMenuItem_Click(object sender, EventArgs e) + { + _diffToExtract = new Dictionary(); + + for (int i = 0; i < PakAsTxt.Length; i++) + { + if (PakAsTxt[i].Contains(Checking.currentSelectedNodePartialPath.Replace("\\", "/"))) + { + string filename = Path.GetFileName(PakAsTxt[i]); + if (filename.Contains(".uasset") || filename.Contains(".uexp") || filename.Contains(".ubulk")) + { + if (!_diffToExtract.ContainsKey(filename.Substring(0, filename.LastIndexOf(".", StringComparison.Ordinal)))) + _diffToExtract.Add(filename.Substring(0, filename.LastIndexOf(".", StringComparison.Ordinal)), PakAsTxt[i]); + } + } + } + Checking.UmWorking = true; + + Invoke(new Action(() => + { + ExtractButton.Enabled = false; + OpenImageButton.Enabled = false; + StopButton.Enabled = true; + })); + if (backgroundWorker2.IsBusy != true) + { + backgroundWorker2.RunWorkerAsync(); + } + } #endregion } } diff --git a/FModel/MainWindow.resx b/FModel/MainWindow.resx index c1dfa462..79b6d856 100644 --- a/FModel/MainWindow.resx +++ b/FModel/MainWindow.resx @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABa - CAAAAk1TRnQBSQFMAgEBAgEAAbABAQGwAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAbgBAQG4AQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -178,6 +178,9 @@ 686, 17 + + 841, 17 + 63 diff --git a/FModel/Methods/VarApp.cs b/FModel/Methods/VarApp.cs index 5e26916f..08574379 100644 --- a/FModel/Methods/VarApp.cs +++ b/FModel/Methods/VarApp.cs @@ -69,6 +69,7 @@ namespace FModel public static string BackupFileName { get; set; } public static string ExtractedFilePath { get; set; } public static bool DifferenceFileExists = false; + public static string currentSelectedNodePartialPath { get; set; } } public struct BundleInfoEntry: IEquatable { diff --git a/FModel/Resources/U512.png b/FModel/Resources/U512.png index 1ccc9d6a30544236092ebfc82b67344ab2063f3b..3239cc96b31106cd510f8ee9fdad33af83f17c6e 100644 GIT binary patch literal 4298 zcmeI0TUb+97RUEF$pLaIaxqLnE7`2DwBM5@!3&OJC<<-h4aX`u5)I zzt>)C?cYA91Tj(e_);7IV83l^#NPox;Wvug*+5J9%|mejIG))Sv3aMYV!W@Tcyz00 zVM54i%4*}8h*9P;mv4}Vb8uF_0}eEZ;!e@;z?{&ummB5dt%)2rt% zSmOq)op~0E4gnQcr?w!#Sph&qI08P+M}cGWx8~bb*5@I-09r9^ZW)~w)t9%#aAdQ& zJG=7qX0QoA`z0bi_uzv=qUT}X>|w9Ef;uUzqDCKxMDZf*n=aR`|E6qA`!zE z`KbDm!;8!VViBf07e|Wbru&P~(p-e+?L-H#Fp0~(R_nOtVVZRKocHihF52chcOyZ~ zQ~jk|NZp91c6jYC6_CE_I&e4=nX0i!o0buMtCM)Z;HCh^!%ZA|ToNv>f7U*)T@}R) zQj*s;8=_V_gL96!LDXJj6*a7o`_&>-liKG$YdkOAaHM6pRZ7<1+ks3mw5u(#D@c>MYTR~s+!joHAs|0G8b~a~qRr^wSzy+? zinDa?81M_{8kV+ukq$~Y@qp}32>Oi+;skEIrJ!2(%`)IVS}Jhel{R#AB{faQ_rD3% zQ-|`=V<}$Pjmz0+=1k8_itJGwIamv|X)6VEc3>1^$j534KnI2V@9-{T7Mo6y0bZ4W zHa(S+N0p>yGJ=vMvc+&EixZyn^EAzC@FDiIxb@7^AjWLDkl&Nn!l8B{r1=eY@Y9}w zh2w$51{d{StV}Apvbf~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