AstroNav GPS Cartridge (#32194)
* initial commit * adds astronav cartridge to QM locker * changes requested in review * fix merge conflicts * fixes the statuscontrol disappearing if you eject the cartridge but still have it installed * fix notificationsenabled on salv pda proto * fixes lingering statuscontrol on eject while held --------- Co-authored-by: archrbx <punk.gear5260@fastmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Content.Client.GPS.Components;
|
||||
using Content.Shared.GPS.Components;
|
||||
using Content.Client.Message;
|
||||
using Content.Client.Stylesheets;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -30,6 +30,13 @@ public sealed class HandheldGpsStatusControl : Control
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
// don't display the label if the gps component is being removed
|
||||
if (_parent.Comp.LifeStage > ComponentLifeStage.Running)
|
||||
{
|
||||
_label.Visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
_updateDif += args.DeltaSeconds;
|
||||
if (_updateDif < _parent.Comp.UpdateRate)
|
||||
return;
|
||||
@@ -44,9 +51,9 @@ public sealed class HandheldGpsStatusControl : Control
|
||||
var posText = "Error";
|
||||
if (_entMan.TryGetComponent(_parent, out TransformComponent? transComp))
|
||||
{
|
||||
var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp);
|
||||
var x = (int) pos.X;
|
||||
var y = (int) pos.Y;
|
||||
var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp);
|
||||
var x = (int)pos.X;
|
||||
var y = (int)pos.Y;
|
||||
posText = $"({x}, {y})";
|
||||
}
|
||||
_label.SetMarkup(Loc.GetString("handheld-gps-coordinates-title", ("coordinates", posText)));
|
||||
|
||||
Reference in New Issue
Block a user