429% speed improvements + load all pak files at once [Load sub-button]

This commit is contained in:
AsvalGTA 2019-03-23 17:19:26 +01:00
parent 9c35c8a446
commit cfbfc6d258
5 changed files with 567 additions and 221 deletions

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{71A31C47-30BC-4CB5-AD89-81E5008F4BEB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>FModel</RootNamespace>
<AssemblyName>FModel</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
@ -181,4 +181,8 @@
</EmbeddedResource>
</ItemGroup>
</Target>
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -55,6 +55,8 @@
this.ConsoleRichTextBox = new System.Windows.Forms.RichTextBox();
this.FilterLabel = new System.Windows.Forms.Label();
this.FilterTextBox = new System.Windows.Forms.TextBox();
this.loadAllPAKsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.groupBox1.SuspendLayout();
this.LoadContext.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ItemIconPictureBox)).BeginInit();
@ -92,14 +94,16 @@
//
this.LoadContext.ImageScalingSize = new System.Drawing.Size(18, 18);
this.LoadContext.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.loadAllPAKsToolStripMenuItem,
this.toolStripSeparator2,
this.optionsToolStripMenuItem});
this.LoadContext.Name = "LoadContext";
this.LoadContext.Size = new System.Drawing.Size(117, 26);
this.LoadContext.Size = new System.Drawing.Size(181, 76);
//
// optionsToolStripMenuItem
//
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(116, 22);
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
this.optionsToolStripMenuItem.Text = "Options";
this.optionsToolStripMenuItem.Click += new System.EventHandler(this.optionsToolStripMenuItem_Click);
//
@ -300,6 +304,18 @@
this.FilterTextBox.TabIndex = 5;
this.FilterTextBox.TextChanged += new System.EventHandler(this.FilterTextBox_TextChanged);
//
// loadAllPAKsToolStripMenuItem
//
this.loadAllPAKsToolStripMenuItem.Name = "loadAllPAKsToolStripMenuItem";
this.loadAllPAKsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.loadAllPAKsToolStripMenuItem.Text = "Load Them All";
this.loadAllPAKsToolStripMenuItem.Click += new System.EventHandler(this.loadAllPAKsToolStripMenuItem_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);
//
// PAKWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -358,6 +374,8 @@
private System.Windows.Forms.ToolStripMenuItem mergeGeneratedImagesToolStripMenuItem;
private System.Windows.Forms.ImageList TreeViewImageList;
private ScintillaNET.Scintilla scintilla1;
private System.Windows.Forms.ToolStripMenuItem loadAllPAKsToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
}
}

View File

