Example #1
0
        private void guiUpdateKnownGems_Click(object sender, EventArgs e)
        {
            var socketColors = new[] { "Amethyst", "Diamond", "Emerald", "Ruby", "Topaz" };

            var sockets = new List<Item>();

            foreach (var gemColor in socketColors)
            {
                for (var index = 1; index < 11; index++)
                {
                    var id = $"x1_{gemColor}_{index:00}";
                    sockets.Add(Item.CreateFromTooltipParams($"item/{id}"));
                }
            }

            for (var index = 1; index < 22; index++)
            {
                var id = $"Unique_Gem_{index:000}_x1";
                sockets.Add(Item.CreateFromTooltipParams($"item/{id}"));
            }

            sockets.WriteToJsonFile("d3gem.json");

            var node = new TreeNode("Updated Gems from battle.net (saved to d3gem.json)");

            var knownSets = KnownGems.GetKnownGemsFromJsonFile("d3gem.json");

            node.Nodes.AddRange(CreateNodeFromD3Object(knownSets).ToArray());

            guiD3ProfileTreeView.Nodes.Add(node);
        }
        private void guiUpdateKnownGems_Click(object sender, EventArgs e)
        {
            var socketColors = new List<string> { "Amethyst", "Diamond", "Emerald", "Ruby", "Topaz" };

            var sockets = new List<Item>();

            foreach (var gemColor in socketColors)
            {
                for (var index = 1; index < 20; index++)
                {
                    var id = String.Format("{0}_{1:00}", gemColor, index);
                    sockets.Add(Item.CreateFromTooltipParams("item/" + id));
                }
            }

            sockets.WriteToJsonFile("d3gem.json");

            var node = new TreeNode("Updated Gems from battle.net (saved from d3gem.json)");

            var knownSets = KnownGems.GetKnownGemsFromJsonFile("d3gem.json");

            node.Nodes.AddRange(CreateNodeFromD3Object(knownSets).ToArray());

            guiD3ProfileTreeView.Nodes.Add(node);
        }