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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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
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;
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;
-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;
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;
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;
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;
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;
-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;
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;
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;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
+using Content.Shared.UserInterface;
namespace Content.Server.Shuttles.Systems;
-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;
-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;
-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;
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;
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;
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;
using Content.Server.PowerCell;
using Content.Shared.PowerCell;
+using Content.Shared.UserInterface;
using Robust.Shared.Containers;
namespace Content.Server.UserInterface;
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
-{
-}
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;
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;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
+using Content.Server.UserInterface;
namespace Content.Server.Wires;
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;
--- /dev/null
+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";
+}
--- /dev/null
+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);
+ }
+ }
+}
+
--- /dev/null
+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
+{
+}
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