deleted config.json related code, added more settings

This commit is contained in:
AsvalGTA 2019-03-12 23:25:47 +01:00
parent dc27e947c5
commit 21a422cf7f
10 changed files with 222 additions and 177 deletions

View File

@ -16,6 +16,9 @@
<setting name="FortnitePAKs" serializeAs="String">
<value />
</setting>
<setting name="mergerFileName" serializeAs="String">
<value />
</setting>
</FModel.Properties.Settings>
</userSettings>
</configuration>

View File

@ -1,33 +0,0 @@
using System;
using System.IO;
using Newtonsoft.Json;
namespace FModel
{
class Config
{
private static string docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + "\\FModel";
private const string configFile = "config.json";
public static ConfigFile conf;
static Config()
{
if (!Directory.Exists(docPath))
Directory.CreateDirectory(docPath);
if (!File.Exists(docPath + "/" + configFile))
{
string json = JsonConvert.SerializeObject(conf, Formatting.Indented);
File.WriteAllText(docPath + "/" + configFile, json);
}
else
{
string json = File.ReadAllText(docPath + "/" + configFile);
conf = JsonConvert.DeserializeObject<ConfigFile>(json);
}
}
}
public struct ConfigFile
{
public string pathToFortnitePAKs;
}
}

View File

@ -91,7 +91,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Help.cs">
<SubType>Form</SubType>
</Compile>

View File

@ -29,28 +29,17 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HelpWindow));
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.SuspendLayout();
//
// richTextBox1
//
this.richTextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.ReadOnly = true;
this.richTextBox1.Size = new System.Drawing.Size(684, 211);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = "";
//
// HelpWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(684, 211);
this.Controls.Add(this.richTextBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "HelpWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FModel Help";
@ -59,7 +48,5 @@
}
#endregion
private System.Windows.Forms.RichTextBox richTextBox1;
}
}

View File

@ -34,14 +34,22 @@
this.label1 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// 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, 92);
this.optionsOKButton.Location = new System.Drawing.Point(475, 169);
this.optionsOKButton.Name = "optionsOKButton";
this.optionsOKButton.Size = new System.Drawing.Size(97, 21);
this.optionsOKButton.TabIndex = 1;
@ -51,69 +59,117 @@
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(92, 38);
this.textBox1.Location = new System.Drawing.Point(54, 19);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(480, 20);
this.textBox1.Size = new System.Drawing.Size(500, 20);
this.textBox1.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 41);
this.label1.Location = new System.Drawing.Point(6, 22);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(74, 13);
this.label1.Size = new System.Drawing.Size(42, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Output Folder:";
this.label1.Text = "Output:";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox1.Location = new System.Drawing.Point(432, 64);
this.checkBox1.Location = new System.Drawing.Point(448, 45);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(140, 17);
this.checkBox1.Size = new System.Drawing.Size(101, 17);
this.checkBox1.TabIndex = 4;
this.checkBox1.Text = "Serialize After Extraction";
this.checkBox1.Text = "Always Serialize";
this.checkBox1.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.AutoSize = true;
this.label2.ForeColor = System.Drawing.Color.Red;
this.label2.Location = new System.Drawing.Point(358, 65);
this.label2.Location = new System.Drawing.Point(374, 46);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(68, 13);
this.label2.TabIndex = 5;
this.label2.Text = "Advisable -->";
//
// label3
// textBox3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 15);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(112, 13);
this.label3.TabIndex = 7;
this.label3.Text = "Fortnite .PAK file path:";
this.textBox3.Location = new System.Drawing.Point(69, 19);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(195, 20);
this.textBox3.TabIndex = 8;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 22);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(57, 13);
this.label4.TabIndex = 9;
this.label4.Text = "File Name:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(12, 144);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(270, 46);
this.groupBox1.TabIndex = 10;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Merger";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add(this.checkBox1);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Location = new System.Drawing.Point(12, 67);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(560, 71);
this.groupBox2.TabIndex = 11;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Extraction";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.textBox2);
this.groupBox3.Controls.Add(this.label3);
this.groupBox3.Location = new System.Drawing.Point(12, 12);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(560, 49);
this.groupBox3.TabIndex = 12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = ".PAK files";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(130, 12);
this.textBox2.Location = new System.Drawing.Point(46, 19);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(442, 20);
this.textBox2.TabIndex = 6;
this.textBox2.Size = new System.Drawing.Size(508, 20);
this.textBox2.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 22);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(34, 13);
this.label3.TabIndex = 3;
this.label3.Text = "Input:";
//
// OptionsWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 123);
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.textBox1);
this.ClientSize = new System.Drawing.Size(584, 198);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.optionsOKButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
@ -122,8 +178,13 @@
this.Name = "OptionsWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FModel Options";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -133,7 +194,12 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label3;
}
}

