public void Draw(DrawingContext ctx)
        {
            List <string> toRemove = new List <string>();

            DateTime now = DateTime.Now;

            foreach (var p in data)
            {
                string    k = p.Key;
                CacheItem i = p.Value;

                if (now > i.ClearTime)
                {
                    toRemove.Add(k);
                    continue;
                }

                if (now > i.StartDrawTime && now < i.EndDrawTime)
                {
                    i.cmd.DrawCache(ctx, i.state);
                }
            }

            foreach (var k in toRemove)
            {
                data.Remove(k);
            }
        }
Beispiel #2
0
 public virtual void Drawing(DrawingContext ctx, GameObject obj)
 {
     foreach (var c in Commands)
     {
         c.Drawing(ctx, obj);
     }
 }
Beispiel #3
0
 public override object State(DrawingContext ctx, GameObject obj)
 {
     return(new TextCacheState
     {
         Location = CalcLocation(obj),
         Text = prepareString(obj)
     });
 }
Beispiel #4
0
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            if (!FixCenter && obj == null)
            {
                return;
            }

            internalDraw(ctx, CalcLocation(obj));
        }
Beispiel #5
0
        public override void DrawCache(DrawingContext ctx, object state)
        {
            TextCacheState drawItemState = state as TextCacheState;

            if (drawItemState == null)
            {
                return;
            }

            internalDraw(ctx, drawItemState.Location, drawItemState.Text);
        }
        private void internalDraw(DrawingContext ctx, Vector3 loc)
        {
            var vecCenter = loc + new Vector3(0, 1, 0);

            ctx.DrawOutlinedBox(vecCenter, new Vector3(1.0f * 1.0f), NodeColor);

            ctx.DrawCircleWithPoint(
                vecCenter,
                0.0f,
                Radius,
                RangeColor, RangeColor);
        }
Beispiel #7
0
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            if (zoneId != -1)
            {
                if (zoneId != ff14bot.Managers.WorldManager.ZoneId)
                {
                    return;
                }
            }

            base.Drawing(ctx, obj);
        }
Beispiel #8
0
        private void internalDraw(DrawingContext ctx, Vector3 loc)
        {
            if (OutColor.A > 0)
            {
                ctx.DrawDonut(loc, InRadius, OutRadius, OutColor);
            }

            if (InColor.A > 0)
            {
                ctx.DrawCircle(loc, InRadius, InColor);
            }
        }
Beispiel #9
0
        public override bool CanDrawing(DrawingContext ctx, GameObject obj)
        {
            if (!FixCenter && obj == null)
            {
                return(false);
            }

            if (InColor.A == 0 && OutColor.A == 0)
            {
                return(false);
            }

            return(true);
        }
Beispiel #10
0
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            foreach (var c in Commands)
            {
                ICacheDrawItem cacheDrawItem = c as ICacheDrawItem;
                if (cacheDrawItem == null)
                {
                    c.Drawing(ctx, obj);
                    continue;
                }

                HandleCacheCommand(cacheDrawItem, ctx, obj);
            }
        }
Beispiel #11
0
        public void HandleCacheCommand(ICacheDrawItem cmd, DrawingContext ctx, GameObject obj)
        {
            if (!cmd.CanDrawing(ctx, obj))
            {
                return;
            }

            string subKey = cmd.Key(ctx, obj);
            string k      = baseKey + subKey;

            if (cacheManager.HasKey(k))
            {
                return;
            }

            object s = cmd.State(ctx, obj);

            cacheManager.Add(k, cmd, s, Duration, Before, After);
        }
Beispiel #12
0
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            Character c = obj as Character;

            if (c == null)
            {
                return;
            }

            if (!c.IsCasting)
            {
                return;
            }

            if (!spells.Contains(c.CastingSpellId))
            {
                return;
            }

            base.Drawing(ctx, obj);
        }
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            Vector3[] points = this.Commands
                               .Where(p => ((p as GatherHotspot) != null))
                               .Select(p => (p as GatherHotspot).Center).ToArray();

            if (points != null && points.Length > 1)
            {
                Vector3 from = points[0];
                for (int i = 1; i < points.Length; ++i)
                {
                    ctx.DrawLine(from, points[i], Color);
                    from = points[i];
                }

                if (points.Length > 2)
                {
                    ctx.DrawLine(from, points[0], Color);
                }
            }

            base.Drawing(ctx, obj);
        }
