diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index 819cbed8..bab35a6f 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -1043,6 +1043,7 @@ namespace FModel }); } + bool isSeparatorAlreadyAdded = false; for (int i = 0; i < BundleInfos.BundleData.Count; i++) { new UpdateMyConsole(BundleInfos.BundleData[i].questDescr, Color.SteelBlue).AppendToConsole(); @@ -1051,6 +1052,12 @@ namespace FModel BundleDesign.theY += 90; + if (!string.IsNullOrEmpty(BundleInfos.BundleData[i].questUnlockType) && !isSeparatorAlreadyAdded) + { + BundleDesign.drawPrestigeSeparator(); + isSeparatorAlreadyAdded = true; + } + //draw quest description BundleDesign.drawQuestBackground(bmp); Font goodFont = FontUtilities.FindFont(BundleDesign.toDrawOn, BundleInfos.BundleData[i].questDescr, new Rectangle(57, BundleDesign.theY + 7, bmp.Width - 227, 38).Size, new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 30)); //size in "new Font()" is never check diff --git a/FModel/Methods/AESManager/DynamicKeys/AddToUI.cs b/FModel/Methods/AESManager/DynamicKeys/AddToUI.cs index ca911e3f..853f2c17 100644 --- a/FModel/Methods/AESManager/DynamicKeys/AddToUI.cs +++ b/FModel/Methods/AESManager/DynamicKeys/AddToUI.cs @@ -67,7 +67,10 @@ namespace FModel { if (DLLImport.IsInternetAvailable()) { - JToken dynamicPaks = JObject.Parse(Keychain.GetEndpoint("http://benbotfn.tk:8080/api/aes")).FindTokens("additionalKeys").FirstOrDefault(); + string data = Keychain.GetEndpoint("http://benbotfn.tk:8080/api/aes"); + if (string.IsNullOrEmpty(data)) { new UpdateMyConsole("[BenBot API] API Down or Rate Limit Exceeded", Color.Red, true).AppendToConsole(); return null; } + + JToken dynamicPaks = JObject.Parse(data).FindTokens("additionalKeys").FirstOrDefault(); return JToken.Parse(dynamicPaks.ToString()).ToString().TrimStart('[').TrimEnd(']'); } else diff --git a/FModel/Methods/AESManager/DynamicKeys/Keychain.cs b/FModel/Methods/AESManager/DynamicKeys/Keychain.cs index 1d01a2ca..6b484102 100644 --- a/FModel/Methods/AESManager/DynamicKeys/Keychain.cs +++ b/FModel/Methods/AESManager/DynamicKeys/Keychain.cs @@ -16,10 +16,9 @@ namespace FModel RestClient EndpointClient = new RestClient(url); RestRequest EndpointRequest = new RestRequest(Method.GET); - var response = EndpointClient.Execute(EndpointRequest); - string content = JToken.Parse(response.Content).ToString(Newtonsoft.Json.Formatting.Indented); + string response = EndpointClient.Execute(EndpointRequest).Content; - return content; + return response; } } } diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs index 9037debc..62739c80 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs @@ -354,5 +354,24 @@ namespace FModel toDrawOn.DrawString(text, new Font(FontUtilities.pfc.Families[0], 15), new SolidBrush(Color.FromArgb(150, 255, 255, 255)), new Point(myBitmap.Width - 10, 210), FontUtilities.rightString); } + + public static void drawPrestigeSeparator() + { + string texture = JohnWick.AssetToTexture2D("T-FNBR-MissionIcon-L"); + if (File.Exists(texture)) + { + Image itemIcon; + using (var bmpTemp = new Bitmap(texture)) + { + itemIcon = new Bitmap(bmpTemp); + } + + toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, headerColor.R, headerColor.G, headerColor.B)), new Rectangle(25, theY, 50, 35)); + + toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 32, 32), new Point(50 - 15, theY + 2)); + + theY += 40; + } + } } } diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleInfos.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleInfos.cs index bb646e6f..8c5718ec 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleInfos.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleInfos.cs @@ -110,7 +110,7 @@ namespace FModel if (assetPathName != null) { string questName = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf(".", StringComparison.Ordinal)); - getQuestData(questName); + getQuestData(questName, token); } } } @@ -122,7 +122,7 @@ namespace FModel /// loop if stage exist /// /// - private static void getQuestData(string questFile) + private static void getQuestData(string questFile, JToken questInfo) { try { @@ -138,6 +138,14 @@ namespace FModel { new UpdateMyState("Parsing " + questFile + "...", "Waiting").ChangeProcessState(); + //prestige challenge check + JToken questUnlockType = questInfo["QuestUnlockType"]; + string unlockType = string.Empty; + if (questUnlockType != null && questUnlockType.Value().Equals("EChallengeBundleQuestUnlockType::BundleLevelup")) + { + unlockType = questUnlockType.Value(); + } + dynamic AssetData = JsonConvert.DeserializeObject(JohnWick.MyAsset.GetSerialized()); JArray AssetArray = JArray.FromObject(AssetData); @@ -214,7 +222,7 @@ namespace FModel string rewardId = rewardsArray.Where(item => !item["ItemPrimaryAssetId"]["PrimaryAssetType"]["Name"].Value().Equals("Quest") && !item["ItemPrimaryAssetId"]["PrimaryAssetType"]["Name"].Value().Equals("Token")).FirstOrDefault()["ItemPrimaryAssetId"]["PrimaryAssetName"].Value(); string rewardQuantity = rewardsArray.Where(item => !item["ItemPrimaryAssetId"]["PrimaryAssetType"]["Name"].Value().Equals("Quest") && !item["ItemPrimaryAssetId"]["PrimaryAssetType"]["Name"].Value().Equals("Token")).FirstOrDefault()["Quantity"].Value(); - BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, rewardId, rewardQuantity); + BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, rewardId, rewardQuantity, unlockType); bool isAlreadyAdded = BundleData.Any(item => item.questDescr.Equals(currentData.questDescr, StringComparison.InvariantCultureIgnoreCase) && item.questCount == currentData.questCount); if (!isAlreadyAdded) { BundleData.Add(currentData); } } @@ -226,7 +234,7 @@ namespace FModel string rewardId = hiddenRewards[0]["TemplateId"].Value(); string rewardQuantity = hiddenRewards[0]["Quantity"].Value(); - BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, rewardId, rewardQuantity); + BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, rewardId, rewardQuantity, unlockType); bool isAlreadyAdded = BundleData.Any(item => item.questDescr.Equals(currentData.questDescr, StringComparison.InvariantCultureIgnoreCase) && item.questCount == currentData.questCount); if (!isAlreadyAdded) { BundleData.Add(currentData); } } @@ -240,7 +248,7 @@ namespace FModel if (qAssetType == "Quest") { - getQuestData(qAssetName); + getQuestData(qAssetName, questInfo); } } } @@ -254,13 +262,13 @@ namespace FModel weightToUse = weight; } - BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, assetTypeToken["ItemPrimaryAssetId"]["PrimaryAssetName"].Value(), weightToUse == null ? "01" : weightToUse.Value()); + BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, assetTypeToken["ItemPrimaryAssetId"]["PrimaryAssetName"].Value(), weightToUse == null ? "01" : weightToUse.Value(), unlockType); bool isAlreadyAdded = BundleData.Any(item => item.questDescr.Equals(currentData.questDescr, StringComparison.InvariantCultureIgnoreCase) && item.questCount == currentData.questCount); if (!isAlreadyAdded) { BundleData.Add(currentData); } } else { - BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, "", ""); + BundleInfoEntry currentData = new BundleInfoEntry(questDescription, questCount, "", "", unlockType); bool isAlreadyAdded = BundleData.Any(item => item.questDescr.Equals(currentData.questDescr, StringComparison.InvariantCultureIgnoreCase) && item.questCount == currentData.questCount); if (!isAlreadyAdded) { BundleData.Add(currentData); } } diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/ChallengeInfoEntry.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/ChallengeInfoEntry.cs index 3e8be47d..fc86933c 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/ChallengeInfoEntry.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/ChallengeInfoEntry.cs @@ -4,17 +4,19 @@ namespace FModel { public struct BundleInfoEntry : IEquatable { - internal BundleInfoEntry(string QuestDescription, long QuestCount, string RewardId, string RewardQuantity) + internal BundleInfoEntry(string QuestDescription, long QuestCount, string RewardId, string RewardQuantity, string UnlockType) { questDescr = QuestDescription; questCount = QuestCount; rewardItemId = RewardId; rewardItemQuantity = RewardQuantity; + questUnlockType = UnlockType; } public string questDescr { get; set; } public long questCount { get; set; } public string rewardItemId { get; set; } public string rewardItemQuantity { get; set; } + public string questUnlockType { get; set; } bool IEquatable.Equals(BundleInfoEntry other) { diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs index cfe0ab0d..8f329c2d 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs @@ -70,7 +70,7 @@ namespace FModel ItemIcon.SearchAthIteDefIcon(AssetArray[0]); - drawIcon(item); + drawIcon(); } } catch (JsonSerializationException) @@ -117,7 +117,7 @@ namespace FModel { string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); ItemIcon.ItemIconPath = JohnWick.AssetToTexture2D(textureFile); - drawIcon(bannerName); + drawIcon(); } } else if (smallImage != null) @@ -127,7 +127,7 @@ namespace FModel { string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); ItemIcon.ItemIconPath = JohnWick.AssetToTexture2D(textureFile); - drawIcon(bannerName); + drawIcon(); } } } @@ -141,7 +141,7 @@ namespace FModel } } - private static void drawIcon(string itemId) + private static void drawIcon() { Image itemIcon = null; if (File.Exists(ItemIcon.ItemIconPath))