Merge branch 'master' of https://github.com/iAmAsval/FModel into fortbytes

This commit is contained in:
MaikyM
2019-06-17 17:21:17 -06:00
27 changed files with 256 additions and 203 deletions

View File

@@ -136,7 +136,6 @@
<Compile Include="Methods\DLLImport.cs" />
<Compile Include="Methods\IconGenerator\DrawText.cs" />
<Compile Include="Methods\IconGenerator\Translations\LoadLocRes.cs" />
<Compile Include="Methods\IconGenerator\Translations\AssetNameMap.cs" />
<Compile Include="Methods\IconGenerator\Translations\SearchResource.cs" />
<Compile Include="Methods\ImagesMerger\ImagesMerger.cs" />
<Compile Include="Methods\Serializer\AssetReader.cs" />
@@ -242,10 +241,10 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="oo2core_5_win64.dll">
<Content Include="csharp_wick.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="csharp_wick.dll">
<Content Include="oo2core_5_win64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="DLLs\csharp-wick.dll" />

View File

@@ -35,6 +35,7 @@
this.OKButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.panel1 = new System.Windows.Forms.Panel();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.groupBox3.SuspendLayout();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
@@ -103,11 +104,24 @@
this.panel1.Size = new System.Drawing.Size(559, 200);
this.panel1.TabIndex = 0;
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(12, 296);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(124, 13);
this.linkLabel1.TabIndex = 18;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "Latest Fortnite AES Keys";
this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel1_LinkClicked);
//
// AESManager
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(589, 325);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.OKButton);
this.Controls.Add(this.groupBox3);
@@ -121,6 +135,7 @@
this.groupBox3.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -132,5 +147,6 @@
private System.Windows.Forms.Button OKButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.LinkLabel linkLabel1;
}
}

View File

@@ -49,7 +49,11 @@ namespace FModel.Forms
private void OKButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.AESKey = textBox2.Text.Substring(2).ToUpper();
if (!string.IsNullOrWhiteSpace(textBox2.Text))
{
Properties.Settings.Default.AESKey = textBox2.Text.Substring(2).ToUpper();
}
else { Properties.Settings.Default.AESKey = ""; }
DynamicKeysManager.AESEntries = new List<AESEntry>();
for (int i = 0; i < ThePak.dynamicPaksList.Count; i++)
@@ -75,5 +79,10 @@ namespace FModel.Forms
Properties.Settings.Default.Save();
Close();
}
private void LinkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("http://benbotfn.tk:8080/api/aes");
}
}
}

View File

@@ -65,10 +65,10 @@
this.linkLabel2.AutoSize = true;
this.linkLabel2.Location = new System.Drawing.Point(398, 91);
this.linkLabel2.Name = "linkLabel2";
this.linkLabel2.Size = new System.Drawing.Size(42, 13);
this.linkLabel2.Size = new System.Drawing.Size(43, 13);
this.linkLabel2.TabIndex = 2;
this.linkLabel2.TabStop = true;
this.linkLabel2.Text = "Donate";
this.linkLabel2.Text = "Discord";
this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
//
// label1

View File

@@ -19,7 +19,7 @@ namespace FModel.Forms
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("https://paypal.me/AsvalD3SK1NG");
System.Diagnostics.Process.Start("https://discordapp.com/invite/JmWvXKb");
}
}
}

View File

@@ -118,6 +118,11 @@ namespace FModel.Forms
Properties.Settings.Default.IconLanguage = comboBox1.SelectedItem.ToString();
Properties.Settings.Default.Save(); //SAVE
if (ThePak.AllpaksDictionary != null)
{
LoadLocRes.LoadMySelectedLocRes(Properties.Settings.Default.IconLanguage);
}
Close();
}

View File

