Ejemplo n.º 1
0
        private void DrawHorizontalGuide(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double width)
        {
            var point0 = new GuidePoint(0, point.Y);
            var point1 = new GuidePoint(width, point.Y);

            DrawGuideLine(dc, cache, point0, point1);
        }
Ejemplo n.º 2
0
        private void DrawVerticalGuide(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double height)
        {
            var point0 = new GuidePoint(point.X, 0);
            var point1 = new GuidePoint(point.X, height);

            DrawGuideLine(dc, cache, point0, point1);
        }
Ejemplo n.º 3
0
        private void DrawGuideLine(DrawingContext dc, BasicStyleCache cache, GuidePoint point0, GuidePoint point1)
        {
            var gs = new GuidelineSet(
                new double[] { point0.X + cache.HalfThickness, point1.X + cache.HalfThickness },
                new double[] { point0.Y + cache.HalfThickness, point1.Y + cache.HalfThickness });

            gs.Freeze();
            dc.PushGuidelineSet(gs);
            dc.DrawLine(cache.StrokePen, new Point(point0.X, point0.Y), new Point(point1.X, point1.Y));
            dc.Pop();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Tries to get the hate of the mob.
        /// </summary>
        /// <param name="cpkt"></param>
        private void CM_REQUESTSHOWNPCLOCATION(CMSG_NPCLOCATIONSELECT cpkt)
        {
            List <GuidePoint> guidepoints = this.character.Tag as List <GuidePoint>;

            if (guidepoints != null && cpkt.LocationId < guidepoints.Count)
            {
                GuidePoint    point  = guidepoints[cpkt.LocationId];
                GuideNpc      npoint = point as GuideNpc;
                GuidePosition ppoint = point as GuidePosition;

                if (npoint != null)
                {
                    //Predicated used searching
                    Predicate <MapObject> FindActor = delegate(MapObject actor)
                    {
                        return(actor.ModelId == npoint.Map);
                    };

                    List <MapObject> matchingactors = new List <MapObject>();
                    Regiontree       tree           = this.character.currentzone.Regiontree;
                    matchingactors.AddRange(tree.SearchActors(FindActor, SearchFlags.Npcs));
                    if (matchingactors.Count > 0)
                    {
                        MapObject matchingactor     = matchingactors[0];
                        SMSG_NPCASKLOCATIONSRC spkt = new SMSG_NPCASKLOCATIONSRC();
                        spkt.SessionId    = this.character.id;
                        spkt.Result       = 0;
                        spkt.DialogScript = 0;
                        spkt.NpcId        = npoint.Map;
                        spkt.X            = matchingactor.Position.x;
                        spkt.Y            = matchingactor.Position.y;
                        spkt.Z            = matchingactor.Position.z;
                        this.Send((byte[])spkt);
                    }
                }
                else if (ppoint != null)
                {
                    SMSG_NPCASKLOCATIONSRC spkt = new SMSG_NPCASKLOCATIONSRC();
                    spkt.SessionId    = this.character.id;
                    spkt.Result       = 2;
                    spkt.DialogScript = 0;
                    spkt.NpcId        = ppoint.Npc;
                    spkt.X            = ppoint.x;
                    spkt.Y            = ppoint.y;
                    spkt.Z            = ppoint.z;
                    spkt.Result2      = 6;
                    this.Send((byte[])spkt);
                }
            }
        }
Ejemplo n.º 5
0
 private void DrawGuidePoint(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double radius)
 {
     dc.DrawEllipse(cache.FillBrush, null, new Point(point.X, point.Y), radius, radius);
 }
Ejemplo n.º 6
0
 public GuideLine(GuidePoint point0, GuidePoint point1)
 {
     Point0 = point0;
     Point1 = point1;
 }
Ejemplo n.º 7
0
        private static void FillEllipse(DrawingContext dc, IBrush brush, GuidePoint point, double radiusX, double radiusY)
        {
            var g = new EllipseGeometry(new Rect(point.X - radiusX, point.Y - radiusY, 2.0 * radiusX, 2.0 * radiusY));

            dc.DrawGeometry(brush, null, g);
        }
Ejemplo n.º 8
0
 private void DrawGuideLine(DrawingContext dc, BasicStyleCache cache, GuidePoint point0, GuidePoint point1)
 {
     dc.DrawLine(cache.StrokePen, new Point(point0.X, point0.Y), new Point(point1.X, point1.Y));
 }
Ejemplo n.º 9
0
 private void DrawGuidePoint(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double radius)
 {
     FillEllipse(dc, cache.FillBrush, point, radius, radius);
 }
Ejemplo n.º 10
0
 private void DrawGuidePoint(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double radius)
 {
     dc.DrawEllipse(cache.FillBrush, null, new Point(point.X, point.Y), radius, radius);
 }
Ejemplo n.º 11
0
 private void DrawVerticalGuide(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double height)
 {
     var point0 = new GuidePoint(point.X, 0);
     var point1 = new GuidePoint(point.X, height);
     DrawGuideLine(dc, cache, point0, point1);
 }
Ejemplo n.º 12
0
 private void DrawHorizontalGuide(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double width)
 {
     var point0 = new GuidePoint(0, point.Y);
     var point1 = new GuidePoint(width, point.Y);
     DrawGuideLine(dc, cache, point0, point1);
 }
Ejemplo n.º 13
0
 private void DrawGuidePoint(DrawingContext dc, BasicStyleCache cache, GuidePoint point, double radius)
 {
     FillEllipse(dc, cache.FillBrush, point, radius, radius);
 }
Ejemplo n.º 14
0
 private void DrawGuideLine(DrawingContext dc, BasicStyleCache cache, GuidePoint point0, GuidePoint point1)
 {
     dc.DrawLine(cache.StrokePen, new Point(point0.X, point0.Y), new Point(point1.X, point1.Y));
 }
Ejemplo n.º 15
0
 private static void FillEllipse(DrawingContext dc, IBrush brush, GuidePoint point, double radiusX, double radiusY)
 {
     var g = new EllipseGeometry(new Rect(point.X - radiusX, point.Y - radiusY, 2.0 * radiusX, 2.0 * radiusY));
     dc.DrawGeometry(brush, null, g);
 }
Ejemplo n.º 16
0
 public GuideLine(GuidePoint point0, GuidePoint point1)
 {
     Point0 = point0;
     Point1 = point1;
 }
Ejemplo n.º 17
0
 private void DrawGuideLine(DrawingContext dc, BasicStyleCache cache, GuidePoint point0, GuidePoint point1)
 {
     var gs = new GuidelineSet(
         new double[] { point0.X + cache.HalfThickness, point1.X + cache.HalfThickness },
         new double[] { point0.Y + cache.HalfThickness, point1.Y + cache.HalfThickness });
     gs.Freeze();
     dc.PushGuidelineSet(gs);
     dc.DrawLine(cache.StrokePen, new Point(point0.X, point0.Y), new Point(point1.X, point1.Y));
     dc.Pop();
 }