Kill UserInterfaceHelpers (#20912)

This commit is contained in:
Kara
2023-10-11 02:17:59 -07:00
committed by GitHub
parent 756fd6f309
commit 14dac914ce
12 changed files with 104 additions and 98 deletions

View File

@@ -55,7 +55,5 @@ namespace Content.Server.Communications
/// </summary> /// </summary>
[DataField] [DataField]
public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/announce.ogg"); public SoundSpecifier Sound = new SoundPathSpecifier("/Audio/Announcements/announce.ogg");
public PlayerBoundUserInterface? UserInterface => Owner.GetUIOrNull(CommunicationsConsoleUiKey.Key);
} }
} }

View File

@@ -72,8 +72,8 @@ namespace Content.Server.Communications
comp.UIUpdateAccumulator -= UIUpdateInterval; comp.UIUpdateAccumulator -= UIUpdateInterval;
if (comp.UserInterface is { } ui && ui.SubscribedSessions.Count > 0) if (_uiSystem.TryGetUi(uid, CommunicationsConsoleUiKey.Key, out var ui) && ui.SubscribedSessions.Count > 0)
UpdateCommsConsoleInterface(uid, comp); UpdateCommsConsoleInterface(uid, comp, ui);
} }
base.Update(frameTime); base.Update(frameTime);
@@ -121,9 +121,11 @@ namespace Content.Server.Communications
/// <summary> /// <summary>
/// Updates the UI for a particular comms console. /// Updates the UI for a particular comms console.
/// </summary> /// </summary>
/// <param name="comp"></param> public void UpdateCommsConsoleInterface(EntityUid uid, CommunicationsConsoleComponent comp, PlayerBoundUserInterface? ui = null)
public void UpdateCommsConsoleInterface(EntityUid uid, CommunicationsConsoleComponent comp)
{ {
if (ui == null && !_uiSystem.TryGetUi(uid, CommunicationsConsoleUiKey.Key, out ui))
return;
var stationUid = _stationSystem.GetOwningStation(uid); var stationUid = _stationSystem.GetOwningStation(uid);
List<string>? levels = null; List<string>? levels = null;
string currentLevel = default!; string currentLevel = default!;
@@ -151,15 +153,14 @@ namespace Content.Server.Communications
} }
} }
if (comp.UserInterface is not null) _uiSystem.SetUiState(ui, new CommunicationsConsoleInterfaceState(
_uiSystem.SetUiState(comp.UserInterface, new CommunicationsConsoleInterfaceState( CanAnnounce(comp),
CanAnnounce(comp), CanCallOrRecall(comp),
CanCallOrRecall(comp), levels,
levels, currentLevel,
currentLevel, currentDelay,
currentDelay, _roundEndSystem.ExpectedCountdownEnd
_roundEndSystem.ExpectedCountdownEnd ));
));
} }
private static bool CanAnnounce(CommunicationsConsoleComponent comp) private static bool CanAnnounce(CommunicationsConsoleComponent comp)
@@ -203,7 +204,9 @@ namespace Content.Server.Communications
private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleSelectAlertLevelMessage message) private void OnSelectAlertLevelMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleSelectAlertLevelMessage message)
{ {
if (message.Session.AttachedEntity is not { Valid: true } mob) return; if (message.Session.AttachedEntity is not { Valid: true } mob)
return;
if (!CanUse(mob, uid)) if (!CanUse(mob, uid))
{ {
_popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Session, PopupType.Medium); _popupSystem.PopupCursor(Loc.GetString("comms-console-permission-denied"), message.Session, PopupType.Medium);
@@ -284,8 +287,12 @@ namespace Content.Server.Communications
private void OnCallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleCallEmergencyShuttleMessage message) private void OnCallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleCallEmergencyShuttleMessage message)
{ {
if (!CanCallOrRecall(comp)) return; if (!CanCallOrRecall(comp))
if (message.Session.AttachedEntity is not { Valid: true } mob) return; return;
if (message.Session.AttachedEntity is not { Valid: true } mob)
return;
if (!CanUse(mob, uid)) if (!CanUse(mob, uid))
{ {
_popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session);
@@ -306,8 +313,12 @@ namespace Content.Server.Communications
private void OnRecallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleRecallEmergencyShuttleMessage message) private void OnRecallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleRecallEmergencyShuttleMessage message)
{ {
if (!CanCallOrRecall(comp)) return; if (!CanCallOrRecall(comp))
if (message.Session.AttachedEntity is not { Valid: true } mob) return; return;
if (message.Session.AttachedEntity is not { Valid: true } mob)
return;
if (!CanUse(mob, uid)) if (!CanUse(mob, uid))
{ {
_popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session); _popupSystem.PopupEntity(Loc.GetString("comms-console-permission-denied"), uid, message.Session);

View File

@@ -24,7 +24,5 @@ namespace Content.Server.Crayon
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("deleteEmpty")] [DataField("deleteEmpty")]
public bool DeleteEmpty = true; public bool DeleteEmpty = true;
[ViewVariables] public PlayerBoundUserInterface? UserInterface => Owner.GetUIOrNull(CrayonUiKey.Key);
} }
} }

