]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Lock Anomaly generator to research access (#24464)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Thu, 1 Feb 2024 08:45:24 +0000 (11:45 +0300)
committerGitHub <noreply@github.com>
Thu, 1 Feb 2024 08:45:24 +0000 (19:45 +1100)
* small patch

* fix

* remove garbage

* fix

* moved to shared events

* fix

* LocId

---------

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
42 files changed:
Content.Server/Access/Systems/AgentIDCardSystem.cs
Content.Server/Arcade/BlockGame/BlockGameArcadeSystem.cs
Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs
Content.Server/Atmos/EntitySystems/GasTankSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs
Content.Server/Bed/Cryostorage/CryostorageSystem.cs
Content.Server/Cloning/CloningConsoleSystem.cs
Content.Server/DeviceLinking/Systems/SignalTimerSystem.cs
Content.Server/DeviceNetwork/Systems/NetworkConfiguratorSystem.cs
Content.Server/Drone/DroneSystem.cs
Content.Server/Eye/Blinding/ActivatableUIRequiresVisionSystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Forensics/Systems/ForensicScannerSystem.cs
Content.Server/Gateway/Systems/GatewaySystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/Lock/EntitySystems/ActivatableUIRequiresLockSystem.cs
Content.Server/MagicMirror/MagicMirrorSystem.cs
Content.Server/Medical/CryoPodSystem.cs
Content.Server/NukeOps/WarDeclaratorSystem.cs
Content.Server/Paper/PaperSystem.cs
Content.Server/Power/EntitySystems/ActivatableUIRequiresPowerSystem.cs
Content.Server/Radio/EntitySystems/RadioDeviceSystem.cs
Content.Server/Research/Systems/ResearchSystem.Console.cs
Content.Server/Research/TechnologyDisk/Systems/DiskConsoleSystem.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.Drone.cs
Content.Server/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Server/Silicons/Borgs/BorgSystem.Ui.cs
Content.Server/Silicons/Borgs/BorgSystem.cs
Content.Server/Sound/EmitSoundSystem.cs
Content.Server/Store/Systems/StoreSystem.Ui.cs
Content.Server/Store/Systems/StoreSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraMonitorSystem.cs
Content.Server/UserInterface/ActivatableUISystem.Power.cs
Content.Server/UserInterface/ActivatableUISystem.cs
Content.Server/VendingMachines/VendingMachineSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Xenoarchaeology/Equipment/Systems/ArtifactAnalyzerSystem.cs
Content.Shared/Access/Components/ActivatableUIRequiresAccessComponent.cs [new file with mode: 0644]
Content.Shared/Access/Systems/ActivatableUIRequiresAccessSystem.cs [new file with mode: 0644]
Content.Shared/UserInterface/ActivatableUIEvents.cs [new file with mode: 0644]
Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml

index b0772fcc32b200b18189e3614edf83048e0a5815..4d242e8f81d4ae5499edec3bd6e668b1a0e14434 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Access.Components;
 using Content.Server.Popups;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Components;
 using Content.Shared.Access.Systems;
 using Content.Shared.Interaction;
index a57401cbb19862263c869a4fb8d334978c776f40..34a5689fd154d6e5bc5be2c2ce545df518616677 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Power.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Arcade;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
index eae9b94964770c4b9ca6f1048d5e9c90aee1f080..d97c94fd9925e8583387763579213b3089e3f67a 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Power.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
index e00990f5944070e655604cd5d88c0e13cb85067f..dfe84473402fc2c4fbb038b11e65055846edf1a1 100644 (file)
@@ -4,7 +4,7 @@ using Content.Server.Body.Components;
 using Content.Server.Body.Systems;
 using Content.Server.Cargo.Systems;
 using Content.Server.Explosion.EntitySystems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Actions;
 using Content.Shared.Atmos;
 using Content.Shared.Atmos.Components;
index 8e065921fed6f29ebd1f68964af1d985ad197a04..ee0dca0fb0a901ff0e1ac6afa1137aef9bbb84d7 100644 (file)
@@ -14,7 +14,7 @@ using Content.Shared.Atmos.Piping.Unary.Components;
 using JetBrains.Annotations;
 using Robust.Server.GameObjects;
 using Content.Server.Power.EntitySystems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
 using Content.Shared.Examine;
index f82f835d876956c1f44bd41fb7c1cb81012d0799..11184bee0add406d150b5b20a163b54bd8580e52 100644 (file)
@@ -6,7 +6,7 @@ using Content.Server.Inventory;
 using Content.Server.Popups;
 using Content.Server.Station.Components;
 using Content.Server.Station.Systems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Systems;
 using Content.Shared.Bed.Cryostorage;
 using Content.Shared.Chat;
index 0be9b64134514568dd6842365fb30a2d83a40eb7..41768066392a8aeeef52963b363e7181a7697e29 100644 (file)
@@ -5,7 +5,7 @@ using Content.Server.DeviceLinking.Systems;
 using Content.Server.Medical.Components;
 using Content.Server.Power.Components;
 using Content.Server.Power.EntitySystems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Cloning;
 using Content.Shared.Cloning.CloningConsole;
 using Content.Shared.Database;
index 8cdeac3e8eb8e10fccb6b0d2c51d895648e637be..0426ee7cc3613f9129ec6a0a21ef53bd08a8bb6d 100644 (file)
@@ -1,11 +1,10 @@
 using Content.Server.DeviceLinking.Components;
 using Content.Server.DeviceLinking.Events;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Systems;
 using Content.Shared.MachineLinking;
 using Content.Shared.TextScreen;
 using Robust.Server.GameObjects;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Timing;
 
index c8faa930d1126eb55ea4d72b9e4c51a6bbaa4132..9a038f1c78a5b39485501c398ca36b8503e22830 100644 (file)
@@ -2,7 +2,6 @@ using System.Linq;
 using Content.Server.Administration.Logs;
 using Content.Server.DeviceLinking.Systems;
 using Content.Server.DeviceNetwork.Components;
-using Content.Server.UserInterface;
 using Content.Shared.Access.Components;
 using Content.Shared.Access.Systems;
 using Content.Shared.Database;
@@ -13,6 +12,7 @@ using Content.Shared.DeviceNetwork.Systems;
 using Content.Shared.Examine;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
+using Content.Shared.UserInterface;
 using Content.Shared.Verbs;
 using JetBrains.Annotations;
 using Robust.Server.Audio;
index 7e1199bb4d605deb42055ab9f291449465c09f8a..769d1b5d119728a336193a2d4d76bed94c7a9514 100644 (file)
@@ -3,7 +3,7 @@ using Content.Server.Drone.Components;
 using Content.Server.Ghost.Roles.Components;
 using Content.Server.Popups;
 using Content.Server.Tools.Innate;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Body.Components;
 using Content.Shared.Drone;
 using Content.Shared.Emoting;
index 7bed97db12351d41a6114893c80a69454a0371eb..b51efc2f5e16878320c6a18b9f93bf0333f3a920 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Shared.Eye.Blinding;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Server.Popups;
 using Content.Shared.Eye.Blinding.Components;
 using Content.Shared.Eye.Blinding.Systems;
index 5ea4393865b8d2834253e352a7d59a61f2314554..f25fb6254257750e8811bd54665402028ce5a1a3 100644 (file)
@@ -8,7 +8,7 @@ using Content.Server.Paper;
 using Content.Server.Popups;
 using Content.Server.Power.Components;
 using Content.Server.Tools;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Database;
index 6710864c729a1630fbab0c0cc535b8016719991c..be44f9e203bc5cf133258d717a37482eb52d7f88 100644 (file)
@@ -2,7 +2,7 @@ using System.Linq;
 using System.Text;
 using Content.Server.Paper;
 using Content.Server.Popups;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.DoAfter;
 using Content.Shared.Forensics;
 using Content.Shared.Hands.EntitySystems;
index 14be11324825a54271dc9d0739c780a94fc62af1..52525ee0d4c49b54915af67713b006d3fe313fea 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Gateway.Components;
 using Content.Server.Station.Systems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Systems;
 using Content.Shared.Gateway;
 using Content.Shared.Popups;
index 8b1f3b471c54701918e6436246e26d73c4fd08c8..621c583a558a5ba8f7d2d4a014ed526c722df7dd 100644 (file)
@@ -8,7 +8,7 @@ using Content.Server.Materials;
 using Content.Server.Power.Components;
 using Content.Server.Power.EntitySystems;
 using Content.Server.Stack;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.Emag.Components;
 using Content.Shared.Lathe;
index bfb2fbc6e164d8f6ebfa2bdab42e7ccfeb0cfaec..dfe398ebafa648b2654fb76e3cfe957b1cd6d2cb 100644 (file)
@@ -1,7 +1,8 @@
 using Content.Server.Lock.Components;
 using Content.Server.Popups;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Lock;
+using Content.Server.UserInterface;
 
 namespace Content.Server.Lock.EntitySystems;
 public sealed class ActivatableUIRequiresLockSystem : EntitySystem
index f6858e10a05eca5fc6974768a4d0967b4d31b2da..aef6e11d71c8ec1ff7f73f6d253895516ed58448 100644 (file)
@@ -1,7 +1,7 @@
 using System.Linq;
 using Content.Server.DoAfter;
 using Content.Server.Humanoid;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.DoAfter;
 using Content.Shared.Humanoid;
 using Content.Shared.Humanoid.Markings;
index 3fcec3a824cbfa4ba60e793e4ae3f5ecd0ea9059..e05dc2494fb6d9f627a825c4d5e3e45c33cf394f 100644 (file)
@@ -13,7 +13,7 @@ using Content.Server.NodeContainer.NodeGroups;
 using Content.Server.NodeContainer.Nodes;
 using Content.Server.Power.Components;
 using Content.Server.Temperature.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Chemistry;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Chemistry.Components.SolutionManager;
index 328990738e7da0bb9b76ca042553d36b2709537f..7761651f4ee314b781309df3053409a7364c437d 100644 (file)
@@ -1,12 +1,12 @@
-using Content.Server.Administration.Logs;
+using Content.Server.Administration.Logs;
 using Content.Server.GameTicking.Rules;
 using Content.Server.GameTicking.Rules.Components;
 using Content.Server.Popups;
-using Content.Server.UserInterface;
 using Content.Shared.CCVar;
 using Content.Shared.Chat;
 using Content.Shared.Database;
 using Content.Shared.NukeOps;
+using Content.Shared.UserInterface;
 using Robust.Server.GameObjects;
 using Robust.Shared.Configuration;
 
index 7525ad7cf39d95dc7fb34f017e57c0ef57f5e41e..f599bbdb6a5b7d17bf503558ca339a96ef70a87b 100644 (file)
@@ -1,7 +1,7 @@
 using System.Linq;
 using Content.Server.Administration.Logs;
 using Content.Server.Popups;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.Examine;
 using Content.Shared.Interaction;
index 5f32b4b06bd2592b56341041f0681413c24d399d..561b0e71f093c512bbaf18dd900a3eb13fbaa4f4 100644 (file)
@@ -1,8 +1,9 @@
 using Content.Shared.Popups;
 using Content.Server.Power.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using JetBrains.Annotations;
 using Content.Shared.Wires;
+using Content.Server.UserInterface;
 
 namespace Content.Server.Power.EntitySystems;
 
index 2cd3777c526de90eae8988e93f87e59c1a8eadfd..ace7d8ae31ade069cadf08dad9770eceab162d34 100644 (file)
@@ -6,7 +6,7 @@ using Content.Server.Power.EntitySystems;
 using Content.Server.Radio.Components;
 using Content.Server.Speech;
 using Content.Server.Speech.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Chat;
 using Content.Shared.Examine;
 using Content.Shared.Interaction;
index e802e2c7f9e9611bf41d1c033473c61fae9dc691..9f95fd25176a4d938d430580143b0b619b1e8ae3 100644 (file)
@@ -1,6 +1,6 @@
 using Content.Server.Power.EntitySystems;
 using Content.Server.Research.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Components;
 using Content.Shared.Research.Components;
 using Content.Shared.Research.Prototypes;
index 8a65e0a8bc770caa07cdb9fada1c1126b7e268ab..2064abd8ebf298cc9ea2999587d6b10fbc44b11f 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.Research.Systems;
+using Content.Server.Research.Systems;
 using Content.Server.Research.TechnologyDisk.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Research;
 using Content.Shared.Research.Components;
 using Robust.Server.Audio;
index 3b9a12a3310ca5bc71096eb372467c19630b5f43..37c70c4e486e544e7a32ac425110224a8cb81a09 100644 (file)
@@ -4,7 +4,7 @@ using Content.Server.DeviceNetwork.Components;
 using Content.Server.Screens.Components;
 using Content.Server.Shuttles.Components;
 using Content.Server.Shuttles.Events;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access;
 using Content.Shared.CCVar;
 using Content.Shared.Database;
index cef4faa13b2afddedaa703166b20f8e629159def..99ab54f9afa8dfb3d1466ae181b8bc90a912338a 100644 (file)
@@ -1,7 +1,7 @@
 using Content.Server.Shuttles.Components;
 using Content.Server.Shuttles.Events;
 using Content.Server.Station.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 
 namespace Content.Server.Shuttles.Systems;
 
index afe9d78a25cd5145cbfae06ffc9d48d7825403cf..18dd3b0baf04aaed763dc3aedec88496ae73ea28 100644 (file)
@@ -20,6 +20,7 @@ using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
+using Content.Shared.UserInterface;
 
 namespace Content.Server.Shuttles.Systems;
 
index fa551ebc37e6ffeccaf3f1fa0b12cdd1385e940e..8af682114c83feed1d7bf3f168078f35e42a3187 100644 (file)
@@ -1,5 +1,5 @@
-using System.Linq;
-using Content.Server.UserInterface;
+using System.Linq;
+using Content.Shared.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.NameIdentifier;
 using Content.Shared.PowerCell.Components;
index 4d7892c0b71ad3fd0f7544aeca46fa05ffd96b61..0efbe1a40ab7e52d5088e880b4588dc7ea71fb70 100644 (file)
@@ -1,9 +1,9 @@
-using Content.Server.Actions;
+using Content.Server.Actions;
 using Content.Server.Administration.Logs;
 using Content.Server.Administration.Managers;
 using Content.Server.Hands.Systems;
 using Content.Server.PowerCell;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Access.Systems;
 using Content.Shared.Alert;
 using Content.Shared.Database;
index 3c7713b305cac5eca67b69f8c161f327217f94e1..059800c3f9d7b8c1966427d2ab217c6af7667406 100644 (file)
@@ -1,6 +1,6 @@
-using Content.Server.Explosion.EntitySystems;
+using Content.Server.Explosion.EntitySystems;
 using Content.Server.Sound.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Sound;
 using Robust.Shared.Random;
 
index 32c9a050435bedbadf8805a2e8b4bc82685b401d..7599b08b3ce4049cb3bbdf52cdfd838e95966be7 100644 (file)
@@ -4,13 +4,12 @@ using Content.Server.Administration.Logs;
 using Content.Server.PDA.Ringer;
 using Content.Server.Stack;
 using Content.Server.Store.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.FixedPoint;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Store;
 using Robust.Server.GameObjects;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
index d5b17f440e9ce782da7ecf8651cbd3effa3eb218..67fbd4faf51074f87b34878127cc641e928dabb3 100644 (file)
@@ -1,5 +1,5 @@
 using Content.Server.Store.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.FixedPoint;
 using Content.Shared.Implants.Components;
 using Content.Shared.Interaction;
index 39dcb1a9e0fd213802d28502cfc7955fd500c3a3..cbc2f6d31ec3642b6d969f62fdfc72574a9d7209 100644 (file)
@@ -2,7 +2,7 @@ using System.Linq;
 using Content.Server.DeviceNetwork;
 using Content.Server.DeviceNetwork.Systems;
 using Content.Server.Power.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.SurveillanceCamera;
 using Robust.Server.GameObjects;
 using Robust.Shared.Player;
index 7c687aa3cd406e4b87c4fd437f096d59efbafa11..d4dcc91d46e8d303fb3ad6329a7c65d208584b4e 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Server.PowerCell;
 using Content.Shared.PowerCell;
+using Content.Shared.UserInterface;
 using Robust.Shared.Containers;
 
 namespace Content.Server.UserInterface;
index e3dad6335865bedbedbf8f1203b9180426b9eab9..387221e00ca1be92fa7af2b98b72c0689d19da40 100644 (file)
@@ -218,53 +218,3 @@ public sealed partial class ActivatableUISystem : EntitySystem
         CloseAll(uid, aui);
     }
 }
