-using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
+using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
-namespace Content.Server.UserInterface;
+namespace Content.Shared.UserInterface;
-[RegisterComponent]
+[RegisterComponent, NetworkedComponent]
public sealed partial class IntrinsicUIComponent : Component
{
/// <summary>
[DataDefinition]
public sealed partial class IntrinsicUIEntry
{
- [DataField("toggleAction", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>), required: true)]
- public string? ToggleAction;
+ [DataField("toggleAction", required: true)]
+ public EntProtoId? ToggleAction;
/// <summary>
/// The action used for this BUI.
-using Content.Server.Actions;
-using Content.Shared.UserInterface;
-using Robust.Server.GameObjects;
-using Robust.Shared.Player;
+using Content.Shared.Actions;
-namespace Content.Server.UserInterface;
+namespace Content.Shared.UserInterface;
public sealed class IntrinsicUISystem : EntitySystem
{
- [Dependency] private readonly ActionsSystem _actionsSystem = default!;
- [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
+ [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+ [Dependency] private readonly SharedUserInterfaceSystem _uiSystem = default!;
public override void Initialize()
{
}
}
- public bool InteractUI(EntityUid uid, Enum key, IntrinsicUIComponent? iui = null, ActorComponent? actor = null)
+ public bool InteractUI(EntityUid uid, Enum key, IntrinsicUIComponent? iui = null)
{
- if (!Resolve(uid, ref iui, ref actor))
+ if (!Resolve(uid, ref iui))
return false;
var attempt = new IntrinsicUIOpenAttemptEvent(uid, key);
if (attempt.Cancelled)
return false;
- return _uiSystem.TryToggleUi(uid, key, actor.PlayerSession);
+ return _uiSystem.TryToggleUi(uid, key, uid);
}
}