/// <summary> /// JohnWick is case sensitive so that way we search the item in the dictionary with CurrentCultureIgnoreCase and if he exists, we take his name /// so the name taken will be working for JohnWick /// </summary> /// <param name="item"></param> public static void DrawRewardIcon(string item) { ItemIcon.ItemIconPath = string.Empty; var value = ThePak.AllpaksDictionary.Where(x => string.Equals(x.Key, item, 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) { var itemId = ItemsIdParser.FromJson(JToken.Parse(JohnWick.MyAsset.GetSerialized()).ToString()); for (int i = 0; i < itemId.Length; i++) { ItemIcon.SearchAthIteDefIcon(itemId[i]); drawIcon(item); } } } catch (JsonSerializationException) { //do not crash when JsonSerialization does weird stuff } } } } }
private static void drawIngredientIcon(JToken AssetArray, int i) { ItemIcon.ItemIconPath = string.Empty; ItemIcon.SearchAthIteDefIcon(AssetArray); if (File.Exists(ItemIcon.ItemIconPath)) { Image itemIcon; using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath)) { itemIcon = new Bitmap(bmpTemp); } toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 50, 50), new Point(10, 536 + (75 * i))); } else { Image itemIcon = Resources.unknown512; toDrawOn.DrawImage(itemIcon, new Point(0, 0)); } }
/// <summary> /// JohnWick is case sensitive so that way we search the item in the dictionary with CurrentCultureIgnoreCase and if he exists, we take his name /// so the name taken will be working for JohnWick /// </summary> /// <param name="item"></param> public static void DrawRewardIcon(string item) { ItemIcon.ItemIconPath = string.Empty; var value = ThePak.AllpaksDictionary.Where(x => string.Equals(x.Key, item, 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.SearchAthIteDefIcon(AssetArray[0]); drawIcon(); } } catch (JsonSerializationException) { //do not crash when JsonSerialization does weird stuff } } } else { drawIcon(); } } else { drawIcon(); } }
private static void drawRewards(string itemId, string type, string quantity) { 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": { graphicsPath = new GraphicsPath(); drawPathAndFill(graphicsPath, quantity, Color.FromArgb(255, 143, 74, 32), Color.FromArgb(255, 255, 219, 103)); break; } case "AthenaSeasonalXP": { graphicsPath = new GraphicsPath(); drawPathAndFill(graphicsPath, quantity, Color.FromArgb(255, 81, 131, 15), Color.FromArgb(255, 230, 253, 177)); break; } case "MtxGiveaway": { 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], 40), new SolidBrush(Color.White), new Point(975, BundleDesign.theY + 5), FontUtilities.rightString); break; } default: break; } if (graphicsPath != null) { graphicsPath.Dispose(); } }