@@ -46,6 +46,7 @@
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.filesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoSaveImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -70,7 +71,6 @@
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.panel1.SuspendLayout();
@@ -196,7 +196,7 @@
//
this.settingsToolStripMenuItem.Image = global::FModel.Properties.Resources.properties_16xLG;
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this.settingsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.settingsToolStripMenuItem.Text = "Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
@@ -213,11 +213,19 @@
// searchToolStripMenuItem
//
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.searchToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.searchToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
this.searchToolStripMenuItem.Text = "Search";
this.searchToolStripMenuItem.Click += new System.EventHandler(this.searchToolStripMenuItem_Click);
//
// copySelectedFilePathToolStripMenuItem
//
this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem";
this.copySelectedFilePathToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F3;
this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path";
this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click);
//
// imageToolStripMenuItem
//
this.imageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -232,7 +240,7 @@
// saveImageToolStripMenuItem
//
this.saveImageToolStripMenuItem.Name = "saveImageToolStripMenuItem";
this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.saveImageToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.saveImageToolStripMenuItem.Text = "Save Image";
this.saveImageToolStripMenuItem.Click += new System.EventHandler(this.saveImageToolStripMenuItem_Click);
//
@@ -240,18 +248,18 @@
//
this.autoSaveImagesToolStripMenuItem.CheckOnClick = true;
this.autoSaveImagesToolStripMenuItem.Name = "autoSaveImagesToolStripMenuItem";
this.autoSaveImagesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.autoSaveImagesToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.autoSaveImagesToolStripMenuItem.Text = "Auto Save Images";
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(165, 6);
//
// mergeImagesToolStripMenuItem
//
this.mergeImagesToolStripMenuItem.Name = "mergeImagesToolStripMenuItem";
this.mergeImagesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.mergeImagesToolStripMenuItem.Size = new System.Drawing.Size(168, 22);
this.mergeImagesToolStripMenuItem.Text = "Merge Images";
this.mergeImagesToolStripMenuItem.Click += new System.EventHandler(this.mergeImagesToolStripMenuItem_Click);
//
@@ -464,14 +472,6 @@
this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork);
this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted);
//
// copySelectedFilePathToolStripMenuItem
//
this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem";
this.copySelectedFilePathToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2;
this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(216, 22);
this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path";
this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click);
//
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@@ -278,7 +278,11 @@ namespace FModel
{
try
{
JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + ThePak.mainPaksList[i].thePak, Settings.Default.AESKey);
if (!string.IsNullOrWhiteSpace(Settings.Default.AESKey))
{
JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + ThePak.mainPaksList[i].thePak, Settings.Default.AESKey);
}
else { break; }
}
catch (Exception)
{
@@ -368,6 +372,7 @@ namespace FModel
ThePak.CurrentUsedPak = null;
ThePak.CurrentUsedPakGuid = null;
}
LoadLocRes.LoadMySelectedLocRes(Settings.Default.IconLanguage);
UpdateConsole("Building tree, please wait...", Color.FromArgb(255, 244, 132, 66), "Loading");
}
private void TreeParsePath(TreeNodeCollection nodeList, string path) //https://social.msdn.microsoft.com/Forums/en-US/c75c1804-6933-40ba-b17a-0e36ae8bcbb5/how-to-create-a-tree-view-with-full-paths?forum=csharplanguage
@@ -1262,7 +1267,7 @@ namespace FModel
DrawText.DrawTexts(theItem, g, specialMode);
UpdateConsole(theItem.DisplayName, Color.FromArgb(255, 66, 244, 66), "Success");
UpdateConsole(theItem.DisplayName.SourceString, Color.FromArgb(255, 66, 244, 66), "Success");
if (autoSaveImagesToolStripMenuItem.Checked || updateModeToolStripMenuItem.Checked)
{
bmp.Save(App.DefaultOutputPath + "\\Icons\\" + ThePak.CurrentUsedItem + ".png", ImageFormat.Png);
@@ -1363,7 +1368,7 @@ namespace FModel
}
}
UpdateConsole(theItem.DisplayName, Color.FromArgb(255, 66, 244, 66), "Success");
UpdateConsole(theItem.DisplayName.SourceString, Color.FromArgb(255, 66, 244, 66), "Success");
if (autoSaveImagesToolStripMenuItem.Checked || updateModeToolStripMenuItem.Checked)
{
Invoke(new Action(() =>

View File

@@ -131,7 +131,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABa
CAAAAk1TRnQBSQFMAgEBAgEAATABAQEwAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAATgBAQE4AQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@@ -39,7 +39,6 @@ namespace FModel
}
AESEntries = outputList;
}
else { throw new Exception("Fail to locate AESManager.xml"); }
}
}
}

View File