-
-public sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
-{
-    public EntityUid User { get; }
-    public ActivatableUIOpenAttemptEvent(EntityUid who)
-    {
-        User = who;
-    }
-}
-
-public sealed class UserOpenActivatableUIAttemptEvent : CancellableEntityEventArgs //have to one-up the already stroke-inducing name
-{
-    public EntityUid User { get; }
-    public EntityUid Target { get; }
-    public UserOpenActivatableUIAttemptEvent(EntityUid who, EntityUid target)
-    {
-        User = who;
-        Target = target;
-    }
-}
-
-public sealed class AfterActivatableUIOpenEvent : EntityEventArgs
-{
-    public EntityUid User { get; }
-    public readonly ICommonSession Session;
-
-    public AfterActivatableUIOpenEvent(EntityUid who, ICommonSession session)
-    {
-        User = who;
-        Session = session;
-    }
-}
-
-/// <summary>
-/// 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
-/// </summary>
-public sealed class BeforeActivatableUIOpenEvent : EntityEventArgs
-{
-    public EntityUid User { get; }
-    public BeforeActivatableUIOpenEvent(EntityUid who)
-    {
-        User = who;
-    }
-}
-
-public sealed class ActivatableUIPlayerChangedEvent : EntityEventArgs
-{
-}
index f2c7e6dd19b9ab4d7378b59f7a60859f79536f7e..9443b0b3948aa2f18e21ee0c8b22cd63e7047877 100644 (file)
@@ -18,6 +18,7 @@ using Content.Shared.Emag.Systems;
 using Content.Shared.Emp;
 using Content.Shared.Popups;
 using Content.Shared.Throwing;
