From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 22 Aug 2024 17:03:05 +0000 (+1000) Subject: Predict IntrinsicUI (#31310) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7e2de7937fb72e5d3f4e390d440111896cb88592;p=space-station-14.git Predict IntrinsicUI (#31310) --- diff --git a/Content.Server/UserInterface/IntrinsicUIComponent.cs b/Content.Shared/UserInterface/IntrinsicUIComponent.cs similarity index 59% rename from Content.Server/UserInterface/IntrinsicUIComponent.cs rename to Content.Shared/UserInterface/IntrinsicUIComponent.cs index 83936edc8c..ede0fd9c34 100644 --- a/Content.Server/UserInterface/IntrinsicUIComponent.cs +++ b/Content.Shared/UserInterface/IntrinsicUIComponent.cs @@ -1,9 +1,9 @@ -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 { /// @@ -15,8 +15,8 @@ public sealed partial class IntrinsicUIComponent : Component [DataDefinition] public sealed partial class IntrinsicUIEntry { - [DataField("toggleAction", customTypeSerializer: typeof(PrototypeIdSerializer), required: true)] - public string? ToggleAction; + [DataField("toggleAction", required: true)] + public EntProtoId? ToggleAction; /// /// The action used for this BUI. diff --git a/Content.Server/UserInterface/IntrinsicUISystem.cs b/Content.Shared/UserInterface/IntrinsicUISystem.cs similarity index 73% rename from Content.Server/UserInterface/IntrinsicUISystem.cs rename to Content.Shared/UserInterface/IntrinsicUISystem.cs index 0f7261865d..2d8c5d1480 100644 --- a/Content.Server/UserInterface/IntrinsicUISystem.cs +++ b/Content.Shared/UserInterface/IntrinsicUISystem.cs @@ -1,14 +1,11 @@ -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() { @@ -32,9 +29,9 @@ public sealed class IntrinsicUISystem : EntitySystem } } - 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); @@ -42,7 +39,7 @@ public sealed class IntrinsicUISystem : EntitySystem if (attempt.Cancelled) return false; - return _uiSystem.TryToggleUi(uid, key, actor.PlayerSession); + return _uiSystem.TryToggleUi(uid, key, uid); } }