This commit is contained in:
Asval 2019-05-10 02:06:41 +02:00
parent a22a6d86d8
commit 04143e68c4
7 changed files with 1000 additions and 561 deletions

View File

@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8FABCD3A-9D55-4B54-B237-B259D815DEB8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<RootNamespace>FModel</RootNamespace>
<AssemblyName>FModel</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>

View File

@ -37,7 +37,7 @@
//
this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OKButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.OKButton.Location = new System.Drawing.Point(274, 401);
this.OKButton.Location = new System.Drawing.Point(222, 300);
this.OKButton.Name = "OKButton";
this.OKButton.Size = new System.Drawing.Size(97, 21);
this.OKButton.TabIndex = 15;
@ -47,24 +47,24 @@
//
// checkedAssets
//
this.checkedAssets.CheckOnClick = true;
this.checkedAssets.FormattingEnabled = true;
this.checkedAssets.Items.AddRange(new object[] {
"Challenges",
"Consumables & Weapons",
"Cosmetics",
"Traps",
"Variants"
});
"Variants"});
this.checkedAssets.Location = new System.Drawing.Point(12, 12);
this.checkedAssets.Name = "checkedAssets";
this.checkedAssets.Size = new System.Drawing.Size(359, 364);
this.checkedAssets.Size = new System.Drawing.Size(307, 274);
this.checkedAssets.TabIndex = 16;
//
// IconGeneratorAssets
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(383, 434);
this.ClientSize = new System.Drawing.Size(331, 333);
this.Controls.Add(this.checkedAssets);
this.Controls.Add(this.OKButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;

View File

@ -37,6 +37,7 @@
this.label1 = new System.Windows.Forms.Label();
this.OKButton = new System.Windows.Forms.Button();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.button2 = new System.Windows.Forms.Button();
this.checkBox8 = new System.Windows.Forms.CheckBox();
this.checkBox7 = new System.Windows.Forms.CheckBox();
this.filenameLabel = new System.Windows.Forms.Label();
@ -51,7 +52,6 @@
this.label5 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox4.SuspendLayout();
@ -122,7 +122,7 @@
//
this.OKButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OKButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.OKButton.Location = new System.Drawing.Point(475, 401);
this.OKButton.Location = new System.Drawing.Point(475, 379);
this.OKButton.Name = "OKButton";
this.OKButton.Size = new System.Drawing.Size(97, 21);
this.OKButton.TabIndex = 15;
@ -149,10 +149,20 @@
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Icon Creation";
//
// button2
//
this.button2.Location = new System.Drawing.Point(6, 19);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(377, 22);
this.button2.TabIndex = 27;
this.button2.Text = "Manage Assets";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// checkBox8
//
this.checkBox8.AutoSize = true;
this.checkBox8.Location = new System.Drawing.Point(6, 20);
this.checkBox8.Location = new System.Drawing.Point(6, 52);
this.checkBox8.Name = "checkBox8";
this.checkBox8.Size = new System.Drawing.Size(177, 17);
this.checkBox8.TabIndex = 26;
@ -163,7 +173,7 @@
// checkBox7
//
this.checkBox7.AutoSize = true;
this.checkBox7.Location = new System.Drawing.Point(6, 59);
this.checkBox7.Location = new System.Drawing.Point(6, 91);
this.checkBox7.Name = "checkBox7";
this.checkBox7.Size = new System.Drawing.Size(15, 14);
this.checkBox7.TabIndex = 25;
@ -173,7 +183,7 @@
// filenameLabel
//
this.filenameLabel.AutoSize = true;
this.filenameLabel.Location = new System.Drawing.Point(115, 60);
this.filenameLabel.Location = new System.Drawing.Point(115, 92);
this.filenameLabel.Name = "filenameLabel";
this.filenameLabel.Size = new System.Drawing.Size(60, 13);
this.filenameLabel.TabIndex = 24;
@ -181,7 +191,7 @@
//
// trackBar1
//
this.trackBar1.Location = new System.Drawing.Point(58, 112);
this.trackBar1.Location = new System.Drawing.Point(58, 144);
this.trackBar1.Maximum = 100;
this.trackBar1.Name = "trackBar1";
this.trackBar1.Size = new System.Drawing.Size(325, 45);
@ -192,7 +202,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(22, 83);
this.label9.Location = new System.Drawing.Point(22, 115);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(30, 13);
this.label9.TabIndex = 23;
@ -200,7 +210,7 @@
//
// trackBar2
//
this.trackBar2.Location = new System.Drawing.Point(58, 83);
this.trackBar2.Location = new System.Drawing.Point(58, 115);
this.trackBar2.Maximum = 1000;
this.trackBar2.Minimum = 1;
this.trackBar2.Name = "trackBar2";
@ -214,7 +224,7 @@
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(6, 115);
this.label8.Location = new System.Drawing.Point(6, 147);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(46, 13);
this.label8.TabIndex = 21;
@ -222,7 +232,7 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(27, 53);
this.button1.Location = new System.Drawing.Point(27, 85);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(82, 24);
this.button1.TabIndex = 19;
@ -293,21 +303,11 @@
this.label4.TabIndex = 9;
this.label4.Text = "File Name:";
//
// button2
//
this.button2.Location = new System.Drawing.Point(6, 160);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(116, 24);
this.button2.TabIndex = 27;
this.button2.Text = "Manage Assets";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Settings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(584, 434);
this.ClientSize = new System.Drawing.Size(584, 412);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.OKButton);