View File

@@ -74,7 +74,8 @@ public sealed class CrayonSystem : SharedCrayonSystem
// Decrease "Ammo" // Decrease "Ammo"
component.Charges--; component.Charges--;
Dirty(component); Dirty(uid, component);
_adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}"); _adminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} drew a {component.Color:color} {component.SelectedState}");
args.Handled = true; args.Handled = true;
@@ -89,17 +90,16 @@ public sealed class CrayonSystem : SharedCrayonSystem
return; return;
if (!TryComp<ActorComponent>(args.User, out var actor) || if (!TryComp<ActorComponent>(args.User, out var actor) ||
component.UserInterface == null) !_uiSystem.TryGetUi(uid, SharedCrayonComponent.CrayonUiKey.Key, out var ui))
{ {
return; return;
} }
_uiSystem.ToggleUi(component.UserInterface, actor.PlayerSession); _uiSystem.ToggleUi(ui, actor.PlayerSession);
if (ui.SubscribedSessions.Contains(actor.PlayerSession))
if (component.UserInterface?.SubscribedSessions.Contains(actor.PlayerSession) == true)
{ {
// Tell the user interface the selected stuff // Tell the user interface the selected stuff
_uiSystem.SetUiState(component.UserInterface, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color)); _uiSystem.SetUiState(ui, new CrayonBoundUserInterfaceState(component.SelectedState, component.SelectableColor, component.Color));
} }
args.Handled = true; args.Handled = true;
@@ -108,22 +108,22 @@ public sealed class CrayonSystem : SharedCrayonSystem
private void OnCrayonBoundUI(EntityUid uid, CrayonComponent component, CrayonSelectMessage args) private void OnCrayonBoundUI(EntityUid uid, CrayonComponent component, CrayonSelectMessage args)
{ {
// Check if the selected state is valid // Check if the selected state is valid
if (!_prototypeManager.TryIndex<DecalPrototype>(args.State, out var prototype) || !prototype.Tags.Contains("crayon")) return; if (!_prototypeManager.TryIndex<DecalPrototype>(args.State, out var prototype) || !prototype.Tags.Contains("crayon"))
return;
component.SelectedState = args.State; component.SelectedState = args.State;
Dirty(component); Dirty(uid, component);
} }
private void OnCrayonBoundUIColor(EntityUid uid, CrayonComponent component, CrayonColorMessage args) private void OnCrayonBoundUIColor(EntityUid uid, CrayonComponent component, CrayonColorMessage args)
{ {
// you still need to ensure that the given color is a valid color // you still need to ensure that the given color is a valid color
if (component.SelectableColor && args.Color != component.Color) if (!component.SelectableColor || args.Color == component.Color)
{ return;
component.Color = args.Color;
Dirty(component); component.Color = args.Color;
} Dirty(uid, component);
} }
@@ -134,7 +134,7 @@ public sealed class CrayonSystem : SharedCrayonSystem
// Get the first one from the catalog and set it as default // Get the first one from the catalog and set it as default
var decal = _prototypeManager.EnumeratePrototypes<DecalPrototype>().FirstOrDefault(x => x.Tags.Contains("crayon")); var decal = _prototypeManager.EnumeratePrototypes<DecalPrototype>().FirstOrDefault(x => x.Tags.Contains("crayon"));
component.SelectedState = decal?.ID ?? string.Empty; component.SelectedState = decal?.ID ?? string.Empty;
Dirty(component); Dirty(uid, component);
} }
private void OnCrayonDropped(EntityUid uid, CrayonComponent component, DroppedEvent args) private void OnCrayonDropped(EntityUid uid, CrayonComponent component, DroppedEvent args)

