From 7203caf3db4a4ad02d1f9f26c4f2f70e5db748b7 Mon Sep 17 00:00:00 2001 From: Asval Date: Sun, 16 Jun 2019 23:07:02 +0200 Subject: [PATCH] fixed rare crashes --- FModel/Forms/AESManager.cs | 6 +++- FModel/Forms/About.Designer.cs | 4 +-- FModel/Forms/About.cs | 2 +- FModel/MainWindow.Designer.cs | 30 +++++++++---------- FModel/MainWindow.cs | 6 +++- FModel/MainWindow.resx | 2 +- .../Translations/AssetNameMap.cs | 4 +-- 7 files changed, 31 insertions(+), 23 deletions(-) diff --git a/FModel/Forms/AESManager.cs b/FModel/Forms/AESManager.cs index afeaf3a3..ed0c2559 100644 --- a/FModel/Forms/AESManager.cs +++ b/FModel/Forms/AESManager.cs @@ -49,7 +49,11 @@ namespace FModel.Forms private void OKButton_Click(object sender, EventArgs e) { - Properties.Settings.Default.AESKey = textBox2.Text.Substring(2).ToUpper(); + if (!string.IsNullOrWhiteSpace(textBox2.Text)) + { + Properties.Settings.Default.AESKey = textBox2.Text.Substring(2).ToUpper(); + } + else { Properties.Settings.Default.AESKey = ""; } DynamicKeysManager.AESEntries = new List(); for (int i = 0; i < ThePak.dynamicPaksList.Count; i++) diff --git a/FModel/Forms/About.Designer.cs b/FModel/Forms/About.Designer.cs index bc37b556..32286cbf 100644 --- a/FModel/Forms/About.Designer.cs +++ b/FModel/Forms/About.Designer.cs @@ -65,10 +65,10 @@ this.linkLabel2.AutoSize = true; this.linkLabel2.Location = new System.Drawing.Point(398, 91); this.linkLabel2.Name = "linkLabel2"; - this.linkLabel2.Size = new System.Drawing.Size(42, 13); + this.linkLabel2.Size = new System.Drawing.Size(43, 13); this.linkLabel2.TabIndex = 2; this.linkLabel2.TabStop = true; - this.linkLabel2.Text = "Donate"; + this.linkLabel2.Text = "Discord"; this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked); // // label1 diff --git a/FModel/Forms/About.cs b/FModel/Forms/About.cs index 352ba04b..91c016cf 100644 --- a/FModel/Forms/About.cs +++ b/FModel/Forms/About.cs @@ -19,7 +19,7 @@ namespace FModel.Forms private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - System.Diagnostics.Process.Start("https://paypal.me/AsvalD3SK1NG"); + System.Diagnostics.Process.Start("https://discordapp.com/invite/JmWvXKb"); } } } diff --git a/FModel/MainWindow.Designer.cs b/FModel/MainWindow.Designer.cs index 07952a28..e5cb5318 100644 --- a/FModel/MainWindow.Designer.cs +++ b/FModel/MainWindow.Designer.cs @@ -46,6 +46,7 @@ this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.filesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoSaveImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -70,7 +71,6 @@ this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker(); - this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.panel1.SuspendLayout(); @@ -196,7 +196,7 @@ // this.settingsToolStripMenuItem.Image = global::FModel.Properties.Resources.properties_16xLG; this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; - this.settingsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); + this.settingsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.settingsToolStripMenuItem.Text = "Settings"; this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); @@ -213,11 +213,19 @@ // searchToolStripMenuItem // this.searchToolStripMenuItem.Name = "searchToolStripMenuItem"; - this.searchToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1; + this.searchToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; this.searchToolStripMenuItem.Size = new System.Drawing.Size(216, 22); this.searchToolStripMenuItem.Text = "Search"; this.searchToolStripMenuItem.Click += new System.EventHandler(this.searchToolStripMenuItem_Click); // + // copySelectedFilePathToolStripMenuItem + // + this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem"; + this.copySelectedFilePathToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3; + this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(216, 22); + this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path"; + this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click); + // // imageToolStripMenuItem // this.imageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -232,7 +240,7 @@ // 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); // @@ -240,18 +248,18 @@ // 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); // @@ -464,14 +472,6 @@ this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork); this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted); // - // copySelectedFilePathToolStripMenuItem - // - this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem"; - this.copySelectedFilePathToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; - this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(216, 22); - this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path"; - this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click); - // // MainWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index ce654f99..62c4cca0 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -278,7 +278,11 @@ namespace FModel { try { - JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + ThePak.mainPaksList[i].thePak, Settings.Default.AESKey); + if (!string.IsNullOrWhiteSpace(Settings.Default.AESKey)) + { + JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + ThePak.mainPaksList[i].thePak, Settings.Default.AESKey); + } + else { break; } } catch (Exception) { diff --git a/FModel/MainWindow.resx b/FModel/MainWindow.resx index dd0273af..b4540a87 100644 --- a/FModel/MainWindow.resx +++ b/FModel/MainWindow.resx @@ -131,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABa - CAAAAk1TRnQBSQFMAgEBAgEAATABAQEwAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAATgBAQE4AQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/FModel/Methods/IconGenerator/Translations/AssetNameMap.cs b/FModel/Methods/IconGenerator/Translations/AssetNameMap.cs index b1504326..594c3cbc 100644 --- a/FModel/Methods/IconGenerator/Translations/AssetNameMap.cs +++ b/FModel/Methods/IconGenerator/Translations/AssetNameMap.cs @@ -62,8 +62,8 @@ namespace FModel { int index = listBeforeData.IndexOf(str); - Console.WriteLine("DName: " + listBeforeData[index - 3]); - Console.WriteLine("Description: " + listBeforeData[index - 1]); + //Console.WriteLine("DName: " + listBeforeData[index - 3]); + //Console.WriteLine("Description: " + listBeforeData[index - 1]); myNamespacesList.Add(listBeforeData[index - 3]); myNamespacesList.Add(listBeforeData[index - 1]);