BUI changes required for Engine PR (#10608)
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Content.Server.UserInterface
|
||||
{
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly ActionBlockerSystem _blockerSystem = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -56,11 +57,7 @@ namespace Content.Server.UserInterface
|
||||
if (!TryComp(args.Performer, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
if (!component.TryGetBoundUserInterface(args.Key, out var bui))
|
||||
return;
|
||||
|
||||
bui.Toggle(actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
args.Handled = _uiSystem.TryToggleUi(uid, args.Key, actor.PlayerSession);
|
||||
}
|
||||
|
||||
private void AddOpenUiVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEvent<ActivationVerb> args)
|
||||
|
||||
@@ -4,9 +4,10 @@ namespace Content.Server.UserInterface
|
||||
{
|
||||
public static class UserInterfaceHelpers
|
||||
{
|
||||
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, object uiKey)
|
||||
[Obsolete("Use UserInterfaceSystem")]
|
||||
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, Enum uiKey)
|
||||
{
|
||||
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerUserInterfaceComponent>(entity)?.GetBoundUserInterfaceOrNull(uiKey);
|
||||
return IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<UserInterfaceSystem>().GetUiOrNull(entity, uiKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user