View File

@@ -20,8 +20,6 @@ public sealed partial class InstrumentComponent : SharedInstrumentComponent
public IPlayerSession? InstrumentPlayer => public IPlayerSession? InstrumentPlayer =>
_entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser _entMan.GetComponentOrNull<ActivatableUIComponent>(Owner)?.CurrentSingleUser
?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession; ?? _entMan.GetComponentOrNull<ActorComponent>(Owner)?.PlayerSession;
[ViewVariables] public PlayerBoundUserInterface? UserInterface => Owner.GetUIOrNull(InstrumentUiKey.Key);
} }
[RegisterComponent] [RegisterComponent]

View File

@@ -5,7 +5,6 @@ using Content.Server.Stunnable;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.Instruments; using Content.Shared.Instruments;
using Content.Shared.Instruments.UI; using Content.Shared.Instruments.UI;
using Content.Shared.Interaction;
using Content.Shared.Physics; using Content.Shared.Physics;
using Content.Shared.Popups; using Content.Shared.Popups;
using JetBrains.Annotations; using JetBrains.Annotations;
@@ -17,7 +16,6 @@ using Robust.Shared.Configuration;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Server.Instruments; namespace Content.Server.Instruments;
@@ -435,9 +433,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
// Just in case // Just in case
Clean(uid); Clean(uid);
_bui.TryCloseAll(uid, InstrumentUiKey.Key);
if (instrument.UserInterface is not null)
_bui.CloseAll(instrument.UserInterface);
} }
instrument.Timer += frameTime; instrument.Timer += frameTime;

View File

@@ -17,8 +17,6 @@ namespace Content.Server.Medical.Components
[DataField("scanDelay")] [DataField("scanDelay")]
public float ScanDelay = 0.8f; public float ScanDelay = 0.8f;
public PlayerBoundUserInterface? UserInterface => Owner.GetUIOrNull(HealthAnalyzerUiKey.Key);
/// <summary> /// <summary>
/// Sound played on scanning begin /// Sound played on scanning begin
/// </summary> /// </summary>

View File

