From 529e24a773ea3a572367cc38e7ddef5a26898838 Mon Sep 17 00:00:00 2001 From: AsvalGTA Date: Thu, 14 Mar 2019 01:33:08 +0100 Subject: [PATCH] fixed some crashes issue + new help window [WIP] --- FModel/App.config | 3 + .../{Button => Custom}/SplitButtonControl.cs | 7 +- FModel/FModel.csproj | 3 +- FModel/Help.Designer.cs | 157 ++++++++++++++++++ FModel/Help.cs | 5 + FModel/Options.Designer.cs | 34 +++- FModel/Options.cs | 2 + FModel/PAKWindow.Designer.cs | 100 +++++------ FModel/PAKWindow.cs | 128 +++++++++----- FModel/PAKWindow.resx | 5 +- FModel/Properties/Settings.Designer.cs | 12 ++ FModel/Properties/Settings.settings | 3 + FModel/Resources/folder.png | Bin 656 -> 0 bytes 13 files changed, 354 insertions(+), 105 deletions(-) rename FModel/{Button => Custom}/SplitButtonControl.cs (94%) delete mode 100644 FModel/Resources/folder.png diff --git a/FModel/App.config b/FModel/App.config index 8fae2515..65f4e78a 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -19,6 +19,9 @@ + + 0 + \ No newline at end of file diff --git a/FModel/Button/SplitButtonControl.cs b/FModel/Custom/SplitButtonControl.cs similarity index 94% rename from FModel/Button/SplitButtonControl.cs rename to FModel/Custom/SplitButtonControl.cs index 25a684b0..b6af5f36 100644 --- a/FModel/Button/SplitButtonControl.cs +++ b/FModel/Custom/SplitButtonControl.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.ComponentModel; using System.Drawing; using System.Drawing.Drawing2D; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace FModel diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 9d37baae..31219926 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -115,7 +115,7 @@ - + Component @@ -153,7 +153,6 @@ - diff --git a/FModel/Help.Designer.cs b/FModel/Help.Designer.cs index 9704a8c8..c63142b3 100644 --- a/FModel/Help.Designer.cs +++ b/FModel/Help.Designer.cs @@ -29,13 +29,157 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HelpWindow)); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); this.SuspendLayout(); // + // label1 + // + this.label1.Font = new System.Drawing.Font("Burbank Big Cd Bd", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.Color.Black; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(660, 29); + this.label1.TabIndex = 0; + this.label1.Text = "Useful Paths To Know"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + this.label2.Location = new System.Drawing.Point(12, 73); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(157, 16); + this.label2.TabIndex = 1; + this.label2.Text = "pakchunk0_s1-WindowsClient"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); + this.label3.Location = new System.Drawing.Point(175, 73); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(52, 16); + this.label3.TabIndex = 2; + this.label3.Text = "BR Items"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label4.Location = new System.Drawing.Point(270, 73); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(141, 16); + this.label4.TabIndex = 3; + this.label4.Text = "\\Athena\\Items\\Cosmetics\\"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label5.Location = new System.Drawing.Point(461, 73); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(150, 16); + this.label5.TabIndex = 4; + this.label5.Text = "Name, Description, Rarity, ..."; + this.label5.Click += new System.EventHandler(this.label5_Click); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); + this.label6.Location = new System.Drawing.Point(175, 89); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(59, 16); + this.label6.TabIndex = 5; + this.label6.Text = "BR Quests"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label7.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label7.Location = new System.Drawing.Point(270, 89); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(124, 16); + this.label7.TabIndex = 6; + this.label7.Text = "\\Athena\\Items\\Quests\\"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label8.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label8.Location = new System.Drawing.Point(461, 89); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(211, 16); + this.label8.TabIndex = 7; + this.label8.Text = "Description, Difficulty, Reward, Count, ..."; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); + this.label9.Location = new System.Drawing.Point(175, 105); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(88, 16); + this.label9.TabIndex = 8; + this.label9.Text = "BR Game Modes"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label10.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label10.Location = new System.Drawing.Point(270, 105); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(100, 16); + this.label10.TabIndex = 9; + this.label10.Text = "\\Athena\\Playlists\\"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Burbank Big Cd Bd", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(64))))); + this.label11.Location = new System.Drawing.Point(461, 105); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(206, 16); + this.label11.TabIndex = 10; + this.label11.Text = "Title, Description, Type, Max Players, ..."; + // // HelpWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(684, 211); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; @@ -44,9 +188,22 @@ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "FModel Help"; this.ResumeLayout(false); + this.PerformLayout(); } #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; } } \ No newline at end of file diff --git a/FModel/Help.cs b/FModel/Help.cs index c51e4a4d..7db1c7bf 100644 --- a/FModel/Help.cs +++ b/FModel/Help.cs @@ -16,5 +16,10 @@ namespace FModel { InitializeComponent(); } + + private void label5_Click(object sender, EventArgs e) + { + + } } } diff --git a/FModel/Options.Designer.cs b/FModel/Options.Designer.cs index 17d73390..747506f7 100644 --- a/FModel/Options.Designer.cs +++ b/FModel/Options.Designer.cs @@ -41,9 +41,12 @@ this.groupBox3 = new System.Windows.Forms.GroupBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.imgsPerRow = new System.Windows.Forms.NumericUpDown(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.imgsPerRow)).BeginInit(); this.SuspendLayout(); // // optionsOKButton @@ -113,11 +116,13 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.imgsPerRow); + this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.textBox3); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Location = new System.Drawing.Point(12, 144); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(270, 46); + this.groupBox1.Size = new System.Drawing.Size(414, 46); this.groupBox1.TabIndex = 10; this.groupBox1.TabStop = false; this.groupBox1.Text = "Merger"; @@ -162,6 +167,30 @@ this.label3.TabIndex = 3; this.label3.Text = "Input:"; // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(270, 22); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(88, 13); + this.label5.TabIndex = 10; + this.label5.Text = "Images Per Row:"; + // + // imgsPerRow + // + this.imgsPerRow.Location = new System.Drawing.Point(364, 19); + this.imgsPerRow.Maximum = new decimal(new int[] { + 20, + 0, + 0, + 0}); + this.imgsPerRow.Name = "imgsPerRow"; + this.imgsPerRow.ReadOnly = true; + this.imgsPerRow.Size = new System.Drawing.Size(44, 20); + this.imgsPerRow.TabIndex = 12; + this.imgsPerRow.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.imgsPerRow.ThousandsSeparator = true; + // // OptionsWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -184,6 +213,7 @@ this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.imgsPerRow)).EndInit(); this.ResumeLayout(false); } @@ -201,5 +231,7 @@ private System.Windows.Forms.GroupBox groupBox3; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.NumericUpDown imgsPerRow; } } \ No newline at end of file diff --git a/FModel/Options.cs b/FModel/Options.cs index a9a19ec5..5bd8946c 100644 --- a/FModel/Options.cs +++ b/FModel/Options.cs @@ -24,6 +24,7 @@ namespace FModel textBox1.Text = Properties.Settings.Default.ExtractOutput; textBox2.Text = Properties.Settings.Default.FortnitePAKs; textBox3.Text = Properties.Settings.Default.mergerFileName; + imgsPerRow.Value = Properties.Settings.Default.mergerImagesRow; PAKBefore = Properties.Settings.Default.FortnitePAKs; OutputBefore = Properties.Settings.Default.ExtractOutput; @@ -42,6 +43,7 @@ namespace FModel Properties.Settings.Default.ExtractOutput = textBox1.Text; Properties.Settings.Default.FortnitePAKs = textBox2.Text; Properties.Settings.Default.mergerFileName = textBox3.Text; + Properties.Settings.Default.mergerImagesRow = Decimal.ToInt32(imgsPerRow.Value); if (!Directory.Exists(Properties.Settings.Default.ExtractOutput)) Directory.CreateDirectory(Properties.Settings.Default.ExtractOutput); diff --git a/FModel/PAKWindow.Designer.cs b/FModel/PAKWindow.Designer.cs index 89f2260c..58a35acc 100644 --- a/FModel/PAKWindow.Designer.cs +++ b/FModel/PAKWindow.Designer.cs @@ -31,6 +31,7 @@ this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PAKWindow)); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.LoadButton = new FModel.SplitButton(); this.LoadContext = new System.Windows.Forms.ContextMenuStrip(this.components); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -42,8 +43,11 @@ this.TreeViewImageList = new System.Windows.Forms.ImageList(this.components); this.ItemIconPictureBox = new System.Windows.Forms.PictureBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.scintilla1 = new ScintillaNET.Scintilla(); + this.SaveImageButton = new FModel.SplitButton(); this.ImageContext = new System.Windows.Forms.ContextMenuStrip(this.components); this.OpenImageTS = new System.Windows.Forms.ToolStripMenuItem(); + this.ExtractAssetButton = new FModel.SplitButton(); this.ExtractAsset = new System.Windows.Forms.ContextMenuStrip(this.components); this.LoadDataTS = new System.Windows.Forms.ToolStripMenuItem(); this.SaveImageTS = new System.Windows.Forms.ToolStripMenuItem(); @@ -52,10 +56,6 @@ this.ConsoleRichTextBox = new System.Windows.Forms.RichTextBox(); this.FilterLabel = new System.Windows.Forms.Label(); this.FilterTextBox = new System.Windows.Forms.TextBox(); - this.scintilla1 = new ScintillaNET.Scintilla(); - this.SaveImageButton = new FModel.SplitButton(); - this.ExtractAssetButton = new FModel.SplitButton(); - this.LoadButton = new FModel.SplitButton(); this.groupBox1.SuspendLayout(); this.LoadContext.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ItemIconPictureBox)).BeginInit(); @@ -77,6 +77,18 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "PAK"; // + // LoadButton + // + this.LoadButton.Location = new System.Drawing.Point(296, 18); + this.LoadButton.Menu = this.LoadContext; + this.LoadButton.Name = "LoadButton"; + this.LoadButton.Size = new System.Drawing.Size(106, 23); + this.LoadButton.TabIndex = 12; + this.LoadButton.Text = " Load"; + this.LoadButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.LoadButton.UseVisualStyleBackColor = true; + this.LoadButton.Click += new System.EventHandler(this.LoadButton_Click); + // // LoadContext // this.LoadContext.ImageScalingSize = new System.Drawing.Size(18, 18); @@ -178,6 +190,28 @@ this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; // + // scintilla1 + // + this.scintilla1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.scintilla1.IndentationGuides = ScintillaNET.IndentView.Real; + this.scintilla1.Location = new System.Drawing.Point(6, 18); + this.scintilla1.Name = "scintilla1"; + this.scintilla1.ScrollWidth = 539; + this.scintilla1.Size = new System.Drawing.Size(560, 350); + this.scintilla1.TabIndex = 12; + // + // SaveImageButton + // + this.SaveImageButton.Location = new System.Drawing.Point(810, 635); + this.SaveImageButton.Menu = this.ImageContext; + this.SaveImageButton.Name = "SaveImageButton"; + this.SaveImageButton.Size = new System.Drawing.Size(112, 23); + this.SaveImageButton.TabIndex = 11; + this.SaveImageButton.Text = " Save Image"; + this.SaveImageButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.SaveImageButton.UseVisualStyleBackColor = true; + this.SaveImageButton.Click += new System.EventHandler(this.SaveImageButton_Click); + // // ImageContext // this.ImageContext.ImageScalingSize = new System.Drawing.Size(18, 18); @@ -194,6 +228,18 @@ this.OpenImageTS.Text = "Open Image"; this.OpenImageTS.Click += new System.EventHandler(this.OpenImageTS_Click); // + // ExtractAssetButton + // + this.ExtractAssetButton.Location = new System.Drawing.Point(810, 664); + this.ExtractAssetButton.Menu = this.ExtractAsset; + this.ExtractAssetButton.Name = "ExtractAssetButton"; + this.ExtractAssetButton.Size = new System.Drawing.Size(112, 23); + this.ExtractAssetButton.TabIndex = 10; + this.ExtractAssetButton.Text = " Extract Asset"; + this.ExtractAssetButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.ExtractAssetButton.UseVisualStyleBackColor = true; + this.ExtractAssetButton.Click += new System.EventHandler(this.ExtractAssetButton_Click); + // // ExtractAsset // this.ExtractAsset.ImageScalingSize = new System.Drawing.Size(18, 18); @@ -263,52 +309,6 @@ this.FilterTextBox.TabIndex = 5; this.FilterTextBox.TextChanged += new System.EventHandler(this.FilterTextBox_TextChanged); // - // scintilla1 - // - this.scintilla1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.scintilla1.IndentationGuides = ScintillaNET.IndentView.Real; - this.scintilla1.Location = new System.Drawing.Point(6, 18); - this.scintilla1.Name = "scintilla1"; - this.scintilla1.ScrollWidth = 539; - this.scintilla1.Size = new System.Drawing.Size(560, 350); - this.scintilla1.TabIndex = 12; - // - // SaveImageButton - // - this.SaveImageButton.Location = new System.Drawing.Point(810, 635); - this.SaveImageButton.Menu = this.ImageContext; - this.SaveImageButton.Name = "SaveImageButton"; - this.SaveImageButton.Size = new System.Drawing.Size(112, 23); - this.SaveImageButton.TabIndex = 11; - this.SaveImageButton.Text = " Save Image"; - this.SaveImageButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.SaveImageButton.UseVisualStyleBackColor = true; - this.SaveImageButton.Click += new System.EventHandler(this.SaveImageButton_Click); - // - // ExtractAssetButton - // - this.ExtractAssetButton.Location = new System.Drawing.Point(810, 664); - this.ExtractAssetButton.Menu = this.ExtractAsset; - this.ExtractAssetButton.Name = "ExtractAssetButton"; - this.ExtractAssetButton.Size = new System.Drawing.Size(112, 23); - this.ExtractAssetButton.TabIndex = 10; - this.ExtractAssetButton.Text = " Extract Asset"; - this.ExtractAssetButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.ExtractAssetButton.UseVisualStyleBackColor = true; - this.ExtractAssetButton.Click += new System.EventHandler(this.ExtractAssetButton_Click); - // - // LoadButton - // - this.LoadButton.Location = new System.Drawing.Point(296, 18); - this.LoadButton.Menu = this.LoadContext; - this.LoadButton.Name = "LoadButton"; - this.LoadButton.Size = new System.Drawing.Size(106, 23); - this.LoadButton.TabIndex = 12; - this.LoadButton.Text = " Load"; - this.LoadButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - this.LoadButton.UseVisualStyleBackColor = true; - this.LoadButton.Click += new System.EventHandler(this.LoadButton_Click); - // // PAKWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/FModel/PAKWindow.cs b/FModel/PAKWindow.cs index 6f412870..e4e4b332 100644 --- a/FModel/PAKWindow.cs +++ b/FModel/PAKWindow.cs @@ -39,6 +39,14 @@ namespace FModel SetWindowTheme(treeHandle, "explorer", null); } + [DllImport("wininet.dll")] + private extern static bool InternetGetConnectedState(out int description, int reservedValue); + public static bool IsInternetAvailable() + { + int description; + return InternetGetConnectedState(out description, 0); + } + public PAKWindow() { InitializeComponent(); @@ -79,6 +87,8 @@ namespace FModel private void PAKWindow_Load(object sender, EventArgs e) { + bool connection = IsInternetAvailable(); + SetTreeViewTheme(PAKTreeView.Handle); Properties.Settings.Default.ExtractAndSerialize = true; //SERIALIZE BY DEFAULT @@ -122,36 +132,56 @@ namespace FModel } AESKeyTextBox.Text = "0x" + File.ReadAllText("key.txt").ToUpper(); - string url = "https://pastebin.com/raw/0fbB05hc"; - long fileSize = 0; - HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); - using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) - using (Stream stream = response.GetResponseStream()) - using (StreamReader reader = new StreamReader(stream)) - { - fileSize = Convert.ToInt64(reader.ReadToEnd()); - } - - if (!File.Exists(docPath + "\\john-wick-parse-modded.exe")) + FileInfo info; + if (!File.Exists(docPath + "\\john-wick-parse-modded.exe") && connection == true) { WebClient Client = new WebClient(); Client.DownloadFile("https://dl.dropbox.com/s/9y5rv3hycin3w8r/john-wick-parse-modded.exe?dl=0", docPath + "\\john-wick-parse-modded.exe"); + info = new FileInfo(docPath + "\\john-wick-parse-modded.exe"); AppendText("[FileNotFoundException] ", Color.Red); AppendText("File ", Color.Black); AppendText("john-wick-parse-modded.exe ", Color.SteelBlue); AppendText("downloaded successfully", Color.Black, true); } - - FileInfo info = new FileInfo(docPath + "\\john-wick-parse-modded.exe"); - if (info.Length != fileSize) + else if (!File.Exists(docPath + "\\john-wick-parse-modded.exe") && connection == false) { - WebClient Client = new WebClient(); - Client.DownloadFile("https://dl.dropbox.com/s/9y5rv3hycin3w8r/john-wick-parse-modded.exe?dl=0", docPath + "\\john-wick-parse-modded.exe"); + AppendText("Can't download ", Color.Black); + AppendText("john-wick-parse-modded.exe", Color.SteelBlue); + AppendText(", no internet connection", Color.Black, true); + } - AppendText("[FileNeedUpdateException] ", Color.Red); - AppendText("john-wick-parse-modded.exe ", Color.SteelBlue); - AppendText("updated successfully", Color.Black, true); + if (File.Exists(docPath + "\\john-wick-parse-modded.exe")) + { + info = new FileInfo(docPath + "\\john-wick-parse-modded.exe"); + + string url = "https://pastebin.com/raw/0fbB05hc"; + long fileSize = 0; + if (connection == true) + { + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); + using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) + using (Stream stream = response.GetResponseStream()) + using (StreamReader reader = new StreamReader(stream)) + { + fileSize = Convert.ToInt64(reader.ReadToEnd()); + } + if (info.Length != fileSize) + { + WebClient Client = new WebClient(); + Client.DownloadFile("https://dl.dropbox.com/s/9y5rv3hycin3w8r/john-wick-parse-modded.exe?dl=0", docPath + "\\john-wick-parse-modded.exe"); + + AppendText("[FileNeedUpdateException] ", Color.Red); + AppendText("john-wick-parse-modded.exe ", Color.SteelBlue); + AppendText("updated successfully", Color.Black, true); + } + } + else + { + AppendText("Can't check if ", Color.Black); + AppendText("john-wick-parse-modded.exe ", Color.SteelBlue); + AppendText("needs to be updated", Color.Black, true); + } } ExtractAssetButton.Enabled = false; @@ -211,7 +241,7 @@ namespace FModel } if (node == null) { - node = new TreeNode(folder) { ImageIndex=0 }; + node = new TreeNode(folder); nodeList.Add(node); } if (path != "") @@ -241,33 +271,42 @@ namespace FModel private static string currentGUID; private async void LoadButton_Click(object sender, EventArgs e) { - PAKTreeView.Nodes.Clear(); - ItemsListBox.Items.Clear(); - File.WriteAllText("key.txt", AESKeyTextBox.Text.Substring(2)); - - currentPAK = PAKsComboBox.SelectedItem.ToString(); - LoadButton.Enabled = false; - await Task.Run(() => { - jwpmProcess("filelist \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + docPath + "\""); - }); - LoadButton.Enabled = true; - currentGUID = readPAKGuid(Properties.Settings.Default.FortnitePAKs + "\\" + PAKsComboBox.SelectedItem); - - if (!File.Exists(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt")) + if (PAKsComboBox.SelectedItem == null) { - AppendText("✗ ", Color.Red); - AppendText(" Can't read ", Color.Black); - AppendText(PAKsComboBox.SelectedItem.ToString(), Color.SteelBlue); - AppendText(" with this key", Color.Black, true); + AppendText("Please, select one of your ", Color.Black); + AppendText("Fortnite .PAK files ", Color.SteelBlue); + AppendText("to load.", Color.Black, true); } else { - PAKFileAsTXT = File.ReadAllLines(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt"); - File.Delete(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt"); + PAKTreeView.Nodes.Clear(); + ItemsListBox.Items.Clear(); + File.WriteAllText("key.txt", AESKeyTextBox.Text.Substring(2)); - for (int i = 0; i < PAKFileAsTXT.Length; i++) + currentPAK = PAKsComboBox.SelectedItem.ToString(); + LoadButton.Enabled = false; + await Task.Run(() => { + jwpmProcess("filelist \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + docPath + "\""); + }); + LoadButton.Enabled = true; + currentGUID = readPAKGuid(Properties.Settings.Default.FortnitePAKs + "\\" + PAKsComboBox.SelectedItem); + + if (!File.Exists(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt")) { - CreatePath(PAKTreeView.Nodes, PAKFileAsTXT[i].Replace(PAKFileAsTXT[i].Split('/').Last(), "")); + AppendText("✗ ", Color.Red); + AppendText(" Can't read ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.SteelBlue); + AppendText(" with this key", Color.Black, true); + } + else + { + PAKFileAsTXT = File.ReadAllLines(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt"); + File.Delete(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt"); + + for (int i = 0; i < PAKFileAsTXT.Length; i++) + { + CreatePath(PAKTreeView.Nodes, PAKFileAsTXT[i].Replace(PAKFileAsTXT[i].Split('/').Last(), "")); + } } } } @@ -1365,7 +1404,12 @@ namespace FModel selectedImages.Add(Image.FromFile(files)); } - var numperrow = 7; + if (Properties.Settings.Default.mergerImagesRow == 0) + { + Properties.Settings.Default.mergerImagesRow = 7; + Properties.Settings.Default.Save(); + } + int numperrow = Properties.Settings.Default.mergerImagesRow; var w = 530 * numperrow; int h = int.Parse(Math.Ceiling(double.Parse(selectedImages.Count.ToString()) / numperrow).ToString()) * 530; Bitmap bmp = new Bitmap(w - 8, h - 8); diff --git a/FModel/PAKWindow.resx b/FModel/PAKWindow.resx index 16353538..913151e6 100644 --- a/FModel/PAKWindow.resx +++ b/FModel/PAKWindow.resx @@ -117,9 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - 277, 17 @@ -134,7 +131,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACc - BwAAAk1TRnQBSQFMAgEBAgEAASABAAEgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + BwAAAk1TRnQBSQFMAgEBAgEAASgBAAEoAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/FModel/Properties/Settings.Designer.cs b/FModel/Properties/Settings.Designer.cs index 0e7c6624..a2193d08 100644 --- a/FModel/Properties/Settings.Designer.cs +++ b/FModel/Properties/Settings.Designer.cs @@ -69,5 +69,17 @@ namespace FModel.Properties { this["mergerFileName"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0")] + public int mergerImagesRow { + get { + return ((int)(this["mergerImagesRow"])); + } + set { + this["mergerImagesRow"] = value; + } + } } } diff --git a/FModel/Properties/Settings.settings b/FModel/Properties/Settings.settings index 0c997af9..b07ba364 100644 --- a/FModel/Properties/Settings.settings +++ b/FModel/Properties/Settings.settings @@ -14,5 +14,8 @@ + + 0 + \ No newline at end of file diff --git a/FModel/Resources/folder.png b/FModel/Resources/folder.png deleted file mode 100644 index 93c4d4e3692c265c5782d40826befad2760a0a4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 656 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dy%*9TgAsieWw;%dH0CG7CJR*x3 z7}%GAFr)0$>&8Gq$r9IylHmNblJdl&REF~Ma=pyF?Be9af>gcyqV(DCY@~pSUIqAs zxc&!%RiW$J;y!Io`>`W=duPnn&e(6;l7DPZ`LQMW$JW%Z+mg3+Mt$Fw{B3K}_pLyY zWFWb%JsK!-d2amHj;L>2lP}GQ19E}lTRWn+bwpoTly!Z10fY+_fiQq1Q16FJ8=>M| zaof5RcTGs!H6?e?lz8)lzJBoj z#Y6Wm9e!~4#KRls9^O6i=-#R4PcA)w^Y+El%dehaef{G4o0m71A%qutH1y6 zXEK>MM+sHk7d!XHfRo`DYj=^Ln8&p#cd8Wfx7MUCIhe0$JK?wZmEW^WIWl-nUJDr9 z$};=c@T_L(%|&Y)-gO7^GcVVkv(Dhukr+P>n;oJG=hzE5J~%S$sd>Q4E^l$*411bE zNag$0Yz=FE9enGv>yc%*pVlh2@`)t}i$xgid0QS9sQH<5eNcYz^Ogb!dtrT013RNM zZ`ozeJY{BSCN(LU>)v<#*wkw7rg8*n8v* c->mdKI;Vst0AdnKR{#J2