@@ -1,7 +1,6 @@
using FModel.Methods.BackupPAKs.Parser.AccessCodeParser;
using FModel.Methods.BackupPAKs.Parser.TokenParser;
using RestSharp;
using System;
using Newtonsoft.Json.Linq;
using System.Globalization;
using System.Collections.Generic;
@@ -20,24 +19,17 @@ namespace FModel
/// <returns> url content </returns>
public static string GetEndpoint(string url, bool auth)
{
string content = string.Empty;
try
{
RestClient EndpointClient = new RestClient(url);
RestRequest EndpointRequest = new RestRequest(Method.GET);
RestClient EndpointClient = new RestClient(url);
RestRequest EndpointRequest = new RestRequest(Method.GET);
if (auth)
{
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
}
var response = EndpointClient.Execute(EndpointRequest);
content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
}
catch (Exception ex)
if (auth)
{
throw new Exception(ex.Message);
EndpointRequest.AddHeader("Authorization", "bearer " + getExchangeToken(getAccessCode(getAccessToken(Properties.Settings.Default.eEmail, Properties.Settings.Default.ePassword))));
}
var response = EndpointClient.Execute(EndpointRequest);
string content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented);
return content;
}
private static string getAccessToken(string email, string password)

View File

@@ -154,13 +154,49 @@ namespace FModel
}
private static void drawCompletionText(string count)
{
string all = string.Empty;
string any = string.Empty;
switch (Settings.Default.IconLanguage)
{
case "English":
all = "Complete ALL CHALLENGES to earn the reward item";
any = "Complete ANY " + count + " CHALLENGES to earn the reward item";
goto default;
case "French":
all = "Terminez CHACUN DES DÉFIS pour gagner la récompense";
any = "Terminez " + count + " DES DÉFIS pour gagner la récompense";
goto default;
case "German":
all = "Schließe ALLE HERAUSFORDERUNGEN ab, um die Belohnung zu verdienen";
any = "Schließe " + count + " HERAUSFORDERUNGEN ab, um die Belohnung zu verdienen";
goto default;
case "Italian":
all = "Completa TUTTE LE SFIDE per ottenere l'oggetto in ricompensa";
any = "Completa " + count + " SFIDE QUALSIASI per ottenere l'oggetto ricompensa";
goto default;
case "Spanish":
all = "Completa LOS DESAFÍOS para conseguir el objeto de recompensa";
any = "Completa " + count + " DE LOS DESAFÍOS para conseguir el objeto de recompensa";
goto default;
default:
if (count == "-1")
{
toDrawOn.DrawString(all, new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
}
else
{
toDrawOn.DrawString(any, new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
}
break;
}
if (count == "-1")
{
toDrawOn.DrawString("Complete ALL CHALLENGES to earn the reward item", new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
toDrawOn.DrawString(all, new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
}
else
{
toDrawOn.DrawString("Complete ANY " + count + " CHALLENGES to earn the reward item", new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
toDrawOn.DrawString(any, new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22));
}
}
@@ -170,8 +206,25 @@ namespace FModel
/// <param name="myBitmap"></param>
public static void drawWatermark(Bitmap myBitmap)
{
toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40));
toDrawOn.DrawString(myItem.DisplayName + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
if (LoadLocRes.myLocRes != null && Settings.Default.IconLanguage != "English")
{
string text = SearchResource.getTranslatedText(myItem.DisplayName.Key);
if (!string.IsNullOrEmpty(text))
{
toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40));
toDrawOn.DrawString(text + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
}
else
{
toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40));
toDrawOn.DrawString(myItem.DisplayName.SourceString + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
}
}
else
{
toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40));
toDrawOn.DrawString(myItem.DisplayName.SourceString + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(FontUtilities.pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width / 2, theY + 250), FontUtilities.centeredString);
}
}
private static void drawForbyteReward()

View File

