Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 2 additions & 35 deletions Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
// SPDX-FileCopyrightText: 2024 ErhardSteinhauer
// SPDX-FileCopyrightText: 2024 Jake Huxell
// SPDX-FileCopyrightText: 2024 eoineoineoin
// SPDX-FileCopyrightText: 2024 exincore
// SPDX-FileCopyrightText: 2024 metalgearsloth
// SPDX-FileCopyrightText: 2025 Ilya246
//
// SPDX-License-Identifier: MPL-2.0

using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared._Mono.GridEdgeMarker; // Mono
using Content.Shared.Maps; // Mono
using Content.Shared.Shuttles.Components;
using Robust.Client.AutoGenerated;
Expand All @@ -35,7 +25,6 @@ public partial class BaseShuttleControl : MapGridControl
{
[Dependency] private readonly IParallelManager _parallel = default!;
[Dependency] private readonly ITileDefinitionManager _tileDef = default!; // Mono
protected readonly EntityLookupSystem _lookup; // Mono
protected readonly SharedMapSystem Maps;

protected readonly Font Font;
Expand All @@ -50,11 +39,6 @@ public partial class BaseShuttleControl : MapGridControl
// stores inward directions of borders
private readonly Dictionary<Vector2i, DirectionFlag> _gridNeighborSet = new(); // Mono
private readonly List<(Vector2 Start, Vector2 End)> _edges = new();
private readonly HashSet<Entity<GridEdgeMarkerComponent>> _edgeMarkers = new();

private Vector2 CenterVec = new Vector2(0.5f, 0.5f); // Mono

private EntityQuery<TransformComponent> _xformQuery; // Mono

private Vector2[] _allVertices = Array.Empty<Vector2>();

Expand All @@ -68,8 +52,6 @@ public BaseShuttleControl(float minRange, float maxRange, float range) : base(mi
{
RobustXamlLoader.Load(this);
Maps = EntManager.System<SharedMapSystem>();
_lookup = EntManager.System<EntityLookupSystem>(); // Mono
_xformQuery = EntManager.GetEntityQuery<TransformComponent>(); // Mono
Font = new VectorFont(IoCManager.Resolve<IResourceCache>().GetResource<FontResource>("/Fonts/NotoSans/NotoSans-Regular.ttf"), 12);

_drawJob = new GridDrawJob()
Expand Down Expand Up @@ -110,7 +92,7 @@ protected void DrawCircles(DrawingHandleScreen handle)
var maxDistance = MathF.Pow(2f, EquatorialMultiplier * 6f);
var cornerDistance = MathF.Sqrt(WorldRange * WorldRange + WorldRange * WorldRange);

var origin = MidPointVector; // Mono
var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));

for (var radius = minDistance; radius <= maxDistance; radius *= EquatorialMultiplier)
{
Expand Down Expand Up @@ -141,7 +123,7 @@ protected void DrawCircles(DrawingHandleScreen handle)
// Frontier Corvax: north line drawing
protected void DrawNorthLine(DrawingHandleScreen handle, Angle angle)
{
var origin = MidPointVector;
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.1f);
handle.DrawLine(origin, origin + aExtent, lineColor);
Expand Down Expand Up @@ -250,21 +232,6 @@ protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 gridToView, Entity
}
}

// Mono
_edgeMarkers.Clear();
_lookup.GetLocalEntitiesIntersecting(grid, grid.Comp.LocalAABB, _edgeMarkers);
foreach (var edge in _edgeMarkers)
{
if (!_xformQuery.TryComp(edge, out var xform))
continue;

var coord = xform.Coordinates.Position;
var rotation = xform.LocalRotation;
var begin = rotation.RotateVec(edge.Comp.Begin - CenterVec) + CenterVec;
var end = rotation.RotateVec(edge.Comp.End - CenterVec) + CenterVec;
_edges.Add((coord + begin * tileSize, coord + end * tileSize));
}

// Decompose the edges into longer lines to save data.
// Now we decompose the lines into longer lines (less data to send to the GPU)
var decomposed = true;
Expand Down
10 changes: 0 additions & 10 deletions Content.Client/Shuttles/UI/NavScreen.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,5 @@
</controls:BoxContainer>
<!-- End Frontier - Service Flags -->

<!-- Frontier - Maximum Shuttle Speed -->
<controls:BoxContainer Orientation="Vertical" HorizontalExpand="True" Name="MaximumShuttleSpeedBox" Margin="4 4 4 4">
<controls:Label Text="{controls:Loc 'shuttle-console-maximum-speed'}"/>
<controls:SliderIntInput Name="MaximumShuttleSpeedValue"
Access="Public"
MinValue="0"
MaxValue="140"
Value="140"
HorizontalExpand="True"/>
</controls:BoxContainer>
</controls:BoxContainer>
</controls:BoxContainer>
17 changes: 1 addition & 16 deletions Content.Client/Shuttles/UI/ShuttleDockControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
// SPDX-FileCopyrightText: 2024 ErhardSteinhauer
// SPDX-FileCopyrightText: 2024 Plykiya
// SPDX-FileCopyrightText: 2024 eoineoineoin
// SPDX-FileCopyrightText: 2024 metalgearsloth
// SPDX-FileCopyrightText: 2025 Ilya246
// SPDX-FileCopyrightText: 2025 RikuTheKiller
// SPDX-FileCopyrightText: 2025 Whatstone
//
// SPDX-License-Identifier: MPL-2.0

using System.Numerics;
using Content.Client.Shuttles.Systems;
using Content.Shared.Shuttles.BUIStates;
Expand Down Expand Up @@ -151,12 +141,7 @@ protected override void Draw(DrawingHandleScreen handle)

var curGridToWorld = _xformSystem.GetWorldMatrix(grid.Owner);
var curGridToView = curGridToWorld * worldToSelectedDock * selectedDockToView;

// Mono - hide color if needed
var hideLabel = iffComp != null && (iffComp.Flags & IFFFlags.HideLabel) != 0x0;
var hideColor = hideLabel && iffComp != null && (iffComp.Flags & IFFFlags.AlwaysShowColor) == 0x0;
// this has no detection logic but this is probably fine
var color = hideColor ? Color.White : _shuttles.GetIFFColor(grid.Owner, grid.Owner == GridEntity, component: iffComp);
var color = _shuttles.GetIFFColor(grid.Owner, grid.Owner == GridEntity, component: iffComp);

DrawGrid(handle, curGridToView, grid, color);

Expand Down
Loading
Loading