+using Content.Shared.UserInterface;
 using Content.Shared.VendingMachines;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
index cb019e3d64a69faffdbe721290fd61dfa53b6fc1..5275a95c3402425baeaab79361c87b191596552b 100644 (file)
@@ -5,7 +5,7 @@ using Content.Server.Administration.Logs;
 using Content.Server.Construction;
 using Content.Server.Construction.Components;
 using Content.Server.Power.Components;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Shared.Database;
 using Content.Shared.DoAfter;
 using Content.Shared.GameTicking;
@@ -23,6 +23,7 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
+using Content.Server.UserInterface;
 
 namespace Content.Server.Wires;
 
index 2f0b5459d91e36c8f846463702cea9ebdcf6e097..51906313a32a25fd729f735fcfeb6b40d5446306 100644 (file)
@@ -1,9 +1,8 @@
 using System.Linq;
-using Content.Server.Construction;
 using Content.Server.Paper;
 using Content.Server.Power.Components;
 using Content.Server.Research.Systems;
-using Content.Server.UserInterface;
+using Content.Shared.UserInterface;
 using Content.Server.Xenoarchaeology.Equipment.Components;
 using Content.Server.Xenoarchaeology.XenoArtifacts;
 using Content.Server.Xenoarchaeology.XenoArtifacts.Events;