Beispiel #14
0
 private void internalDraw(DrawingContext ctx, Vector3 center, float heading)
 {
     ctx.DrawSector(center, Color, Radius, Angle, heading);
 }
Beispiel #15
0
        private void internalDraw(DrawingContext ctx, Vector3 loc, string text)
        {
            Vector3 newVec = loc + new Vector3(0, 1, 0);

            ctx.Draw3DText(text, newVec, FontSize);
        }
Beispiel #16
0
        public override void Drawing(DrawingContext ctx, GameObject obj)
        {
            string outString = prepareString(obj);

            ctx.Draw3DText(outString, CalcLocation(obj), FontSize);
        }
Beispiel #17
0
        private void internalDraw(DrawingContext ctx, Vector3 loc)
        {
            bool shouldAddPoint = (DateTime.Now - lastAdd).TotalMilliseconds > pointIntervalMsc;

            if (pointCount > 5)
            {
                shouldAddPoint = shouldAddPoint && (SlimDX.Vector3.DistanceSquared(loc, lastPoint) > distanceSquare);
            }

            if (shouldAddPoint)
            {
                lastAdd   = DateTime.Now;
                lastPoint = loc;

                if (pointCount < maxPointCount)
                {
                    pointCount++;
                    path.Add(loc);
                }
                else
                {
                    path.RemoveAt(0);
                    path.Add(loc);
                }
            }

            if (path == null || pointCount < 3)
            {
                return;
            }

            if (useFadeOut)
            {
                float   startA   = Math.Max(C1.A, (byte)0x79);
                float   endA     = 10f;
                float   stepA    = (startA - endA) / maxPointCount;
                Vector3 a        = path[0];
                float   currentA = endA - stepA;

                foreach (var b in path)
                {
                    currentA += stepA;
                    if (a == b)
                    {
                        continue;
                    }

                    Color c = Color.FromArgb((int)Math.Floor(currentA), this.C1);
                    ctx.DrawLine(a, b, c);
                    a = b;
                }
            }
            else
            {
                Vector3 a = path[0];
                foreach (var b in path)
                {
                    if (a == b)
                    {
                        continue;
                    }

                    ctx.DrawLine(a, b, this.C1);
                    a = b;
                }
            }
        }
Beispiel #18
0
 public override void internalDrawingCache(DrawingContext ctx, DrawItemState state)
 {
     // No cache support
     //internalDraw(ctx, state.Center);
 }
Beispiel #19
0
 private void internalDraw(DrawingContext ctx, Vector3 loc, float heading)
 {
     ctx.DrawCircleWithPoint(loc, heading, Radius, Color, PointColor);
 }
Beispiel #20
0
 public override void Drawing(DrawingContext ctx, GameObject obj)
 {
     internalDraw(ctx, Center);
 }
Beispiel #21
0
 public override void internalDrawingCache(DrawingContext ctx, DrawItemState state)
 {
     internalDraw(ctx, state.Center);
 }
Beispiel #22
0
 private void internalDraw(DrawingContext ctx, Vector3 loc, float heading)
 {
     ctx.DrawAgroLine(loc, heading, Width, Length, Color, PointColor);
 }
Beispiel #23
0
 public override void Drawing(DrawingContext ctx, GameObject obj)
 {
     internalDraw(ctx, CalcLocation(obj), CalcHeading(obj));
 }
Beispiel #24
0
        private void internalDraw(DrawingContext ctx, Vector3 loc)
        {
            var vecCenter = loc + new Vector3(0, 1, 0);

            ctx.DrawOutlinedBox(vecCenter, new Vector3(1f * SizeFactor), BoxColor);
        }