View File

@ -97,15 +97,15 @@
this.toolStripStatusLabel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(200)))), ((int)(((byte)(200)))));
this.toolStripStatusLabel1.Margin = new System.Windows.Forms.Padding(1, 3, 50, 2);
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(74, 17);
this.toolStripStatusLabel1.Text = "FModel 2.2.1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(47, 17);
this.toolStripStatusLabel1.Text = "FModel";
//
// toolStripStatusLabel2
//
this.toolStripStatusLabel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(200)))), ((int)(((byte)(200)))));
this.toolStripStatusLabel2.Margin = new System.Windows.Forms.Padding(0, 3, 50, 2);
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(936, 17);
this.toolStripStatusLabel2.Size = new System.Drawing.Size(963, 17);
this.toolStripStatusLabel2.Spring = true;
//
// toolStripStatusLabel3

View File

@ -93,6 +93,8 @@ namespace FModel
{
InitializeComponent();
toolStripStatusLabel1.Text += @" " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString().Substring(0, 5);
treeView1.Sort();
//REMOVE SPACE CAUSED BY SIZING GRIP
statusStrip1.Padding = new Padding(statusStrip1.Padding.Left, statusStrip1.Padding.Top, statusStrip1.Padding.Left, statusStrip1.Padding.Bottom);
@ -730,7 +732,7 @@ namespace FModel
{
AllpaksDictionary = new Dictionary<string, string>();
_diffToExtract = new Dictionary<string, string>();
Settings.Default.AESKey = AESKeyTextBox.Text.Substring(2);
Settings.Default.AESKey = AESKeyTextBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
if (selectedPak != null)
@ -834,6 +836,9 @@ namespace FModel
}
}
Settings.Default.AESKey = AESKeyTextBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
for (int i = 0; i < allYourPaKs.Length; i++)
{
string arCurrentUsedPak = allYourPaKs[i]; //SET CURRENT PAK
@ -1534,8 +1539,6 @@ namespace FModel
g.DrawImage(bg512, new Point(5, 383));
#region DRAW TEXT
try
{
try
{
g.DrawString(theItem.DisplayName, new Font(_pfc.Families[0], 35), new SolidBrush(Color.White), new Point(522 / 2, 395), _centeredString);
@ -1687,14 +1690,9 @@ namespace FModel
g.DrawImage(Forms.Settings.ResizeImage(traversalLogo, 32, 32), new Point(6, 3));
}
}
catch (IndexOutOfRangeException)
catch (Exception)
{
} //COSMETIC USER FACING FLAGS
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
#endregion
pictureBox1.Image = bmp;
@ -1734,7 +1732,7 @@ namespace FModel
Image rarityBg = Resources.L512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
}
if (theItem.Rarity == "EFortRarity::Epic")
if (theItem.Rarity == "EFortRarity::Epic" || theItem.Rarity == "EFortRarity::Quality")
{
Image rarityBg = Resources.E512;
toDrawOn.DrawImage(rarityBg, new Point(0, 0));
@ -2187,9 +2185,14 @@ namespace FModel
return toReturn;
}
//TODO: SIMPLIFY
private void CreateChallengesIcon(ItemsIdParser theItem, string theParsedJson, string questJson = null)
{
if (theItem.ExportType == "FortChallengeBundleItemDefinition")
{
if (CurrentUsedItem == "QuestBundle_S9_Fortbyte")
CreateFortByteChallengesIcon(theItem, theParsedJson, questJson);
else
{
Bitmap bmp = new Bitmap(Resources.Quest);
Graphics g = Graphics.FromImage(bmp);
@ -2303,19 +2306,13 @@ namespace FModel
for (int i2 = 0; i2 < bundleParser[i].QuestInfos.Length; i2++)
{
string cName = Path.GetFileName(bundleParser[i].QuestInfos[i2].QuestDefinition.AssetPathName);
SelectedChallengesArray[i2] = cName.Substring(cName.LastIndexOf('.') + 1);
SelectedChallengesArray[i2] = cName.Substring(0, cName.LastIndexOf('.'));
}
for (int i2 = 0; i2 < SelectedChallengesArray.Length; i2++)
{
try
{
//MANUAL FIX
if (SelectedChallengesArray[i2] == "Quest_BR_LevelUp_SeasonLevel")
SelectedChallengesArray[i2] = "Quest_BR_LevelUp_SeasonLevel_25";
if (SelectedChallengesArray[i2] == "Quest_BR_OT_Play_Featured_Creative")
SelectedChallengesArray[i2] = "Quest_BR_OT_play_featured_creative";
if (CurrentUsedPakGuid != null && CurrentUsedPakGuid != "0-0-0-0")
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + CurrentUsedPak + "\" \"" + SelectedChallengesArray[i2] + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
else
@ -2443,7 +2440,7 @@ namespace FModel
.Where(x => x.ItemPrimaryAssetId.PrimaryAssetType.Name != "Token")
.FirstOrDefault().Quantity, Color.DarkGreen, true);
}
catch (Exception ex)
catch (NullReferenceException)
{
if (questParser[ii].HiddenRewards != null)
{
@ -2461,9 +2458,13 @@ namespace FModel
}
else
{
Console.WriteLine(ex.Message);
AppendText("", Color.Black, true);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
else
{
@ -2523,6 +2524,50 @@ namespace FModel
justSkip += 1;
iamY += 140;
if (itemReward.Contains("Fortbyte_WeeklyChallengesComplete_"))
{
#region DRAW ICON
string textureFile = "T_UI_PuzzleIcon_64";
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 ?? throw new InvalidOperationException()] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
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");
if (File.Exists(ItemIconPath))
{
Image itemIcon;
using (var bmpTemp = new Bitmap(ItemIconPath))
{
itemIcon = new Bitmap(bmpTemp);
}
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
else
{
Image itemIcon = Resources.unknown512;
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
#endregion
if (compCount == "-1")
g.DrawString("Complete ALL CHALLENGES to earn the reward item", new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY + 22));
else
g.DrawString("Complete ANY " + compCount + " CHALLENGES to earn the reward item", new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY + 22));
}
else
{
if (bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().ItemDefinition.AssetPathName == "None")
{
var partsofbruhreally = bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().TemplateId.Split(':');
@ -2592,6 +2637,7 @@ namespace FModel
}
}
}
}
catch (Exception ex)
{
UpdateConsole(ex.Message, Color.FromArgb(255, 244, 66, 66), "Error");
@ -2658,6 +2704,7 @@ namespace FModel
AppendText("", Color.Black, true);
}
}
}
private void LoopStageQuest(string qAssetType, string qAssetName, Graphics toDrawOn, int yeay, int line)
{
Graphics toDrawOnLoop = toDrawOn;
@ -2797,7 +2844,7 @@ namespace FModel
.Where(x => x.ItemPrimaryAssetId.PrimaryAssetType.Name != "Token")
.FirstOrDefault().Quantity, Color.DarkGreen, true);
}
catch (Exception ex)
catch (NullReferenceException)
{
if (questParser[i].HiddenRewards != null)
{
@ -2813,9 +2860,13 @@ namespace FModel
}
else
{
Console.WriteLine(ex.Message);
AppendText("", Color.Black, true);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
else
{
@ -3156,6 +3207,394 @@ namespace FModel
}
}
}
private void CreateFortByteChallengesIcon(ItemsIdParser theItem, string theParsedJson, string questJson = null)
{
Bitmap bmp = new Bitmap(2500, 7500);
Graphics g = Graphics.FromImage(bmp);
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
g.SmoothingMode = SmoothingMode.HighQuality;
int iamY = 275;
int justSkip = 0;
YAfterLoop = 0;
bool v2 = false;
int sRed;
int sGreen;
int sBlue;
var bundleParser = ChallengeBundleIdParser.FromJson(theParsedJson);
for (int i = 0; i < bundleParser.Length; i++)
{
#region DRAW BUNDLE ICON
try
{
if (Settings.Default.createIconForChallenges)
{
if (bundleParser[i].DisplayStyle.DisplayImage != null)
{
v2 = true;
string seasonFolder = questJson.Substring(questJson.Substring(0, questJson.LastIndexOf("\\", StringComparison.Ordinal)).LastIndexOf("\\", StringComparison.Ordinal) + 1).ToUpper();
#region COLORS + IMAGE
if (seasonFolder.Substring(0, seasonFolder.LastIndexOf("\\", StringComparison.Ordinal)) != "LTM")
{
sRed = (int)(bundleParser[i].DisplayStyle.SecondaryColor.R * 255);
sGreen = (int)(bundleParser[i].DisplayStyle.SecondaryColor.G * 255);
sBlue = (int)(bundleParser[i].DisplayStyle.SecondaryColor.B * 255);
}
else
{
sRed = (int)(bundleParser[i].DisplayStyle.AccentColor.R * 255);
sGreen = (int)(bundleParser[i].DisplayStyle.AccentColor.G * 255);
sBlue = (int)(bundleParser[i].DisplayStyle.AccentColor.B * 255);
}
int seasonRed = Convert.ToInt32(sRed / 1.5);
int seasonGreen = Convert.ToInt32(sGreen / 1.5);
int seasonBlue = Convert.ToInt32(sBlue / 1.5);
g.FillRectangle(new SolidBrush(Color.FromArgb(255, sRed, sGreen, sBlue)), new Rectangle(0, 0, bmp.Width, 271));
g.FillRectangle(new SolidBrush(Color.FromArgb(255, seasonRed, seasonGreen, seasonBlue)), new Rectangle(0, 271, bmp.Width, bmp.Height - 271));
try
{
g.DrawString(seasonFolder.Substring(0, seasonFolder.LastIndexOf("\\", StringComparison.Ordinal)), new Font(_pfc.Families[1], 42), new SolidBrush(Color.FromArgb(255, seasonRed, seasonGreen, seasonBlue)), new Point(340, 40));
}
catch (NullReferenceException)
{
AppendText("[NullReferenceException] ", Color.Red);
AppendText("No ", Color.Black);
AppendText("Season ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //LAST SUBFOLDER
try
{
g.DrawString(theItem.DisplayName.ToUpper(), new Font(_pfc.Families[1], 115), new SolidBrush(Color.White), new Point(325, 70));
}
catch (NullReferenceException)
{
AppendText("[NullReferenceException] ", Color.Red);
AppendText("No ", Color.Black);
AppendText("DisplayName ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //NAME
string pngPath;
string textureFile = Path.GetFileName(bundleParser[i].DisplayStyle.DisplayImage.AssetPathName).Substring(0, Path.GetFileName(bundleParser[i].DisplayStyle.DisplayImage.AssetPathName).LastIndexOf('.'));
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 && textureFile == "M_UI_ChallengeTile_PCB")
{
pngPath = GetRenderSwitchMaterialTexture(textureFile, textureFilePath);
Image challengeIcon = Image.FromFile(pngPath);
g.DrawImage(Forms.Settings.ResizeImage(challengeIcon, 271, 271), new Point(40, 0)); //327
}
else if (textureFilePath != null)
{
MyAsset = new PakAsset(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile);
MyAsset.SaveTexture(textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png");
pngPath = textureFilePath.Substring(0, textureFilePath.LastIndexOf('\\')) + "\\" + textureFile + ".png";
UpdateConsole(textureFile + " successfully converted to .PNG", Color.FromArgb(255, 66, 244, 66), "Success");
Image challengeIcon;
using (var bmpTemp = new Bitmap(pngPath))
{
challengeIcon = new Bitmap(bmpTemp);
}
g.DrawImage(Forms.Settings.ResizeImage(challengeIcon, 271, 271), new Point(40, 0)); //327
}
#endregion
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
#endregion
SelectedChallengesArray = new string[bundleParser[i].QuestInfos.Length];
for (int i2 = 0; i2 < bundleParser[i].QuestInfos.Length; i2++)
{
string cName = Path.GetFileName(bundleParser[i].QuestInfos[i2].QuestDefinition.AssetPathName);
SelectedChallengesArray[i2] = cName.Substring(0, cName.LastIndexOf('.'));
}
int damageOpCount = 0;
int damageOpPosition = 0;
for (int i2 = 0; i2 < SelectedChallengesArray.Length; i2++)
{
try
{
if (CurrentUsedPakGuid != null && CurrentUsedPakGuid != "0-0-0-0")
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + CurrentUsedPak + "\" \"" + SelectedChallengesArray[i2] + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
else
JwpmProcess("extract \"" + Settings.Default.PAKsPath + "\\" + AllpaksDictionary[SelectedChallengesArray[i2]] + "\" \"" + SelectedChallengesArray[i2] + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string challengeFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", SelectedChallengesArray[i2] + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
if (challengeFilePath != null)
{
UpdateConsole(SelectedChallengesArray[i2] + " successfully extracted", Color.FromArgb(255, 66, 244, 66), "Success");
if (challengeFilePath.Contains(".uasset") || challengeFilePath.Contains(".uexp") || challengeFilePath.Contains(".ubulk"))
{
MyAsset = new PakAsset(challengeFilePath.Substring(0, challengeFilePath.LastIndexOf('.')));
try
{
if (MyAsset.GetSerialized() != null)
{
UpdateConsole(SelectedChallengesArray[i2] + " successfully serialized", Color.FromArgb(255, 66, 244, 66), "Success");
string parsedJson = JToken.Parse(MyAsset.GetSerialized()).ToString();
var questParser = QuestParser.FromJson(parsedJson);
UpdateConsole("Parsing " + SelectedChallengesArray[i2] + "...", Color.FromArgb(255, 244, 132, 66), "Waiting");
for (int ii = 0; ii < questParser.Length; ii++)
{
string oldQuest = string.Empty;
string oldCount = string.Empty;
for (int ii2 = 0; ii2 < questParser[ii].Objectives.Length; ii2++)
{
string newQuest = questParser[ii].Objectives[ii2].Description;
string newCount = questParser[ii].Objectives[ii2].Count.ToString();
if (newQuest != oldQuest && newCount != oldCount)
{
if (Settings.Default.createIconForChallenges)
{
if (questParser[ii].Objectives[ii2].Description == "Deal damage to opponents")
{
damageOpCount += 1;
if (damageOpCount == 1)
{
AppendText(questParser[ii].Objectives[ii2].Description, Color.SteelBlue);
AppendText("\t\tCount: " + questParser[ii].Objectives[ii2].Count, Color.DarkRed, true);
justSkip += 1;
iamY += 140;
g.DrawString(questParser[ii].Objectives[ii2].Description, new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY));
damageOpPosition = iamY;
Image slider = Resources.Challenges_Slider;
g.DrawImage(slider, new Point(108, iamY + 86));
g.DrawString(questParser[ii].Objectives[ii2].Count.ToString(), new Font(_pfc.Families[0], 20), new SolidBrush(Color.FromArgb(255, 255, 255, 255)), new Point(968, iamY + 87));
if (justSkip != 1)
{
g.DrawLine(new Pen(Color.FromArgb(30, 255, 255, 255)), 100, iamY - 10, 2410, iamY - 10);
}
#region getIcon
string textureFile = Path.GetFileName(questParser[ii].LargePreviewImage.AssetPathName)?.Substring(0, Path.GetFileName(questParser[ii].LargePreviewImage.AssetPathName).LastIndexOf('.'));
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 ?? throw new InvalidOperationException()] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
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");
if (File.Exists(ItemIconPath))
{
Image itemIcon;
using (var bmpTemp = new Bitmap(ItemIconPath))
{
itemIcon = new Bitmap(bmpTemp);
}
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
else
{
Image itemIcon = Resources.unknown512;
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
#endregion
}
}
else
{
AppendText(questParser[ii].Objectives[ii2].Description, Color.SteelBlue);
AppendText("\t\tCount: " + questParser[ii].Objectives[ii2].Count, Color.DarkRed, true);
justSkip += 1;
iamY += 140;
g.DrawString(questParser[ii].Objectives[ii2].Description, new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY));
Image slider = Resources.Challenges_Slider;
g.DrawImage(slider, new Point(108, iamY + 86));
g.DrawString(questParser[ii].Objectives[ii2].Count.ToString(), new Font(_pfc.Families[0], 20), new SolidBrush(Color.FromArgb(255, 255, 255, 255)), new Point(968, iamY + 87));
if (justSkip != 1)
{
g.DrawLine(new Pen(Color.FromArgb(30, 255, 255, 255)), 100, iamY - 10, 2410, iamY - 10);
}
#region getIcon
string textureFile = Path.GetFileName(questParser[ii].LargePreviewImage.AssetPathName)?.Substring(0, Path.GetFileName(questParser[ii].LargePreviewImage.AssetPathName).LastIndexOf('.'));
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 ?? throw new InvalidOperationException()] + "\" \"" + textureFile + "\" \"" + DefaultOutputPath + "\" " + Settings.Default.AESKey);
string textureFilePath = Directory.GetFiles(DefaultOutputPath + "\\Extracted", textureFile + ".*", SearchOption.AllDirectories).Where(x => !x.EndsWith(".png")).FirstOrDefault();
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");
if (File.Exists(ItemIconPath))
{
Image itemIcon;
using (var bmpTemp = new Bitmap(ItemIconPath))
{
itemIcon = new Bitmap(bmpTemp);
}
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
else
{
Image itemIcon = Resources.unknown512;
g.DrawImage(Forms.Settings.ResizeImage(itemIcon, 110, 110), new Point(2300, iamY + 6));
}
#endregion
}
}
oldQuest = questParser[ii].Objectives[ii2].Description;
oldCount = questParser[ii].Objectives[ii2].Count.ToString();
}
}
}
}
else
UpdateConsole("No serialized file found", Color.FromArgb(255, 244, 66, 66), "Error");
}
catch (JsonSerializationException)
{
AppendText(CurrentUsedItem + " ", Color.Red);
AppendText(".JSON file can't be displayed", Color.Black, true);
}
}
}
else
UpdateConsole("Error while extracting " + SelectedChallengesArray[i2], Color.FromArgb(255, 244, 66, 66), "Error");
}
catch (KeyNotFoundException)
{
AppendText("Can't extract ", Color.Black);
AppendText(SelectedChallengesArray[i2], Color.SteelBlue, true);
}
}
g.DrawString("Same Quest x" + damageOpCount, new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(1500, damageOpPosition + 25));
iamY += 100;
//BundleCompletionRewards
try
{
for (int i2 = 0; i2 < bundleParser[i].BundleCompletionRewards.Length; i2++)
{
string itemReward = bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().ItemDefinition.AssetPathName.Substring(bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().ItemDefinition.AssetPathName.LastIndexOf(".", StringComparison.Ordinal) + 1);
string compCount = bundleParser[i].BundleCompletionRewards[i2].CompletionCount.ToString();
if (itemReward != "AthenaBattlePass_WeeklyChallenge_Token" && itemReward != "AthenaBattlePass_WeeklyBundle_Token")
{
justSkip += 1;
iamY += 140;
if (bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().ItemDefinition.AssetPathName == "None")
{
var partsofbruhreally = bundleParser[i].BundleCompletionRewards[i2].Rewards.FirstOrDefault().TemplateId.Split(':');
DrawRewardBanner(partsofbruhreally[1], g, iamY);
}
else
DrawRewardIcon(itemReward, g, iamY);
if (compCount == "-1")
g.DrawString("Complete ALL CHALLENGES to earn the reward item", new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY + 22));
else
g.DrawString("Complete ANY " + compCount + " CHALLENGES to earn the reward item", new Font(_pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, iamY + 22));
}
}
}
catch (Exception ex)
{
UpdateConsole(ex.Message, Color.FromArgb(255, 244, 66, 66), "Error");
iamY -= 100;
}
}
if (Settings.Default.createIconForChallenges)
{
#region WATERMARK
g.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, iamY + 240, bmp.Width, 40));
g.DrawString(theItem.DisplayName + " Generated using FModel & JohnWickParse - " + DateTime.Now.ToString("dd/MM/yyyy"), new Font(_pfc.Families[0], 20), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(bmp.Width / 2, iamY + 250), _centeredString);
#endregion
if (v2 == false)
{
#region DRAW TEXT
try
{
string seasonFolder = questJson.Substring(questJson.Substring(0, questJson.LastIndexOf("\\", StringComparison.Ordinal)).LastIndexOf("\\", StringComparison.Ordinal) + 1).ToUpper();
g.DrawString(seasonFolder.Substring(0, seasonFolder.LastIndexOf("\\", StringComparison.Ordinal)), new Font(_pfc.Families[1], 42), new SolidBrush(Color.FromArgb(255, 149, 213, 255)), new Point(340, 40));
}
catch (NullReferenceException)
{
AppendText("[NullReferenceException] ", Color.Red);
AppendText("No ", Color.Black);
AppendText("Season ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //LAST SUBFOLDER
try
{
g.DrawString(theItem.DisplayName.ToUpper(), new Font(_pfc.Families[1], 115), new SolidBrush(Color.White), new Point(325, 70));
}
catch (NullReferenceException)
{
AppendText("[NullReferenceException] ", Color.Red);
AppendText("No ", Color.Black);
AppendText("DisplayName ", Color.SteelBlue);
AppendText("found", Color.Black, true);
} //NAME
#endregion
}
#region CUT IMAGE
using (Bitmap bmp2 = bmp)
{
var newImg = bmp2.Clone(
new Rectangle { X = 0, Y = 0, Width = bmp.Width, Height = iamY + 280 },
bmp2.PixelFormat);
pictureBox1.Image = newImg;
} //CUT
#endregion
}
UpdateConsole(theItem.DisplayName, Color.FromArgb(255, 66, 244, 66), "Success");
if (autoSaveImagesToolStripMenuItem.Checked || updateModeToolStripMenuItem.Checked)
{
Invoke(new Action(() =>
{
pictureBox1.Image.Save(DefaultOutputPath + "\\Icons\\" + CurrentUsedItem + ".png", ImageFormat.Png);
}));
AppendText(CurrentUsedItem, Color.DarkRed);
AppendText(" successfully saved", Color.Black, true);
}
AppendText("", Color.Black, true);
}
private void ConvertTexture2D()
{

View File

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

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.2.2.0")]
[assembly: AssemblyFileVersion("2.2.2.0")]
[assembly: AssemblyVersion("2.3.0.0")]
[assembly: AssemblyFileVersion("2.3.0.0")]
[assembly: NeutralResourcesLanguage("en")]