@@ -51,12 +51,12 @@ namespace Content.Server.Medical
args.Handled = true; args.Handled = true;
} }
private void OpenUserInterface(EntityUid user, HealthAnalyzerComponent healthAnalyzer) private void OpenUserInterface(EntityUid user, EntityUid analyzer)
{ {
if (!TryComp<ActorComponent>(user, out var actor) || healthAnalyzer.UserInterface == null) if (!TryComp<ActorComponent>(user, out var actor) || !_uiSystem.TryGetUi(analyzer, HealthAnalyzerUiKey.Key, out var ui))
return; return;
_uiSystem.OpenUi(healthAnalyzer.UserInterface ,actor.PlayerSession); _uiSystem.OpenUi(ui ,actor.PlayerSession);
} }
public void UpdateScannedUser(EntityUid uid, EntityUid user, EntityUid? target, HealthAnalyzerComponent? healthAnalyzer) public void UpdateScannedUser(EntityUid uid, EntityUid user, EntityUid? target, HealthAnalyzerComponent? healthAnalyzer)
@@ -64,7 +64,7 @@ namespace Content.Server.Medical
if (!Resolve(uid, ref healthAnalyzer)) if (!Resolve(uid, ref healthAnalyzer))
return; return;
if (target == null || healthAnalyzer.UserInterface == null) if (target == null || !_uiSystem.TryGetUi(uid, HealthAnalyzerUiKey.Key, out var ui))
return; return;
if (!HasComp<DamageableComponent>(target)) if (!HasComp<DamageableComponent>(target))
@@ -73,9 +73,9 @@ namespace Content.Server.Medical
TryComp<TemperatureComponent>(target, out var temp); TryComp<TemperatureComponent>(target, out var temp);
TryComp<BloodstreamComponent>(target, out var bloodstream); TryComp<BloodstreamComponent>(target, out var bloodstream);
OpenUserInterface(user, healthAnalyzer); OpenUserInterface(user, uid);
_uiSystem.SendUiMessage(healthAnalyzer.UserInterface, new HealthAnalyzerScannedUserMessage(GetNetEntity(target), temp != null ? temp.CurrentTemperature : float.NaN, _uiSystem.SendUiMessage(ui, new HealthAnalyzerScannedUserMessage(GetNetEntity(target), temp != null ? temp.CurrentTemperature : float.NaN,
bloodstream != null ? bloodstream.BloodSolution.FillFraction : float.NaN)); bloodstream != null ? bloodstream.BloodSolution.FillFraction : float.NaN));
} }
} }

View File

@@ -11,8 +11,6 @@ namespace Content.Server.UserInterface
[ViewVariables] [ViewVariables]
public Enum? Key { get; set; } public Enum? Key { get; set; }
[ViewVariables] public PlayerBoundUserInterface? UserInterface => (Key != null) ? Owner.GetUIOrNull(Key) : null;
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField] [DataField]
public bool InHandsOnly { get; set; } = false; public bool InHandsOnly { get; set; } = false;

View File

