diff --git a/FModel/App.config b/FModel/App.config index 1d63336a..5274fd67 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -37,6 +37,9 @@ False + + + \ No newline at end of file diff --git a/FModel/Options.Designer.cs b/FModel/Options.Designer.cs index 8124662a..a919243b 100644 --- a/FModel/Options.Designer.cs +++ b/FModel/Options.Designer.cs @@ -44,12 +44,14 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox6 = new System.Windows.Forms.CheckBox(); this.checkBox5 = new System.Windows.Forms.CheckBox(); this.checkBox4 = new System.Windows.Forms.CheckBox(); this.checkBox3 = new System.Windows.Forms.CheckBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.label6 = new System.Windows.Forms.Label(); - this.checkBox6 = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.imgsPerRow)).BeginInit(); this.groupBox2.SuspendLayout(); @@ -60,7 +62,7 @@ // optionsOKButton // this.optionsOKButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.optionsOKButton.Location = new System.Drawing.Point(475, 218); + this.optionsOKButton.Location = new System.Drawing.Point(475, 245); this.optionsOKButton.Name = "optionsOKButton"; this.optionsOKButton.Size = new System.Drawing.Size(97, 21); this.optionsOKButton.TabIndex = 1; @@ -128,7 +130,7 @@ 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, 193); + this.groupBox1.Location = new System.Drawing.Point(12, 220); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(414, 46); this.groupBox1.TabIndex = 10; @@ -201,6 +203,8 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.comboBox1); + this.groupBox4.Controls.Add(this.label7); this.groupBox4.Controls.Add(this.checkBox6); this.groupBox4.Controls.Add(this.checkBox5); this.groupBox4.Controls.Add(this.checkBox4); @@ -209,11 +213,21 @@ this.groupBox4.Controls.Add(this.label6); this.groupBox4.Location = new System.Drawing.Point(12, 144); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(560, 43); + this.groupBox4.Size = new System.Drawing.Size(560, 70); this.groupBox4.TabIndex = 13; this.groupBox4.TabStop = false; this.groupBox4.Text = "Icon Creation"; // + // checkBox6 + // + this.checkBox6.AutoSize = true; + this.checkBox6.Location = new System.Drawing.Point(476, 19); + this.checkBox6.Name = "checkBox6"; + this.checkBox6.Size = new System.Drawing.Size(78, 17); + this.checkBox6.TabIndex = 14; + this.checkBox6.Text = "Challenges"; + this.checkBox6.UseVisualStyleBackColor = true; + // // checkBox5 // this.checkBox5.AutoSize = true; @@ -263,21 +277,31 @@ this.label6.TabIndex = 0; this.label6.Text = "Supported Folders:"; // - // checkBox6 + // label7 // - this.checkBox6.AutoSize = true; - this.checkBox6.Location = new System.Drawing.Point(476, 19); - this.checkBox6.Name = "checkBox6"; - this.checkBox6.Size = new System.Drawing.Size(78, 17); - this.checkBox6.TabIndex = 14; - this.checkBox6.Text = "Challenges"; - this.checkBox6.UseVisualStyleBackColor = true; + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 45); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(57, 13); + this.label7.TabIndex = 15; + this.label7.Text = "File Name:"; + // + // comboBox1 + // + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)", + "displayName (i.e. Recruit)"}); + this.comboBox1.Location = new System.Drawing.Point(69, 42); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(485, 21); + this.comboBox1.TabIndex = 16; // // OptionsWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(584, 249); + this.ClientSize = new System.Drawing.Size(584, 277); this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); @@ -325,5 +349,7 @@ private System.Windows.Forms.CheckBox checkBox4; private System.Windows.Forms.CheckBox checkBox5; private System.Windows.Forms.CheckBox checkBox6; + private System.Windows.Forms.ComboBox comboBox1; + private System.Windows.Forms.Label label7; } } \ No newline at end of file diff --git a/FModel/Options.cs b/FModel/Options.cs index 7e32dc2c..a59fb76c 100644 --- a/FModel/Options.cs +++ b/FModel/Options.cs @@ -30,6 +30,7 @@ namespace FModel checkBox3.Checked = Properties.Settings.Default.createIconForConsumablesWeapons; checkBox4.Checked = Properties.Settings.Default.createIconForTraps; checkBox6.Checked = Properties.Settings.Default.createIconForChallenges; + comboBox1.SelectedItem = Properties.Settings.Default.IconName; PAKBefore = Properties.Settings.Default.FortnitePAKs; OutputBefore = Properties.Settings.Default.ExtractOutput; @@ -85,7 +86,14 @@ namespace FModel { Properties.Settings.Default.createIconForChallenges = false; } - + if (comboBox1.SelectedItem == null) + { + Properties.Settings.Default.IconName = "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)"; + } + else + { + Properties.Settings.Default.IconName = comboBox1.SelectedItem.ToString(); + } Properties.Settings.Default.ExtractOutput = textBox1.Text; Properties.Settings.Default.FortnitePAKs = textBox2.Text; diff --git a/FModel/PAKWindow.cs b/FModel/PAKWindow.cs index 2b1c1078..8d08ccca 100644 --- a/FModel/PAKWindow.cs +++ b/FModel/PAKWindow.cs @@ -1517,14 +1517,28 @@ namespace FModel ItemIconPictureBox.Image = bmp; if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving icons set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //Cosmetics if (Properties.Settings.Default.createIconForConsumablesWeapons == true && (IDParser[iii].ExportType.Contains("FortWeaponRangedItemDefinition") || IDParser[iii].ExportType.Contains("FortWeaponMeleeItemDefinition"))) @@ -1785,14 +1799,28 @@ namespace FModel ItemIconPictureBox.Image = bmp; if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving icons set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //Consumables & Weapons if (Properties.Settings.Default.createIconForTraps == true && (IDParser[iii].ExportType.Contains("FortTrapItemDefinition") || IDParser[iii].ExportType.Contains("FortContextTrapItemDefinition"))) @@ -2017,14 +2045,28 @@ namespace FModel ItemIconPictureBox.Image = bmp; if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving icons set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //Traps if (Properties.Settings.Default.createIconForVariants == true && (IDParser[iii].ExportType == "FortVariantTokenType")) @@ -2271,14 +2313,28 @@ namespace FModel ItemIconPictureBox.Image = bmp; if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving icons set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //CosmeticVariantTokens } @@ -2436,14 +2492,28 @@ namespace FModel if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving icons set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //ASSET IS A CHALLENGE => if (IDParser[ii].ExportType == "Texture2D") @@ -2521,14 +2591,28 @@ namespace FModel if (((ToolStripMenuItem)ExtractAsset.Items[1]).Checked == true) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + AppendText("Auto saving images set to ", Color.Black); AppendText("True", Color.Green, true); - ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png); + ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + nameToSave + ".png", ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); - AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true); + AppendText(docPath + "\\Generated Icons\\" + nameToSave + ".png", Color.SteelBlue, true); } } //ASSET IS A TEXTURE => LOAD TEXTURE if (IDParser[ii].ExportType == "SoundWave") @@ -2644,16 +2728,30 @@ namespace FModel { if (ItemIconPictureBox.Image != null) { + string nameToSave; + if (Properties.Settings.Default.IconName == null || Properties.Settings.Default.IconName == "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)") + { + nameToSave = currentItem; + } + else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") + { + nameToSave = ItemName; + } + else + { + nameToSave = currentItem; + } + SaveFileDialog saveTheDialog = new SaveFileDialog(); saveTheDialog.Title = "Save Icon"; saveTheDialog.Filter = "PNG Files (*.png)|*.png"; saveTheDialog.InitialDirectory = docPath + "\\Generated Icons\\"; - saveTheDialog.FileName = currentItem; + saveTheDialog.FileName = nameToSave; if (saveTheDialog.ShowDialog() == DialogResult.OK) { ItemIconPictureBox.Image.Save(saveTheDialog.FileName, ImageFormat.Png); AppendText("✔ ", Color.Green); - AppendText(currentItem, Color.DarkRed); + AppendText(nameToSave, Color.DarkRed); AppendText(" successfully saved to ", Color.Black); AppendText(saveTheDialog.FileName, Color.SteelBlue, true); } diff --git a/FModel/Properties/Settings.Designer.cs b/FModel/Properties/Settings.Designer.cs index 2cf2fd36..5742c303 100644 --- a/FModel/Properties/Settings.Designer.cs +++ b/FModel/Properties/Settings.Designer.cs @@ -141,5 +141,17 @@ namespace FModel.Properties { this["createIconForChallenges"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string IconName { + get { + return ((string)(this["IconName"])); + } + set { + this["IconName"] = value; + } + } } } diff --git a/FModel/Properties/Settings.settings b/FModel/Properties/Settings.settings index 0947947c..d53b67f4 100644 --- a/FModel/Properties/Settings.settings +++ b/FModel/Properties/Settings.settings @@ -32,5 +32,8 @@ False + + + \ No newline at end of file diff --git a/README.md b/README.md index cd40a3df..26ac9cb1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # FModel -[![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases/tag/1.2) +[![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases) [![](https://img.shields.io/badge/License-GPL-blue.svg?logo=gnu)](https://github.com/iAmAsval/FModel/blob/master/LICENSE) [![](https://img.shields.io/badge/Twitter-@AsvalFN-1da1f2.svg?logo=twitter)](https://twitter.com/AsvalFN) [![](https://img.shields.io/badge/Discord-Need%20Help%3F-7289da.svg?logo=discord)](https://discord.gg/JmWvXKb) @@ -12,7 +12,7 @@ ### Prerequisites [.NET Framework 4.6.1](https://dotnet.microsoft.com/download/dotnet-framework-runtime/net461) ### Download -[![](https://img.shields.io/badge/Releases-Executable-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases) +[![](https://img.shields.io/badge/Release-Executable-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/tag/1.3) ### How does it works **1.** Once you start the executable, you'll be asked to set your path to your Fortnite .PAK files. Meanwhile a `FModel` subfolder will be created in your `Documents` folder and it'll automatically download the latest version of the modded Fortnite Asset Parser in this subfolder. ![](https://i.imgur.com/sO6G6Vy.gif) @@ -47,14 +47,14 @@ This project is mainly based on what [UModel](https://github.com/gildor2/UModel) I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instead if you wanna use something made professionnaly. ## TODO -- [ ] Improve speed +- [x] Improve speed - [x] Multithreading - Need improvements - [x] Filter for the items ListBox - [x] Quest viewer or something -- [ ] Load all paks +- [x] Load all paks - [ ] Load only difference between 2 paks version - [ ] Custom watermark option on icons -- [ ] Choose between extracted filename or displayName for icons file name +- [x] Choose between extracted filename or displayName for icons file name - [ ] Stop button while extracting - [ ] Support for meshes - [ ] Support for animations