Exemplo n.º 1
0
 public int monsterDensityAroundCursor(float distance)
 {
     if (!Hud.Game.Me.IsInTown)
     {
         IScreenCoordinate coord = Hud.Game.Me.FloorCoordinate.ToScreenCoordinate(); //Hud.Render.GetCursorPos();
         coord.X = Hud.Window.CursorX;
         coord.Y = Hud.Window.CursorY;
         IWorldCoordinate cursor = coord.ToWorldCoordinate();
         int count = 0;
         foreach (IMonster monster in Hud.Game.AliveMonsters)
         {
             if (monster.FloorCoordinate.XYDistanceTo(cursor) < distance)
             {
                 count++;
             }
         }
         if (drawCursorCircle)
         {
             cursorBrush.DrawWorldEllipse(distance, -1, cursor);
         }
         if (drawCursorLabel)
         {
             cursorDecorator.Paint(Hud.Window.CursorX - 10, Hud.Window.CursorY + 30, 50, 20, count.ToString(), null, "");
         }
         return(count);
     }
     return(0);
 }
Exemplo n.º 2
0
        public void Paint(IActor actor, IWorldCoordinate coord, string text)
        {
            if (!Enabled)
            {
                return;
            }
            if (Brush == null)
            {
                return;
            }

            var radius = Radius;

            if (radius == -1)
            {
                if (actor != null)
                {
                    radius = Math.Min(actor.RadiusBottom, 20);
                }
                else
                {
                    return;
                }
            }

            if (RadiusTransformator != null)
            {
                radius = RadiusTransformator.TransformRadius(radius);
            }

            if (HasShadow)
            {
                if (Brush.StrokeStyle.DashStyle == SharpDX.Direct2D1.DashStyle.Solid)
                {
                    _shadowBrush.StrokeWidth = Brush.StrokeWidth >= 0 ? Brush.StrokeWidth + 1 : Brush.StrokeWidth - 1;
                    _shadowBrush.DrawWorldEllipse(radius, -1, coord);
                }
            }

            Brush.DrawWorldEllipse(radius, -1, coord);
        }