Example #1
0
        public static void DrawTexts(ItemsIdParser theItem, Graphics myGraphic, string mode)
        {
            DrawDisplayName(theItem, myGraphic);
            DrawDescription(theItem, myGraphic);

            SetTexts(theItem);

            switch (mode)
            {
            case "athIteDef":
                DrawToLeft(ShortDescription, myGraphic);
                DrawToRight(CosmeticSource, myGraphic);
                break;

            case "consAndWeap":
                DrawToRight(ItemAction, myGraphic);
                if (MainWindow.ExtractedFilePath.Contains("Items\\Consumables\\"))
                {
                    DrawToLeft(MaxStackSize, myGraphic);
                }
                break;

            case "variant":
                DrawToLeft(ShortDescription, myGraphic);
                DrawToRight(CosmeticId, myGraphic);
                break;

            case "stwHeroes":
                DrawToRight(HeroType, myGraphic);
                DrawPower(myGraphic);
                break;

            case "stwDefenders":
                DrawToRight(DefenderType, myGraphic);
                DrawPower(myGraphic);
                break;
            }

            if (theItem.ExportType == "AthenaItemWrapDefinition" && Checking.WasFeatured && ItemIcon.ItemIconPath.Contains("WeaponRenders"))
            {
                DrawAdditionalImage(theItem, myGraphic);
            }
            if (theItem.AmmoData != null && theItem.AmmoData.AssetPathName.Contains("Ammo")) //TO AVOID TRIGGERING CONSUMABLES, NAME SHOULD CONTAIN "AMMO"
            {
                ItemIcon.GetAmmoData(theItem.AmmoData.AssetPathName, myGraphic);
                DrawWeaponStat(WeaponRowName, myGraphic);
            }

            DrawCosmeticUff(theItem, myGraphic);
        }
Example #2
0
 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));
     }
 }
Example #3
0
        public static void createItemDefinitionIcon(JToken theItem)
        {
            JToken craftedItem = SchematicItemInfos.setSchematicData(theItem);

            toDrawOn = createGraphic(522, 522 + (75 * SchematicItemInfos.schematicInfoList.Count));
            Rarity.DrawRarity(craftedItem, toDrawOn);

            ItemIcon.ItemIconPath = string.Empty;
            ItemIcon.GetItemIcon(craftedItem, Settings.Default.loadFeaturedImage);
            if (File.Exists(ItemIcon.ItemIconPath))
            {
                Image itemIcon;
                using (var bmpTemp = new Bitmap(ItemIcon.ItemIconPath))
                {
                    itemIcon = new Bitmap(bmpTemp);
                }
                toDrawOn.DrawImage(ImageUtilities.ResizeImage(itemIcon, 512, 512), new Point(5, 5));
            }
            else
            {
                Image itemIcon = Resources.unknown512;
                toDrawOn.DrawImage(itemIcon, new Point(0, 0));
            }

            if (string.Equals(Properties.Settings.Default.rarityDesign, "Flat"))
            {
                GraphicsPath p = new GraphicsPath();
                p.StartFigure();
                p.AddLine(4, 438, 517, 383);
                p.AddLine(517, 383, 517, 383 + 134);
                p.AddLine(4, 383 + 134, 4, 383 + 134);
                p.AddLine(4, 383 + 134, 4, 438);
                p.CloseFigure();
                toDrawOn.FillPath(new SolidBrush(Color.FromArgb(70, 0, 0, 50)), p);
            }
            else
            {
                toDrawOn.FillRectangle(new SolidBrush(Color.FromArgb(70, 0, 0, 50)), new Rectangle(5, 383, 512, 134));
            }

            DrawText.DrawTexts(craftedItem, toDrawOn, "");
        }
Example #4
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();
            }
        }
Example #5
0
        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();
            }
        }