예제 #1
0
 public DebugTextDisplayLine AddLine(string debugSettingsKey, Func <string> text, ILifetimeObject owner)
 {
     return(AddLine(new DebugTextDisplayLine(text, () => DebugSettings.Get(debugSettingsKey))
     {
         Owner = owner
     }));
 }
예제 #2
0
        public void Draw(IBatchRenderer sbatch)
        {
            if (!DebugSettings.Get("ShowDebugMiniMap"))
            {
                return;
            }

            var rectBoundings = Owner.MapFullBounds;
            var scale         = FloatMath.Min(MaxSize / rectBoundings.Width, MaxSize / rectBoundings.Height);

            var sizeOuter = rectBoundings.AsScaled(scale).Size;
            var sizeView  = Owner.GuaranteedMapViewport.AsScaled(scale).Size;
            var sizeView2 = Owner.CompleteMapViewport.AsScaled(scale).Size;
            var posView   = (Owner.GuaranteedMapViewport.VectorTopLeft - rectBoundings.VectorTopLeft) * scale;
            var posView2  = (Owner.CompleteMapViewport.VectorTopLeft - rectBoundings.VectorTopLeft) * scale;

            var offset     = new FPoint(Owner.VAdapterHUD.VirtualTotalWidth - Padding - sizeOuter.Width, Padding) - Owner.VAdapterHUD.VirtualGuaranteedBoundingsOffset;
            var offsetZero = offset - rectBoundings.VectorTopLeft * scale;

            sbatch.FillRectangle(offset, sizeOuter, Color.Red * 0.25f);
            sbatch.DrawRectangle(offset, sizeOuter, Color.Red);

            sbatch.FillRectangle(offset + posView, sizeView, Color.Black * 0.1f);
            sbatch.DrawRectangle(offset + posView, sizeView, Color.Black, 2);
            sbatch.DrawRectangle(offset + posView2, sizeView2, Color.Black * 0.666f, 1);

            sbatch.DrawLine(offsetZero.X, offset.Y, offsetZero.X, offset.Y + sizeOuter.Height, Color.Black * 0.5f);
            sbatch.DrawLine(offset.X, offsetZero.Y, offset.X + sizeOuter.Width, offsetZero.Y, Color.Black * 0.5f);
            sbatch.FillRectangle(FRectangle.CreateByCenter(offsetZero, 0, 0, 5, 5), Color.Black * 0.5f);

            foreach (var entity in Owner.GetAllEntities())
            {
                float radius = scale * (entity.DrawingBoundingBox.Width + entity.DrawingBoundingBox.Height) / 4;

                if (radius < 0.5f)
                {
                    continue;
                }

                if (entity.IsInViewport)
                {
                    if (entity.DebugIdentColor.A > 0)
                    {
                        sbatch.FillCircle(offsetZero + entity.Position.ToVec2D() * scale, radius, 8, entity.DebugIdentColor * 0.85f);
                    }
                }
                else
                {
                    if (entity.DebugIdentColor.A > 0)
                    {
                        sbatch.FillCircle(offsetZero + entity.Position.ToVec2D() * scale, radius, 8, entity.DebugIdentColor * 0.25f);
                    }
                }
            }
        }
예제 #3
0
 public DebugTextDisplayLine AddTabularLine(string debugSettingsKey, Func <List <string> > texts)
 {
     return(AddLine(new DebugTextDisplayLine(texts, () => DebugSettings.Get(debugSettingsKey))));
 }
예제 #4
0
 public DebugTextDisplayLine AddLine(string debugSettingsKey, Func <string> text)
 {
     return(AddLine(new DebugTextDisplayLine(text, () => DebugSettings.Get(debugSettingsKey))));
 }