diff --git a/FModel/App.config b/FModel/App.config index 037ed097..747661a3 100644 --- a/FModel/App.config +++ b/FModel/App.config @@ -52,6 +52,9 @@ False + + False + \ No newline at end of file diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 277507ad..b0c1dd5a 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -108,6 +108,7 @@ PAKWindow.cs + @@ -147,6 +148,7 @@ + diff --git a/FModel/Options.Designer.cs b/FModel/Options.Designer.cs index 3f5db04c..3bf76ed1 100644 --- a/FModel/Options.Designer.cs +++ b/FModel/Options.Designer.cs @@ -44,6 +44,7 @@ this.textBox2 = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.checkBox8 = new System.Windows.Forms.CheckBox(); this.checkBox7 = new System.Windows.Forms.CheckBox(); this.filenameLabel = new System.Windows.Forms.Label(); this.trackBar1 = new System.Windows.Forms.TrackBar(); @@ -214,6 +215,7 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.checkBox8); this.groupBox4.Controls.Add(this.checkBox7); this.groupBox4.Controls.Add(this.filenameLabel); this.groupBox4.Controls.Add(this.trackBar1); @@ -237,6 +239,17 @@ this.groupBox4.TabStop = false; this.groupBox4.Text = "Icon Creation"; // + // checkBox8 + // + this.checkBox8.AutoSize = true; + this.checkBox8.Location = new System.Drawing.Point(6, 79); + this.checkBox8.Name = "checkBox8"; + this.checkBox8.Size = new System.Drawing.Size(177, 17); + this.checkBox8.TabIndex = 26; + this.checkBox8.Text = "Use Featured Image If Available"; + this.checkBox8.UseVisualStyleBackColor = true; + this.checkBox8.CheckedChanged += new System.EventHandler(this.checkBox8_CheckedChanged); + // // checkBox7 // this.checkBox7.AutoSize = true; @@ -461,5 +474,6 @@ private System.Windows.Forms.TrackBar trackBar2; private System.Windows.Forms.Label filenameLabel; private System.Windows.Forms.CheckBox checkBox7; + private System.Windows.Forms.CheckBox checkBox8; } } \ No newline at end of file diff --git a/FModel/Options.cs b/FModel/Options.cs index b95a7164..9b90605a 100644 --- a/FModel/Options.cs +++ b/FModel/Options.cs @@ -96,23 +96,43 @@ namespace FModel comboBox1.SelectedItem = Properties.Settings.Default.IconName; trackBar2.Value = Properties.Settings.Default.wSize; trackBar1.Value = Properties.Settings.Default.wOpacity; + checkBox8.Checked = Properties.Settings.Default.loadFeaturedImage; button1.Enabled = Properties.Settings.Default.isWatermark; trackBar1.Enabled = Properties.Settings.Default.isWatermark; trackBar2.Enabled = Properties.Settings.Default.isWatermark; - if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + if (Properties.Settings.Default.loadFeaturedImage == false) { - filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); - Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); - Graphics g = Graphics.FromImage(bmp); - - Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); - var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); - g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); - wPictureBox.Image = bmp; + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + + wPictureBox.Image = bmp; + } + } + if (Properties.Settings.Default.loadFeaturedImage == true) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); + + Bitmap bmp = new Bitmap(Properties.Resources.wTemplateF); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)Properties.Settings.Default.wOpacity / 100); + g.DrawImage(ResizeImage(opacityImage, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize), (522 - Properties.Settings.Default.wSize) / 2, (522 - Properties.Settings.Default.wSize) / 2, Properties.Settings.Default.wSize, Properties.Settings.Default.wSize); + + wPictureBox.Image = bmp; + } } PAKBefore = Properties.Settings.Default.FortnitePAKs; @@ -177,6 +197,14 @@ namespace FModel { Properties.Settings.Default.isWatermark = false; } + if (checkBox8.Checked == true) + { + Properties.Settings.Default.loadFeaturedImage = true; + } + if (checkBox8.Checked == false) + { + Properties.Settings.Default.loadFeaturedImage = false; + } if (comboBox1.SelectedItem == null) { Properties.Settings.Default.IconName = "Selected Item Name (i.e. CID_001_Athena_Commando_F_Default)"; @@ -225,48 +253,102 @@ namespace FModel Properties.Settings.Default.Save(); filenameLabel.Text = "File Name: " + Path.GetFileName(Properties.Settings.Default.wFilename); - if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + if (checkBox8.Checked == false) { - Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); - Graphics g = Graphics.FromImage(bmp); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); - Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); - g.DrawImage(ResizeImage(watermark, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); - wPictureBox.Image = bmp; + wPictureBox.Image = bmp; + } + } + if (checkBox8.Checked == true) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplateF); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + } } } } private void trackBar2_ValueChanged(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + if (checkBox8.Checked == false) { - Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); - Graphics g = Graphics.FromImage(bmp); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); - Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); - var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); - g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); - wPictureBox.Image = bmp; - wPictureBox.Refresh(); + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } + } + if (checkBox8.Checked == true) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplateF); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } } } private void trackBar1_ValueChanged(object sender, EventArgs e) { - if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + if (checkBox8.Checked == false) { - Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); - Graphics g = Graphics.FromImage(bmp); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); - Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); - var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); - g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); - wPictureBox.Image = bmp; - wPictureBox.Refresh(); + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } + } + if (checkBox8.Checked == true) + { + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplateF); + Graphics g = Graphics.FromImage(bmp); + + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + + wPictureBox.Image = bmp; + wPictureBox.Refresh(); + } } } @@ -285,5 +367,33 @@ namespace FModel trackBar2.Enabled = true; } } + + private void checkBox8_CheckedChanged(object sender, EventArgs e) + { + if (checkBox8.Checked == false) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplate); + Graphics g = Graphics.FromImage(bmp); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + } + wPictureBox.Image = bmp; + } + if (checkBox8.Checked == true) + { + Bitmap bmp = new Bitmap(Properties.Resources.wTemplateF); + Graphics g = Graphics.FromImage(bmp); + if (!string.IsNullOrEmpty(Properties.Settings.Default.wFilename)) + { + Image watermark = Image.FromFile(Properties.Settings.Default.wFilename); + var opacityImage = SetImageOpacity(watermark, (float)trackBar1.Value / 100); + g.DrawImage(ResizeImage(opacityImage, trackBar2.Value, trackBar2.Value), (522 - trackBar2.Value) / 2, (522 - trackBar2.Value) / 2, trackBar2.Value, trackBar2.Value); + } + wPictureBox.Image = bmp; + } + } } } diff --git a/FModel/PAKWindow.cs b/FModel/PAKWindow.cs index ff0f5525..635b109d 100644 --- a/FModel/PAKWindow.cs +++ b/FModel/PAKWindow.cs @@ -1,4 +1,5 @@ using FModel.Items; +using FModel.Parser.Featured; using FModel.Challenges; using FModel.Quest; using Newtonsoft.Json; @@ -1181,6 +1182,7 @@ namespace FModel } public static string currentItem; + public static bool wasFeatured; private async void ExtractAssetButton_Click(object sender, EventArgs e) { Stopwatch stopWatch = new Stopwatch(); @@ -1299,508 +1301,1178 @@ namespace FModel getItemRarity(IDParser[iii], g); string itemIconPath = string.Empty; + string catalogName = string.Empty; - if (IDParser[iii].HeroDefinition != null) + if (Properties.Settings.Default.loadFeaturedImage == false) { - var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath)) + wasFeatured = false; + if (IDParser[iii].HeroDefinition != null) { - AppendText("✔ ", Color.Green); - AppendText("Extracting ", Color.Black); - AppendText(IDParser[iii].HeroDefinition, Color.DarkRed, true); - - if (isAllPAKs == false) - { - await Task.Run(() => - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { - try - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].HeroDefinition] + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); - } - catch (KeyNotFoundException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); - } - }); - } - filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - try - { - if (filesPath != null) + var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) { AppendText("✔ ", Color.Green); - AppendText(IDParser[iii].HeroDefinition, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); - try + AppendText("Extracting ", Color.Black); + AppendText(IDParser[iii].HeroDefinition, Color.DarkRed, true); + + if (isAllPAKs == false) { await Task.Run(() => { - jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); }); - var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].HeroDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); - var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); - File.Delete(filesJSON2); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].HeroDefinition] + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + try + { + if (filesPath != null) + { AppendText("✔ ", Color.Green); AppendText(IDParser[iii].HeroDefinition, Color.DarkRed); - AppendText(" successfully serialized", Color.Black, true); - - var IDParser2 = ItemsIdParser.FromJson(json2); - for (int i1 = 0; i1 < IDParser2.Length; i1++) - { - if (IDParser2[i1].LargePreviewImage != null) - { - string textureFile = Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).LastIndexOf('.')); - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" detected as a ", Color.Black); - AppendText("Texture2D file", Color.SteelBlue, true); - - var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath2)) - { - if (currentGUID != "0-0-0-0") - { - await Task.Run(() => - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - else - { - if (isAllPAKs == false) - { - await Task.Run(() => - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { - try - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - catch (KeyNotFoundException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); - } - }); - } - filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - } - try - { - if (filesPath2 != null) - { - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); - - itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; - if (!File.Exists(itemIconPath)) - { - await Task.Run(() => - { - jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); - }); - itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; - } - - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully converted to a PNG image with path ", Color.Black); - AppendText(itemIconPath, Color.SteelBlue, true); - } - } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(textureFile, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); - } - } - } - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - } - } - } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(IDParser[iii].HeroDefinition, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); - } - } - else if (IDParser[iii].WeaponDefinition != null) - { - var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath)) - { - AppendText("✔ ", Color.Green); - AppendText("Extracting ", Color.Black); - AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed, true); - - if (isAllPAKs == false) - { - await Task.Run(() => - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); try { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].WeaponDefinition] + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); + await Task.Run(() => + { + jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].HeroDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); + var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); + File.Delete(filesJSON2); + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].HeroDefinition, Color.DarkRed); + AppendText(" successfully serialized", Color.Black, true); + + var IDParser2 = ItemsIdParser.FromJson(json2); + for (int i1 = 0; i1 < IDParser2.Length; i1++) + { + if (IDParser2[i1].LargePreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath2)) + { + if (currentGUID != "0-0-0-0") + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath2 != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } } - catch (KeyNotFoundException ex) + catch (Exception ex) { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); + Console.WriteLine(ex.Message); } - }); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(IDParser[iii].HeroDefinition, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); } - filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); } - try + else if (IDParser[iii].WeaponDefinition != null) { - if (filesPath != null) + var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) { AppendText("✔ ", Color.Green); - AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); - try + AppendText("Extracting ", Color.Black); + AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed, true); + + if (isAllPAKs == false) { await Task.Run(() => { - jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); }); - var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].WeaponDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); - var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); - File.Delete(filesJSON2); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].WeaponDefinition] + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + try + { + if (filesPath != null) + { AppendText("✔ ", Color.Green); AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed); - AppendText(" successfully serialized", Color.Black, true); - - var IDParser2 = ItemsIdParser.FromJson(json2); - for (int i2 = 0; i2 < IDParser2.Length; i2++) + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + try { - if (IDParser2[i2].LargePreviewImage != null) + await Task.Run(() => { - string textureFile = Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).LastIndexOf('.')); - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" detected as a ", Color.Black); - AppendText("Texture2D file", Color.SteelBlue, true); + jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].WeaponDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); + var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); + File.Delete(filesJSON2); + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed); + AppendText(" successfully serialized", Color.Black, true); - var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath2)) + var IDParser2 = ItemsIdParser.FromJson(json2); + for (int i2 = 0; i2 < IDParser2.Length; i2++) + { + if (IDParser2[i2].LargePreviewImage != null) { - if (currentGUID != "0-0-0-0") + string textureFile = Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath2)) { - await Task.Run(() => + if (currentGUID != "0-0-0-0") { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath2 != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(IDParser[iii].WeaponDefinition, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); + } + } + else if (IDParser[iii].LargePreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + if (currentGUID != "0-0-0-0") //DYNAMIC PAK + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else //NORMAL PAK + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/2dAssets/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + else if (IDParser[iii].SmallPreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + if (currentGUID != "0-0-0-0") + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/2dAssets/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } + if (Properties.Settings.Default.loadFeaturedImage == true) + { + try + { + if (IDParser[iii].DisplayAssetPath.AssetPathName.Contains("/Game/Catalog/DisplayAssets/")) + { + wasFeatured = true; + catalogName = IDParser[iii].DisplayAssetPath.AssetPathName; + var filesPath = Directory.GetFiles(docPath + "\\Extracted", catalogName.Substring(catalogName.LastIndexOf('.') + 1) + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + AppendText("✔ ", Color.Green); + AppendText("Extracting ", Color.Black); + AppendText(catalogName.Substring(catalogName.LastIndexOf('.') + 1), Color.DarkRed, true); + + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + catalogName.Substring(catalogName.LastIndexOf('.') + 1) + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => + { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[catalogName.Substring(catalogName.LastIndexOf('.') + 1)] + "\" \"" + catalogName.Substring(catalogName.LastIndexOf('.') + 1) + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", catalogName.Substring(catalogName.LastIndexOf('.') + 1) + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + try + { + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(catalogName.Substring(catalogName.LastIndexOf('.') + 1), Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + try + { + await Task.Run(() => + { + jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + var filesJSON2 = Directory.GetFiles(docPath, catalogName.Substring(catalogName.LastIndexOf('.') + 1) + ".json", SearchOption.AllDirectories).FirstOrDefault(); + var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); + File.Delete(filesJSON2); + AppendText("✔ ", Color.Green); + AppendText(catalogName.Substring(catalogName.LastIndexOf('.') + 1), Color.DarkRed); + AppendText(" successfully serialized", Color.Black, true); + + var IDParser2 = FeaturedParser.FromJson(json2); + for (int i1 = 0; i1 < IDParser2.Length; i1++) + { + if (IDParser2[i1].DetailsImage != null) + { + string textureFile = IDParser2[i1].DetailsImage.ResourceObject; + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath2)) + { + if (currentGUID != "0-0-0-0") + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath2 != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(catalogName.Substring(catalogName.LastIndexOf('.') + 1), Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); + } + } + } + catch (NullReferenceException) + { + wasFeatured = false; + if (IDParser[iii].HeroDefinition != null) + { + var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + AppendText("✔ ", Color.Green); + AppendText("Extracting ", Color.Black); + AppendText(IDParser[iii].HeroDefinition, Color.DarkRed, true); + + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].HeroDefinition] + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + try + { + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].HeroDefinition, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + try + { + await Task.Run(() => + { + jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].HeroDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); + var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); + File.Delete(filesJSON2); + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].HeroDefinition, Color.DarkRed); + AppendText(" successfully serialized", Color.Black, true); + + var IDParser2 = ItemsIdParser.FromJson(json2); + for (int i1 = 0; i1 < IDParser2.Length; i1++) + { + if (IDParser2[i1].LargePreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i1].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath2)) + { + if (currentGUID != "0-0-0-0") + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath2 != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(IDParser[iii].HeroDefinition, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); + } + } + else if (IDParser[iii].WeaponDefinition != null) + { + var filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + AppendText("✔ ", Color.Green); + AppendText("Extracting ", Color.Black); + AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed, true); + + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].WeaponDefinition] + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + try + { + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + try + { + await Task.Run(() => + { + jwpmProcess("serialize \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + var filesJSON2 = Directory.GetFiles(docPath, IDParser[iii].WeaponDefinition + ".json", SearchOption.AllDirectories).FirstOrDefault(); + var json2 = JToken.Parse(File.ReadAllText(filesJSON2)).ToString(); + File.Delete(filesJSON2); + AppendText("✔ ", Color.Green); + AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed); + AppendText(" successfully serialized", Color.Black, true); + + var IDParser2 = ItemsIdParser.FromJson(json2); + for (int i2 = 0; i2 < IDParser2.Length; i2++) + { + if (IDParser2[i2].LargePreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser2[i2].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath2)) + { + if (currentGUID != "0-0-0-0") + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + } + try + { + if (filesPath2 != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(IDParser[iii].WeaponDefinition, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); + } + } + else if (IDParser[iii].LargePreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); + + var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) + { + if (currentGUID != "0-0-0-0") //DYNAMIC PAK + { + await Task.Run(() => + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + }); + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else //NORMAL PAK + { + if (isAllPAKs == false) + { + await Task.Run(() => + { + if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/2dAssets/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); } else { - if (isAllPAKs == false) - { - await Task.Run(() => - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { - try - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - catch (KeyNotFoundException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); - } - }); - } - filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); } - } - try - { - if (filesPath2 != null) - { - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath2.Substring(0, filesPath2.LastIndexOf('.')), Color.SteelBlue, true); - - itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; - if (!File.Exists(itemIconPath)) - { - await Task.Run(() => - { - jwpmProcess("texture \"" + filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + "\""); - }); - itemIconPath = filesPath2.Substring(0, filesPath2.LastIndexOf('.')) + ".png"; - } - - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully converted to a PNG image with path ", Color.Black); - AppendText(itemIconPath, Color.SteelBlue, true); - } - } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(textureFile, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); - } + }); } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); } } - catch (Exception ex) + try { - Console.WriteLine(ex.Message); + if (filesPath != null) + { + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + } + + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); } } - } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(IDParser[iii].WeaponDefinition, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText(PAKsComboBox.SelectedItem.ToString(), Color.DarkRed, true); - } - } - else if (IDParser[iii].LargePreviewImage != null) - { - string textureFile = Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].LargePreviewImage.AssetPathName).LastIndexOf('.')); - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" detected as a ", Color.Black); - AppendText("Texture2D file", Color.SteelBlue, true); + else if (IDParser[iii].SmallPreviewImage != null) + { + string textureFile = Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).LastIndexOf('.')); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" detected as a ", Color.Black); + AppendText("Texture2D file", Color.SteelBlue, true); - var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath)) - { - if (currentGUID != "0-0-0-0") //DYNAMIC PAK - { - await Task.Run(() => + var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + if (!File.Exists(filesPath)) { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - else //NORMAL PAK - { - if (isAllPAKs == false) - { - await Task.Run(() => + if (currentGUID != "0-0-0-0") { - if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/2dAssets/")) - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - else if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) + await Task.Run(() => { jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - else - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { - try - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - catch (KeyNotFoundException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); - } - }); - } - filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - } - try - { - if (filesPath != null) - { - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); - - itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; - if (!File.Exists(itemIconPath)) - { - await Task.Run(() => + }); + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } + else { - jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); - }); - itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + if (isAllPAKs == false) + { + await Task.Run(() => + { + if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/2dAssets/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + else + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + }); + } + if (isAllPAKs == true) + { + await Task.Run(() => { + try + { + jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); + } + catch (KeyNotFoundException ex) + { + Console.ForegroundColor = ConsoleColor.Red; + Console.Write("[ERROR] "); + Console.ForegroundColor = ConsoleColor.White; + Console.Write(ex.Message); + } + }); + } + filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); + } } - - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully converted to a PNG image with path ", Color.Black); - AppendText(itemIconPath, Color.SteelBlue, true); - } - } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(textureFile, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); - } - } - else if (IDParser[iii].SmallPreviewImage != null) - { - string textureFile = Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).Substring(0, Path.GetFileName(IDParser[iii].SmallPreviewImage.AssetPathName).LastIndexOf('.')); - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" detected as a ", Color.Black); - AppendText("Texture2D file", Color.SteelBlue, true); - - var filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - if (!File.Exists(filesPath)) - { - if (currentGUID != "0-0-0-0") - { - await Task.Run(() => + try { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - }); - filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - else - { - if (isAllPAKs == false) - { - await Task.Run(() => + if (filesPath != null) { - if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/2dAssets/")) - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - else if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/") || IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/Athena/Items/")) - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - else - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - }); - } - if (isAllPAKs == true) - { - await Task.Run(() => { - try - { - jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\""); - } - catch (KeyNotFoundException ex) - { - Console.ForegroundColor = ConsoleColor.Red; - Console.Write("[ERROR] "); - Console.ForegroundColor = ConsoleColor.White; - Console.Write(ex.Message); - } - }); - } - filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault(); - } - } - try - { - if (filesPath != null) - { - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully extracted to ", Color.Black); - AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully extracted to ", Color.Black); + AppendText(filesPath.Substring(0, filesPath.LastIndexOf('.')), Color.SteelBlue, true); - itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; - if (!File.Exists(itemIconPath)) - { - await Task.Run(() => - { - jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); - }); - itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; - } + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + if (!File.Exists(itemIconPath)) + { + await Task.Run(() => + { + jwpmProcess("texture \"" + filesPath.Substring(0, filesPath.LastIndexOf('.')) + "\""); + }); + itemIconPath = filesPath.Substring(0, filesPath.LastIndexOf('.')) + ".png"; + } - AppendText("✔ ", Color.Green); - AppendText(textureFile, Color.DarkRed); - AppendText(" successfully converted to a PNG image with path ", Color.Black); - AppendText(itemIconPath, Color.SteelBlue, true); + AppendText("✔ ", Color.Green); + AppendText(textureFile, Color.DarkRed); + AppendText(" successfully converted to a PNG image with path ", Color.Black); + AppendText(itemIconPath, Color.SteelBlue, true); + } + } + catch (IndexOutOfRangeException) + { + AppendText("[IndexOutOfRangeException] ", Color.Red); + AppendText("Can't extract ", Color.Black); + AppendText(textureFile, Color.SteelBlue); + AppendText(" in ", Color.Black); + AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); + } } } - catch (IndexOutOfRangeException) - { - AppendText("[IndexOutOfRangeException] ", Color.Red); - AppendText("Can't extract ", Color.Black); - AppendText(textureFile, Color.SteelBlue); - AppendText(" in ", Color.Black); - AppendText("pakchunk0_s7-WindowsClient.pak", Color.DarkRed, true); - } } if (File.Exists(itemIconPath)) { Image ItemIcon = Image.FromFile(itemIconPath); - g.DrawImage(ItemIcon, new Point(5, 5)); + g.DrawImage(ResizeImage(ItemIcon, 512, 512), new Point(5, 5)); } else { @@ -1876,17 +2548,18 @@ 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)") + if (wasFeatured == true) { - nameToSave = currentItem; - } - else if (Properties.Settings.Default.IconName == "displayName (i.e. Recruit)") - { - nameToSave = ItemName; + nameToSave = catalogName.Substring(catalogName.LastIndexOf('.') + 1); } else { - nameToSave = currentItem; + 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); diff --git a/FModel/Parser/FeaturedParser.cs b/FModel/Parser/FeaturedParser.cs new file mode 100644 index 00000000..f0e3ea3c --- /dev/null +++ b/FModel/Parser/FeaturedParser.cs @@ -0,0 +1,100 @@ +// +// +// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do: +// +// using FModel.Parser; +// +// var featuredParser = FeaturedParser.FromJson(jsonString); + +namespace FModel.Parser.Featured +{ + using System; + using System.Collections.Generic; + + using System.Globalization; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + + public partial class FeaturedParser + { + [JsonProperty("export_type")] + public string ExportType { get; set; } + + [JsonProperty("TileImage")] + public ImageLol TileImage { get; set; } + + [JsonProperty("DetailsImage")] + public ImageLol DetailsImage { get; set; } + + [JsonProperty("Gradient")] + public Gradient Gradient { get; set; } + + [JsonProperty("Background")] + public Background Background { get; set; } + } + + public partial class Background + { + [JsonProperty("r")] + public double R { get; set; } + + [JsonProperty("g")] + public double G { get; set; } + + [JsonProperty("b")] + public double B { get; set; } + + [JsonProperty("a")] + public long A { get; set; } + } + + public partial class ImageLol + { + [JsonProperty("ImageSize")] + public ImageSize ImageSize { get; set; } + + [JsonProperty("ResourceObject")] + public string ResourceObject { get; set; } + } + + public partial class ImageSize + { + [JsonProperty("x")] + public long X { get; set; } + + [JsonProperty("y")] + public long Y { get; set; } + } + + public partial class Gradient + { + [JsonProperty("Start")] + public Background Start { get; set; } + + [JsonProperty("Stop")] + public Background Stop { get; set; } + } + + public partial class FeaturedParser + { + public static FeaturedParser[] FromJson(string json) => JsonConvert.DeserializeObject(json, FModel.Parser.Featured.Converter.Settings); + } + + public static class Serialize + { + public static string ToJson(this FeaturedParser[] self) => JsonConvert.SerializeObject(self, FModel.Parser.Featured.Converter.Settings); + } + + internal static class Converter + { + public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings + { + MetadataPropertyHandling = MetadataPropertyHandling.Ignore, + DateParseHandling = DateParseHandling.None, + Converters = + { + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } + }, + }; + } +} diff --git a/FModel/Parser/ItemsIDParser.cs b/FModel/Parser/ItemsIDParser.cs index b9f73ddc..1f383c02 100644 --- a/FModel/Parser/ItemsIDParser.cs +++ b/FModel/Parser/ItemsIDParser.cs @@ -52,6 +52,9 @@ namespace FModel.Items [JsonProperty("LargePreviewImage")] public PreviewImage LargePreviewImage { get; set; } + + [JsonProperty("DisplayAssetPath")] + public DisplayAssetPath DisplayAssetPath { get; set; } } public partial class GameplayTags @@ -69,6 +72,15 @@ namespace FModel.Items public string SubPathString { get; set; } } + public partial class DisplayAssetPath + { + [JsonProperty("asset_path_name")] + public string AssetPathName { get; set; } + + [JsonProperty("sub_path_string")] + public string SubPathString { get; set; } + } + public partial class ItemsIdParser { public static ItemsIdParser[] FromJson(string json) => JsonConvert.DeserializeObject(json, FModel.Items.Converter.Settings); diff --git a/FModel/Properties/Resources.Designer.cs b/FModel/Properties/Resources.Designer.cs index 23f3d847..68ffce48 100644 --- a/FModel/Properties/Resources.Designer.cs +++ b/FModel/Properties/Resources.Designer.cs @@ -219,5 +219,15 @@ namespace FModel.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap wTemplateF { + get { + object obj = ResourceManager.GetObject("wTemplateF", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/FModel/Properties/Resources.resx b/FModel/Properties/Resources.resx index c8c2f391..2af4bcfb 100644 --- a/FModel/Properties/Resources.resx +++ b/FModel/Properties/Resources.resx @@ -127,6 +127,9 @@ ..\Resources\L512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\U512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\R512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -136,9 +139,6 @@ ..\FNTools_Logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\BurbankBigCondensed-Black.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ..\Resources\FNTools_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -148,22 +148,25 @@ ..\Resources\M512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\unknown512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\BurbankBigCondensed-Bold.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ..\Resources\E512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\T512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\U512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\wTemplate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\BurbankBigCondensed-Black.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\T512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\unknown512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\wTemplateF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/FModel/Properties/Settings.Designer.cs b/FModel/Properties/Settings.Designer.cs index 2d4a698d..37a258bc 100644 --- a/FModel/Properties/Settings.Designer.cs +++ b/FModel/Properties/Settings.Designer.cs @@ -201,5 +201,17 @@ namespace FModel.Properties { this["isWatermark"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool loadFeaturedImage { + get { + return ((bool)(this["loadFeaturedImage"])); + } + set { + this["loadFeaturedImage"] = value; + } + } } } diff --git a/FModel/Properties/Settings.settings b/FModel/Properties/Settings.settings index abbcabf7..bbe110dd 100644 --- a/FModel/Properties/Settings.settings +++ b/FModel/Properties/Settings.settings @@ -47,5 +47,8 @@ False + + False + \ No newline at end of file diff --git a/FModel/Resources/wTemplateF.png b/FModel/Resources/wTemplateF.png new file mode 100644 index 00000000..9c7a35ac Binary files /dev/null and b/FModel/Resources/wTemplateF.png differ