From b94752ab95b527644808cb8c6f0899365ce50487 Mon Sep 17 00:00:00 2001 From: Asval Date: Fri, 8 Mar 2019 00:35:54 +0100 Subject: [PATCH] Added filter for the items ListBox --- FModel/FModel.csproj | 50 +++++++++++++++++++++- FModel/PAKWindow.Designer.cs | 40 ++++++++++++++---- FModel/PAKWindow.cs | 28 ++++++++++++- FModel/Properties/AssemblyInfo.cs | 2 +- FModel/Properties/app.manifest | 70 +++++++++++++++++++++++++++++++ README.md | 6 ++- 6 files changed, 182 insertions(+), 14 deletions(-) create mode 100644 FModel/Properties/app.manifest diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 12057bee..bfebcea1 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -14,6 +14,24 @@ true + false + publish\ + false + Disk + true + Foreground + 7 + Days + false + false + true + true + publish.htm + 0 + 1.0.0.%2a + false + true + true AnyCPU @@ -40,6 +58,24 @@ + + 3ED5A42E3C4689AF46F18366F8BF30D245116948 + + + FModel_TemporaryKey.pfx + + + false + + + false + + + LocalIntranet + + + Properties\app.manifest + ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll @@ -81,6 +117,7 @@ True + SettingsSingleFileGenerator Settings.Designer.cs @@ -108,6 +145,17 @@ - + + + False + Microsoft .NET Framework 4.6.1 %28x86 et x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/FModel/PAKWindow.Designer.cs b/FModel/PAKWindow.Designer.cs index baa317dd..0ddb3a11 100644 --- a/FModel/PAKWindow.Designer.cs +++ b/FModel/PAKWindow.Designer.cs @@ -44,6 +44,8 @@ this.ConsoleRichTextBox = new System.Windows.Forms.RichTextBox(); this.ExtractButton = new System.Windows.Forms.Button(); this.ItemRichTextBox = new System.Windows.Forms.RichTextBox(); + this.FilterLabel = new System.Windows.Forms.Label(); + this.FilterTextBox = new System.Windows.Forms.TextBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ItemIconPictureBox)).BeginInit(); this.groupBox2.SuspendLayout(); @@ -75,7 +77,7 @@ // AESKeyLabel // this.AESKeyLabel.AutoSize = true; - this.AESKeyLabel.Location = new System.Drawing.Point(6, 50); + this.AESKeyLabel.Location = new System.Drawing.Point(6, 51); this.AESKeyLabel.Name = "AESKeyLabel"; this.AESKeyLabel.Size = new System.Drawing.Size(52, 13); this.AESKeyLabel.TabIndex = 2; @@ -137,14 +139,14 @@ this.groupBox2.Controls.Add(this.ItemIconPictureBox); this.groupBox2.Location = new System.Drawing.Point(426, 12); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(928, 667); + this.groupBox2.Size = new System.Drawing.Size(928, 693); this.groupBox2.TabIndex = 4; this.groupBox2.TabStop = false; // // SaveImageCheckBox // this.SaveImageCheckBox.AutoSize = true; - this.SaveImageCheckBox.Location = new System.Drawing.Point(703, 613); + this.SaveImageCheckBox.Location = new System.Drawing.Point(703, 639); this.SaveImageCheckBox.Name = "SaveImageCheckBox"; this.SaveImageCheckBox.Size = new System.Drawing.Size(108, 17); this.SaveImageCheckBox.TabIndex = 9; @@ -154,7 +156,7 @@ // // SaveImageButton // - this.SaveImageButton.Location = new System.Drawing.Point(816, 609); + this.SaveImageButton.Location = new System.Drawing.Point(816, 635); this.SaveImageButton.Name = "SaveImageButton"; this.SaveImageButton.Size = new System.Drawing.Size(106, 23); this.SaveImageButton.TabIndex = 8; @@ -165,7 +167,7 @@ // LoadDataCheckBox // this.LoadDataCheckBox.AutoSize = true; - this.LoadDataCheckBox.Location = new System.Drawing.Point(703, 642); + this.LoadDataCheckBox.Location = new System.Drawing.Point(703, 668); this.LoadDataCheckBox.Name = "LoadDataCheckBox"; this.LoadDataCheckBox.Size = new System.Drawing.Size(101, 17); this.LoadDataCheckBox.TabIndex = 7; @@ -179,13 +181,13 @@ this.ConsoleRichTextBox.Location = new System.Drawing.Point(6, 374); this.ConsoleRichTextBox.Name = "ConsoleRichTextBox"; this.ConsoleRichTextBox.ReadOnly = true; - this.ConsoleRichTextBox.Size = new System.Drawing.Size(922, 153); + this.ConsoleRichTextBox.Size = new System.Drawing.Size(922, 229); this.ConsoleRichTextBox.TabIndex = 6; this.ConsoleRichTextBox.Text = ""; // // ExtractButton // - this.ExtractButton.Location = new System.Drawing.Point(816, 638); + this.ExtractButton.Location = new System.Drawing.Point(816, 664); this.ExtractButton.Name = "ExtractButton"; this.ExtractButton.Size = new System.Drawing.Size(106, 23); this.ExtractButton.TabIndex = 5; @@ -204,13 +206,32 @@ this.ItemRichTextBox.TabIndex = 4; this.ItemRichTextBox.Text = ""; // + // FilterLabel + // + this.FilterLabel.AutoSize = true; + this.FilterLabel.Location = new System.Drawing.Point(18, 688); + this.FilterLabel.Name = "FilterLabel"; + this.FilterLabel.Size = new System.Drawing.Size(32, 13); + this.FilterLabel.TabIndex = 6; + this.FilterLabel.Text = "Filter:"; + // + // FilterTextBox + // + this.FilterTextBox.Location = new System.Drawing.Point(56, 685); + this.FilterTextBox.Name = "FilterTextBox"; + this.FilterTextBox.Size = new System.Drawing.Size(364, 20); + this.FilterTextBox.TabIndex = 5; + this.FilterTextBox.TextChanged += new System.EventHandler(this.FilterTextBox_TextChanged); + // // PAKWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1366, 691); + this.ClientSize = new System.Drawing.Size(1366, 712); + this.Controls.Add(this.FilterLabel); this.Controls.Add(this.groupBox2); this.Controls.Add(this.PAKTreeView); + this.Controls.Add(this.FilterTextBox); this.Controls.Add(this.ItemsListBox); this.Controls.Add(this.groupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; @@ -226,6 +247,7 @@ this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -246,6 +268,8 @@ private System.Windows.Forms.CheckBox LoadDataCheckBox; private System.Windows.Forms.CheckBox SaveImageCheckBox; private System.Windows.Forms.Button SaveImageButton; + private System.Windows.Forms.Label FilterLabel; + private System.Windows.Forms.TextBox FilterTextBox; } } diff --git a/FModel/PAKWindow.cs b/FModel/PAKWindow.cs index b9b8414c..754403ef 100644 --- a/FModel/PAKWindow.cs +++ b/FModel/PAKWindow.cs @@ -189,10 +189,11 @@ namespace FModel } } } + private static List afterItems; private void PAKTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) { List beforeItems = new List(); - List afterItems = new List(); + afterItems = new List(); ItemsListBox.Items.Clear(); @@ -233,6 +234,29 @@ namespace FModel ExtractButton.Enabled = ItemsListBox.SelectedIndex >= 0; } + private void FilterTextBox_TextChanged(object sender, EventArgs e) + { + ItemsListBox.BeginUpdate(); + ItemsListBox.Items.Clear(); + if (!string.IsNullOrEmpty(FilterTextBox.Text)) + { + foreach (string str in afterItems) + { + if (str.Contains(FilterTextBox.Text)) + { + ItemsListBox.Items.Add(str); + } + } + } + else + { + foreach (var b in afterItems) + { + ItemsListBox.Items.Add(b); + } + } + ItemsListBox.EndUpdate(); + } private void ItemsListBox_SelectedIndexChanged(object sender, EventArgs e) { if (ItemsListBox.SelectedItem != null) @@ -622,7 +646,7 @@ namespace FModel { jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\""); } - else if (data.SmallPreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/")) + else if (data.SmallPreviewImage.AssetPathName.Contains("/Game/Athena/TestAssets/") || data.SmallPreviewImage.AssetPathName.Contains("/Game/Athena/Prototype/")) { jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + PAKsComboBox.SelectedItem + "\" \"" + textureFile + "\" \"" + docPath + "\""); } diff --git a/FModel/Properties/AssemblyInfo.cs b/FModel/Properties/AssemblyInfo.cs index 11b64a14..f2a8f717 100644 --- a/FModel/Properties/AssemblyInfo.cs +++ b/FModel/Properties/AssemblyInfo.cs @@ -6,7 +6,7 @@ using System.Runtime.InteropServices; // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly: AssemblyTitle("FModel")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("FModel is a Fortnite .PAK file explorer built in C#")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FModel")] diff --git a/FModel/Properties/app.manifest b/FModel/Properties/app.manifest new file mode 100644 index 00000000..fa7d7ca7 --- /dev/null +++ b/FModel/Properties/app.manifest @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 3b32a9b9..baf279c1 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ **5.** Clicking on **Extract** will extract the selected Asset to your `Documents` folder, try to serialize it and will display infos about it - Asset is an **_ID_**: - - Try to create an icon with **Name**, **Description**, **Rarity**, **Type** and the **Cosmetic Source** + - Try to create an [Icon](https://i.imgur.com/CkiU3p5.png) with **Name**, **Description**, **Rarity**, **Type** and the **Cosmetic Source** - Asset is a **_Texture_**: - Try to display the Asset as PNG - Asset is a **_Sound_**: @@ -46,5 +46,7 @@ ## TODO - [ ] Improve speed - [ ] Detect the pak file of an image if default isn't working -- [ ] Filter ItemsListBox +- [x] Filter for the items ListBox +- [ ] Support for meshes +- [ ] Support for animations - [ ] Readable code