diff --git a/Content.Server/AME/Components/AMEControllerComponent.cs b/Content.Server/AME/Components/AMEControllerComponent.cs index ce298fd862..3674b2468c 100644 --- a/Content.Server/AME/Components/AMEControllerComponent.cs +++ b/Content.Server/AME/Components/AMEControllerComponent.cs @@ -14,19 +14,13 @@ using Content.Shared.Sound; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.Containers; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; namespace Content.Server.AME.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(IInteractUsing))] - public sealed class AMEControllerComponent : SharedAMEControllerComponent, IActivate, IInteractUsing + public sealed class AMEControllerComponent : SharedAMEControllerComponent, IInteractUsing { [Dependency] private readonly IEntityManager _entities = default!; @@ -115,30 +109,6 @@ namespace Content.Server.AME.Components } - /// - /// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible. - /// - /// Data relevant to the event such as the actor which triggered it. - void IActivate.Activate(ActivateEventArgs args) - { - if (!_entities.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - if (!_entities.TryGetComponent(args.User, out HandsComponent? hands)) - { - Owner.PopupMessage(args.User, Loc.GetString("ame-controller-component-interact-no-hands-text")); - return; - } - - var activeHandEntity = hands.GetActiveHandItem?.Owner; - if (activeHandEntity == null) - { - UserInterface?.Open(actor.PlayerSession); - } - } - private void OnPowerChanged(PowerChangedMessage e) { UpdateUserInterface(); diff --git a/Content.Server/Arcade/BlockGameSystem.cs b/Content.Server/Arcade/ArcadeSystem.cs similarity index 73% rename from Content.Server/Arcade/BlockGameSystem.cs rename to Content.Server/Arcade/ArcadeSystem.cs index 08bd5c73b1..5cdfaf2027 100644 --- a/Content.Server/Arcade/BlockGameSystem.cs +++ b/Content.Server/Arcade/ArcadeSystem.cs @@ -1,18 +1,40 @@ -using System.Collections.Generic; -using System.Linq; +using System.Linq; using Content.Server.Arcade.Components; +using Content.Server.UserInterface; using Content.Shared.Arcade; -using Robust.Shared.GameObjects; using Robust.Shared.Utility; +using Robust.Server.GameObjects; + namespace Content.Server.Arcade { // ReSharper disable once ClassNeverInstantiated.Global - public sealed class BlockGameSystem : EntitySystem + public sealed class ArcadeSystem : EntitySystem { private readonly List _roundHighscores = new(); private readonly List _globalHighscores = new(); + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnAfterUIOpen); + SubscribeLocalEvent(OnAfterUIOpenSV); + } + + private void OnAfterUIOpen(EntityUid uid, BlockGameArcadeComponent component, AfterActivatableUIOpenEvent args) + { + var actor = Comp(args.User); + if (component.UserInterface?.SessionHasOpen(actor.PlayerSession) == true) + { + component.RegisterPlayerSession(actor.PlayerSession); + } + } + + private void OnAfterUIOpenSV(EntityUid uid, SpaceVillainArcadeComponent component, AfterActivatableUIOpenEvent args) + { + component.Game ??= new SpaceVillainArcadeComponent.SpaceVillainGame(component); + } + public HighScorePlacement RegisterHighScore(string name, int score) { var entry = new BlockGameMessages.HighScoreEntry(name, score); diff --git a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs index 0eb925dd58..e4bca71008 100644 --- a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs +++ b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs @@ -1,29 +1,22 @@ -using System; -using System.Collections.Generic; using System.Linq; using Content.Server.Power.Components; using Content.Server.UserInterface; -using Content.Shared.ActionBlocker; using Content.Shared.Arcade; using Content.Shared.Interaction; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Maths; using Robust.Shared.Random; namespace Content.Server.Arcade.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class BlockGameArcadeComponent : Component, IActivate + public sealed class BlockGameArcadeComponent : Component { [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IEntityManager _entityManager = default!; - private bool Powered => _entityManager.TryGetComponent(Owner, out var powerReceiverComponent) && powerReceiverComponent.Powered; - private BoundUserInterface? UserInterface => Owner.GetUIOrNull(BlockGameUiKey.Key); + public bool Powered => _entityManager.TryGetComponent(Owner, out var powerReceiverComponent) && powerReceiverComponent.Powered; + public BoundUserInterface? UserInterface => Owner.GetUIOrNull(BlockGameUiKey.Key); private BlockGame? _game; @@ -44,19 +37,7 @@ namespace Content.Server.Arcade.Components } } - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if(!Powered || !IoCManager.Resolve().TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - - UserInterface?.Toggle(actor.PlayerSession); - if (UserInterface?.SessionHasOpen(actor.PlayerSession) == true) - { - RegisterPlayerSession(actor.PlayerSession); - } - } - - private void RegisterPlayerSession(IPlayerSession session) + public void RegisterPlayerSession(IPlayerSession session) { if (_player == null) _player = session; else _spectators.Add(session); @@ -233,7 +214,7 @@ namespace Content.Server.Arcade.Components } private int _internalPoints; - private BlockGameSystem.HighScorePlacement? _highScorePlacement = null; + private ArcadeSystem.HighScorePlacement? _highScorePlacement = null; private void SendPointsUpdate() { @@ -292,13 +273,13 @@ namespace Content.Server.Arcade.Components private void SendHighscoreUpdate() { - var entitySystem = EntitySystem.Get(); + var entitySystem = EntitySystem.Get(); _component.UserInterface?.SendMessage(new BlockGameMessages.BlockGameHighScoreUpdateMessage(entitySystem.GetLocalHighscores(), entitySystem.GetGlobalHighscores())); } private void SendHighscoreUpdate(IPlayerSession session) { - var entitySystem = EntitySystem.Get(); + var entitySystem = EntitySystem.Get(); _component.UserInterface?.SendMessage(new BlockGameMessages.BlockGameHighScoreUpdateMessage(entitySystem.GetLocalHighscores(), entitySystem.GetGlobalHighscores()), session); } @@ -656,7 +637,7 @@ namespace Content.Server.Arcade.Components if (_component._player?.AttachedEntity is {Valid: true} playerEntity) { - var blockGameSystem = EntitySystem.Get(); + var blockGameSystem = EntitySystem.Get(); _highScorePlacement = blockGameSystem.RegisterHighScore(IoCManager.Resolve().GetComponent(playerEntity).EntityName, Points); SendHighscoreUpdate(); diff --git a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs index 9262764434..a1ab366b80 100644 --- a/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs +++ b/Content.Server/Arcade/Components/SpaceVillainArcadeComponent.cs @@ -1,32 +1,22 @@ -using System; -using System.Collections.Generic; using Content.Server.Power.Components; using Content.Server.UserInterface; using Content.Server.VendingMachines; using Content.Server.WireHacking; -using Content.Shared.ActionBlocker; using Content.Shared.Arcade; using Content.Shared.Interaction; using Content.Shared.Sound; using Content.Shared.Wires; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Maths; using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List; -using Robust.Shared.ViewVariables; namespace Content.Server.Arcade.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class SpaceVillainArcadeComponent : SharedSpaceVillainArcadeComponent, IActivate, IWires + public sealed class SpaceVillainArcadeComponent : SharedSpaceVillainArcadeComponent, IWires { [Dependency] private readonly IRobustRandom _random = null!; @@ -37,7 +27,7 @@ namespace Content.Server.Arcade.Components [ViewVariables] private bool _overflowFlag; [ViewVariables] private bool _playerInvincibilityFlag; [ViewVariables] private bool _enemyInvincibilityFlag; - [ViewVariables] private SpaceVillainGame _game = null!; + [ViewVariables] public SpaceVillainGame Game = null!; [DataField("newGameSound")] private SoundSpecifier _newGameSound = new SoundPathSpecifier("/Audio/Effects/Arcade/newgame.ogg"); [DataField("playerAttackSound")] private SoundSpecifier _playerAttackSound = new SoundPathSpecifier("/Audio/Effects/Arcade/player_attack.ogg"); @@ -72,22 +62,6 @@ namespace Content.Server.Arcade.Components "ToyPhazon", "ToyFireRipley", "ToyReticence", "ToyRipley", "ToySeraph", "ToyDurand", "ToySkeleton" }; - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!Powered || !IoCManager.Resolve().TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - - _game ??= new SpaceVillainGame(this); - - if (_entityManager.TryGetComponent(Owner, out var wiresComponent) && wiresComponent.IsPanelOpen) - { - wiresComponent.OpenInterface(actor.PlayerSession); - } - else - { - UserInterface?.Toggle(actor.PlayerSession); - } - } protected override void Initialize() { @@ -131,22 +105,22 @@ namespace Content.Server.Arcade.Components switch (msg.PlayerAction) { case PlayerAction.Attack: - _game?.ExecutePlayerAction(msg.PlayerAction); + Game?.ExecutePlayerAction(msg.PlayerAction); break; case PlayerAction.Heal: - _game?.ExecutePlayerAction(msg.PlayerAction); + Game?.ExecutePlayerAction(msg.PlayerAction); break; case PlayerAction.Recharge: - _game?.ExecutePlayerAction(msg.PlayerAction); + Game?.ExecutePlayerAction(msg.PlayerAction); break; case PlayerAction.NewGame: SoundSystem.Play(Filter.Pvs(Owner), _newGameSound.GetSound(), Owner, AudioParams.Default.WithVolume(-4f)); - _game = new SpaceVillainGame(this); - UserInterface?.SendMessage(_game.GenerateMetaDataMessage()); + Game = new SpaceVillainGame(this); + UserInterface?.SendMessage(Game.GenerateMetaDataMessage()); break; case PlayerAction.RequestData: - UserInterface?.SendMessage(_game.GenerateMetaDataMessage()); + UserInterface?.SendMessage(Game.GenerateMetaDataMessage()); break; } } diff --git a/Content.Server/Atmos/Components/GasAnalyzerComponent.cs b/Content.Server/Atmos/Components/GasAnalyzerComponent.cs index 16c5e6f87d..b4389ad8b4 100644 --- a/Content.Server/Atmos/Components/GasAnalyzerComponent.cs +++ b/Content.Server/Atmos/Components/GasAnalyzerComponent.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Threading.Tasks; using Content.Server.Atmos.EntitySystems; using Content.Server.Hands.Components; @@ -9,18 +8,13 @@ using Content.Shared.Interaction; using Content.Shared.Popups; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Map; -using Robust.Shared.ViewVariables; namespace Content.Server.Atmos.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(SharedGasAnalyzerComponent))] - public sealed class GasAnalyzerComponent : SharedGasAnalyzerComponent, IAfterInteract, IDropped, IActivate + public sealed class GasAnalyzerComponent : SharedGasAnalyzerComponent, IAfterInteract, IDropped { [Dependency] private readonly IEntityManager _entities = default!; @@ -263,8 +257,6 @@ namespace Content.Server.Atmos.Components return true; } - - void IDropped.Dropped(DroppedEventArgs eventArgs) { if (_entities.TryGetComponent(eventArgs.User, out ActorComponent? actor)) @@ -272,15 +264,5 @@ namespace Content.Server.Atmos.Components CloseInterface(actor.PlayerSession); } } - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (_entities.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - { - ToggleInterface(actor.PlayerSession); - return; - } - return; - } } } diff --git a/Content.Server/Atmos/Components/GasTankComponent.cs b/Content.Server/Atmos/Components/GasTankComponent.cs index c4b042a261..820a8b2e6a 100644 --- a/Content.Server/Atmos/Components/GasTankComponent.cs +++ b/Content.Server/Atmos/Components/GasTankComponent.cs @@ -20,9 +20,8 @@ using Robust.Shared.Utility; namespace Content.Server.Atmos.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] #pragma warning disable 618 - public sealed class GasTankComponent : Component, IExamine, IGasMixtureHolder, IDropped, IActivate + public sealed class GasTankComponent : Component, IExamine, IGasMixtureHolder, IDropped #pragma warning restore 618 { [Dependency] private readonly IEntityManager _entMan = default!; @@ -147,12 +146,6 @@ namespace Content.Server.Atmos.Components return air; } - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) return; - OpenInterface(actor.PlayerSession); - } - public void ConnectToInternals() { if (IsConnected || !IsFunctional) return; diff --git a/Content.Server/Body/Components/BodyScannerComponent.cs b/Content.Server/Body/Components/BodyScannerComponent.cs index 18d5619dc3..1b5e4b80ee 100644 --- a/Content.Server/Body/Components/BodyScannerComponent.cs +++ b/Content.Server/Body/Components/BodyScannerComponent.cs @@ -1,45 +1,16 @@ using Content.Server.UserInterface; using Content.Shared.Body.Components; -using Content.Shared.Interaction; using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.ViewVariables; namespace Content.Server.Body.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(SharedBodyScannerComponent))] - public sealed class BodyScannerComponent : SharedBodyScannerComponent, IActivate + public sealed class BodyScannerComponent : SharedBodyScannerComponent { [Dependency] private readonly IEntityManager _entMan = default!; [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(BodyScannerUiKey.Key); - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - { - return; - } - - var session = actor.PlayerSession; - - if (session.AttachedEntity == default) - { - return; - } - - if (_entMan.TryGetComponent(session.AttachedEntity, out SharedBodyComponent? body)) - { - var state = InterfaceState(body); - UserInterface?.SetState(state); - } - - UserInterface?.Open(session); - } - protected override void Initialize() { base.Initialize(); diff --git a/Content.Server/CharacterAppearance/Components/MagicMirrorComponent.cs b/Content.Server/CharacterAppearance/Components/MagicMirrorComponent.cs index 351978e973..c275e9846f 100644 --- a/Content.Server/CharacterAppearance/Components/MagicMirrorComponent.cs +++ b/Content.Server/CharacterAppearance/Components/MagicMirrorComponent.cs @@ -2,25 +2,17 @@ using Content.Server.CharacterAppearance.Systems; using Content.Server.UserInterface; using Content.Shared.CharacterAppearance; using Content.Shared.CharacterAppearance.Components; -using Content.Shared.Interaction; -using Content.Shared.Popups; using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Maths; -using Robust.Shared.ViewVariables; namespace Content.Server.CharacterAppearance.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class MagicMirrorComponent : SharedMagicMirrorComponent, IActivate + public sealed class MagicMirrorComponent : SharedMagicMirrorComponent { [Dependency] private readonly IEntityManager _entities = default!; [Dependency] private readonly SpriteAccessoryManager _spriteAccessoryManager = default!; - [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(MagicMirrorUiKey.Key); + [ViewVariables] public BoundUserInterface? UserInterface => Owner.GetUIOrNull(MagicMirrorUiKey.Key); protected override void Initialize() { @@ -94,36 +86,5 @@ namespace Content.Server.CharacterAppearance.Components EntitySystem.Get().ForceAppearanceUpdate(player); } - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entities.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - { - return; - } - - if (!_entities.TryGetComponent(eventArgs.User, out HumanoidAppearanceComponent? looks)) - { - Owner.PopupMessage(eventArgs.User, Loc.GetString("magic-mirror-component-activate-user-has-no-hair")); - return; - } - - UserInterface?.Toggle(actor.PlayerSession); - - var appearance = looks.Appearance; - - var msg = new MagicMirrorInitialDataMessage( - appearance.HairColor, - appearance.FacialHairColor, - appearance.HairStyleId, - appearance.FacialHairStyleId, - appearance.EyeColor, - looks.CategoriesHair, - looks.CategoriesFacialHair, - looks.CanColorHair, - looks.CanColorFacialHair); - - UserInterface?.SendMessage(msg, actor.PlayerSession); - } } } diff --git a/Content.Server/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs b/Content.Server/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs index 1866ff3c6b..001da8ada7 100644 --- a/Content.Server/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs +++ b/Content.Server/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs @@ -2,8 +2,6 @@ using Content.Shared.Body.Components; using Content.Shared.CharacterAppearance.Components; using Content.Shared.CharacterAppearance.Systems; using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; namespace Content.Server.CharacterAppearance.Systems { diff --git a/Content.Server/CharacterAppearance/Systems/MagicMirrorSystem.cs b/Content.Server/CharacterAppearance/Systems/MagicMirrorSystem.cs new file mode 100644 index 0000000000..97083f3511 --- /dev/null +++ b/Content.Server/CharacterAppearance/Systems/MagicMirrorSystem.cs @@ -0,0 +1,42 @@ +using Content.Server.CharacterAppearance.Components; +using Content.Server.UserInterface; +using Content.Shared.CharacterAppearance.Components; +using Robust.Server.GameObjects; + +namespace Content.Server.CharacterAppearance.Systems +{ + public sealed class MagicMirrorSystem : EntitySystem + { + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnOpenUIAttempt); + SubscribeLocalEvent(AfterUIOpen); + } + + private void OnOpenUIAttempt(EntityUid uid, MagicMirrorComponent mirror, ActivatableUIOpenAttemptEvent args) + { + if (!HasComp(args.User)) + args.Cancel(); + } + private void AfterUIOpen(EntityUid uid, MagicMirrorComponent component, AfterActivatableUIOpenEvent args) + { + var looks = Comp(args.User); + var actor = Comp(args.User); + var appearance = looks.Appearance; + + var msg = new MagicMirrorComponent.MagicMirrorInitialDataMessage( + appearance.HairColor, + appearance.FacialHairColor, + appearance.HairStyleId, + appearance.FacialHairStyleId, + appearance.EyeColor, + looks.CategoriesHair, + looks.CategoriesFacialHair, + looks.CanColorHair, + looks.CanColorFacialHair); + + component.UserInterface?.SendMessage(msg, actor.PlayerSession); + } + } +} diff --git a/Content.Server/Chemistry/Components/ChemMasterComponent.cs b/Content.Server/Chemistry/Components/ChemMasterComponent.cs index 3f2d98af70..823cdc453e 100644 --- a/Content.Server/Chemistry/Components/ChemMasterComponent.cs +++ b/Content.Server/Chemistry/Components/ChemMasterComponent.cs @@ -1,28 +1,19 @@ -using System; -using System.Collections.Generic; -using Content.Server.Chemistry.Components.SolutionManager; using Content.Server.Chemistry.EntitySystems; using Content.Server.Hands.Components; using Content.Server.Labels.Components; using Content.Server.Power.Components; using Content.Server.UserInterface; -using Content.Shared.ActionBlocker; using Content.Shared.Chemistry.Components; using Content.Shared.Containers.ItemSlots; using Content.Shared.FixedPoint; -using Content.Shared.Interaction; using Content.Shared.Item; using Content.Shared.Popups; using Content.Shared.Random.Helpers; using Content.Shared.Sound; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; + using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; namespace Content.Server.Chemistry.Components { @@ -33,9 +24,8 @@ namespace Content.Server.Chemistry.Components /// Messages sent from the client are used to handle ui button presses. /// [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(SharedChemMasterComponent))] - public sealed class ChemMasterComponent : SharedChemMasterComponent, IActivate + public sealed class ChemMasterComponent : SharedChemMasterComponent { [Dependency] private readonly IEntityManager _entities = default!; @@ -385,30 +375,6 @@ namespace Content.Server.Chemistry.Components UpdateUserInterface(); } - /// - /// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible. - /// - /// Data relevant to the event such as the actor which triggered it. - void IActivate.Activate(ActivateEventArgs args) - { - if (!_entities.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - if (!_entities.TryGetComponent(args.User, out HandsComponent? hands)) - { - Owner.PopupMessage(args.User, Loc.GetString("chem-master-component-activate-no-hands")); - return; - } - - var activeHandEntity = hands.GetActiveHandItem?.Owner; - if (activeHandEntity == null) - { - UserInterface?.Open(actor.PlayerSession); - } - } - private void ClickSound() { SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f)); diff --git a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs index a39a8e1e51..7c5a23321c 100644 --- a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs +++ b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs @@ -1,30 +1,17 @@ -using System; -using System.Collections.Generic; using System.Linq; -using Content.Server.Chemistry.Components.SolutionManager; using Content.Server.Chemistry.EntitySystems; -using Content.Server.Hands.Components; using Content.Server.Power.Components; using Content.Server.UserInterface; -using Content.Shared.ActionBlocker; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Dispenser; using Content.Shared.Containers.ItemSlots; using Content.Shared.FixedPoint; -using Content.Shared.Interaction; -using Content.Shared.Popups; using Content.Shared.Sound; using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Player; using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; namespace Content.Server.Chemistry.Components @@ -36,9 +23,8 @@ namespace Content.Server.Chemistry.Components /// Messages sent from the client are used to handle ui button presses. /// [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(SharedReagentDispenserComponent))] - public sealed class ReagentDispenserComponent : SharedReagentDispenserComponent, IActivate + public sealed class ReagentDispenserComponent : SharedReagentDispenserComponent { private static ReagentInventoryComparer _comparer = new(); public static string SolutionName = "reagent"; @@ -296,30 +282,6 @@ namespace Content.Server.Chemistry.Components UpdateUserInterface(); } - /// - /// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible. - /// - /// Data relevant to the event such as the actor which triggered it. - void IActivate.Activate(ActivateEventArgs args) - { - if (!_entities.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - if (!_entities.TryGetComponent(args.User, out HandsComponent? hands)) - { - Owner.PopupMessage(args.User, Loc.GetString("reagent-dispenser-component-activate-no-hands")); - return; - } - - var activeHandEntity = hands.GetActiveHandItem?.Owner; - if (activeHandEntity == null) - { - UserInterface?.Open(actor.PlayerSession); - } - } - private void ClickSound() { SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f)); diff --git a/Content.Server/Cloning/CloningSystem.cs b/Content.Server/Cloning/CloningSystem.cs index fd21dcd206..381094f4d2 100644 --- a/Content.Server/Cloning/CloningSystem.cs +++ b/Content.Server/Cloning/CloningSystem.cs @@ -1,15 +1,9 @@ -using System.Collections.Generic; using System.Linq; using Content.Server.Cloning.Components; using Content.Server.Mind.Components; using Content.Server.Power.Components; using Content.Shared.GameTicking; -using Content.Shared.Interaction; using Content.Shared.Preferences; -using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Maths; using Robust.Shared.Timing; using static Content.Shared.Cloning.SharedCloningPodComponent; @@ -28,7 +22,6 @@ namespace Content.Server.Cloning base.Initialize(); SubscribeLocalEvent(Reset); - SubscribeLocalEvent(HandleActivate); SubscribeLocalEvent(HandleMindAdded); } @@ -45,17 +38,6 @@ namespace Content.Server.Cloning ClonesWaitingForMind.Remove(mind); } - private void HandleActivate(EntityUid uid, CloningPodComponent component, ActivateInWorldEvent args) - { - if (!component.Powered || - !EntityManager.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - component.UserInterface?.Open(actor.PlayerSession); - } - private void HandleMindAdded(EntityUid uid, BeingClonedComponent component, MindAddedMessage message) { if (component.Parent == EntityUid.Invalid || diff --git a/Content.Server/Disposal/Tube/Components/DisposalRouterComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalRouterComponent.cs index 285e38c617..3eb0eca1fc 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalRouterComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalRouterComponent.cs @@ -1,33 +1,18 @@ -using System; -using System.Collections.Generic; using System.Text; using Content.Server.Disposal.Unit.Components; -using Content.Server.Hands.Components; using Content.Server.UserInterface; -using Content.Shared.ActionBlocker; -using Content.Shared.Interaction; -using Content.Shared.Popups; using Content.Shared.Sound; -using Robust.Server.Console; using Robust.Server.GameObjects; -using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; using static Content.Shared.Disposal.Components.SharedDisposalRouterComponent; namespace Content.Server.Disposal.Tube.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(IDisposalTubeComponent))] - public sealed class DisposalRouterComponent : DisposalJunctionComponent, IActivate + public sealed class DisposalRouterComponent : DisposalJunctionComponent { [Dependency] private readonly IEntityManager _entMan = default!; @@ -131,30 +116,6 @@ namespace Content.Server.Disposal.Tube.Components SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f)); } - /// - /// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible. - /// - /// Data relevant to the event such as the actor which triggered it. - void IActivate.Activate(ActivateEventArgs args) - { - if (!_entMan.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - if (!_entMan.TryGetComponent(args.User, out HandsComponent? hands)) - { - Owner.PopupMessage(args.User, Loc.GetString("disposal-router-window-tag-input-activate-no-hands")); - return; - } - - var activeHandEntity = hands.GetActiveHandItem?.Owner; - if (activeHandEntity == null) - { - OpenUserInterface(actor); - } - } - protected override void OnRemove() { UserInterface?.CloseAll(); diff --git a/Content.Server/Disposal/Tube/Components/DisposalTaggerComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalTaggerComponent.cs index 3f4b60aea0..c4a039ae21 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalTaggerComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalTaggerComponent.cs @@ -1,30 +1,17 @@ using Content.Server.Disposal.Unit.Components; -using Content.Server.Hands.Components; using Content.Server.UserInterface; -using Content.Shared.ActionBlocker; -using Content.Shared.Interaction; -using Content.Shared.Popups; using Content.Shared.Sound; -using Robust.Server.Console; using Robust.Server.GameObjects; -using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; using static Content.Shared.Disposal.Components.SharedDisposalTaggerComponent; namespace Content.Server.Disposal.Tube.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] [ComponentReference(typeof(IDisposalTubeComponent))] - public sealed class DisposalTaggerComponent : DisposalTransitComponent, IActivate + public sealed class DisposalTaggerComponent : DisposalTransitComponent { [Dependency] private readonly IEntityManager _entMan = default!; @@ -97,31 +84,6 @@ namespace Content.Server.Disposal.Tube.Components { SoundSystem.Play(Filter.Pvs(Owner), _clickSound.GetSound(), Owner, AudioParams.Default.WithVolume(-2f)); } - - /// - /// Called when you click the owner entity with an empty hand. Opens the UI client-side if possible. - /// - /// Data relevant to the event such as the actor which triggered it. - void IActivate.Activate(ActivateEventArgs args) - { - if (!_entMan.TryGetComponent(args.User, out ActorComponent? actor)) - { - return; - } - - if (!_entMan.TryGetComponent(args.User, out HandsComponent? hands)) - { - Owner.PopupMessage(args.User, Loc.GetString("disposal-tagger-window-activate-no-hands")); - return; - } - - var activeHandEntity = hands.GetActiveHandItem?.Owner; - if (activeHandEntity == null) - { - OpenUserInterface(actor); - } - } - protected override void OnRemove() { base.OnRemove(); diff --git a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs index 250501eebc..5d7d0e290d 100644 --- a/Content.Server/Disposal/Tube/DisposalTubeSystem.cs +++ b/Content.Server/Disposal/Tube/DisposalTubeSystem.cs @@ -1,13 +1,12 @@ using Content.Server.Disposal.Tube.Components; +using Content.Server.UserInterface; +using Content.Server.Hands.Components; using Content.Shared.Movement; using Content.Shared.Verbs; +using Content.Shared.Popups; using Robust.Server.GameObjects; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Map; -using Robust.Shared.Maths; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -23,10 +22,12 @@ namespace Content.Server.Disposal.Tube base.Initialize(); SubscribeLocalEvent(BodyTypeChanged); - SubscribeLocalEvent(OnRelayMovement); SubscribeLocalEvent>(AddOpenUIVerbs); SubscribeLocalEvent>(AddOpenUIVerbs); + SubscribeLocalEvent(OnOpenRouterUIAttempt); + SubscribeLocalEvent(OnOpenTaggerUIAttempt); + } private void AddOpenUIVerbs(EntityUid uid, DisposalTaggerComponent component, GetVerbsEvent args) @@ -72,6 +73,37 @@ namespace Content.Server.Disposal.Tube SoundSystem.Play(Filter.Pvs(uid), component.ClangSound.GetSound(), uid); } + private void OnOpenRouterUIAttempt(EntityUid uid, DisposalRouterComponent router, ActivatableUIOpenAttemptEvent args) + { + if (!TryComp(args.User, out var hands)) + { + uid.PopupMessage(args.User, Loc.GetString("disposal-router-window-tag-input-activate-no-hands")); + return; + } + + var activeHandEntity = hands.GetActiveHandItem?.Owner; + if (activeHandEntity != null) + { + args.Cancel(); + } + } + + private void OnOpenTaggerUIAttempt(EntityUid uid, DisposalTaggerComponent router, ActivatableUIOpenAttemptEvent args) + { + if (!TryComp(args.User, out var hands)) + { + uid.PopupMessage(args.User, Loc.GetString("disposal-tagger-window-activate-no-hands")); + return; + } + + var activeHandEntity = hands.GetActiveHandItem?.Owner; + if (activeHandEntity != null) + { + args.Cancel(); + } + } + + private static void BodyTypeChanged( EntityUid uid, DisposalTubeComponent component, diff --git a/Content.Server/Drone/Components/DroneComponent.cs b/Content.Server/Drone/Components/DroneComponent.cs index 87d49f50fc..4bf4129664 100644 --- a/Content.Server/Drone/Components/DroneComponent.cs +++ b/Content.Server/Drone/Components/DroneComponent.cs @@ -1,9 +1,4 @@ -using System.Collections.Generic; using Content.Server.Storage; -using Robust.Shared.Analyzers; -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization.Manager.Attributes; - namespace Content.Server.Drone.Components { diff --git a/Content.Server/Drone/DroneSystem.cs b/Content.Server/Drone/DroneSystem.cs index 579fb7e2e9..e7be49fba5 100644 --- a/Content.Server/Drone/DroneSystem.cs +++ b/Content.Server/Drone/DroneSystem.cs @@ -51,7 +51,10 @@ namespace Content.Server.Drone private void OnActivateUIAttempt(EntityUid uid, DroneComponent component, UserOpenActivatableUIAttemptEvent args) { - args.Cancel(); + if (!_tagSystem.HasTag(args.Target, "DroneUsable")) + { + args.Cancel(); + } } private void OnExamined(EntityUid uid, DroneComponent component, ExaminedEvent args) diff --git a/Content.Server/Kitchen/Components/MicrowaveComponent.cs b/Content.Server/Kitchen/Components/MicrowaveComponent.cs index 1086110dc3..784e0acecb 100644 --- a/Content.Server/Kitchen/Components/MicrowaveComponent.cs +++ b/Content.Server/Kitchen/Components/MicrowaveComponent.cs @@ -30,8 +30,7 @@ using Robust.Shared.Player; namespace Content.Server.Kitchen.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class MicrowaveComponent : SharedMicrowaveComponent, IActivate, IInteractUsing, ISuicideAct, IBreakAct + public sealed class MicrowaveComponent : SharedMicrowaveComponent, IInteractUsing, ISuicideAct, IBreakAct { [Dependency] private readonly IEntityManager _entities = default!; @@ -76,13 +75,13 @@ namespace Content.Server.Kitchen.Components private bool HasContents => _storage.ContainedEntities.Count > 0; - private bool _uiDirty = true; + public bool UIDirty = true; private bool _lostPower; private int _currentCookTimeButtonIndex; public void DirtyUi() { - _uiDirty = true; + UIDirty = true; } private Container _storage = default!; @@ -121,7 +120,7 @@ namespace Content.Server.Kitchen.Components { EjectSolids(); ClickSound(); - _uiDirty = true; + UIDirty = true; } break; @@ -130,7 +129,7 @@ namespace Content.Server.Kitchen.Components { EjectSolid(msg.EntityID); ClickSound(); - _uiDirty = true; + UIDirty = true; } break; @@ -138,7 +137,7 @@ namespace Content.Server.Kitchen.Components _currentCookTimeButtonIndex = msg.ButtonIndex; _currentCookTimerTime = msg.NewCookTime; ClickSound(); - _uiDirty = true; + UIDirty = true; break; } } @@ -157,7 +156,7 @@ namespace Content.Server.Kitchen.Components _lostPower = true; EjectSolids(); _busy = false; - _uiDirty = true; + UIDirty = true; } if (_busy && _broken) @@ -167,10 +166,10 @@ namespace Content.Server.Kitchen.Components _lostPower = true; EjectSolids(); _busy = false; - _uiDirty = true; + UIDirty = true; } - if (_uiDirty) + if (UIDirty) { UserInterface?.SetState(new MicrowaveUpdateUserInterfaceState ( @@ -179,7 +178,7 @@ namespace Content.Server.Kitchen.Components _currentCookTimeButtonIndex, _currentCookTimerTime )); - _uiDirty = false; + UIDirty = false; } } @@ -203,17 +202,6 @@ namespace Content.Server.Kitchen.Components SetAppearance(MicrowaveVisualState.Broken); } - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entities.TryGetComponent(eventArgs.User, out ActorComponent? actor) || !Powered) - { - return; - } - - _uiDirty = true; - UserInterface?.Toggle(actor.PlayerSession); - } - async Task IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs) { if (!Powered) @@ -242,7 +230,7 @@ namespace Content.Server.Kitchen.Components var ent = food.Owner; //Get the entity of the ItemComponent. _storage.Insert(ent); - _uiDirty = true; + UIDirty = true; return true; } @@ -353,10 +341,10 @@ namespace Content.Server.Kitchen.Components SetAppearance(MicrowaveVisualState.Idle); _busy = false; - _uiDirty = true; + UIDirty = true; }); _lostPower = false; - _uiDirty = true; + UIDirty = true; } /// @@ -544,7 +532,7 @@ namespace Content.Server.Kitchen.Components _currentCookTimerTime = 10; ClickSound(); - _uiDirty = true; + UIDirty = true; Wzhzhzh(); return SuicideKind.Heat; } diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index 626122697b..4135e5fdf2 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -1,7 +1,7 @@ using Content.Server.Chemistry.EntitySystems; using Content.Server.Kitchen.Components; +using Content.Server.UserInterface; using JetBrains.Annotations; -using Robust.Shared.GameObjects; namespace Content.Server.Kitchen.EntitySystems { diff --git a/Content.Server/Lathe/Components/LatheComponent.cs b/Content.Server/Lathe/Components/LatheComponent.cs index b008cef2a5..203b563382 100644 --- a/Content.Server/Lathe/Components/LatheComponent.cs +++ b/Content.Server/Lathe/Components/LatheComponent.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Content.Server.Materials; @@ -13,15 +11,11 @@ using Content.Shared.Power; using Content.Shared.Research.Prototypes; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.ViewVariables; namespace Content.Server.Lathe.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class LatheComponent : SharedLatheComponent, IInteractUsing, IActivate + public sealed class LatheComponent : SharedLatheComponent, IInteractUsing { [Dependency] private readonly IEntityManager _entMan = default!; @@ -138,19 +132,6 @@ namespace Content.Server.Lathe.Components { UserInterface?.Open(session); } - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - if (!Powered) - { - return; - } - - OpenUserInterface(actor.PlayerSession); - } - async Task IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs) { if (!_entMan.TryGetComponent(Owner, out MaterialStorageComponent? storage) diff --git a/Content.Server/Paper/PaperComponent.cs b/Content.Server/Paper/PaperComponent.cs index ed4f743d83..5259b896cc 100644 --- a/Content.Server/Paper/PaperComponent.cs +++ b/Content.Server/Paper/PaperComponent.cs @@ -5,25 +5,20 @@ using Content.Shared.Interaction; using Content.Shared.Paper; using Content.Shared.Tag; using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Serialization.Manager.Attributes; + using Robust.Shared.Utility; -using Robust.Shared.ViewVariables; namespace Content.Server.Paper { [RegisterComponent] #pragma warning disable 618 [ComponentReference(typeof(SharedPaperComponent))] - [ComponentReference(typeof(IActivate))] - public sealed class PaperComponent : SharedPaperComponent, IExamine, IInteractUsing, IActivate + public sealed class PaperComponent : SharedPaperComponent, IExamine, IInteractUsing #pragma warning restore 618 { [Dependency] private readonly IEntityManager _entMan = default!; - private PaperAction _mode; + public PaperAction Mode; [DataField("content")] public string Content { get; set; } = ""; @@ -42,7 +37,7 @@ namespace Content.Server.Paper UserInterface.OnReceiveMessage += OnUiReceiveMessage; } - _mode = PaperAction.Read; + Mode = PaperAction.Read; UpdateUserInterface(); } @@ -62,9 +57,9 @@ namespace Content.Server.Paper appearance.SetData(PaperVisuals.Status, status); } - private void UpdateUserInterface() + public void UpdateUserInterface() { - UserInterface?.SetState(new PaperBoundUserInterfaceState(Content, _mode)); + UserInterface?.SetState(new PaperBoundUserInterfaceState(Content, Mode)); } public void Examine(FormattedMessage message, bool inDetailsRange) @@ -81,17 +76,6 @@ namespace Content.Server.Paper ); } - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - - _mode = PaperAction.Read; - UpdateUserInterface(); - UserInterface?.Toggle(actor.PlayerSession); - return; - } - private void OnUiReceiveMessage(ServerBoundUserInterfaceMessage obj) { var msg = (PaperInputText) obj.Message; @@ -118,7 +102,7 @@ namespace Content.Server.Paper if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) return false; - _mode = PaperAction.Write; + Mode = PaperAction.Write; UpdateUserInterface(); UserInterface?.Open(actor.PlayerSession); return true; diff --git a/Content.Server/Paper/PaperSystem.cs b/Content.Server/Paper/PaperSystem.cs new file mode 100644 index 0000000000..edf578d61d --- /dev/null +++ b/Content.Server/Paper/PaperSystem.cs @@ -0,0 +1,20 @@ +using Content.Server.UserInterface; +using Content.Shared.Paper; + +namespace Content.Server.Paper +{ + public sealed class PaperSystem : EntitySystem + { + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(AfterUIOpen); + } + + private void AfterUIOpen(EntityUid uid, PaperComponent component, BeforeActivatableUIOpenEvent args) + { + component.Mode = SharedPaperComponent.PaperAction.Read; + component.UpdateUserInterface(); + } + } +} diff --git a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs index 70d79c30a2..01c80efd2e 100644 --- a/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs +++ b/Content.Server/ParticleAccelerator/Components/ParticleAcceleratorControlBoxComponent.cs @@ -1,5 +1,3 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; @@ -9,18 +7,10 @@ using Content.Server.Power.EntitySystems; using Content.Server.UserInterface; using Content.Server.VendingMachines; using Content.Server.WireHacking; -using Content.Shared.ActionBlocker; -using Content.Shared.Interaction; using Content.Shared.Singularity.Components; using Robust.Server.GameObjects; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Map; -using Robust.Shared.Maths; -using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; -using Robust.Shared.ViewVariables; using static Content.Shared.Wires.SharedWiresComponent; using Timer = Robust.Shared.Timing.Timer; @@ -32,9 +22,8 @@ namespace Content.Server.ParticleAccelerator.Components /// Is the computer thing people interact with to control the PA. /// Also contains primary logic for actual PA behavior, part scanning, etc... /// - [ComponentReference(typeof(IActivate))] [RegisterComponent] - public sealed class ParticleAcceleratorControlBoxComponent : ParticleAcceleratorPartComponent, IActivate, IWires + public sealed class ParticleAcceleratorControlBoxComponent : ParticleAcceleratorPartComponent, IWires { [Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IMapManager _mapManager = default!; @@ -210,30 +199,6 @@ namespace Content.Server.ParticleAccelerator.Components UserInterface?.SetState(state); } - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - { - return; - } - - if (_entMan.TryGetComponent(Owner, out var wires) && wires.IsPanelOpen) - { - wires.OpenInterface(actor.PlayerSession); - } - else - { - if (!ConsolePowered) - { - return; - } - - UserInterface?.Toggle(actor.PlayerSession); - UpdateUI(); - } - } - protected override void OnRemove() { UserInterface?.CloseAll(); diff --git a/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs b/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs index f14f6c6dcf..849d8a8c9e 100644 --- a/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs +++ b/Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs @@ -1,24 +1,8 @@ -using System.Linq; -using Content.Shared; -using Content.Shared.CCVar; -using Content.Shared.ActionBlocker; -using Content.Shared.Hands; using Content.Shared.Popups; -using Content.Shared.Standing; -using Content.Shared.Stunnable; -using Content.Shared.Throwing; -using Content.Shared.Interaction; -using Content.Shared.Interaction.Helpers; using Content.Server.Power.Components; using Content.Server.UserInterface; +using Content.Server.WireHacking; using JetBrains.Annotations; -using Robust.Server.GameObjects; -using Robust.Server.Player; -using Robust.Shared.Configuration; -using Robust.Shared.Localization; -using Robust.Shared.GameObjects; -using Robust.Shared.Network; -using Robust.Shared.IoC; namespace Content.Server.Power.EntitySystems { @@ -39,7 +23,9 @@ namespace Content.Server.Power.EntitySystems if (args.Cancelled) return; if (EntityManager.TryGetComponent(uid, out var power) && !power.Powered) { - args.User.PopupMessageCursor(Loc.GetString("base-computer-ui-component-not-powered")); + if (TryComp(uid, out var wires) && wires.IsPanelOpen) + return; + args.User.PopupMessageCursor(Loc.GetString("base-computer-ui-component-not-powered", ("machine", uid))); args.Cancel(); } } diff --git a/Content.Server/Research/Components/ResearchClientComponent.cs b/Content.Server/Research/Components/ResearchClientComponent.cs index 44c8ce1130..83d30d3b11 100644 --- a/Content.Server/Research/Components/ResearchClientComponent.cs +++ b/Content.Server/Research/Components/ResearchClientComponent.cs @@ -3,15 +3,12 @@ using Content.Shared.Interaction; using Content.Shared.Research.Components; using Robust.Server.GameObjects; using Robust.Server.Player; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.ViewVariables; namespace Content.Server.Research.Components { [RegisterComponent] [Virtual] - public class ResearchClientComponent : SharedResearchClientComponent, IActivate + public class ResearchClientComponent : SharedResearchClientComponent { [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; @@ -55,15 +52,6 @@ namespace Content.Server.Research.Components UpdateUserInterface(); UserInterface?.Open(session); } - - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!IoCManager.Resolve().TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - - OpenUserInterface(actor.PlayerSession); - } - public void UpdateUserInterface() { UserInterface?.SetState(GetNewUiState()); diff --git a/Content.Server/Research/Components/ResearchConsoleComponent.cs b/Content.Server/Research/Components/ResearchConsoleComponent.cs index d9fb09ea1e..0849e27d3a 100644 --- a/Content.Server/Research/Components/ResearchConsoleComponent.cs +++ b/Content.Server/Research/Components/ResearchConsoleComponent.cs @@ -1,26 +1,18 @@ using Content.Server.Power.Components; using Content.Server.UserInterface; -using Content.Shared.Audio; -using Content.Shared.Interaction; using Content.Shared.Research.Components; using Content.Shared.Research.Prototypes; using Content.Shared.Sound; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; using Robust.Shared.Player; using Robust.Shared.Prototypes; -using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; namespace Content.Server.Research.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] - public sealed class ResearchConsoleComponent : SharedResearchConsoleComponent, IActivate + public sealed class ResearchConsoleComponent : SharedResearchConsoleComponent { [Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; @@ -110,20 +102,7 @@ namespace Content.Server.Research.Components UserInterface?.Open(session); } - void IActivate.Activate(ActivateEventArgs eventArgs) - { - if (!_entMan.TryGetComponent(eventArgs.User, out ActorComponent? actor)) - return; - if (!Powered) - { - return; - } - - OpenUserInterface(actor.PlayerSession); - PlayKeyboardSound(); - } - - private void PlayKeyboardSound() + public void PlayKeyboardSound() { SoundSystem.Play(Filter.Pvs(Owner), _soundCollectionName.GetSound(), Owner, AudioParams.Default); } diff --git a/Content.Server/Research/Components/ResearchPointSourceComponent.cs b/Content.Server/Research/Components/ResearchPointSourceComponent.cs index 8d1dbf64d8..9cab3de039 100644 --- a/Content.Server/Research/Components/ResearchPointSourceComponent.cs +++ b/Content.Server/Research/Components/ResearchPointSourceComponent.cs @@ -1,14 +1,9 @@ using Content.Server.Power.Components; using Content.Shared.Interaction; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; namespace Content.Server.Research.Components { [RegisterComponent] - [ComponentReference(typeof(IActivate))] public sealed class ResearchPointSourceComponent : ResearchClientComponent { [DataField("pointspersecond")] diff --git a/Content.Server/Research/ResearchSystem.cs b/Content.Server/Research/ResearchSystem.cs index e742f91a85..343fb7fc46 100644 --- a/Content.Server/Research/ResearchSystem.cs +++ b/Content.Server/Research/ResearchSystem.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +using Content.Server.UserInterface; using Content.Server.Research.Components; using JetBrains.Annotations; -using Robust.Shared.GameObjects; + namespace Content.Server.Research { @@ -14,6 +14,17 @@ namespace Content.Server.Research private readonly List _servers = new(); public IReadOnlyList Servers => _servers; + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnAfterUIOpen); + } + + private void OnAfterUIOpen(EntityUid uid, ResearchConsoleComponent component, AfterActivatableUIOpenEvent args) + { + component.PlayKeyboardSound(); + } + public bool RegisterServer(ResearchServerComponent server) { if (_servers.Contains(server)) return false; diff --git a/Content.Server/UserInterface/ActivatableUISystem.cs b/Content.Server/UserInterface/ActivatableUISystem.cs index c638e05ae1..c5e85d3d84 100644 --- a/Content.Server/UserInterface/ActivatableUISystem.cs +++ b/Content.Server/UserInterface/ActivatableUISystem.cs @@ -112,13 +112,23 @@ namespace Content.Server.UserInterface // 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). var oae = new ActivatableUIOpenAttemptEvent(user); - var uae = new UserOpenActivatableUIAttemptEvent(user); + var uae = new UserOpenActivatableUIAttemptEvent(user, aui.Owner); RaiseLocalEvent(user, uae, false); RaiseLocalEvent((aui).Owner, oae, false); if (oae.Cancelled || uae.Cancelled) return false; + // Give the UI an opportunity to prepare itself if it needs to do anything + // before opening + var bae = new BeforeActivatableUIOpenEvent(user); + RaiseLocalEvent((aui).Owner, bae, false); + SetCurrentSingleUser((aui).Owner, actor.PlayerSession, aui); ui.Toggle(actor.PlayerSession); + + //Let the component know a user opened it so it can do whatever it needs to do + var aae = new AfterActivatableUIOpenEvent(user); + RaiseLocalEvent((aui).Owner, aae, false); + return true; } @@ -153,11 +163,37 @@ namespace Content.Server.UserInterface public sealed class UserOpenActivatableUIAttemptEvent : CancellableEntityEventArgs //have to one-up the already stroke-inducing name { public EntityUid User { get; } - public UserOpenActivatableUIAttemptEvent(EntityUid who) + public EntityUid Target { get; } + public UserOpenActivatableUIAttemptEvent(EntityUid who, EntityUid target) + { + User = who; + Target = target; + } + } + + public sealed class AfterActivatableUIOpenEvent : EntityEventArgs + { + public EntityUid User { get; } + public AfterActivatableUIOpenEvent(EntityUid who) { User = who; } } + + /// + /// This is after it's decided the user can open the UI, + /// but before the UI actually opens. + /// Use this if you need to prepare the UI itself + /// + public sealed class BeforeActivatableUIOpenEvent : EntityEventArgs + { + public EntityUid User { get; } + public BeforeActivatableUIOpenEvent(EntityUid who) + { + User = who; + } + } + public sealed class ActivatableUIPlayerChangedEvent : EntityEventArgs { } diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index 1cb63d1e32..844f10cb27 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -1,23 +1,15 @@ -using System.Collections.Generic; -using Content.Shared.Interaction; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; using Robust.Shared.Player; -using System; using System.Linq; using Content.Server.Popups; using Content.Server.Power.Components; -using Content.Server.WireHacking; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.VendingMachines; using Robust.Server.GameObjects; -using Robust.Shared.Localization; using Robust.Shared.Prototypes; using Robust.Shared.Random; using Content.Server.Throwing; -using Robust.Shared.Maths; using Content.Shared.Acts; using static Content.Shared.VendingMachines.SharedVendingMachineComponent; @@ -34,7 +26,6 @@ namespace Content.Server.VendingMachines.systems { base.Initialize(); SubscribeLocalEvent(OnComponentInit); - SubscribeLocalEvent(HandleActivate); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnInventoryRequestMessage); SubscribeLocalEvent(OnInventoryEjectMessage); @@ -72,30 +63,6 @@ namespace Content.Server.VendingMachines.systems AuthorizedVend(uid, entity, args.ID, component); } - private void HandleActivate(EntityUid uid, VendingMachineComponent component, ActivateInWorldEvent args) - { - if (!TryComp(args.User, out var actor)) - { - return; - } - - if (!IsPowered(uid, component)) - { - return; - } - - if (TryComp(uid, out var wires)) - { - if (wires.IsPanelOpen) - { - wires.OpenInterface(actor.PlayerSession); - return; - } - } - - component.UserInterface?.Toggle(actor.PlayerSession); - } - private void OnPowerChanged(EntityUid uid, VendingMachineComponent component, PowerChangedEvent args) { TryUpdateVisualState(uid, null, component); diff --git a/Resources/Locale/en-US/components/base-computer-ui-component.ftl b/Resources/Locale/en-US/components/base-computer-ui-component.ftl index 8111c16e43..731609ea0e 100644 --- a/Resources/Locale/en-US/components/base-computer-ui-component.ftl +++ b/Resources/Locale/en-US/components/base-computer-ui-component.ftl @@ -1 +1 @@ -base-computer-ui-component-not-powered = The computer is not powered. \ No newline at end of file +base-computer-ui-component-not-powered = {CAPITALIZE(THE($machine))} is not powered. diff --git a/Resources/Prototypes/Entities/Objects/Misc/paper.yml b/Resources/Prototypes/Entities/Objects/Misc/paper.yml index ca86185a12..c998205fee 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/paper.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/paper.yml @@ -10,6 +10,8 @@ layers: - state: paper - type: Paper + - type: ActivatableUI + key: enum.PaperUiKey.Key - type: UserInterface interfaces: - key: enum.PaperUiKey.Key diff --git a/Resources/Prototypes/Entities/Objects/Specific/atmos.yml b/Resources/Prototypes/Entities/Objects/Specific/atmos.yml index 9e11ff92d7..69b844021b 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/atmos.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/atmos.yml @@ -9,6 +9,8 @@ state: icon netsync: false - type: GasAnalyzer + - type: ActivatableUI + key: enum.GasAnalyzerUiKey.Key - type: UserInterface interfaces: - key: enum.GasAnalyzerUiKey.Key diff --git a/Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml b/Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml index 994624e7b3..53722ef961 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/gas_tanks.yml @@ -6,6 +6,8 @@ - type: Sprite sprite: Objects/Tanks/generic.rsi state: icon + - type: ActivatableUI + key: enum.SharedGasTankUiKey.Key - type: UserInterface interfaces: - key: enum.SharedGasTankUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml index eee628d814..ad13cd5123 100644 --- a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml +++ b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml @@ -26,6 +26,9 @@ - SmallImpassable - type: ApcPowerReceiver - type: ExtensionCableReceiver + - type: ActivatableUI + key: enum.ReagentDispenserUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.ReagentDispenserUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml index 7d8903631b..978cb63b07 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml @@ -41,6 +41,9 @@ - type: SpaceVillainArcade - type: Wires BoardName: "Arcade" + - type: ActivatableUI + key: enum.SpaceVillainArcadeUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.SpaceVillainArcadeUiKey.Key @@ -57,6 +60,9 @@ parent: ArcadeBase components: - type: BlockGameArcade + - type: ActivatableUI + key: enum.BlockGameUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.BlockGameUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml index a628388309..42f6f61248 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/computers.yml @@ -93,7 +93,7 @@ color: "#1f8c28" - type: Computer board: MedicalRecordsComputerCircuitboard - + - type: entity parent: ComputerBase id: ComputerCriminalRecords @@ -156,6 +156,9 @@ - type: ResearchClient - type: ResearchConsole - type: TechnologyDatabase + - type: ActivatableUI + key: enum.ResearchConsoleUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.ResearchConsoleUiKey.Key @@ -226,6 +229,9 @@ description: That's a body scanner. components: - type: BodyScanner + - type: ActivatableUI + key: enum.BodyScannerUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.BodyScannerUiKey.Key @@ -295,6 +301,10 @@ radius: 1.5 energy: 1.6 color: "#e6e227" + - type: Tag + tags: + - DroneUsable + - type: entity parent: ComputerBase diff --git a/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml b/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml index a25f7d3d3b..e08c545107 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml @@ -45,6 +45,9 @@ node: machineFrame - !type:DoActsBehavior acts: [ "Destruction" ] + - type: ActivatableUI + key: enum.ChemMasterUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.ChemMasterUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml index 16b68f0f4b..59dca066c1 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml @@ -54,6 +54,8 @@ enum.CloningPodStatus.NoMind: pod_e enum.CloningPodStatus.Gore: pod_g enum.CloningPodStatus.Idle: pod_0 + - type: ActivatableUI + key: enum.CloningPodUIKey.Key #Ejecting doesn't require power so I didn't give it that component - type: UserInterface interfaces: - key: enum.CloningPodUIKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index d56c9d6a1a..2d24719701 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -70,6 +70,9 @@ visuals: - type: AutolatheVisualizer - type: WiresVisualizer + - type: ActivatableUI + key: enum.LatheUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.LatheUiKey.Key @@ -182,6 +185,9 @@ - KitchenKnife - ButchCleaver - FlashlightLantern + - type: ActivatableUI + key: enum.LatheUiKey.Key #Yes only having 1 of them here doesn't break anything + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.LatheUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml index e981d14b43..caac16ed15 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml @@ -49,6 +49,9 @@ - type: Appearance visuals: - type: MedicalScannerVisualizer + - type: ActivatableUI + key: enum.MedicalScannerUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.MedicalScannerUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml index 61223d6807..b5953c42df 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml @@ -14,6 +14,8 @@ - type: Appearance visuals: - type: MicrowaveVisualizer + - type: ActivatableUI + key: enum.MicrowaveUiKey.Key - type: UserInterface interfaces: - key: enum.MicrowaveUiKey.Key @@ -48,4 +50,4 @@ - !type:DoActsBehavior acts: ["Breakage"] - type: ApcPowerReceiver - powerLoad: 400 \ No newline at end of file + powerLoad: 400 diff --git a/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml b/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml index 7ff3b991f4..5f65b53f93 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml @@ -37,6 +37,9 @@ behaviors: - !type:DoActsBehavior acts: ["Breakage"] + - type: ActivatableUI + key: enum.VendingMachineUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.VendingMachineUiKey.Key @@ -188,6 +191,9 @@ - type: Advertise pack: ClothesMateAds - type: Speech + - type: Tag + tags: + - DroneUsable - type: Sprite sprite: Structures/Machines/VendingMachines/clothing.rsi layers: @@ -657,6 +663,9 @@ radius: 1.5 energy: 1.6 color: "#c73434" + - type: Tag + tags: + - DroneUsable - type: entity parent: VendingMachine @@ -754,6 +763,9 @@ radius: 1.5 energy: 1.6 color: "#d4ab33" + - type: Tag + tags: + - DroneUsable - type: entity parent: VendingMachine diff --git a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml index 9f4a748975..46530cc8c5 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Disposal/pipes.yml @@ -114,6 +114,8 @@ - type: DisposalVisualizer state_free: conpipe-tagger state_anchored: pipe-tagger + - type: ActivatableUI + key: enum.DisposalTaggerUiKey.Key - type: UserInterface interfaces: - key: enum.DisposalTaggerUiKey.Key @@ -178,6 +180,8 @@ state_anchored: pipe-j1s - type: Flippable mirrorEntity: DisposalRouterFlipped + - type: ActivatableUI + key: enum.DisposalRouterUiKey.Key - type: UserInterface interfaces: - key: enum.DisposalRouterUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml index 847e57a343..8153183b29 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml @@ -23,6 +23,9 @@ - type: Construction graph: ParticleAcceleratorControlBox node: completed + - type: ActivatableUI + key: enum.ParticleAcceleratorControlBoxUiKey.Key + - type: ActivatableUIRequiresPower - type: UserInterface interfaces: - key: enum.ParticleAcceleratorControlBoxUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml index 541ffb4f8f..5d030735f3 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/ame.yml @@ -46,6 +46,8 @@ - type: Anchorable - type: Pullable - type: AMEController + - type: ActivatableUI + key: enum.AMEControllerUiKey.Key - type: UserInterface interfaces: - key: enum.AMEControllerUiKey.Key diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml index 2b44e00e7f..b524f099bf 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/mirror.yml @@ -12,6 +12,8 @@ - type: Transform anchored: true - type: MagicMirror + - type: ActivatableUI + key: enum.MagicMirrorUiKey.Key - type: UserInterface interfaces: - key: enum.MagicMirrorUiKey.Key