OverlayInformation.ItemPanel.DrawItems C# (CSharp) Method

DrawItems() private static method

private static DrawItems ( System.Vector2 pos, System.Vector2 size, int r, int g, int b ) : void
pos System.Vector2
size System.Vector2
r int
g int
b int
return void
        private static void DrawItems(Vector2 pos,Vector2 size,int r,int g,int b)
        {
            var i = 0;
            if (Members.ItemDictionary.Count == 0) {return;}
            foreach (var v in Members.EnemyHeroes)
            {
                if (Members.MeepoIgnoreList.Contains(v))
                    continue;
                /*var dividedWeStand = v.FindSpell("meepo_divided_we_stand") as DividedWeStand;
                if (dividedWeStand != null && v.ClassID == ClassID.CDOTA_Unit_Hero_Meepo && dividedWeStand.ID > 0)
                    continue;*/
                List<Item> items;
                try
                {
                    if (!Members.ItemDictionary.TryGetValue(v.Handle, out items))
                        continue;
                }
                catch (Exception)
                {
                    Printer.Print("[DrawItems]: "+v.StoredName());
                    continue;
                }

                var heroPos = pos + new Vector2(0, (size.Y/7 + 3)*i+2);
                Drawing.DrawRect(heroPos, size/7,
                    Textures.GetTexture("materials/ensage_ui/heroes_horizontal/" +
                                        v.StoredName().Substring("npc_dota_hero_".Length) + ".vmat"));
                var n = 0;

                foreach (var item in items)
                {
                    try
                    {
                        var texturename = item.IsRecipe
                            ? "materials/ensage_ui/items/recipe.vmat"
                            : $"materials/ensage_ui/items/{item.Name.Replace("item_", "")}.vmat";
                        if (item is Bottle)
                        {
                            var bottletype = item as Bottle;
                            if (bottletype.StoredRune != RuneType.None)
                            {
                                texturename =
                                    $"materials/ensage_ui/items/{item.Name.Replace("item_", "") + "_" + bottletype.StoredRune}.vmat";
                            }
                        }
                        var itemPos = heroPos + new Vector2(size.X/7, 0) + new Vector2(size.X/7*n + 5, 0);
                        DrawItem(itemPos, size/6, texturename, r, g, b);
                        DrawState(item, v, itemPos, size/6);
                        n++;
                    }
                    catch (Exception)
                    {
                        //Printer.Print("Hero: "+v.Name+". Item: "+item.Name);
                    }
                }
                for (var j = 0; j < 6-n; j++)
                {
                    var itemPos = heroPos + new Vector2(size.X / 7, 0) + new Vector2(size.X / 7 * (n + j) + 5, 0);
                    DrawItem(itemPos, size / 6, "materials/ensage_ui/items/emptyitembg.vmat", r, g, b);
                }
                i++;
            }
        }