View File

@ -13,6 +13,7 @@ namespace FModel
{
public partial class OptionsWindow : Form
{
private static string PAKBefore;
private static string OutputBefore;
public OptionsWindow()
@ -21,8 +22,10 @@ namespace FModel
checkBox1.Checked = Properties.Settings.Default.ExtractAndSerialize;
textBox1.Text = Properties.Settings.Default.ExtractOutput;
//textBox2.Text = Properties.Settings.Default.FortnitePAKs;
textBox2.Text = Properties.Settings.Default.FortnitePAKs;
textBox3.Text = Properties.Settings.Default.mergerFileName;
PAKBefore = Properties.Settings.Default.FortnitePAKs;
OutputBefore = Properties.Settings.Default.ExtractOutput;
}
@ -37,15 +40,22 @@ namespace FModel
Properties.Settings.Default.ExtractAndSerialize = false;
}
Properties.Settings.Default.ExtractOutput = textBox1.Text;
//Properties.Settings.Default.FortnitePAKs = textBox2.Text;
Properties.Settings.Default.FortnitePAKs = textBox2.Text;
Properties.Settings.Default.mergerFileName = textBox3.Text;
if (!Directory.Exists(Properties.Settings.Default.ExtractOutput))
Directory.CreateDirectory(Properties.Settings.Default.ExtractOutput);
string PAKAfter = Properties.Settings.Default.FortnitePAKs;
if (PAKBefore != PAKAfter)
{
MessageBox.Show("Please, restart FModel to apply your new input path", "FModel Path Changed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
string OutputAfter = Properties.Settings.Default.ExtractOutput;
if (OutputBefore != OutputAfter)
{
MessageBox.Show("Please, restart FModel to apply your new path", "FModel Path Changed", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show("Please, restart FModel to apply your new output path", "FModel Path Changed", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Properties.Settings.Default.Save();

View File

@ -19,7 +19,6 @@ namespace FModel
{
public partial class PAKWindow : Form
{
public static ConfigFile conf;
public static string docPath;
private static string[] PAKFileAsTXT;
private static string ItemName;
@ -73,9 +72,6 @@ namespace FModel
private void PAKWindow_Load(object sender, EventArgs e)
{
Console.ForegroundColor = ConsoleColor.White; //DEFAULT CONSOLE COLOR
conf = new ConfigFile(); //CREATE CONFIG FILE
Properties.Settings.Default.ExtractAndSerialize = true; //SERIALIZE BY DEFAULT
docPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString() + "\\FModel";
@ -89,17 +85,18 @@ namespace FModel
docPath = Properties.Settings.Default.ExtractOutput;
}
if (!Directory.Exists(Config.conf.pathToFortnitePAKs))
if (!Directory.Exists(Properties.Settings.Default.FortnitePAKs))
{
AppendText("[PathNotFoundException] ", Color.Red);
AppendText(" Please go to ", Color.Black);
AppendText(docPath, Color.SteelBlue);
AppendText(" and enter your Fortnite .PAK files path in ", Color.Black);
AppendText("config.json", Color.SteelBlue, true);
AppendText(" Please go to the ", Color.Black);
AppendText("Load button drop down menu ", Color.SteelBlue);
AppendText(", ", Color.Black);
AppendText("click on Options ", Color.SteelBlue);
AppendText("and enter your Fortnite .PAK files path", Color.Black, true);
}
else
{
IEnumerable<string> yourPAKs = Directory.GetFiles(Config.conf.pathToFortnitePAKs).Where(x => x.EndsWith(".pak"));
IEnumerable<string> yourPAKs = Directory.GetFiles(Properties.Settings.Default.FortnitePAKs).Where(x => x.EndsWith(".pak"));
for (int i = 0; i < yourPAKs.Count(); i++)
{
PAKsComboBox.Items.Add(Path.GetFileName(yourPAKs.ElementAt(i)));
@ -232,10 +229,10 @@ namespace FModel
currentPAK = PAKsComboBox.SelectedItem.ToString();
LoadButton.Enabled = false;
await Task.Run(() => {
jwpmProcess("filelist \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + docPath + "\"");
jwpmProcess("filelist \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + docPath + "\"");
});
LoadButton.Enabled = true;
currentGUID = readPAKGuid(Config.conf.pathToFortnitePAKs + "\\" + PAKsComboBox.SelectedItem);
currentGUID = readPAKGuid(Properties.Settings.Default.FortnitePAKs + "\\" + PAKsComboBox.SelectedItem);
if (!File.Exists(docPath + "\\" + PAKsComboBox.SelectedItem + ".txt"))
{
@ -615,7 +612,7 @@ namespace FModel
if (!File.Exists(files))
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
files = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
@ -688,7 +685,7 @@ namespace FModel
AppendText(IDParser[iii].HeroDefinition, Color.DarkRed, true);
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -729,14 +726,14 @@ namespace FModel
if (currentGUID != "0-0-0-0")
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -801,7 +798,7 @@ namespace FModel
AppendText(IDParser[iii].WeaponDefinition, Color.DarkRed, true);
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -842,14 +839,14 @@ namespace FModel
if (currentGUID != "0-0-0-0")
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -918,7 +915,7 @@ namespace FModel
if (currentGUID != "0-0-0-0") //DYNAMIC PAK
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -927,15 +924,15 @@ namespace FModel
await Task.Run(() => {
if (IDParser[iii].LargePreviewImage.AssetPathName.Contains("/Game/2dAssets/"))
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
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/"))
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
else
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
@ -988,7 +985,7 @@ namespace FModel
if (currentGUID != "0-0-0-0")
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
@ -997,15 +994,15 @@ namespace FModel
await Task.Run(() => {
if (IDParser[iii].SmallPreviewImage.AssetPathName.Contains("/Game/2dAssets/"))
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
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/"))
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
else
{
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
@ -1144,7 +1141,7 @@ namespace FModel
if (!File.Exists(filesPath))
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
@ -1219,7 +1216,7 @@ namespace FModel
if (!File.Exists(filesPath))
{
await Task.Run(() => {
jwpmProcess("extract \"" + Config.conf.pathToFortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".uexp", SearchOption.AllDirectories).FirstOrDefault();
}
@ -1329,67 +1326,74 @@ namespace FModel
private void mergeGeneratedImagesToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog theDialog = new OpenFileDialog();
theDialog.Multiselect = true;
theDialog.InitialDirectory = docPath + "\\Generated Icons\\";
theDialog.Title = "Choose your images";
theDialog.Filter = "PNG Files (*.png)|*.png|JPEG Files (*.jpg)|*.jpg|BMP Files (*.bmp)|*.bmp|All Files (*.*)|*.*";
if (theDialog.ShowDialog() == DialogResult.OK)
if (string.IsNullOrEmpty(Properties.Settings.Default.mergerFileName))
{
List<Image> selectedImages = new List<Image>();
foreach (var files in theDialog.FileNames)
MessageBox.Show("Please, set a name to your file before trying to merge images\n\nSteps:\n\t- Load button drop down menu\n\t- Options", "FModel Merger File Name Missing", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
OpenFileDialog theDialog = new OpenFileDialog();
theDialog.Multiselect = true;
theDialog.InitialDirectory = docPath + "\\Generated Icons\\";
theDialog.Title = "Choose your images";
theDialog.Filter = "PNG Files (*.png)|*.png|JPEG Files (*.jpg)|*.jpg|BMP Files (*.bmp)|*.bmp|All Files (*.*)|*.*";
if (theDialog.ShowDialog() == DialogResult.OK)
{
selectedImages.Add(Image.FromFile(files));
}
var numperrow = 7;
var w = 530 * numperrow;
int h = int.Parse(Math.Ceiling(double.Parse(selectedImages.Count.ToString()) / numperrow).ToString()) * 530;
Bitmap bmp = new Bitmap(w - 8, h - 8);
if (selectedImages.Count * 530 < 530 * numperrow)
{
w = selectedImages.Count * 530;
}
var num = 1;
var cur_w = 0;
var cur_h = 0;
for (int i = 0; i < selectedImages.Count; i++)
{
using (Graphics g = Graphics.FromImage(bmp))
List<Image> selectedImages = new List<Image>();
foreach (var files in theDialog.FileNames)
{
g.DrawImage(selectedImages[i], new PointF(cur_w, cur_h));
if (num % numperrow == 0)
selectedImages.Add(Image.FromFile(files));
}
var numperrow = 7;
var w = 530 * numperrow;
int h = int.Parse(Math.Ceiling(double.Parse(selectedImages.Count.ToString()) / numperrow).ToString()) * 530;
Bitmap bmp = new Bitmap(w - 8, h - 8);
if (selectedImages.Count * 530 < 530 * numperrow)
{
w = selectedImages.Count * 530;
}
var num = 1;
var cur_w = 0;
var cur_h = 0;
for (int i = 0; i < selectedImages.Count; i++)
{
using (Graphics g = Graphics.FromImage(bmp))
{
cur_w = 0;
cur_h += 530;
num += 1;
}
else
{
cur_w += 530;
num += 1;
g.DrawImage(selectedImages[i], new PointF(cur_w, cur_h));
if (num % numperrow == 0)
{
cur_w = 0;
cur_h += 530;
num += 1;
}
else
{
cur_w += 530;
num += 1;
}
}
}
bmp.Save(docPath + "\\" + Properties.Settings.Default.mergerFileName + ".png", ImageFormat.Png);
var newForm = new Form();
PictureBox pb = new PictureBox();
pb.Dock = DockStyle.Fill;
pb.Image = bmp;
pb.SizeMode = PictureBoxSizeMode.Zoom;
newForm.WindowState = FormWindowState.Maximized;
newForm.Size = bmp.Size;
newForm.Icon = Properties.Resources.FNTools_Logo_Icon;
newForm.Text = docPath + "\\" + Properties.Settings.Default.mergerFileName + ".png";
newForm.StartPosition = FormStartPosition.CenterScreen;
newForm.Controls.Add(pb);
newForm.Show();
}
bmp.Save(docPath + "\\Merger.png");
var newForm = new Form();
PictureBox pb = new PictureBox();
pb.Dock = DockStyle.Fill;
pb.Image = bmp;
pb.SizeMode = PictureBoxSizeMode.Zoom;
newForm.WindowState = FormWindowState.Maximized;
newForm.Size = bmp.Size;
newForm.Icon = Properties.Resources.FNTools_Logo_Icon;
newForm.Text = docPath + "\\Merger.png";
newForm.StartPosition = FormStartPosition.CenterScreen;
newForm.Controls.Add(pb);
newForm.Show();
}
}

View File

@ -57,5 +57,17 @@ namespace FModel.Properties {
this["FortnitePAKs"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string mergerFileName {
get {
return ((string)(this["mergerFileName"]));
}
set {
this["mergerFileName"] = value;
}
}
}
}

View File

@ -11,5 +11,8 @@
<Setting Name="FortnitePAKs" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="mergerFileName" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>

View File

@ -13,21 +13,15 @@
### Prerequisites
[.NET Framework 4.6.1](https://dotnet.microsoft.com/download/dotnet-framework-runtime/net461)
### How does it works
**1.** Once you start the executable, a `FModel` subfolder will be created in your `Documents` folder as well as a `config.json` file and it'll automatically download the latest version of the modded Fortnite Asset Parser.
**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/oaceS8K.gif)
**2.** Open the config file and fill `pathToFortnitePAKs` with the path to your Fortnite .PAK files
```json
{
"pathToFortnitePAKs": "C:\\Program Files\\Epic Games\\Fortnite\\FortniteGame\\Content\\Paks"
}
```
**3.** Restart the executable, select your .PAK file, enter the AES key and click **Load**
**2.** Restart the executable, select your .PAK file, enter the AES key and click **Load**
- It will parse all Assets contained in the selected .PAK file with their respective path
**4.** Navigate through the tree to find the Asset you want
**3.** Navigate through the tree to find the Asset you want
**5.** Clicking on **Extract Asset** will extract the selected Asset to your `Documents` folder, try to serialize it and will display infos about it
**4.** Clicking on **Extract Asset** 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](https://i.imgur.com/PStlmUV.png) with **Name**, **Description**, **Rarity**, **Type** and the **Cosmetic Source**
- Asset is a **_Texture_**:
@ -52,7 +46,7 @@ I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instea
- [ ] Improve speed
- [x] Multithreading
- [x] Filter for the items ListBox
- [ ] More options
- [ ] More settings
- [ ] Stop button while extracting
- [ ] Support for meshes
- [ ] Support for animations