diff --git a/Content.Shared/Access/Components/ActivatableUIRequiresAccessComponent.cs b/Content.Shared/Access/Components/ActivatableUIRequiresAccessComponent.cs
new file mode 100644 (file)
index 0000000..342d182
--- /dev/null
@@ -0,0 +1,11 @@
+using Content.Shared.Access.Systems;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Access.Components;
+
+[RegisterComponent, NetworkedComponent, Access(typeof(ActivatableUIRequiresAccessSystem))]
+public sealed partial class ActivatableUIRequiresAccessComponent : Component
+{
+    [DataField]
+    public LocId? PopupMessage = "lock-comp-has-user-access-fail";
+}
diff --git a/Content.Shared/Access/Systems/ActivatableUIRequiresAccessSystem.cs b/Content.Shared/Access/Systems/ActivatableUIRequiresAccessSystem.cs
new file mode 100644 (file)
index 0000000..9020518
--- /dev/null
@@ -0,0 +1,31 @@
+using Content.Shared.Popups;
+using Content.Shared.UserInterface;
+using Content.Shared.Access.Components;
+
+namespace Content.Shared.Access.Systems;
+public sealed class ActivatableUIRequiresAccessSystem : EntitySystem
+{
+    [Dependency] private readonly AccessReaderSystem _access = default!;
+    [Dependency] private readonly SharedPopupSystem _popup = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<ActivatableUIRequiresAccessComponent, ActivatableUIOpenAttemptEvent>(OnUIOpenAttempt);
+    }
+
+    private void OnUIOpenAttempt(Entity<ActivatableUIRequiresAccessComponent> activatableUI, ref ActivatableUIOpenAttemptEvent args)
+    {
+        if (args.Cancelled)
+            return;
+
+        if (!_access.IsAllowed(args.User, activatableUI))
+        {
+            args.Cancel();
+            if (activatableUI.Comp.PopupMessage != null)
+                _popup.PopupClient(Loc.GetString(activatableUI.Comp.PopupMessage), activatableUI, args.User);
+        }
+    }
+}
+
diff --git a/Content.Shared/UserInterface/ActivatableUIEvents.cs b/Content.Shared/UserInterface/ActivatableUIEvents.cs
new file mode 100644 (file)
index 0000000..6e6b3f6
--- /dev/null
@@ -0,0 +1,52 @@
+using Robust.Shared.Player;
+
+namespace Content.Shared.UserInterface;
+public sealed class ActivatableUIOpenAttemptEvent : CancellableEntityEventArgs
+{
+    public EntityUid User { get; }
+    public ActivatableUIOpenAttemptEvent(EntityUid who)
+    {
+        User = who;
+    }
+}
+
+public sealed class UserOpenActivatableUIAttemptEvent : CancellableEntityEventArgs //have to one-up the already stroke-inducing name
+{
+    public EntityUid User { get; }
+    public EntityUid Target { get; }
+    public UserOpenActivatableUIAttemptEvent(EntityUid who, EntityUid target)
+    {
+        User = who;
+        Target = target;
+    }
+}
+
+public sealed class AfterActivatableUIOpenEvent : EntityEventArgs
+{
+    public EntityUid User { get; }
+    public readonly ICommonSession Session;
+
+    public AfterActivatableUIOpenEvent(EntityUid who, ICommonSession session)
+    {
+        User = who;
+        Session = session;
+    }
+}
+
+/// <summary>
+/// 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
+/// </summary>
+public sealed class BeforeActivatableUIOpenEvent : EntityEventArgs
+{
+    public EntityUid User { get; }
+    public BeforeActivatableUIOpenEvent(EntityUid who)
+    {
+        User = who;
+    }
+}
+
+public sealed class ActivatableUIPlayerChangedEvent : EntityEventArgs
+{
+}
index 7fb8ec771d8aa4b5978b8dd187baf0f6c3e2e1fd..2697e00a7000ea15ad307d94373b04d05a13ab19 100644 (file)
         acts: ["Breakage"]
   - type: ActivatableUI
     key: enum.AnomalyGeneratorUiKey.Key
+  - type: ActivatableUIRequiresAccess
   - type: ActivatableUIRequiresPower
   - type: UserInterface
     interfaces:
   - type: WiresVisuals
   - type: StaticPrice
     price: 5000
+  - type: AccessReader
+    access: [["Research"]]
   - type: GuideHelp
     guides:
     - AnomalousResearch