@@ -76,7 +76,7 @@ public sealed partial class ActivatableUISystem : EntitySystem
return; return;
ActivationVerb verb = new(); ActivationVerb verb = new();
verb.Act = () => InteractUI(args.User, component); verb.Act = () => InteractUI(args.User, uid, component);
verb.Text = Loc.GetString(component.VerbText); verb.Text = Loc.GetString(component.VerbText);
// TODO VERBS add "open UI" icon? // TODO VERBS add "open UI" icon?
args.Verbs.Add(verb); args.Verbs.Add(verb);
@@ -84,16 +84,24 @@ public sealed partial class ActivatableUISystem : EntitySystem
private void OnActivate(EntityUid uid, ActivatableUIComponent component, ActivateInWorldEvent args) private void OnActivate(EntityUid uid, ActivatableUIComponent component, ActivateInWorldEvent args)
{ {
if (args.Handled) return; if (args.Handled)
if (component.InHandsOnly) return; return;
args.Handled = InteractUI(args.User, component);
if (component.InHandsOnly)
return;
args.Handled = InteractUI(args.User, uid, component);
} }
private void OnUseInHand(EntityUid uid, ActivatableUIComponent component, UseInHandEvent args) private void OnUseInHand(EntityUid uid, ActivatableUIComponent component, UseInHandEvent args)
{ {
if (args.Handled) return; if (args.Handled)
if (component.rightClickOnly) return; return;
args.Handled = InteractUI(args.User, component);
if (component.rightClickOnly)
return;
args.Handled = InteractUI(args.User, uid, component);
} }
private void OnParentChanged(EntityUid uid, ActivatableUIComponent aui, ref EntParentChangedMessage args) private void OnParentChanged(EntityUid uid, ActivatableUIComponent aui, ref EntParentChangedMessage args)
@@ -103,53 +111,64 @@ public sealed partial class ActivatableUISystem : EntitySystem
private void OnUIClose(EntityUid uid, ActivatableUIComponent component, BoundUIClosedEvent args) private void OnUIClose(EntityUid uid, ActivatableUIComponent component, BoundUIClosedEvent args)
{ {
if (args.Session != component.CurrentSingleUser) return; if (args.Session != component.CurrentSingleUser)
if (args.UiKey != component.Key) return; return;
if (!Equals(args.UiKey, component.Key))
return;
SetCurrentSingleUser(uid, null, component); SetCurrentSingleUser(uid, null, component);
} }
private bool InteractUI(EntityUid user, ActivatableUIComponent aui) private bool InteractUI(EntityUid user, EntityUid uiEntity, ActivatableUIComponent aui)
{ {
if (!_blockerSystem.CanInteract(user, aui.Owner) && (!aui.AllowSpectator || !HasComp<GhostComponent>(user))) if (!_blockerSystem.CanInteract(user, uiEntity) && (!aui.AllowSpectator || !HasComp<GhostComponent>(user)))
return false; return false;
if (aui.RequireHands && !HasComp<HandsComponent>(user)) if (aui.RequireHands && !HasComp<HandsComponent>(user))
return false; return false;
if (!EntityManager.TryGetComponent(user, out ActorComponent? actor)) return false; if (!EntityManager.TryGetComponent(user, out ActorComponent? actor))
return false;
if (aui.AdminOnly && !_adminManager.IsAdmin(actor.PlayerSession)) return false; if (aui.AdminOnly && !_adminManager.IsAdmin(actor.PlayerSession))
return false;
var ui = aui.UserInterface; if (aui.Key == null)
if (ui == null) return false; return false;
if (!_uiSystem.TryGetUi(uiEntity, aui.Key, out var ui))
return false;
if (aui.SingleUser && (aui.CurrentSingleUser != null) && (actor.PlayerSession != aui.CurrentSingleUser)) if (aui.SingleUser && (aui.CurrentSingleUser != null) && (actor.PlayerSession != aui.CurrentSingleUser))
{ {
// If we get here, supposedly, the object is in use. // If we get here, supposedly, the object is in use.
// Check with BUI that it's ACTUALLY in use just in case. // Check with BUI that it's ACTUALLY in use just in case.
// Since this could brick the object if it goes wrong. // Since this could brick the object if it goes wrong.
if (ui.SubscribedSessions.Count != 0) return false; if (ui.SubscribedSessions.Count != 0)
return false;
} }
// If we've gotten this far, fire a cancellable event that indicates someone is about to activate this. // If we've gotten this far, fire a cancellable event that indicates someone is about to activate this.
// This is so that stuff can require further conditions (like power). // This is so that stuff can require further conditions (like power).
var oae = new ActivatableUIOpenAttemptEvent(user); var oae = new ActivatableUIOpenAttemptEvent(user);
var uae = new UserOpenActivatableUIAttemptEvent(user, aui.Owner); var uae = new UserOpenActivatableUIAttemptEvent(user, uiEntity);
RaiseLocalEvent(user, uae, false); RaiseLocalEvent(user, uae);
RaiseLocalEvent((aui).Owner, oae, false); RaiseLocalEvent(uiEntity, oae);
if (oae.Cancelled || uae.Cancelled) return false; if (oae.Cancelled || uae.Cancelled)
return false;
// Give the UI an opportunity to prepare itself if it needs to do anything // Give the UI an opportunity to prepare itself if it needs to do anything
// before opening // before opening
var bae = new BeforeActivatableUIOpenEvent(user); var bae = new BeforeActivatableUIOpenEvent(user);
RaiseLocalEvent((aui).Owner, bae, false); RaiseLocalEvent(uiEntity, bae);
SetCurrentSingleUser((aui).Owner, actor.PlayerSession, aui); SetCurrentSingleUser(uiEntity, actor.PlayerSession, aui);
_uiSystem.ToggleUi(ui, actor.PlayerSession); _uiSystem.ToggleUi(ui, actor.PlayerSession);
//Let the component know a user opened it so it can do whatever it needs to do //Let the component know a user opened it so it can do whatever it needs to do
var aae = new AfterActivatableUIOpenEvent(user, actor.PlayerSession); var aae = new AfterActivatableUIOpenEvent(user, actor.PlayerSession);
RaiseLocalEvent((aui).Owner, aae, false); RaiseLocalEvent(uiEntity, aae);
return true; return true;
} }
@@ -163,24 +182,28 @@ public sealed partial class ActivatableUISystem : EntitySystem
aui.CurrentSingleUser = v; aui.CurrentSingleUser = v;
RaiseLocalEvent(uid, new ActivatableUIPlayerChangedEvent(), false); RaiseLocalEvent(uid, new ActivatableUIPlayerChangedEvent());
} }
public void CloseAll(EntityUid uid, ActivatableUIComponent? aui = null) public void CloseAll(EntityUid uid, ActivatableUIComponent? aui = null)
{ {
if (!Resolve(uid, ref aui, false)) if (!Resolve(uid, ref aui, false))
return; return;
if (aui.UserInterface is null)
if (aui.Key == null || !_uiSystem.TryGetUi(uid, aui.Key, out var ui))
return; return;
_uiSystem.CloseAll(aui.UserInterface); _uiSystem.CloseAll(ui);
} }
private void OnHandDeselected(EntityUid uid, ActivatableUIComponent? aui, HandDeselectedEvent args) private void OnHandDeselected(EntityUid uid, ActivatableUIComponent? aui, HandDeselectedEvent args)
{ {
if (!Resolve(uid, ref aui, false)) return; if (!Resolve(uid, ref aui, false))
return;
if (!aui.CloseOnHandDeselect) if (!aui.CloseOnHandDeselect)
return; return;
CloseAll(uid, aui); CloseAll(uid, aui);
} }
} }

