示例#1
0
        public object CreateControl()
        {
            if (Type == MapItemElement.AT_HasBeenOperated)
            {
                Size = new System.Windows.Size(10, 10);
                Ellipse Ellipse = new Ellipse {
                    Width = 20, Height = 20
                };
                Ellipse.Fill = new ImageBrush {
                    ImageSource = Extensions.FKImage("Icons/operated")
                };
                Ellipse.Fill.Freeze();
                Ellipse.Opacity         = 0.5;
                Ellipse.RenderTransform = new RotateTransform(0);

                return(Ellipse);

                //return new Ellipse { Width = 10, Height = 10, Stroke = System.Windows.Media.Brushes.Red, StrokeThickness = 2 };
            }

            else
            {
                MapItemShape Shape = Config.MiniMapItems(Type, Identifier).Shape;
                Size = new System.Windows.Size(Shape.Width / 2, Shape.Height / 2);

                if (Shape.Shape == ItemShape.Ellipse)
                {
                    return new Ellipse
                           {
                               Width           = Shape.Width,
                               Height          = Shape.Height,
                               Opacity         = Shape.Opacity,
                               Fill            = Shape.FillBrush,
                               StrokeThickness = Shape.StrokeThickness,
                               Stroke          = Shape.StrokeBrush
                           }
                }
                ;

                else if (Shape.Shape == ItemShape.Rectangle)
                {
                    return new Rectangle
                           {
                               Width           = Shape.Width,
                               Height          = Shape.Height,
                               Opacity         = Shape.Opacity,
                               Fill            = Shape.FillBrush,
                               StrokeThickness = Shape.StrokeThickness,
                               Stroke          = Shape.StrokeBrush
                           }
                }
                ;
            }
            return(null);
        }
示例#2
0
        public object CreateControl()
        {
            MapItemShape Shape = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;

            Size = new System.Windows.Size(Shape.Width / 2, Shape.Height / 2);

            if (Marker.x1C_StringListSnoId == ItemQualityMinimap.KeyWarden)
            {
                return(new Ellipse
                {
                    Width = Shape.Width,
                    Height = Shape.Height,
                    Opacity = Shape.Opacity,
                    Fill = Extensions.HexToBrush("#ae2af8"),
                });
            }

            if (Shape.Shape == ItemShape.Ellipse)
            {
                return new Ellipse
                       {
                           Width           = Shape.Width,
                           Height          = Shape.Height,
                           Opacity         = Shape.Opacity,
                           Fill            = Shape.FillBrush,
                           StrokeThickness = Shape.StrokeThickness,
                           Stroke          = Shape.StrokeBrush
                       }
            }
            ;

            else if (Shape.Shape == ItemShape.Rectangle)
            {
                return new Rectangle
                       {
                           Width           = Shape.Width,
                           Height          = Shape.Height,
                           Opacity         = Shape.Opacity,
                           Fill            = Shape.FillBrush,
                           StrokeThickness = Shape.StrokeThickness,
                           Stroke          = Shape.StrokeBrush
                       }
            }
            ;

            return(null);
        }
示例#3
0
        public object CreateControl()
        {
            MapItemShape Shape = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;

            Size = new System.Windows.Size(Shape.Width / 2, Shape.Height / 2);

            if (Shape.Shape == ItemShape.Ellipse)
            {
                return new Ellipse
                       {
                           Width           = Shape.Width,
                           Height          = Shape.Height,
                           Opacity         = Shape.Opacity,
                           Fill            = Shape.FillBrush,
                           StrokeThickness = Shape.StrokeThickness,
                           Stroke          = Shape.StrokeBrush
                       }
            }
            ;

            else if (Shape.Shape == ItemShape.Rectangle)
            {
                return new Rectangle
                       {
                           Width           = Shape.Width,
                           Height          = Shape.Height,
                           Opacity         = Shape.Opacity,
                           Fill            = Shape.FillBrush,
                           StrokeThickness = Shape.StrokeThickness,
                           Stroke          = Shape.StrokeBrush
                       }
            }
            ;

            return(null);
        }
