diff --git a/Content.Client/Nutrition/Components/HungerComponent.cs b/Content.Client/Nutrition/Components/HungerComponent.cs index 4dea387b446d..db1b3383e374 100644 --- a/Content.Client/Nutrition/Components/HungerComponent.cs +++ b/Content.Client/Nutrition/Components/HungerComponent.cs @@ -22,8 +22,6 @@ public override void HandleComponentState(ComponentState? curState, ComponentSta } _currentHungerThreshold = hunger.CurrentThreshold; - - EntitySystem.Get().RefreshMovementSpeedModifiers(Owner); } } } diff --git a/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs b/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs index b1cde98993ef..63f71f8dc2ff 100644 --- a/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs +++ b/Content.Client/Shuttles/BUI/ShuttleConsoleBoundUserInterface.cs @@ -22,10 +22,19 @@ protected override void Open() _window.UndockPressed += OnUndockPressed; _window.StartAutodockPressed += OnAutodockPressed; _window.StopAutodockPressed += OnStopAutodockPressed; + _window.DestinationPressed += OnDestinationPressed; _window.OpenCentered(); _window.OnClose += OnClose; } + private void OnDestinationPressed(EntityUid obj) + { + SendMessage(new ShuttleConsoleDestinationMessage() + { + Destination = obj, + }); + } + private void OnClose() { Close(); diff --git a/Content.Client/Shuttles/UI/RadarControl.cs b/Content.Client/Shuttles/UI/RadarControl.cs index d93c051d230b..580510ec56c3 100644 --- a/Content.Client/Shuttles/UI/RadarControl.cs +++ b/Content.Client/Shuttles/UI/RadarControl.cs @@ -35,6 +35,11 @@ public sealed class RadarControl : Control private float _radarMaxRange = 256f; public float RadarRange { get; private set; } = 256f; + /// + /// Controls the maximum distance that IFF labels will display. + /// + public float MaxRadarRange { get; private set; } = 256f * 10f; + private int MidPoint => SizeFull / 2; private int SizeFull => (int) ((MinimapRadius + MinimapMargin) * 2 * UIScale); private int ScaledMinimapRadius => (int) (MinimapRadius * UIScale); @@ -182,7 +187,7 @@ protected override void Draw(DrawingHandleScreen handle) // Draw other grids... differently foreach (var grid in _mapManager.FindGridsIntersecting(mapPosition.MapId, - new Box2(mapPosition.Position - RadarRange, mapPosition.Position + RadarRange))) + new Box2(mapPosition.Position - MaxRadarRange, mapPosition.Position + MaxRadarRange))) { if (grid.GridEntityId == ourGridId) continue; @@ -206,19 +211,25 @@ protected override void Draw(DrawingHandleScreen handle) if (ShowIFF) { + Label label; + if (!_iffControls.TryGetValue(grid.GridEntityId, out var control)) { - var label = new Label() + label = new Label() { HorizontalAlignment = HAlignment.Left, + FontColorOverride = Color.Aquamarine, }; control = new PanelContainer() { - HorizontalAlignment = HAlignment.Left, - VerticalAlignment = VAlignment.Top, - Children = { label }, - StyleClasses = { StyleNano.StyleClassTooltipPanel }, + HorizontalAlignment = HAlignment.Center, + VerticalAlignment = VAlignment.Center, + Children = + { + label + }, + StyleClasses = { StyleNano.StyleClassBorderedWindowPanel }, }; _iffControls[grid.GridEntityId] = control; @@ -227,20 +238,17 @@ protected override void Draw(DrawingHandleScreen handle) var gridCentre = matty.Transform(gridBody.LocalCenter); gridCentre.Y = -gridCentre.Y; + var distance = gridCentre.Length; - // TODO: When we get IFF or whatever we can show controls at a further distance; for now - // we don't do that because it would immediately reveal nukies. - if (gridCentre.Length < RadarRange) - { - control.Visible = true; - var label = (Label) control.GetChild(0); - label.Text = Loc.GetString("shuttle-console-iff-label", ("name", name), ("distance", $"{gridCentre.Length:0.0}")); - LayoutContainer.SetPosition(control, ScalePosition(gridCentre) / UIScale); - } - else + if (gridCentre.Length > RadarRange) { - control.Visible = false; + gridCentre = gridCentre.Normalized * RadarRange; } + + control.Visible = true; + label = (Label) control.GetChild(0); + label.Text = Loc.GetString("shuttle-console-iff-label", ("name", name), ("distance", $"{distance:0.0}")); + LayoutContainer.SetPosition(control, ScalePosition(gridCentre) / UIScale); } else { diff --git a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml index 868bed16dc24..548c136d0aa2 100644 --- a/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml +++ b/Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml @@ -4,7 +4,8 @@ xmlns:ui1="clr-namespace:Content.Client.HUD.UI" Title="{Loc 'shuttle-console-window-title'}"> + HorizontalAlignment="Stretch" + Margin="5 5 5 5"> + + + + + + @@ -40,6 +49,14 @@ +