mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* PopupClient to PopupEntity/Coordinates * PopupPredictedX to PopupEntity/Cursor/Coordinates * The rest of the damn owl * nullability fixes * Buckle cleanup * cleanup, address PR comments * ExecutionSystem: one popup method * correct my filthy lies * Apply most of ajcm's suggestions * return user to SharedItemRecallSystem.cs * Fix lingering Ensnarable broadcast popups * targeted drain popups * fix lingering untargeted Guardian popups I read the comment on GuardianHostRecall. Oops. * target stethoscope popups * fix the PDA vibration popup * Fix target for encryption key removal popup * anomaly scanner: args.User, not uid * disposal unit comment, bcast pda vibration popup
28 lines
921 B
C#
28 lines
921 B
C#
using Content.Shared.Popups;
|
|
using Content.Shared.Whitelist;
|
|
|
|
namespace Content.Shared.Lock;
|
|
|
|
public sealed partial class LockingWhitelistSystem : EntitySystem
|
|
{
|
|
[Dependency] private EntityWhitelistSystem _whitelistSystem = default!;
|
|
[Dependency] private SharedPopupSystem _popupSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<LockingWhitelistComponent, UserLockToggleAttemptEvent>(OnUserLockToggleAttempt);
|
|
}
|
|
|
|
private void OnUserLockToggleAttempt(Entity<LockingWhitelistComponent> ent, ref UserLockToggleAttemptEvent args)
|
|
{
|
|
if (_whitelistSystem.CheckBoth(args.Target, ent.Comp.Blacklist, ent.Comp.Whitelist))
|
|
return;
|
|
|
|
if (!args.Silent)
|
|
_popupSystem.PopupEntity(Loc.GetString("locking-whitelist-component-lock-toggle-deny"), ent.Owner, ent.Owner);
|
|
|
|
args.Cancelled = true;
|
|
}
|
|
}
|