Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Added north line
Browse files Browse the repository at this point in the history
  • Loading branch information
FireNameFN committed May 14, 2024
1 parent 1525f1c commit 6a2ac4d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ protected void DrawCircles(DrawingHandleScreen handle)
}
}

protected void DrawNorthLine(DrawingHandleScreen handle, Angle angle)
{
var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));
var aExtent = (angle - Math.Tau / 4).ToVec() * ScaledMinimapRadius * 1.42f;
var lineColor = Color.Red.WithAlpha(0.02f);
handle.DrawLine(origin, origin + aExtent, lineColor);
}

protected void DrawGrid(DrawingHandleScreen handle, Matrix3 matrix, Entity<MapGridComponent> grid, Color color, float alpha = 0.01f)
{
var rator = Maps.GetAllTilesEnumerator(grid.Owner, grid.Comp);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Shuttles/UI/ShuttleDockControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected override void Draw(DrawingHandleScreen handle)
}

DrawCircles(handle);
DrawNorthLine(handle, _angle.Value);
var gridNent = EntManager.GetNetEntity(GridEntity);
var mapPos = _xformSystem.ToMapCoordinates(_coordinates.Value);
var ourGridMatrix = _xformSystem.GetWorldMatrix(gridXform.Owner);
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ protected override void Draw(DrawingHandleScreen handle)
Matrix3.Multiply(posMatrix, ourEntMatrix, out var ourWorldMatrix);
var ourWorldMatrixInvert = ourWorldMatrix.Invert();

var rot = ourEntRot + _rotation.Value;

DrawNorthLine(handle, rot);

// Draw our grid in detail
var ourGridId = xform.GridUid;
if (EntManager.TryGetComponent<MapGridComponent>(ourGridId, out var ourGrid) &&
Expand Down Expand Up @@ -178,7 +182,6 @@ protected override void Draw(DrawingHandleScreen handle)

handle.DrawPrimitives(DrawPrimitiveTopology.TriangleFan, radarPosVerts, Color.Lime);

var rot = ourEntRot + _rotation.Value;
var viewBounds = new Box2Rotated(new Box2(-WorldRange, -WorldRange, WorldRange, WorldRange).Translated(mapPos.Position), rot, mapPos.Position);
var viewAABB = viewBounds.CalcBoundingBox();

Expand Down

0 comments on commit 6a2ac4d

Please sign in to comment.