diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index 54c3d98e..d3352089 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -1068,9 +1068,9 @@ namespace FModel BundleInfos.getBundleData(theItem); bool isFortbyte = false; - Bitmap bmp = new Bitmap(2500, 15000); + Bitmap bmp = new Bitmap(1024, 10000); BundleDesign.BundlePath = extractedBundlePath; - BundleDesign.theY = 275; + BundleDesign.theY = 200; BundleDesign.toDrawOn = Graphics.FromImage(bmp); BundleDesign.toDrawOn.TextRenderingHint = TextRenderingHint.AntiAliasGridFit; BundleDesign.toDrawOn.SmoothingMode = SmoothingMode.HighQuality; @@ -1096,40 +1096,30 @@ namespace FModel new UpdateMyConsole("\t\tCount: " + BundleInfos.BundleData[i].questCount, Color.DarkRed).AppendToConsole(); new UpdateMyConsole("\t\t" + BundleInfos.BundleData[i].rewardItemId + ":" + BundleInfos.BundleData[i].rewardItemQuantity, Color.DarkGreen, true).AppendToConsole(); - BundleDesign.theY += 140; - - //in case you wanna make some changes - //BundleDesign.toDrawOn.DrawRectangle(new Pen(new SolidBrush(Color.Red)), new Rectangle(107, BundleDesign.theY + 7, 2000, 93)); //rectangle that resize the font -> used for "Font goodFont = " - //BundleDesign.toDrawOn.DrawRectangle(new Pen(new SolidBrush(Color.Blue)), new Rectangle(107, BundleDesign.theY + 7, 2000, 75)); //rectangle the font needs to be fit with + BundleDesign.theY += 90; //draw quest description - Font goodFont = FontUtilities.FindFont(BundleDesign.toDrawOn, BundleInfos.BundleData[i].questDescr, new Rectangle(107, BundleDesign.theY + 7, 2000, 93).Size, new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 50)); //size in "new Font()" is never check - BundleDesign.toDrawOn.DrawString(BundleInfos.BundleData[i].questDescr, goodFont, new SolidBrush(Color.White), new Point(100, BundleDesign.theY)); + 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 + BundleDesign.toDrawOn.DrawString(BundleInfos.BundleData[i].questDescr, goodFont, new SolidBrush(Color.White), new Point(55, BundleDesign.theY + 10)); - //draw slider + quest count - Image slider = Resources.Challenges_Slider; - BundleDesign.toDrawOn.DrawImage(slider, new Point(108, BundleDesign.theY + 86)); - BundleDesign.toDrawOn.DrawString("0 / " + BundleInfos.BundleData[i].questCount.ToString(), new Font(FontUtilities.pfc.Families[0], 25), new SolidBrush(Color.FromArgb(255, 255, 255, 255)), new Point(978, BundleDesign.theY + 88)); + //draw quest count + BundleDesign.toDrawOn.DrawString("0 /", new Font(FontUtilities.pfc.Families[1], 12), new SolidBrush(Color.FromArgb(255, 255, 255, 255)), new Point(565, BundleDesign.theY + 42)); + BundleDesign.toDrawOn.DrawString(BundleInfos.BundleData[i].questCount.ToString(), new Font(FontUtilities.pfc.Families[1], 12), new SolidBrush(Color.FromArgb(200, 255, 255, 255)), new Point(587, BundleDesign.theY + 42)); //draw quest reward DrawingRewards.getRewards(BundleInfos.BundleData[i].rewardItemId, BundleInfos.BundleData[i].rewardItemQuantity); - - if (i != 0) - { - //draw separator - BundleDesign.toDrawOn.DrawLine(new Pen(Color.FromArgb(30, 255, 255, 255)), 100, BundleDesign.theY - 10, 2410, BundleDesign.theY - 10); - } } new UpdateMyConsole("", Color.Black, true).AppendToConsole(); - BundleDesign.drawCompletionReward(theItem); + BundleDesign.drawCompletionReward(bmp, theItem); BundleDesign.drawWatermark(bmp); //cut if too long and return the bitmap using (Bitmap bmp2 = bmp) { var newImg = bmp2.Clone( - new Rectangle { X = 0, Y = 0, Width = bmp.Width, Height = BundleDesign.theY + 280 }, + new Rectangle { X = 0, Y = 0, Width = bmp.Width, Height = BundleDesign.theY + 105 }, bmp2.PixelFormat); pictureBox1.Image = newImg; diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs index 2d66bff9..a190fb87 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/BundleDesign.cs @@ -8,13 +8,13 @@ using Newtonsoft.Json.Linq; namespace FModel { - //TODO: REFACTOR + NEW DESIGN static class BundleDesign { public static string BundlePath { get; set; } public static int theY { get; set; } public static Graphics toDrawOn { get; set; } public static JToken myItem { get; set; } + public static Color headerColor { get; set; } /// /// get a random color in case DisplayStyle doesn't exist in drawBackground() @@ -40,91 +40,43 @@ namespace FModel { new UpdateMyState("Drawing...", "Waiting").ChangeProcessState(); + drawHeader(myBitmap, myBundle); + } + + private static void drawHeader(Bitmap myBitmap, JToken myBundle) + { + bool isSXBanner = false; + string bundleDisplayName = BundleInfos.getBundleDisplayName(myItem); + string lastFolder = BundleInfos.getLastFolder(BundlePath); + JToken displayStyle = myBundle["DisplayStyle"]; if (displayStyle != null) { - Color headerColor = BundleInfos.getSecondaryColor(myBundle); + headerColor = BundleInfos.getSecondaryColor(myBundle); - //image JToken customBackground = displayStyle["CustomBackground"]; JToken displayImage = displayStyle["DisplayImage"]; - JToken largePreviewImage = myBundle["LargePreviewImage"]; - if (customBackground != null && !ThePak.CurrentUsedItem.Equals("QuestBundle_S10_SeasonX")) + if (customBackground != null) { JToken assetPathName = customBackground["asset_path_name"]; if (assetPathName != null) { - string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); - Image challengeIcon; - using (Bitmap bmpTemp = new Bitmap(JohnWick.AssetToTexture2D(textureFile))) + if (assetPathName.Value().Contains("/Game/Athena/UI/Challenges/Art/MissionTileImages/") && !ThePak.CurrentUsedItem.Equals("QuestBundle_S10_SeasonX")) { - challengeIcon = new Bitmap(bmpTemp); + isSXBanner = true; + string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); + Image challengeIcon; + using (Bitmap bmpTemp = new Bitmap(JohnWick.AssetToTexture2D(textureFile))) + { + challengeIcon = new Bitmap(bmpTemp); + } + toDrawOn.DrawImage(challengeIcon, new Point(0, 0)); + toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(175, headerColor.R, headerColor.G, headerColor.B)), new Rectangle(0, 0, myBitmap.Width, 256)); } - toDrawOn.DrawImage(ImageUtilities.ResizeImage(challengeIcon, challengeIcon.Width * 3, challengeIcon.Height * 3), new Point(0, challengeIcon.Height - (challengeIcon.Height * 3))); - toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(150, headerColor.R, headerColor.G, headerColor.B)), new Rectangle(0, 0, myBitmap.Width, 256)); - - GraphicsPath gp = new GraphicsPath(); - gp.StartFigure(); - gp.AddLine(0, 256, myBitmap.Width, 256); - gp.AddLine(myBitmap.Width, 256, myBitmap.Width, 241); - gp.AddLine(myBitmap.Width, 241, myBitmap.Width / 2 + 25, 236); - gp.AddLine(myBitmap.Width / 2 + 25, 236, myBitmap.Width / 2 + 35, 249); - gp.AddLine(myBitmap.Width / 2 + 35, 249, 0, 241); - gp.CloseFigure(); - - toDrawOn.FillPath(new SolidBrush(ControlPaint.Light(headerColor)), gp); } - - //last folder with border - GraphicsPath p = new GraphicsPath(); - Pen myPen = new Pen(ControlPaint.Light(headerColor, (float)0.2), 3); - myPen.LineJoin = LineJoin.Round; //needed to avoid spikes - p.AddString( - BundleInfos.getLastFolder(BundlePath), - Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], - (int)FontStyle.Regular, 55, - new Point(50, 30), - FontUtilities.leftString - ); - toDrawOn.DrawPath(myPen, p); - toDrawOn.FillPath(new SolidBrush(ControlPaint.Dark(headerColor, (float)0.05)), p); - - //name - toDrawOn.DrawString(BundleInfos.getBundleDisplayName(myItem), new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 115), new SolidBrush(Color.White), new Point(35, 55)); - - //fill the rest - toDrawOn.FillRectangle(new SolidBrush(ControlPaint.Dark(BundleInfos.getSecondaryColor(myBundle), (float)0.1)), new Rectangle(0, 256, myBitmap.Width, myBitmap.Height)); } - else + if (!isSXBanner) { - //main header - toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(0, 0, myBitmap.Width, 281)); - - //gradient at left and right main header - LinearGradientBrush linGrBrush_left = new LinearGradientBrush(new Point(0, 282 / 2), new Point(282, 282 / 2), - ControlPaint.Light(headerColor, (float)0.3), headerColor); - toDrawOn.FillRectangle(linGrBrush_left, new Rectangle(0, 0, 282, 282)); - LinearGradientBrush linGrBrush_right = new LinearGradientBrush(new Point(2500, 282 / 2), new Point(1500, 282 / 2), - ControlPaint.Light(headerColor, (float)0.3), headerColor); - toDrawOn.FillRectangle(linGrBrush_right, new Rectangle(1500, 0, 1000, 282)); - - //last folder with border - GraphicsPath p = new GraphicsPath(); - Pen myPen = new Pen(ControlPaint.Light(headerColor, (float)0.2), 3); - myPen.LineJoin = LineJoin.Round; //needed to avoid spikes - p.AddString( - BundleInfos.getLastFolder(BundlePath), - Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], - (int)FontStyle.Regular, 55, - new Point(342, 40), - FontUtilities.leftString - ); - toDrawOn.DrawPath(myPen, p); - toDrawOn.FillPath(new SolidBrush(ControlPaint.Dark(headerColor, (float)0.05)), p); - - //name - toDrawOn.DrawString(BundleInfos.getBundleDisplayName(myItem), new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 115), new SolidBrush(Color.White), new Point(325, 70)); - if (displayImage != null) { JToken assetPathName = displayImage["asset_path_name"]; @@ -136,61 +88,64 @@ namespace FModel { challengeIcon = new Bitmap(bmpTemp); } - toDrawOn.DrawImage(ImageUtilities.ResizeImage(challengeIcon, 282, 282), new Point(40, 0)); + toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(0, 0, myBitmap.Width, 256)); + toDrawOn.DrawImage(ImageUtilities.ResizeImage(challengeIcon, 256, 256), new Point(0, 0)); } } - else if (largePreviewImage != null) - { - JToken assetPathName = largePreviewImage["asset_path_name"]; - if (assetPathName != null) - { - string textureFile = Path.GetFileName(assetPathName.Value()).Substring(0, Path.GetFileName(assetPathName.Value()).LastIndexOf('.')); - Image challengeIcon; - using (var bmpTemp = new Bitmap(JohnWick.AssetToTexture2D(textureFile))) - { - challengeIcon = new Bitmap(bmpTemp); - } - toDrawOn.DrawImage(ImageUtilities.ResizeImage(challengeIcon, 282, 282), new Point(40, 0)); - } - } - else - { - toDrawOn.DrawImage(ImageUtilities.ResizeImage(Resources.unknown512, 282, 282), new Point(40, 0)); - } - - //fill the rest - toDrawOn.FillRectangle(new SolidBrush(ControlPaint.Dark(BundleInfos.getSecondaryColor(myBundle), (float)0.1)), new Rectangle(0, 271, myBitmap.Width, myBitmap.Height)); + else { toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(0, 0, myBitmap.Width, 256)); } } } - else - { - Color myBaseColor = getRandomColor(); + else { headerColor = getRandomColor(); toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(0, 0, myBitmap.Width, 256)); } - //main header - toDrawOn.FillRectangle(new SolidBrush(myBaseColor), new Rectangle(0, 0, myBitmap.Width, 281)); + GraphicsPath gp = new GraphicsPath(); + gp.StartFigure(); + gp.AddLine(0, 256, myBitmap.Width, 256); + gp.AddLine(myBitmap.Width, 256, myBitmap.Width, 241); + gp.AddLine(myBitmap.Width, 241, myBitmap.Width / 2 + 25, 236); + gp.AddLine(myBitmap.Width / 2 + 25, 236, myBitmap.Width / 2 + 35, 249); + gp.AddLine(myBitmap.Width / 2 + 35, 249, 0, 241); + gp.CloseFigure(); + toDrawOn.FillPath(new SolidBrush(ControlPaint.Light(headerColor)), gp); - //gradient at left and right main header - LinearGradientBrush linGrBrush_left = new LinearGradientBrush(new Point(0, 282 / 2), new Point(282, 282 / 2), - ControlPaint.Light(myBaseColor, (float)0.3), myBaseColor); - toDrawOn.FillRectangle(linGrBrush_left, new Rectangle(0, 0, 282, 282)); - LinearGradientBrush linGrBrush_right = new LinearGradientBrush(new Point(2500, 282 / 2), new Point(1500, 282 / 2), - ControlPaint.Light(myBaseColor, (float)0.3), myBaseColor); - toDrawOn.FillRectangle(linGrBrush_right, new Rectangle(1500, 0, 1000, 282)); + GraphicsPath p = new GraphicsPath(); + Pen myPen = new Pen(ControlPaint.Light(headerColor, (float)0.2), 3); + myPen.LineJoin = LineJoin.Round; //needed to avoid spikes + p.AddString( + lastFolder, + Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], + (int)FontStyle.Regular, 30, + new Point(isSXBanner || displayStyle == null ? 30 : 265, 70), + FontUtilities.leftString + ); + toDrawOn.DrawPath(myPen, p); + toDrawOn.FillPath(new SolidBrush(ControlPaint.Dark(headerColor, (float)0.05)), p); - //fill the rest - toDrawOn.FillRectangle(new SolidBrush(ControlPaint.Dark(myBaseColor, (float)0.1)), new Rectangle(0, 271, myBitmap.Width, myBitmap.Height)); + toDrawOn.DrawString(bundleDisplayName, new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 40), new SolidBrush(Color.White), new Point(isSXBanner || displayStyle == null ? 25 : 260, 105)); - //last folder - toDrawOn.DrawString( - BundleInfos.getLastFolder(BundlePath), - new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 42), - new SolidBrush(ControlPaint.Dark(myBaseColor, (float)0.05)), - new Point(40, 40) - ); + toDrawOn.FillRectangle(new SolidBrush(ControlPaint.Dark(headerColor, (float)0.1)), new Rectangle(0, 256, myBitmap.Width, myBitmap.Height)); + } - //name - toDrawOn.DrawString(BundleInfos.getBundleDisplayName(myItem), new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 115), new SolidBrush(Color.White), new Point(25, 70)); - } + public static void drawQuestBackground(Bitmap myBitmap, bool noCompletion = true) + { + toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(50, headerColor.R, headerColor.G, headerColor.B)), new Rectangle(25, theY, myBitmap.Width - 50, 70)); + + GraphicsPath gp = new GraphicsPath(); + gp.StartFigure(); + gp.AddLine(32, theY + 5, 29, theY + 67); + gp.AddLine(29, theY + 67, myBitmap.Width - 160, theY + 62); + gp.AddLine(myBitmap.Width - 160, theY + 62, myBitmap.Width - 150, theY + 4); + gp.CloseFigure(); + toDrawOn.FillPath(new SolidBrush(Color.FromArgb(50, headerColor.R, headerColor.G, headerColor.B)), gp); + + if (noCompletion) { toDrawOn.FillRectangle(new SolidBrush(headerColor), new Rectangle(60, theY + 47, 500, 7)); } + + gp = new GraphicsPath(); + gp.StartFigure(); + gp.AddLine(39, theY + 35, 45, theY + 32); + gp.AddLine(45, theY + 32, 48, theY + 37); + gp.AddLine(48, theY + 37, 42, theY + 40); + gp.CloseFigure(); + toDrawOn.FillPath(new SolidBrush(headerColor), gp); } /// @@ -200,12 +155,12 @@ namespace FModel /// ignoring these 2 should give us an item id, we draw this item /// /// - public static void drawCompletionReward(JToken myBundle) + public static void drawCompletionReward(Bitmap myBitmap, JToken myBundle) { JToken bundleCompletionRewards = myBundle["BundleCompletionRewards"]; if (bundleCompletionRewards != null) { - theY += 100; + theY += 50; JArray bundleCompletionRewardsArray = bundleCompletionRewards.Value(); foreach (JToken token in bundleCompletionRewardsArray) { @@ -238,26 +193,18 @@ namespace FModel if (assetPathName.Value().Equals("None")) { theY += 140; + drawCompletionText(myBitmap, compCount); DrawingRewards.getRewards(rewardsArray[i]["TemplateId"].Value(), itemQuantity); - drawCompletionText(compCount); } else { string rewardId = Path.GetFileName(assetPathName.Value().Substring(0, assetPathName.Value().LastIndexOf(".", StringComparison.Ordinal))); - if (!assetPathName.Value().Contains("/Game/Items/Tokens/") && !rewardId.Contains("Quest_BR_")) + if (!assetPathName.Value().Contains("/Game/Items/Tokens/") && !rewardId.Contains("Quest_BR_")) //no fortbyte for weekly challenges { - theY += 140; - try //needed for rare cases where the icon is in /Content/icon.uasset and atm idk why but i can't extract - { - if (rewardId.Contains("Fortbyte_WeeklyChallengesComplete_")) { drawForbyteReward(); } - else { DrawingRewards.getRewards(rewardId, itemQuantity); } - } - catch (Exception) - { - drawUnknownReward(); - } - drawCompletionText(compCount); + theY += 90; + drawCompletionText(myBitmap, compCount); + DrawingRewards.getRewards(rewardId, itemQuantity); } } } @@ -267,7 +214,7 @@ namespace FModel } } } - private static void drawCompletionText(string count) + private static void drawCompletionText(Bitmap myBitmap, string count) { string all = "Complete ALL CHALLENGES to earn the reward item"; string any = "Complete ANY " + count + " CHALLENGES to earn the reward item"; @@ -311,7 +258,8 @@ namespace FModel break; } - toDrawOn.DrawString(count == "-1" ? all : any, new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 50), new SolidBrush(Color.White), new Point(100, theY + 22)); + drawQuestBackground(myBitmap, false); + toDrawOn.DrawString(count == "-1" ? all : any, new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[1], 25), new SolidBrush(Color.White), new Point(55, theY + 15)); } /// @@ -335,34 +283,7 @@ namespace FModel text = text.Replace("{Date}", DateTime.Now.ToString("dd/MM/yyyy")); } - toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(100, 0, 0, 0)), new Rectangle(0, theY + 240, myBitmap.Width, 40)); - toDrawOn.DrawString(text, 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() - { - string textureFile = "T_UI_ChallengeTile_Fortbytes"; - ItemIcon.ItemIconPath = JohnWick.AssetToTexture2D(textureFile); - - if (File.Exists(ItemIcon.ItemIconPath)) - { - Image itemIcon; - using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath)) - { - itemIcon = new Bitmap(bmpTemp); - } - toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 110, 110), new Point(2300, theY + 6)); - } - else - { - Image itemIcon = Resources.unknown512; - toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 110, 110), new Point(2300, theY + 6)); - } - } - private static void drawUnknownReward() - { - Image itemIcon = Resources.unknown512; - toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 110, 110), new Point(2300, theY + 6)); + 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); } } } diff --git a/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs b/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs index 125183f7..cfe0ab0d 100644 --- a/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs +++ b/FModel/Methods/IconGenerator/ChallengeGenerator/DrawingRewards.cs @@ -31,13 +31,13 @@ namespace FModel DrawRewardIcon(parts[1]); } else if (IsRewardType(itemToExtract, "athenabattlestar")) - drawRewards("athenabattlestar", itemQuantity); + drawRewards(itemToExtract, "athenabattlestar", itemQuantity); else if (IsRewardType(itemToExtract, "AthenaSeasonalXP")) - drawRewards("AthenaSeasonalXP", itemQuantity); + drawRewards(itemToExtract, "AthenaSeasonalXP", itemQuantity); else if (IsRewardType(itemToExtract, "MtxGiveaway")) - drawRewards("MtxGiveaway", itemQuantity); + drawRewards(itemToExtract, "MtxGiveaway", itemQuantity); else if (IsRewardType(itemToExtract, "AthenaFortbyte")) - drawRewards("AthenaFortbyte", itemQuantity); + drawRewards(itemToExtract, "AthenaFortbyte", itemQuantity); else DrawRewardIcon(itemToExtract); } @@ -146,12 +146,6 @@ namespace FModel Image itemIcon = null; if (File.Exists(ItemIcon.ItemIconPath)) { - if (Settings.Default.challengesDebug) - { - //draw quest reward id - BundleDesign.toDrawOn.DrawString(itemId, new Font("Courier New", 12), new SolidBrush(Color.White), new RectangleF(2110, BundleDesign.theY + 30, 190, 60), FontUtilities.centeredStringLine); - } - using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath)) { itemIcon = new Bitmap(bmpTemp); @@ -162,57 +156,80 @@ namespace FModel if (itemIcon != null) { - BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 110, 110), new Point(2300, BundleDesign.theY + 6)); + BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 64, 64), new Point(902, BundleDesign.theY + 3)); itemIcon.Dispose(); } } - private static void drawRewards(string type, string quantity) + private static void drawRewards(string itemId, string type, string quantity) { - Image rewardIcon = null; - GraphicsPath graphicsPath = null; + string value = ThePak.AllpaksDictionary.Where(x => string.Equals(x.Key, itemId, StringComparison.CurrentCultureIgnoreCase)).Select(d => d.Key).FirstOrDefault(); + if (value != null) + { + string extractedIconPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[value], value); + if (extractedIconPath != null) + { + if (extractedIconPath.Contains(".uasset") || extractedIconPath.Contains(".uexp") || extractedIconPath.Contains(".ubulk")) + { + JohnWick.MyAsset = new PakAsset(extractedIconPath.Substring(0, extractedIconPath.LastIndexOf('.'))); + try + { + if (JohnWick.MyAsset.GetSerialized() != null) + { + dynamic AssetData = JsonConvert.DeserializeObject(JohnWick.MyAsset.GetSerialized()); + JArray AssetArray = JArray.FromObject(AssetData); + ItemIcon.ItemIconPath = string.Empty; + ItemIcon.SearchAthIteDefIcon(AssetArray[0]); + if (File.Exists(ItemIcon.ItemIconPath)) + { + Image itemIcon; + using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath)) + { + itemIcon = new Bitmap(bmpTemp); + } + BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 48, 48), new Point(947, BundleDesign.theY + 12)); + } + } + } + catch (JsonSerializationException) + { + //do not crash when JsonSerialization does weird stuff + } + } + } + } + + GraphicsPath graphicsPath = null; switch (type) { case "athenabattlestar": { - rewardIcon = Resources.BattlePoints; - BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(rewardIcon, 75, 75), new Point(2325, BundleDesign.theY + 22)); - graphicsPath = new GraphicsPath(); drawPathAndFill(graphicsPath, quantity, Color.FromArgb(255, 143, 74, 32), Color.FromArgb(255, 255, 219, 103)); break; } case "AthenaSeasonalXP": { - rewardIcon = Resources.SeasonalXP; - BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(rewardIcon, 75, 75), new Point(2325, BundleDesign.theY + 22)); - graphicsPath = new GraphicsPath(); drawPathAndFill(graphicsPath, quantity, Color.FromArgb(255, 81, 131, 15), Color.FromArgb(255, 230, 253, 177)); break; } case "MtxGiveaway": { - rewardIcon = Resources.ItemsMTX; - BundleDesign.toDrawOn.DrawImage(ImageUtilities.ResizeImage(rewardIcon, 75, 75), new Point(2325, BundleDesign.theY + 22)); - graphicsPath = new GraphicsPath(); drawPathAndFill(graphicsPath, quantity, Color.FromArgb(255, 100, 160, 175), Color.FromArgb(255, 220, 230, 255)); break; } case "AthenaFortbyte": { - 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)); + BundleDesign.toDrawOn.DrawString("#" + Int32.Parse(quantity).ToString("D2"), new Font(FontUtilities.pfc.Families[1], 40), new SolidBrush(Color.White), new Point(975, BundleDesign.theY + 5), FontUtilities.rightString); break; } default: break; } - if (rewardIcon != null) - rewardIcon = null; - if (graphicsPath != null) graphicsPath.Dispose(); } @@ -231,9 +248,9 @@ namespace FModel /// private static void drawPathAndFill(GraphicsPath p, string quantity, Color border, Color filled) { - Pen myPen = new Pen(border, 5); + Pen myPen = new Pen(border, 3); myPen.LineJoin = LineJoin.Round; //needed to avoid spikes - p.AddString(quantity, FontUtilities.pfc.Families[1], (int)FontStyle.Regular, 60, new Point(2322, BundleDesign.theY + 25), FontUtilities.rightString); + p.AddString(quantity, FontUtilities.pfc.Families[1], (int)FontStyle.Regular, 27, new Point(945, BundleDesign.theY + 20), FontUtilities.rightString); BundleDesign.toDrawOn.DrawPath(myPen, p); BundleDesign.toDrawOn.FillPath(new SolidBrush(filled), p); diff --git a/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs b/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs index 48e3e623..fe112ef1 100644 --- a/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs +++ b/FModel/Methods/IconGenerator/ItemGenerator/DrawText.cs @@ -282,7 +282,7 @@ namespace FModel myGraphic, text, Settings.Default.rarityNew ? new Rectangle(5, 405, 512, 55).Size : new Rectangle(5, 395, 512, 49).Size, - new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : FontUtilities.pfc.Families[0], 35) + new Font(Settings.Default.IconLanguage == "Japanese" ? FontUtilities.pfc.Families[2] : Settings.Default.IconLanguage == "Russian" ? FontUtilities.pfc.Families[1] : FontUtilities.pfc.Families[0], 35) ); myGraphic.DrawString( @@ -442,7 +442,7 @@ namespace FModel /// private static void DrawToLeft(string text, Graphics myGraphic) { - myGraphic.DrawString(text, new Font(FontUtilities.pfc.Families[0], 11), new SolidBrush(Color.White), new Point(5, 503)); + myGraphic.DrawString(text, new Font(Settings.Default.IconLanguage == "Russian" ? FontUtilities.pfc.Families[1] : FontUtilities.pfc.Families[0], 11), new SolidBrush(Color.White), new Point(5, Settings.Default.IconLanguage == "Russian" ? 500 : 503)); } /// diff --git a/FModel/Properties/Resources.Designer.cs b/FModel/Properties/Resources.Designer.cs index 6b1012f3..a6fbb18e 100644 --- a/FModel/Properties/Resources.Designer.cs +++ b/FModel/Properties/Resources.Designer.cs @@ -80,16 +80,6 @@ namespace FModel.Properties { } } - /// - /// Recherche une ressource localisée de type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap BattlePoints { - get { - object obj = ResourceManager.GetObject("BattlePoints", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Recherche une ressource localisée de type System.Byte[]. /// @@ -140,16 +130,6 @@ namespace FModel.Properties { } } - /// - /// Recherche une ressource localisée de type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Challenges_Slider { - get { - object obj = ResourceManager.GetObject("Challenges_Slider", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Recherche une ressource localisée de type System.Drawing.Bitmap. /// @@ -230,16 +210,6 @@ namespace FModel.Properties { } } - /// - /// Recherche une ressource localisée de type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap ItemsMTX { - get { - object obj = ResourceManager.GetObject("ItemsMTX", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Recherche une ressource localisée de type System.Drawing.Bitmap. /// @@ -370,16 +340,6 @@ namespace FModel.Properties { } } - /// - /// Recherche une ressource localisée de type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap SeasonalXP { - get { - object obj = ResourceManager.GetObject("SeasonalXP", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Recherche une ressource localisée de type System.Drawing.Bitmap. /// diff --git a/FModel/Properties/Resources.resx b/FModel/Properties/Resources.resx index 16d13cee..52e40683 100644 --- a/FModel/Properties/Resources.resx +++ b/FModel/Properties/Resources.resx @@ -187,18 +187,6 @@ ..\Resources\BurbankBigCondensed-Bold.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\T-FNBR-BattlePoints-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\T-FNBR-SeasonalXP-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\T-Items-MTX-L.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\Challenges_Slider.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\dmg64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/FModel/Resources/Challenges_Slider.png b/FModel/Resources/Challenges_Slider.png deleted file mode 100644 index abcef0bd..00000000 Binary files a/FModel/Resources/Challenges_Slider.png and /dev/null differ diff --git a/FModel/Resources/T-FNBR-BattlePoints-L.png b/FModel/Resources/T-FNBR-BattlePoints-L.png deleted file mode 100644 index f31f9308..00000000 Binary files a/FModel/Resources/T-FNBR-BattlePoints-L.png and /dev/null differ diff --git a/FModel/Resources/T-FNBR-SeasonalXP-L.png b/FModel/Resources/T-FNBR-SeasonalXP-L.png deleted file mode 100644 index f750e1f1..00000000 Binary files a/FModel/Resources/T-FNBR-SeasonalXP-L.png and /dev/null differ diff --git a/FModel/Resources/T-Items-MTX-L.png b/FModel/Resources/T-Items-MTX-L.png deleted file mode 100644 index 7bdd3d81..00000000 Binary files a/FModel/Resources/T-Items-MTX-L.png and /dev/null differ