mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-15 03:31:38 +01:00
@@ -17,7 +17,6 @@ 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()
|
||||
{
|
||||
@@ -57,7 +56,11 @@ namespace Content.Server.UserInterface
|
||||
if (!TryComp(args.Performer, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
args.Handled = _uiSystem.TryToggleUi(uid, args.Key, actor.PlayerSession);
|
||||
if (!component.TryGetBoundUserInterface(args.Key, out var bui))
|
||||
return;
|
||||
|
||||
bui.Toggle(actor.PlayerSession);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void AddOpenUiVerb(EntityUid uid, ActivatableUIComponent component, GetVerbsEvent<ActivationVerb> args)
|
||||
|
||||
@@ -4,10 +4,9 @@ namespace Content.Server.UserInterface
|
||||
{
|
||||
public static class UserInterfaceHelpers
|
||||
{
|
||||
[Obsolete("Use UserInterfaceSystem")]
|
||||
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, Enum uiKey)
|
||||
public static BoundUserInterface? GetUIOrNull(this EntityUid entity, object uiKey)
|
||||
{
|
||||
return IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<UserInterfaceSystem>().GetUiOrNull(entity, uiKey);
|
||||
return IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ServerUserInterfaceComponent>(entity)?.GetBoundUserInterfaceOrNull(uiKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user