diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index b4cb252f..8d6f051b 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; @@ -1295,10 +1295,11 @@ namespace FModel ChallengeBundleIdParser bundleParser = ChallengeBundleIdParser.FromJson(theParsedJson).FirstOrDefault(); BundleInfos.getBundleData(bundleParser); Bitmap bmp = null; + bool isFortbyte = false; if (Settings.Default.createIconForChallenges) { - bmp = new Bitmap(2500, 5000); + bmp = new Bitmap(2500, 15000); BundleDesign.BundlePath = extractedBundlePath; BundleDesign.theY = 275; BundleDesign.toDrawOn = Graphics.FromImage(bmp); @@ -1309,6 +1310,18 @@ namespace FModel BundleDesign.drawBackground(bmp, bundleParser); } + if (BundleInfos.BundleData[0].rewardItemId != null && string.Equals(BundleInfos.BundleData[0].rewardItemId, "AthenaFortbyte", StringComparison.CurrentCultureIgnoreCase)) + isFortbyte = true; + + // Fortbytes: Sort by number + if (isFortbyte) + { + BundleInfos.BundleData.Sort(delegate (BundleInfoEntry a, BundleInfoEntry b) + { + return Int32.Parse(a.rewardItemQuantity).CompareTo(Int32.Parse(b.rewardItemQuantity)); + }); + } + for (int i = 0; i < BundleInfos.BundleData.Count; i++) { AppendText(BundleInfos.BundleData[i].questDescr, Color.SteelBlue); @@ -1320,7 +1333,7 @@ namespace FModel BundleDesign.theY += 140; //draw quest description - BundleDesign.toDrawOn.DrawString(BundleInfos.BundleData[i].questDescr, new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, BundleDesign.theY)); + BundleDesign.toDrawOn.DrawString(BundleInfos.BundleData[i].questDescr, new Font(FontUtilities.pfc.Families[1], isFortbyte ? 40 : 50), new SolidBrush(Color.White), new Point(100, BundleDesign.theY)); //draw slider + quest count Image slider = Resources.Challenges_Slider; diff --git a/FModel/Methods/ChallengeGenerator/BundleInfos.cs b/FModel/Methods/ChallengeGenerator/BundleInfos.cs index 37e7eed7..dc97c755 100644 --- a/FModel/Methods/ChallengeGenerator/BundleInfos.cs +++ b/FModel/Methods/ChallengeGenerator/BundleInfos.cs @@ -100,6 +100,7 @@ namespace FModel { string oldQuest = string.Empty; long oldCount = 0; + for (int p = 0; p < questParser[x].Objectives.Length; p++) { string newQuest; @@ -117,7 +118,7 @@ namespace FModel if (newQuest != oldQuest && newCount != oldCount) { - if (questParser[x].Rewards != null) + if (questParser[x].Rewards != null && !questFilePath.Contains("Fortbyte_")) { try { @@ -149,10 +150,10 @@ namespace FModel } } } + else if (questFilePath.Contains("Fortbyte_")) + BundleData.Add(new BundleInfoEntry(newQuest, newCount, "AthenaFortbyte", questParser[x].Weight > 0 ? questParser[x].Weight.ToString() : "01")); else - { BundleData.Add(new BundleInfoEntry(newQuest, newCount, "", "")); - } oldQuest = newQuest; oldCount = newCount; diff --git a/FModel/Methods/ChallengeGenerator/DrawingRewards.cs b/FModel/Methods/ChallengeGenerator/DrawingRewards.cs index a58fc51e..a2c915e4 100644 --- a/FModel/Methods/ChallengeGenerator/DrawingRewards.cs +++ b/FModel/Methods/ChallengeGenerator/DrawingRewards.cs @@ -1,4 +1,4 @@ -using csharp_wick; +using csharp_wick; using FModel.Parser.Items; using FModel.Properties; using Newtonsoft.Json; @@ -32,6 +32,7 @@ namespace FModel else if (string.Equals(itemToExtract, "athenabattlestar", StringComparison.CurrentCultureIgnoreCase)) { drawBattleStar(itemQuantity); } else if (string.Equals(itemToExtract, "AthenaSeasonalXP", StringComparison.CurrentCultureIgnoreCase)) { drawSeasonalXp(itemQuantity); } else if (string.Equals(itemToExtract, "MtxGiveaway", StringComparison.CurrentCultureIgnoreCase)) { drawMtxGiveaway(itemQuantity); } + else if (string.Equals(itemToExtract, "AthenaFortbyte", StringComparison.CurrentCultureIgnoreCase)) { drawFortbyte(itemQuantity); } else { DrawRewardIcon(itemToExtract); } } } @@ -148,6 +149,7 @@ namespace FModel BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 110, 110), new Point(2300, BundleDesign.theY + 6)); } } + private static void drawBattleStar(string quantity) { Image rewardIcon = Resources.T_FNBR_BattlePoints_L; @@ -156,6 +158,7 @@ namespace FModel GraphicsPath p = new GraphicsPath(); drawPathAndFill(p, quantity, Color.FromArgb(255, 143, 74, 32), Color.FromArgb(255, 255, 219, 103)); } + private static void drawSeasonalXp(string quantity) { Image rewardIcon = Resources.T_FNBR_SeasonalXP_L; @@ -164,6 +167,7 @@ namespace FModel GraphicsPath p = new GraphicsPath(); drawPathAndFill(p, quantity, Color.FromArgb(255, 81, 131, 15), Color.FromArgb(255, 230, 253, 177)); } + private static void drawMtxGiveaway(string quantity) { Image rewardIcon = Resources.T_Items_MTX_L; @@ -173,6 +177,11 @@ namespace FModel drawPathAndFill(p, quantity, Color.FromArgb(255, 100, 160, 175), Color.FromArgb(255, 220, 230, 255)); } + private static void drawFortbyte(string quantity) + { + BundleDesign.toDrawOn.DrawString("#" + Int32.Parse(quantity).ToString("D2"), new Font(FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(2325, BundleDesign.theY + 22)); + } + /// /// define a pen to draw the outlines of a string with a color and fill with another color /// diff --git a/FModel/Parser/Quests/QuestParser.cs b/FModel/Parser/Quests/QuestParser.cs index 7e2650ce..c6328da9 100644 --- a/FModel/Parser/Quests/QuestParser.cs +++ b/FModel/Parser/Quests/QuestParser.cs @@ -30,6 +30,9 @@ namespace FModel.Parser.Quests [JsonProperty("Objectives")] public Objective[] Objectives { get; set; } + [JsonProperty("Weight")] + public double Weight { get; set; } + [JsonProperty("CompletionText")] public FTextInfos CompletionText { get; set; }