示例#4
0
        public void Draw(bool LargeMap = false)
        {
            this.LargeMinimap = LargeMap;

            try
            {
                if (LargeMinimap)
                {
                    LargeMapOffset = UIObjects.LargeMap.TryGetPoint <UXMinimap>(Enigma.D3.OffsetConversion.UXControlMinimapRect);
                }

                using (DrawingContext drawingContext = _visual.RenderOpen())
                {
                    if ((LargeMinimap && RevealLargemap.Enabled) || (!LargeMinimap && RevealMinimap.Enabled))
                    {
                        if (!TownHelper.InTown)
                        {
                            IEnumerable <SceneHelper.NavHelper> Scenes = SceneHelper.NavHelpers.Values
                                                                         .Where(x => !x.NavContainer.Skip || (!GameManager.Instance.GManager.GList.MainAccount.RiftHelper.InRiftNow && x.LevelAreaSnoID == GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea.x044_SnoId));

                            DrawScene(LargeMinimap ? Scenes : Scenes.Where(x => !this.OutofBounds(x.NavContainer.Position, 450)), drawingContext);
                        }
                    }


                    MapItemElement Current = MapItemElement.AT_Unsigned;
                    MapItemShape   Shape   = null;
                    drawingContext.PushOpacity(1);

                    /*foreach (IMap.IMapActor Actor in Controller.GameManager.Instance.GManager.GList.MainAccount.LevelAreaContainer.Monsters.OrderBy(x => x.Type))
                     * {
                     *  if (Actor.Type == MapItemElement.AT_Portal)
                     *  {
                     *      drawingContext.DrawImage(Door, new Rect(Actor.Point.X - UIScale(25 / 2), Actor.Point.Y - UIScale(26 / 2), UIScale(25), UIScale(26)));
                     *  }
                     *  else
                     *  {
                     *      if (Actor.Type != Current)
                     *      {
                     *          Shape = Config.MiniMapItems(Actor.Type, Actor.Identifier).Shape;
                     *          Current = Actor.Type;
                     *          drawingContext.Pop();
                     *          drawingContext.PushOpacity(Shape.Opacity);
                     *      }
                     *
                     *      if (Shape.Shape == ItemShape.Ellipse)
                     *          DrawEllipse(new DrawHelper(new Size(Shape.Width, Shape.Height), new Point(Actor.Point.X, Actor.Point.Y), Shape.FillBrush, Shape.StrokeBrush), drawingContext);
                     *
                     *      else if (Shape.Shape == ItemShape.Rectangle)
                     *          DrawRectangle(new DrawHelper(new Size(Shape.Width, Shape.Height), new Point(Actor.Point.X, Actor.Point.Y), Shape.FillBrush, Shape.StrokeBrush), drawingContext);
                     *
                     *      if (Actor.EliteOffset != -1 && Drawline)
                     *          drawingContext.DrawLine(Shape.StrokeBrush, new Point(Actor.Point.X - (Shape.Width / 2), Actor.Point.Y - (Shape.Height) / 2), RotatePoint(-45, new Point(175, -105 + (40 * Actor.EliteOffset))));
                     *      // drawingContext.Pop();
                     *  }
                     * }*
                     *
                     * drawingContext.Pop();*/


                    /* foreach (var x in Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.TrickleManager.x04_Ptr_Items.Dereference())
                     * {
                     *
                     *   double UI = Controller.GameManager.Instance.GManager.GRef.Attacher.UIScale;
                     *   MapItemShape Shapes = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;
                     *   Size Controll = new Size(Shapes.Width * UI, Shapes.Height * UI);
                     *
                     *   Point Point = new System.Windows.Point(
                     *        x.x08_WorldPosX - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D0_WorldPosX,
                     *          x.x0C_WorldPosY - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D4_WorldPosY);
                     *
                     *   drawingContext.DrawEllipse(Shapes.FillBrush, Shapes.StrokeBrush,
                     *         Point, Controll.Width, Controll.Height);
                     *
                     * }*/

                    if (Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea == null)
                    {
                        return;
                    }

                    foreach (var marker in Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.LevelArea.x008_PtrQuestMarkersMap.Dereference().ToDictionary().Where(x => x.Value.x00_WorldPosition.x0C_WorldId == Controller.GameManager.Instance.GManager.GList.MainAccount.DiabloIII.ObjectManager.x790.Dereference().x038_WorldId_))
                    {
                        double       UI       = Controller.GameManager.Instance.GManager.GRef.Attacher.UIScale;
                        MapItemShape Shapes   = Config.MiniMapItems(MapItemElement.AT_Objective, -1).Shape;
                        Size         Controll = new Size(Shapes.Width * UI, Shapes.Height * UI);

                        Point Point = new System.Windows.Point(
                            marker.Value.x00_WorldPosition.x00_X - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D0_WorldPosX,
                            marker.Value.x00_WorldPosition.x04_Y - Controller.GameManager.Instance.GManager.GList.MainAccount.Player.x0D4_WorldPosY);

                        int   Scale  = (int)((LargeMap) ? (1200 * UI) / 2 : (350 * UI) / 2);
                        Point offset = new Point((this.VisualOffset.X) * UI, (this.VisualOffset.Y) * UI);

                        if (LargeMap)
                        {
                            Point = new Point(
                                (LargeMapOffset.X < 0) ? Point.X + -LargeMapOffset.X : Point.X - LargeMapOffset.X,
                                (LargeMapOffset.Y < 0) ? Point.Y + -LargeMapOffset.Y : Point.Y - LargeMapOffset.Y
                                );
                        }

                        if (Point.X > offset.X)
                        {
                            Point.X = offset.X;
                        }
                        if (Point.X < -offset.X)
                        {
                            Point.X = -offset.X;
                        }
                        if (Point.Y > offset.Y)
                        {
                            Point.Y = offset.Y;
                        }
                        if (Point.Y < -offset.Y)
                        {
                            Point.Y = -offset.Y;
                        }

                        Point.X = Point.X - (Controll.Width / 2) + 5;
                        Point.Y = Point.Y - (Controll.Height / 2) + 5;

                        //  drawingContext.DrawEllipse(Shapes.FillBrush, Shapes.StrokeBrush,
                        //    Point, Controll.Width, Controll.Height);
                    }
                }
            }

            catch (Exception e) {
                DebugWriter.Write(e);
            }
        }