@ -20,6 +20,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Text.RegularExpressions;
using System.Text;
namespace FModel
{
@ -27,10 +28,13 @@ namespace FModel
{
public static string docPath;
private static string[] PAKFileAsTXT;
private static string[] AllPAKs;
private static bool isAllPAKs;
private static string ItemName;
private static List<string> afterItems;
public static string[] SelectedArray;
public static string[] challengesArray;
public static Dictionary<string, string> AllPAKsDict;
public static Dictionary<string, long> questStageDict;
public static Dictionary<string, long> questDictFinal;
@ -127,9 +131,11 @@ namespace FModel
else
{
IEnumerable<string> yourPAKs = Directory.GetFiles(Properties.Settings.Default.FortnitePAKs).Where(x => x.EndsWith(".pak"));
AllPAKs = new string[yourPAKs.Count()];
for (int i = 0; i < yourPAKs.Count(); i++)
{
PAKsComboBox.Items.Add(Path.GetFileName(yourPAKs.ElementAt(i)));
AllPAKs[i] = Path.GetFileName(yourPAKs.ElementAt(i));
}
}
@ -289,6 +295,7 @@ namespace FModel
private static string currentGUID;
private async void LoadButton_Click(object sender, EventArgs e)
{
isAllPAKs = false;
if (PAKsComboBox.SelectedItem == null)
{
AppendText("Please, select one of your ", Color.Black);
@ -328,6 +335,176 @@ namespace FModel
}
}
}
private async void loadAllPAKsToolStripMenuItem_Click(object sender, EventArgs e)
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
isAllPAKs = true;
AllPAKsDict = new Dictionary<string, string>();
PAKTreeView.Nodes.Clear();
ItemsListBox.Items.Clear();
File.WriteAllText("key.txt", AESKeyTextBox.Text.Substring(2));
LoadButton.Enabled = false;
for (int i = 0; i < AllPAKs.Count(); i++)
{
currentPAK = AllPAKs[i];
currentGUID = readPAKGuid(Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK);
if (currentGUID == "0-0-0-0")
{
AppendText("✔ ", Color.Green);
AppendText("Loading ", Color.Black);
AppendText(currentPAK, Color.DarkRed, true);
await Task.Run(() => {
jwpmProcess("filelist \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + docPath + "\"");
});
if (!File.Exists(docPath + "\\" + currentPAK + ".txt"))
{
AppendText("✗ ", Color.Red);
AppendText(" Can't read ", Color.Black);
AppendText(currentPAK, Color.SteelBlue);
AppendText(" with this key", Color.Black, true);
}
else
{
if (!File.Exists(docPath + "\\FortnitePAKs_Temp.txt"))
{
File.Create(docPath + "\\FortnitePAKs_Temp.txt").Dispose();
}
string[] arr = File.ReadAllLines(docPath + "\\" + currentPAK + ".txt");
for (int ii = 0; ii < arr.Length; ii++)
{
string filename = arr[ii].Substring(arr[ii].LastIndexOf("/") + 1);
if (filename.Contains(".uasset") || filename.Contains(".uexp") || filename.Contains(".ubulk"))
{
if (!AllPAKsDict.ContainsKey(filename.Substring(0, filename.LastIndexOf("."))))
{
AllPAKsDict.Add(filename.Substring(0, filename.LastIndexOf(".")), currentPAK);
}
}
else
{
if (!AllPAKsDict.ContainsKey(filename))
{
AllPAKsDict.Add(filename, currentPAK);
}
}
}
File.AppendAllText(docPath + "\\FortnitePAKs_Temp.txt", File.ReadAllText(docPath + "\\" + currentPAK + ".txt"));
File.Delete(docPath + "\\" + currentPAK + ".txt");
}
}
}
if (File.Exists(docPath + "\\FortnitePAKs_Temp.txt"))
{
string[] arr = File.ReadAllLines(docPath + "\\FortnitePAKs_Temp.txt");
File.Delete(docPath + "\\FortnitePAKs_Temp.txt");
AppendText("Fixing paths... Please wait ", Color.Black, true);
await Task.Run(() => {
for (int i = 0; i < arr.Length; i++)
{
if (arr[i].StartsWith("Athena") ||
arr[i].StartsWith("Balance") ||
arr[i].StartsWith("Characters") ||
arr[i].StartsWith("Banners") ||
arr[i].StartsWith("Building") ||
arr[i].StartsWith("Blueprints") ||
arr[i].StartsWith("ArtTools") ||
arr[i].StartsWith("Catalog") ||
arr[i].StartsWith("Animation") ||
arr[i].StartsWith("Effects") ||
arr[i].StartsWith("Environments") ||
arr[i].StartsWith("Characters") ||
arr[i].StartsWith("CharClasses") ||
arr[i].StartsWith("ContentCreationTools") ||
arr[i].StartsWith("DeathPenalty") ||
arr[i].StartsWith("CollectionBook") ||
arr[i].StartsWith("CommandConsole") ||
arr[i].StartsWith("Creative") ||
arr[i].StartsWith("DeployableBases") ||
arr[i].StartsWith("GameplayCueNotifies") ||
arr[i].StartsWith("Items") ||
arr[i].StartsWith("Missions") ||
arr[i].StartsWith("GameplayEffectTemplates") ||
arr[i].StartsWith("Heroes") ||
arr[i].StartsWith("GameplayCurves") ||
arr[i].StartsWith("Packages") ||
arr[i].StartsWith("FortressPhysicalMaterials") ||
arr[i].StartsWith("Expeditions") ||
arr[i].StartsWith("Gamepad") ||
arr[i].StartsWith("Gadgets") ||
arr[i].StartsWith("Macros") ||
arr[i].StartsWith("Maps") ||
arr[i].StartsWith("Frontend") ||
arr[i].StartsWith("Playgrounds") ||
arr[i].StartsWith("Playsets") ||
arr[i].StartsWith("Movies") ||
arr[i].StartsWith("L10N") ||
arr[i].StartsWith("ImpostorBaker") ||
arr[i].StartsWith("Marketing") ||
arr[i].StartsWith("Marketing_Screenshots") ||
arr[i].StartsWith("Sounds") ||
arr[i].StartsWith("UI") ||
arr[i].StartsWith("Quests") ||
arr[i].StartsWith("VisualThreatManager") ||
arr[i].StartsWith("Weapons") ||
arr[i].StartsWith("WaterAndWind") ||
arr[i].StartsWith("Tools") ||
arr[i].StartsWith("Vehicles") ||
arr[i].StartsWith("PvP") ||
arr[i].StartsWith("Spectating") ||
arr[i].StartsWith("TheOutpost") ||
arr[i].StartsWith("TimeOfDay") ||
arr[i].StartsWith("Research") ||
arr[i].StartsWith("Relics") ||
arr[i].StartsWith("Slate") ||
arr[i].StartsWith("TheKeep") ||
arr[i].StartsWith("FrontEnd") ||
arr[i].StartsWith("AIDirector") ||
arr[i].StartsWith("AI") ||
arr[i].StartsWith("Abilities") ||
arr[i].StartsWith("Accessories") ||
arr[i].StartsWith("WorldTiles") ||
arr[i].StartsWith("Widgets"))
{
arr[i] = "FortniteGame/Content/" + arr[i];
}
if (arr[i].StartsWith("Content") || arr[i].StartsWith("Plugins"))
{
arr[i] = "FortniteGame/" + arr[i];
}
if (arr[i].StartsWith("Female") || arr[i].StartsWith("Male"))
{
arr[i] = "FortniteGame/Content/Characters/Player/" + arr[i];
}
if (arr[i].StartsWith("Male_Avg_Base") || arr[i].StartsWith("Medium") || arr[i].StartsWith("LegacyAssets") || arr[i].StartsWith("Large"))
{
arr[i] = "FortniteGame/Content/Characters/Player/Male/" + arr[i];
}
if (arr[i].StartsWith("Props") || arr[i].StartsWith("Sets") || arr[i].StartsWith("Prototype"))
{
arr[i] = "FortniteGame/Content/Environments/" + arr[i];
}
}
});
File.WriteAllLines(docPath + "\\FortnitePAKs.txt", arr);
PAKFileAsTXT = File.ReadAllLines(docPath + "\\FortnitePAKs.txt");
File.Delete(docPath + "\\FortnitePAKs.txt");
for (int ii = 0; ii < PAKFileAsTXT.Length; ii++)
{
CreatePath(PAKTreeView.Nodes, PAKFileAsTXT[ii].Replace(PAKFileAsTXT[ii].Split('/').Last(), ""));
}
}
LoadButton.Enabled = true;
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
AppendText("\nTime elapsed: " + elapsedTime, Color.Green, true, HorizontalAlignment.Right);
}
public static IEnumerable<TItem> GetAncestors<TItem>(TItem item, Func<TItem, TItem> getParentFunc)
{
@ -662,8 +839,15 @@ namespace FModel
{
var filesPath = Directory.GetFiles(docPath + "\\Extracted", qAssetName + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (!File.Exists(filesPath))
{
if (isAllPAKs == false)
{
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + qAssetName + "\" \"" + docPath + "\"");
}
if (isAllPAKs == true)
{
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[qAssetName] + "\" \"" + qAssetName + "\" \"" + docPath + "\"");
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", qAssetName + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
try
@ -747,10 +931,19 @@ namespace FModel
var files = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (!File.Exists(files))
{
if (isAllPAKs == false)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[currentItem] + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
files = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
if (files != null)
@ -825,10 +1018,19 @@ namespace FModel
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(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].HeroDefinition] + "\" \"" + IDParser[iii].HeroDefinition + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].HeroDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
try
@ -875,11 +1077,20 @@ namespace FModel
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(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -943,10 +1154,19 @@ namespace FModel
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(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[IDParser[iii].WeaponDefinition] + "\" \"" + IDParser[iii].WeaponDefinition + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", IDParser[iii].WeaponDefinition + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
try
@ -993,11 +1213,20 @@ namespace FModel
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(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath2 = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1072,6 +1301,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else //NORMAL PAK
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1088,6 +1319,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1145,6 +1383,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1161,6 +1401,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1272,12 +1519,12 @@ namespace FModel
{
AppendText("Auto saving icons set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //Cosmetics
if (Properties.Settings.Default.createIconForConsumablesWeapons == true && (IDParser[iii].ExportType.Contains("FortWeaponRangedItemDefinition") || IDParser[iii].ExportType.Contains("FortWeaponMeleeItemDefinition")))
@ -1317,6 +1564,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else //NORMAL PAK
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1333,6 +1582,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1390,6 +1646,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1406,6 +1664,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1522,12 +1787,12 @@ namespace FModel
{
AppendText("Auto saving icons set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //Consumables & Weapons
if (Properties.Settings.Default.createIconForTraps == true && (IDParser[iii].ExportType.Contains("FortTrapItemDefinition") || IDParser[iii].ExportType.Contains("FortContextTrapItemDefinition")))
@ -1567,6 +1832,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else //NORMAL PAK
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1583,6 +1850,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1640,6 +1914,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1656,6 +1932,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1736,12 +2019,12 @@ namespace FModel
{
AppendText("Auto saving icons set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //Traps
if (Properties.Settings.Default.createIconForVariants == true && (IDParser[iii].ExportType == "FortVariantTokenType"))
@ -1781,6 +2064,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else //NORMAL PAK
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1797,6 +2082,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1854,6 +2146,8 @@ namespace FModel
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
else
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
@ -1870,6 +2164,13 @@ namespace FModel
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\pakchunk0_s7-WindowsClient.pak" + "\" \"" + textureFile + "\" \"" + docPath + "\"");
}
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[textureFile] + "\" \"" + textureFile + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).FirstOrDefault();
}
}
@ -1972,12 +2273,12 @@ namespace FModel
{
AppendText("Auto saving icons set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //CosmeticVariantTokens
}
@ -2003,11 +2304,20 @@ namespace FModel
{
var filesPath = Directory.GetFiles(docPath + "\\Extracted", challengesArray[w] + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (!File.Exists(filesPath))
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + challengesArray[w] + "\" \"" + docPath + "\"");
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[challengesArray[w]] + "\" \"" + challengesArray[w] + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", challengesArray[w] + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
try
@ -2128,12 +2438,12 @@ namespace FModel
{
AppendText("Auto saving icons set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //ASSET IS A CHALLENGE =>
if (IDParser[ii].ExportType == "Texture2D")
@ -2150,11 +2460,20 @@ namespace FModel
var filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (!File.Exists(filesPath))
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[currentItem] + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
}
try
@ -2204,12 +2523,12 @@ namespace FModel
{
AppendText("Auto saving images set to ", Color.Black);
AppendText("True", Color.Green, true);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + ItemName + ".png", ImageFormat.Png);
ItemIconPictureBox.Image.Save(docPath + "\\Generated Icons\\" + currentItem + ".png", ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(docPath + "\\Generated Icons\\" + ItemName + ".png", Color.SteelBlue, true);
AppendText(docPath + "\\Generated Icons\\" + currentItem + ".png", Color.SteelBlue, true);
}
} //ASSET IS A TEXTURE => LOAD TEXTURE
if (IDParser[ii].ExportType == "SoundWave")
@ -2227,11 +2546,20 @@ namespace FModel
{
var filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".uexp", SearchOption.AllDirectories).FirstOrDefault();
if (!File.Exists(filesPath))
{
if (isAllPAKs == false)
{
await Task.Run(() =>
{
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + currentPAK + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
if (isAllPAKs == true)
{
await Task.Run(() => {
jwpmProcess("extract \"" + Properties.Settings.Default.FortnitePAKs + "\\" + AllPAKsDict[currentItem] + "\" \"" + currentItem + "\" \"" + docPath + "\"");
});
}
filesPath = Directory.GetFiles(docPath + "\\Extracted", currentItem + ".uexp", SearchOption.AllDirectories).FirstOrDefault();
}
try
@ -2320,12 +2648,12 @@ namespace FModel
saveTheDialog.Title = "Save Icon";
saveTheDialog.Filter = "PNG Files (*.png)|*.png";
saveTheDialog.InitialDirectory = docPath + "\\Generated Icons\\";
saveTheDialog.FileName = ItemName;
saveTheDialog.FileName = currentItem;
if (saveTheDialog.ShowDialog() == DialogResult.OK)
{
ItemIconPictureBox.Image.Save(saveTheDialog.FileName, ImageFormat.Png);
AppendText("✔ ", Color.Green);
AppendText(ItemName, Color.DarkRed);
AppendText(currentItem, Color.DarkRed);
AppendText(" successfully saved to ", Color.Black);
AppendText(saveTheDialog.FileName, Color.SteelBlue, true);
}
@ -2352,8 +2680,6 @@ namespace FModel
}
private void mergeGeneratedImagesToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrEmpty(Properties.Settings.Default.mergerFileName))
{
@ -2430,11 +2756,6 @@ namespace FModel
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
}
private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
{

View File

@ -131,7 +131,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACc
BwAAAk1TRnQBSQFMAgEBAgEAAUABAAFAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
BwAAAk1TRnQBSQFMAgEBAgEAAUgBAAFIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -51,7 +51,10 @@ I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instea
- [x] Multithreading - Need improvements
- [x] Filter for the items ListBox
- [x] Quest viewer or something
- [ ] More settings
- [ ] Load all paks
- [ ] Load only difference between 2 paks version
- [ ] Custom watermark option on icons
- [ ] Choose between extracted filename or displayName for icons file name
- [ ] Stop button while extracting
- [ ] Support for meshes
- [ ] Support for animations