Cleaner BoundUserInterfaces (#17736)

This commit is contained in:
TemporalOroboros
2023-07-08 09:02:17 -07:00
committed by GitHub
parent 55b4fb1649
commit 3ac4cf85db
137 changed files with 1069 additions and 972 deletions

View File

@@ -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;