@@ -34,7 +34,16 @@ namespace FModel
}
public static string getBundleDisplayName(ItemsIdParser theItem)
{
return theItem.DisplayName.ToUpper();
if (LoadLocRes.myLocRes != null && Properties.Settings.Default.IconLanguage != "English")
{
string text = SearchResource.getTranslatedText(theItem.DisplayName.Key);
if (!string.IsNullOrEmpty(text))
{
return text.ToUpper();
}
else { return theItem.DisplayName.SourceString.ToUpper(); }
}
else { return theItem.DisplayName.SourceString.ToUpper(); }
}
public static string getLastFolder(string pathToExtractedBundle)
{
@@ -94,11 +103,18 @@ namespace FModel
for (int p = 0; p < questParser[x].Objectives.Length; p++)
{
string newQuest = questParser[x].Objectives[p].Description;
string newQuest;
if (LoadLocRes.myLocRes != null && Properties.Settings.Default.IconLanguage != "English")
{
newQuest = SearchResource.getTranslatedText(questParser[x].Objectives[p].Description.Key);
}
else { newQuest = questParser[x].Objectives[p].Description.SourceString; }
long newCount = questParser[x].Objectives[p].Count;
if (questParser[x].BAthenaMustCompleteInSingleMatch != false && questParser[x].ObjectiveCompletionCount > 0)
if (questParser[x].BAthenaMustCompleteInSingleMatch && questParser[x].ObjectiveCompletionCount > 0)
{
newCount = questParser[x].ObjectiveCompletionCount;
}
if (newQuest != oldQuest && newCount != oldCount)
{

View File

@@ -84,7 +84,19 @@ namespace FModel
try
{
ShortDescription = theItem.ShortDescription;
switch (Settings.Default.IconLanguage)
{
case "French":
case "German":
case "Italian":
case "Spanish":
ShortDescription = SearchResource.getTranslatedText(theItem.ShortDescription.Key);
if (string.IsNullOrEmpty(ShortDescription)) { ShortDescription = theItem.ShortDescription.SourceString; }
break;
default:
ShortDescription = theItem.ShortDescription.SourceString;
break;
}
}
catch (Exception)
{
@@ -219,7 +231,22 @@ namespace FModel
{
if (theItem.DisplayName != null)
{
myGraphic.DrawString(theItem.DisplayName, new Font(FontUtilities.pfc.Families[0], 35), new SolidBrush(Color.White), new Point(522 / 2, 395), FontUtilities.centeredString);
if (LoadLocRes.myLocRes != null && Settings.Default.IconLanguage != "English")
{
string text = SearchResource.getTranslatedText(theItem.DisplayName.Key);
if (!string.IsNullOrEmpty(text))
{
myGraphic.DrawString(text, new Font(FontUtilities.pfc.Families[0], 35), new SolidBrush(Color.White), new Point(522 / 2, 395), FontUtilities.centeredString);
}
else
{
myGraphic.DrawString(theItem.DisplayName.SourceString, new Font(FontUtilities.pfc.Families[0], 35), new SolidBrush(Color.White), new Point(522 / 2, 395), FontUtilities.centeredString);
}
}
else
{
myGraphic.DrawString(theItem.DisplayName.SourceString, new Font(FontUtilities.pfc.Families[0], 35), new SolidBrush(Color.White), new Point(522 / 2, 395), FontUtilities.centeredString);
}
}
}
@@ -232,7 +259,22 @@ namespace FModel
{
if (theItem.Description != null)
{
myGraphic.DrawString(theItem.Description, new Font("Arial", 10), new SolidBrush(Color.White), new RectangleF(5, 441, 512, 49), FontUtilities.centeredStringLine);
if (LoadLocRes.myLocRes != null && Settings.Default.IconLanguage != "English")
{
string text = SearchResource.getTranslatedText(theItem.Description.Key);
if (!string.IsNullOrEmpty(text))
{
myGraphic.DrawString(text, new Font("Arial", 10), new SolidBrush(Color.White), new RectangleF(5, 441, 512, 49), FontUtilities.centeredStringLine);
}
else
{
myGraphic.DrawString(theItem.Description.SourceString, new Font("Arial", 10), new SolidBrush(Color.White), new RectangleF(5, 441, 512, 49), FontUtilities.centeredStringLine);
}
}
else
{
myGraphic.DrawString(theItem.Description.SourceString, new Font("Arial", 10), new SolidBrush(Color.White), new RectangleF(5, 441, 512, 49), FontUtilities.centeredStringLine);
}
}
}

View File

@@ -1,109 +0,0 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace FModel
{
static class AssetNameMap
{
public static List<string> myNamespacesList { get; set; }
public static void searchStringsInUexp(string filepath)
{
myNamespacesList = new List<string>();
if (File.Exists(filepath))
{
List<string> weirdStrings = new List<string>();
List<string> listBeforeData = new List<string>();
bool previousByteWasValid = false;
byte[] bytes = File.ReadAllBytes(filepath);
string pattern = @"^[a-zA-Z0-9()'\-.&!+, ]";
Regex regex = new Regex(pattern);
foreach (byte b in bytes) // Iterate throught all the bytes of the file
{
string byteString = Encoding.UTF8.GetString(new[] { b }); // Generate string for single byte
bool valid = regex.IsMatch(byteString);
if (valid)
{
if (previousByteWasValid) weirdStrings[weirdStrings.Count - 1] += byteString;
else weirdStrings.Add(byteString);
}
previousByteWasValid = valid;
}
bool found = false;
foreach (string str in weirdStrings)
{
if (str.Length >= 2)
{
if (found) { myNamespacesList.Add(str); break; }
listBeforeData.Add(str);
if (str == "Outfit"
|| str == "Back Bling"
|| str == "Pet"
|| str == "Harvesting Tool"
|| str == "Glider"
|| str == "Contrail"
|| str == "Emote"
|| str == "Emoticon"
|| str == "Toy"
|| str == "Music")
{
int index = listBeforeData.IndexOf(str);
Console.WriteLine("DName: " + listBeforeData[index - 3]);
Console.WriteLine("Description: " + listBeforeData[index - 1]);
myNamespacesList.Add(listBeforeData[index - 3]);
myNamespacesList.Add(listBeforeData[index - 1]);
found = true;
}
}
}
}
}
public static void getNameMap(string filepath)
{
Console.Clear();
using (BinaryReader reader = new BinaryReader(File.Open(filepath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite), Encoding.GetEncoding(1252)))
{
reader.ReadBytes(24);
int AssetLength = reader.ReadInt32();
//Console.WriteLine(AssetLength);
reader.ReadBytes(13);
int NamespaceCount = reader.ReadInt32();
long LocalizedStringArrayOffset = -1;
LocalizedStringArrayOffset = reader.ReadInt64();
if (LocalizedStringArrayOffset != -1)
{
long newOffset = LocalizedStringArrayOffset - 4;
reader.BaseStream.Seek(newOffset, SeekOrigin.Begin);
string[] LocalizedStringArray = new string[NamespaceCount];
for (int i = 0; i < LocalizedStringArray.Length; i++)
{
string tag = AssetReader.readCleanString(reader);
if (tag != "None") { LocalizedStringArray[i] = tag; Console.WriteLine(LocalizedStringArray[i]); }
}
}
}
}
}
}

View File

@@ -27,7 +27,11 @@
private static string getMyLocRes(string selectedLanguage)
{
string oldKey = JohnWick.MyKey;
JohnWick.MyKey = Properties.Settings.Default.AESKey;
string locResPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["Game_BR.locres"], "Game_BR.locres");
JohnWick.MyKey = oldKey;
return LocResSerializer.StringFinder(locResPath.Replace("zh-Hant", selectedLanguage));
}
}

View File

@@ -6,17 +6,19 @@ namespace FModel
static class SearchResource
{
private static string parsedJsonToCheck { get; set; }
private static JObject jo { get; set; }
private static string oldLanguage = Properties.Settings.Default.IconLanguage;
public static string getTranslatedText(string theNamespace)
{
string toReturn = string.Empty;
string myParsedJson = string.Empty;
string newLanguage = Properties.Settings.Default.IconLanguage;
if (myParsedJson != parsedJsonToCheck)
if (parsedJsonToCheck == null || newLanguage != oldLanguage)
{
myParsedJson = JToken.Parse(LoadLocRes.myLocRes).ToString().TrimStart('[').TrimEnd(']');
parsedJsonToCheck = JToken.Parse(LoadLocRes.myLocRes).ToString().TrimStart('[').TrimEnd(']');
jo = JObject.Parse(parsedJsonToCheck);
}
JObject jo = JObject.Parse(myParsedJson);
foreach (JToken token in jo.FindTokens(theNamespace))
{
LocResParser LocResParse = LocResParser.FromJson(token.ToString());
@@ -24,13 +26,9 @@ namespace FModel
{
toReturn = LocResParse.LocResText;
}
else if (LocResParse.WorkerSetBonusTraitPattern != null)
{
toReturn = LocResParse.WorkerSetBonusTraitPattern;
}
}
oldLanguage = newLanguage;
parsedJsonToCheck = myParsedJson;
return toReturn;
}
}

View File

@@ -99,18 +99,6 @@ namespace FModel
}
currentPakToCheck = currentPak;
/*if (AssetPath.Contains("Athena\\Items\\") && File.Exists(AssetPath.Substring(0, AssetPath.LastIndexOf(".")) + ".uexp")) //TEST
{
try
{
AssetNameMap.searchStringsInUexp(AssetPath.Substring(0, AssetPath.LastIndexOf(".")) + ".uexp");
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}*/
return AssetPath;
}

