Ejemplo n.º 1
0
        private void Draw(DrawingContext context, SkillNode node)
        {
            var rect       = _icons.SkillPositions[node.IconKey];
            var image      = _icons.GetSkillImage(node.IconKey);
            var imageBrush = new ImageBrush
            {
                Stretch      = Stretch.Uniform,
                ImageSource  = image,
                ViewboxUnits = BrushMappingMode.RelativeToBoundingBox,
                Viewbox      = new Rect(rect.X / image.PixelWidth, rect.Y / image.PixelHeight,
                                        rect.Width / image.PixelWidth, rect.Height / image.PixelHeight)
            };

            context.DrawEllipse(imageBrush, null, node.Position, rect.Width, rect.Height);
        }
Ejemplo n.º 2
0
        private void Draw(DrawingContext context, PassiveNodeViewModel node)
        {
            if (!node.IconKey.Contains("Connected"))
            {
                return;
            }
            if (!_icons.SkillPositions.ContainsKey(node.IconKey))
            {
                return;
            }

            var rect   = _icons.SkillPositions[node.IconKey];
            var radius = Math.Sqrt((rect.Width * rect.Height) / Math.PI);

            var buttonKey = $"Passive{node.PassiveNodeType}ConnectedButton";

            if (_connectedAssets.ContainsKey(buttonKey))
            {
                var connected           = _connectedAssets["PassiveMasteryConnectedButton"];
                var connectedImageBrush = new ImageBrush
                {
                    Stretch     = Stretch.Uniform,
                    ImageSource = connected,
                    Viewbox     = new Rect(0, 0, 1, 1)
                };

                context.DrawEllipse(connectedImageBrush, null, node.Position, connected.PixelWidth * SkillTree.PoESkillTree.MaxImageZoomLevel * 1.5, connected.PixelHeight * SkillTree.PoESkillTree.MaxImageZoomLevel * 1.5);
            }

            var image      = _icons.GetSkillImage(node.IconKey);
            var imageBrush = new ImageBrush
            {
                Stretch      = Stretch.Uniform,
                ImageSource  = image,
                ViewboxUnits = BrushMappingMode.RelativeToBoundingBox,
                Viewbox      = new Rect(rect.X / image.PixelWidth, rect.Y / image.PixelHeight,
                                        rect.Width / image.PixelWidth, rect.Height / image.PixelHeight)
            };

            context.DrawEllipse(imageBrush, null, node.Position, radius, radius);
        }
Ejemplo n.º 3
0
        private void Draw(DrawingContext context, PassiveNodeViewModel node)
        {
            if (!_icons.SkillPositions.TryGetValue(node.IconKey, out var rect))
            {
                return;
            }

            var image      = _icons.GetSkillImage(node.IconKey);
            var imageBrush = new ImageBrush
            {
                Stretch      = Stretch.Uniform,
                ImageSource  = image,
                ViewboxUnits = BrushMappingMode.RelativeToBoundingBox,
                Viewbox      = new Rect(rect.X / image.PixelWidth, rect.Y / image.PixelHeight,
                                        rect.Width / image.PixelWidth, rect.Height / image.PixelHeight)
            };

            var radius = Math.Sqrt((rect.Width * rect.Height) / Math.PI);

            context.DrawEllipse(imageBrush, null, node.Position, radius, radius);
        }