Skip to content

Commit

Permalink
FModel 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
4sval committed May 12, 2019
1 parent 9ec1b46 commit f63db43
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 26 deletions.
73 changes: 50 additions & 23 deletions FModel/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1734,32 +1734,32 @@ private void GetItemRarity(ItemsIdParser theItem, Graphics toDrawOn, string Spec
Image rarityBg = Resources.T512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Mythic")
else if (theItem.Rarity == "EFortRarity::Mythic")
{
Image rarityBg = Resources.M512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Legendary")
else if (theItem.Rarity == "EFortRarity::Legendary")
{
Image rarityBg = Resources.L512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Epic" || theItem.Rarity == "EFortRarity::Quality")
else if (theItem.Rarity == "EFortRarity::Epic" || theItem.Rarity == "EFortRarity::Quality")
{
Image rarityBg = Resources.E512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Rare")
else if (theItem.Rarity == "EFortRarity::Rare")
{
Image rarityBg = Resources.R512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Common" || SpecialMode == "ammo") // Force common rarity if ammo, as ammo is always common in FN
else if (theItem.Rarity == "EFortRarity::Common" || SpecialMode == "ammo") // Force common rarity if ammo, as ammo is always common in FN
{
Image rarityBg = Resources.C512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == null)
else
{
Image rarityBg = Resources.U512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
Expand Down Expand Up @@ -2004,29 +2004,56 @@ private void SearchFeaturedCharacterIcon(ItemsIdParser theItem, string catName,
UpdateConsole("Parsing " + catName.Substring(catName.LastIndexOf('.') + 1) + "...", Color.FromArgb(255, 244, 132, 66), "Waiting");
for (int i = 0; i < featuredId.Length; i++)
{
if (featuredId[i].DetailsImage != null)
//Thanks EPIC
if (CurrentUsedItem == "DA_Featured_CID_319_Athena_Commando_F_Nautilus")
{
string textureFile = featuredId[i].DetailsImage.ResourceObject;
if (featuredId[i].TileImage != null)
{
string textureFile = featuredId[i].TileImage.ResourceObject;

if (CurrentUsedPakGuid != null && CurrentUsedPakGuid != "0-0-0-0")
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + CurrentUsedPak + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
else
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + AllpaksDictionary[textureFile] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (CurrentUsedPakGuid != null && CurrentUsedPakGuid != "0-0-0-0")
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + CurrentUsedPak + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
else
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + AllpaksDictionary[textureFile] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();

if (textureFilePath != null && textureFilePath.Contains("MI_UI_FeaturedRenderSwitch_"))
{
ItemIconPath = GetRenderSwitchMaterialTexture(textureFile, textureFilePath);
if (textureFilePath != null)
{
MyAsset = new PakAsset(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile);
MyAsset.SaveTexture(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png");
ItemIconPath = textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png";
UpdateConsole(textureFile + " successfully converted to .PNG", Color.FromArgb(255, 66, 244, 66), "Success");
}
else
UpdateConsole("Error while extracting " + textureFile, Color.FromArgb(255, 244, 66, 66), "Error");
}
else if (textureFilePath != null && !textureFilePath.Contains("MI_UI_FeaturedRenderSwitch_"))
}
else
{
if (featuredId[i].DetailsImage != null)
{
MyAsset = new PakAsset(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile);
MyAsset.SaveTexture(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png");
ItemIconPath = textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png";
UpdateConsole(textureFile + " successfully converted to .PNG", Color.FromArgb(255, 66, 244, 66), "Success");
string textureFile = featuredId[i].DetailsImage.ResourceObject;

if (CurrentUsedPakGuid != null && CurrentUsedPakGuid != "0-0-0-0")
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + CurrentUsedPak + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
else
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + AllpaksDictionary[textureFile] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();

if (textureFilePath != null && textureFilePath.Contains("MI_UI_FeaturedRenderSwitch_"))
{
ItemIconPath = GetRenderSwitchMaterialTexture(textureFile, textureFilePath);
}
else if (textureFilePath != null && !textureFilePath.Contains("MI_UI_FeaturedRenderSwitch_"))
{
MyAsset = new PakAsset(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile);
MyAsset.SaveTexture(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png");
ItemIconPath = textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png";
UpdateConsole(textureFile + " successfully converted to .PNG", Color.FromArgb(255, 66, 244, 66), "Success");
}
else
UpdateConsole("Error while extracting " + textureFile, Color.FromArgb(255, 244, 66, 66), "Error");
}
else
UpdateConsole("Error while extracting " + textureFile, Color.FromArgb(255, 244, 66, 66), "Error");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# FModel
[![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases)
[![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Total%20Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases)
[![](https://img.shields.io/badge/License-GPL-blue.svg?logo=gnu)](https://github.com/iAmAsval/FModel/blob/master/LICENSE)
[![](https://img.shields.io/badge/[email protected]?logo=twitter)](https://twitter.com/AsvalFN)
[![](https://img.shields.io/badge/Discord-Need%20Help%3F-7289da.svg?logo=discord)](https://discord.gg/JmWvXKb)
Expand All @@ -12,7 +12,7 @@
### Prerequisites
[.NET Framework 4.7.1](https://dotnet.microsoft.com/download/dotnet-framework/net471)
### Download
[![](https://img.shields.io/badge/Release-Executable-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/tag/2.2.2)
[![](https://img.shields.io/badge/Release-Executable-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/tag/2.3)
### How does it works
**1.** Once you start the executable, you'll be asked to set your path to your Fortnite .PAK files. Meanwhile a `FModel` subfolder will be created in your `Documents` folder and it'll automatically download the latest version of the custom [Fortnite Asset Parser](https://github.com/SirWaddles/JohnWickParse) in this subfolder.

Expand Down Expand Up @@ -88,14 +88,14 @@ This project is mainly based on what [UModel](https://github.com/gildor2/UModel)
I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instead if you wanna use something made professionnaly.

## TODO
- [ ] STW Icons
- [ ] Get new file content
- [ ] Display support for .locres files + compare
- [x] Code refactoring
- [x] Multithreading
- [x] Stop button
- [x] Auto update
- [x] CTRL F, CTRL G, CTRL I for jsonTextBox
- [x] STW Icons
- [x] Update Mode
- [x] Search through PAKs
- [x] Improve speed
Expand Down

0 comments on commit f63db43

Please sign in to comment.