View File

@@ -1,5 +1,4 @@
using Content.Server.Actions; using Content.Server.Actions;
using Content.Shared.Actions;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
@@ -36,19 +35,19 @@ public sealed class IntrinsicUISystem : EntitySystem
if (key is null) if (key is null)
{ {
Logger.ErrorS("bui", $"Entity {ToPrettyString(uid)} has an invalid intrinsic UI."); Log.Error($"Entity {ToPrettyString(uid)} has an invalid intrinsic UI.");
} }
var ui = GetUIOrNull(uid, key, iui); var ui = GetUIOrNull(uid, key, iui);
if (ui is null) if (ui is null)
{ {
Logger.ErrorS("bui", $"Couldn't get UI {key} on {ToPrettyString(uid)}"); Log.Error($"Couldn't get UI {key} on {ToPrettyString(uid)}");
return false; return false;
} }
var attempt = new IntrinsicUIOpenAttemptEvent(uid, key); var attempt = new IntrinsicUIOpenAttemptEvent(uid, key);
RaiseLocalEvent(uid, attempt, false); RaiseLocalEvent(uid, attempt);
if (attempt.Cancelled) if (attempt.Cancelled)
return false; return false;
@@ -61,7 +60,7 @@ public sealed class IntrinsicUISystem : EntitySystem
if (!Resolve(uid, ref component)) if (!Resolve(uid, ref component))
return null; return null;
return key is null ? null : uid.GetUIOrNull(key); return key is null ? null : _uiSystem.GetUiOrNull(uid, key);
} }
} }

View File

@@ -1,13 +0,0 @@
using Robust.Server.GameObjects;
namespace Content.Server.UserInterface
{
public static class UserInterfaceHelpers
{
[Obsolete("Use UserInterfaceSystem")]
public static PlayerBoundUserInterface? GetUIOrNull(this EntityUid entity, Enum uiKey)
{
return IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<UserInterfaceSystem>().GetUiOrNull(entity, uiKey);
}
}
}