Cleaner BoundUserInterfaces (#17736)
This commit is contained in:
@@ -1,25 +1,22 @@
|
||||
using Content.Shared.Medical.CrewMonitoring;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.Medical.CrewMonitoring
|
||||
{
|
||||
public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private readonly IEntityManager _entManager;
|
||||
[ViewVariables]
|
||||
private CrewMonitoringWindow? _menu;
|
||||
|
||||
public CrewMonitoringBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
|
||||
public CrewMonitoringBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
|
||||
{
|
||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
EntityUid? gridUid = null;
|
||||
|
||||
if (_entManager.TryGetComponent<TransformComponent>(Owner.Owner, out var xform))
|
||||
if (EntMan.TryGetComponent<TransformComponent>(Owner, out var xform))
|
||||
{
|
||||
gridUid = xform.GridUid;
|
||||
}
|
||||
@@ -37,7 +34,7 @@ namespace Content.Client.Medical.CrewMonitoring
|
||||
switch (state)
|
||||
{
|
||||
case CrewMonitoringState st:
|
||||
_entManager.TryGetComponent<TransformComponent>(Owner.Owner, out var xform);
|
||||
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
|
||||
|
||||
_menu?.ShowSensors(st.Sensors, xform?.Coordinates, st.Snap, st.Precision);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user