View File

@@ -64,9 +64,9 @@ namespace FModel
}
}
}
else { throw new Exception("Unsupported LocRes version."); }
else { throw new ArgumentException("Unsupported LocRes version."); }
}
else { throw new Exception("Wrong LocResMagic number."); }
else { throw new ArgumentException("Wrong LocResMagic number."); }
}
return JsonConvert.SerializeObject(LocResDict, Formatting.Indented);

View File

@@ -73,7 +73,7 @@ namespace FModel
}
/// <summary>
/// Once upon a time, it was used for shitty stuff
///
/// </summary>
public static void JohnWickCheck()
{

View File

@@ -27,15 +27,24 @@ namespace FModel.Parser.Banners
public string CategoryRowName { get; set; }
[JsonProperty("DisplayName")]
public string DisplayName { get; set; }
public FTextInfos DisplayName { get; set; }
[JsonProperty("DisplayDescription")]
public string DisplayDescription { get; set; }
public FTextInfos DisplayDescription { get; set; }
[JsonProperty("bFullUsageRights")]
public bool BFullUsageRights { get; set; }
}
public partial class FTextInfos
{
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("source_string")]
public string SourceString { get; set; }
}
public class Image
{
[JsonProperty("asset_path_name")]

View File

@@ -19,7 +19,7 @@ namespace FModel.Parser.Challenges
public DisplayStyle DisplayStyle { get; set; }
[JsonProperty("DisplayName")]
public string DisplayName { get; set; }
public DisplayName DisplayName { get; set; }
[JsonProperty("SmallPreviewImage")]
public LargePreviewImage SmallPreviewImage { get; set; }
@@ -28,6 +28,15 @@ namespace FModel.Parser.Challenges
public LargePreviewImage LargePreviewImage { get; set; }
}
public partial class DisplayName
{
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("source_string")]
public string SourceString { get; set; }
}
public class BundleCompletionReward
{
[JsonProperty("CompletionCount")]

View File

@@ -28,13 +28,13 @@ namespace FModel.Parser.Items
public string Series { get; set; }
[JsonProperty("DisplayName")]
public string DisplayName { get; set; }
public FTextInfos DisplayName { get; set; }
[JsonProperty("ShortDescription")]
public string ShortDescription { get; set; }
public FTextInfos ShortDescription { get; set; }
[JsonProperty("Description")]
public string Description { get; set; }
public FTextInfos Description { get; set; }
[JsonProperty("GameplayTags")]
public GameplayTags GameplayTags { get; set; }
@@ -67,6 +67,15 @@ namespace FModel.Parser.Items
public WeaponStatHandle WeaponStatHandle { get; set; }
}
public partial class FTextInfos
{
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("source_string")]
public string SourceString { get; set; }
}
public class GameplayTags
{
[JsonProperty("gameplay_tags")]

View File

@@ -34,16 +34,16 @@ namespace FModel.Parser.Quests
public double Weight { get; set; }
[JsonProperty("CompletionText")]
public string CompletionText { get; set; }
public FTextInfos CompletionText { get; set; }
[JsonProperty("GrantToProfileType")]
public string GrantToProfileType { get; set; }
[JsonProperty("DisplayName")]
public string DisplayName { get; set; }
public FTextInfos DisplayName { get; set; }
[JsonProperty("Description")]
public string Description { get; set; }
public FTextInfos Description { get; set; }
[JsonProperty("GameplayTags")]
public GameplayTags GameplayTags { get; set; }
@@ -55,6 +55,15 @@ namespace FModel.Parser.Quests
public LargePreviewImage LargePreviewImage { get; set; }
}
public partial class FTextInfos
{
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("source_string")]
public string SourceString { get; set; }
}
public class GameplayTags
{
[JsonProperty("gameplay_tags")]
@@ -118,10 +127,10 @@ namespace FModel.Parser.Quests
public long LinkSquadIndex { get; set; }
[JsonProperty("Description")]
public string Description { get; set; }
public FTextInfos Description { get; set; }
[JsonProperty("HudShortDescription")]
public string HudShortDescription { get; set; }
public FTextInfos HudShortDescription { get; set; }
[JsonProperty("HudIcon")]
public LargePreviewImage HudIcon { get; set; }

View File

@@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.3.0")]
[assembly: AssemblyFileVersion("2.3.3.0")]
[assembly: AssemblyVersion("2.4.0.0")]
[assembly: AssemblyFileVersion("2.4.0.0")]
[assembly: NeutralResourcesLanguage("en")]

Binary file not shown.

View File

@@ -10,12 +10,12 @@
### 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.3.3)
[![](https://img.shields.io/badge/Release-Executable-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/tag/2.4.0)
### 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.
![](https://i.imgur.com/O2Vg3Bx.gif)
**2.** Restart the executable, enter the AES Key, click **Load** and select your .PAK file
**2.** Restart the executable, go to the AES Manager and add you AES Keys, click **Load** and select your .PAK file
- It will parse all Assets contained in the selected .PAK file with their respective path
**3.** Navigate through the tree to find the Asset you want
@@ -77,17 +77,17 @@ Also if you find this project useful, feel free to give it a :star: thank you :k
| <a href="https://github.com/SirWaddles" target="_blank">**Waddlesworth**</a> | <a href="https://github.com/AyeTSG" target="_blank">**AyeTSG**</a> | <a href="https://github.com/ItsFireMonkey" target="_blank">**FireMonkey**</a> | <a href="https://github.com/MaikyM" target="_blank">**Maiky M**</a> |
| :---: | :---: | :---: | :---: |
| [![Waddlesworth](https://avatars1.githubusercontent.com/u/769399?s=200&v=4)](https://github.com/SirWaddles) | [![AyeTSG](https://avatars1.githubusercontent.com/u/49595354?s=200&v=4)](https://github.com/AyeTSG) | [![FireMonkey](https://avatars2.githubusercontent.com/u/38590471?s=200&v=4)](https://github.com/ItsFireMonkey) | [![Maiky M](https://avatars3.githubusercontent.com/u/51415805?s=200&v=4)](https://github.com/MaikyM) |
| <a href="https://github.com/SirWaddles" target="_blank">`https://github.com/SirWaddles`</a> | <a href="https://twitter.com/AyeTSG" target="_blank">`https://twitter.com/AyeTSG`</a> | <a href="https://twitter.com/FireMonkeyFN" target="_blank">`https://twitter.com/FireMonkeyFN`</a> |<a href="https://twitter.com/Mikey_Bad05" target="_blank">`https://twitter.com/Mikey_Bad05`</a> |
| <a href="https://github.com/SirWaddles" target="_blank">`https://github.com/SirWaddles`</a> | <a href="https://twitter.com/AyeTSG" target="_blank">`https://twitter.com/AyeTSG`</a> | <a href="https://twitter.com/FireMonkeyFN" target="_blank">`https://twitter.com/FireMonkeyFN`</a> |<a href="https://twitter.com/MaikyMOficial" target="_blank">`https://twitter.com/MaikyMOficial`</a> |
### Why FModel
This project is mainly based on what [UModel](https://github.com/gildor2/UModel) can do, in a personalized way, in case UModel doesn't work, as a temporary rescue solution.
I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instead if you wanna use something made professionnaly.
## TODO
- [ ] Code refactoring
- [ ] Icons translation
- [ ] 2FA support
- [ ] Export Queue
- [ ] Nintendo Switch sound files
- [x] Translation support
- [x] AES Manager
- [x] Display support for .locres files
- [x] Nintendo Switch PAKs