Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port "Added north line to shuttle console" from Corvax #1375

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 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,15 @@ protected void DrawCircles(DrawingHandleScreen handle)
}
}

// Frontier Corvax: north line drawing
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);
dvir001 marked this conversation as resolved.
Show resolved Hide resolved
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); // Frontier Corvax: north line drawing
var gridNent = EntManager.GetNetEntity(GridEntity);
var mapPos = _xformSystem.ToMapCoordinates(_coordinates.Value);
var ourGridMatrix = _xformSystem.GetWorldMatrix(gridXform.Owner);
Expand Down
6 changes: 5 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();

// Frontier Corvax: north line drawing
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 All @@ -188,6 +191,7 @@ protected override void Draw(DrawingHandleScreen handle)
// Frontier - collect blip location data outside foreach - more changes ahead
var blipDataList = new List<BlipData>();


// Draw other grids... differently
foreach (var grid in _grids)
{
Expand Down
Loading