Fix dock radar colours (#38942)
* Fix docking colours * Add comments and fallback * Better comments!
This commit is contained in:
@@ -40,6 +40,8 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
|
||||
private readonly HashSet<DockingPortState> _drawnDocks = new();
|
||||
private readonly Dictionary<DockingPortState, Button> _dockButtons = new();
|
||||
|
||||
private readonly Color _fallbackHighlightedColor = Color.Magenta;
|
||||
|
||||
/// <summary>
|
||||
/// Store buttons for every other dock
|
||||
/// </summary>
|
||||
@@ -213,11 +215,11 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
|
||||
|
||||
if (HighlightedDock == dock.Entity)
|
||||
{
|
||||
otherDockColor = Color.ToSrgb(Color.Magenta);
|
||||
otherDockColor = Color.ToSrgb(dock.HighlightedColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
otherDockColor = Color.ToSrgb(Color.Purple);
|
||||
otherDockColor = Color.ToSrgb(dock.Color);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -311,7 +313,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
|
||||
ScalePosition(Vector2.Transform(new Vector2(-0.5f, 0.5f), rotation)),
|
||||
ScalePosition(Vector2.Transform(new Vector2(0.5f, -0.5f), rotation)));
|
||||
|
||||
var dockColor = Color.Magenta;
|
||||
var dockColor = _viewedState?.HighlightedColor ?? _fallbackHighlightedColor;
|
||||
var connectionColor = Color.Pink;
|
||||
|
||||
handle.DrawRect(ourDockConnection, connectionColor.WithAlpha(0.2f));
|
||||
|
||||
@@ -308,7 +308,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
|
||||
-dockRadius * UIScale,
|
||||
(Size.X + dockRadius) * UIScale,
|
||||
(Size.Y + dockRadius) * UIScale);
|
||||
|
||||
|
||||
if (_docks.TryGetValue(nent, out var docks))
|
||||
{
|
||||
foreach (var state in docks)
|
||||
@@ -321,7 +321,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
|
||||
continue;
|
||||
}
|
||||
|
||||
var color = Color.ToSrgb(Color.Magenta);
|
||||
var color = Color.ToSrgb(state.HighlightedColor);
|
||||
|
||||
var verts = new[]
|
||||
{
|
||||
|
||||
@@ -235,6 +235,8 @@ public sealed partial class ShuttleConsoleSystem : SharedShuttleConsoleSystem
|
||||
_xformQuery.TryGetComponent(comp.DockedWith, out var otherDockXform) ?
|
||||
GetNetEntity(otherDockXform.GridUid) :
|
||||
null,
|
||||
Color = comp.RadarColor,
|
||||
HighlightedColor = comp.HighlightedRadarColor
|
||||
};
|
||||
|
||||
gridDocks.Add(state);
|
||||
|
||||
@@ -17,4 +17,14 @@ public sealed class DockingPortState
|
||||
public bool Connected => GridDockedWith != null;
|
||||
|
||||
public NetEntity? GridDockedWith;
|
||||
|
||||
/// <summary>
|
||||
/// The default colour used to shade a dock on a radar screen
|
||||
/// </summary>
|
||||
public Color Color;
|
||||
|
||||
/// <summary>
|
||||
/// The colour used to shade a dock on a radar screen if it is highlighted (hovered over/selected on docking screen/shown in the main ship radar)
|
||||
/// </summary>
|
||||
public Color HighlightedColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user