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
36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using Content.Shared.CCVar;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Shuttles.Components;
|
|
using Content.Shared.UserInterface;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Shared.Shuttles.Systems;
|
|
|
|
public abstract partial class SharedEmergencyShuttleSystem : EntitySystem
|
|
{
|
|
[Dependency] protected IConfigurationManager ConfigManager = default!;
|
|
[Dependency] protected SharedPopupSystem Popup = default!;
|
|
|
|
private bool _emergencyEarlyLaunchAllowed;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt);
|
|
|
|
Subs.CVar(ConfigManager, CCVars.EmergencyEarlyLaunchAllowed, value => _emergencyEarlyLaunchAllowed = value, true);
|
|
}
|
|
|
|
private void OnEmergencyOpenAttempt(Entity<EmergencyShuttleConsoleComponent> ent, ref ActivatableUIOpenAttemptEvent args)
|
|
{
|
|
// I'm hoping ActivatableUI checks it's open before allowing these messages.
|
|
if (_emergencyEarlyLaunchAllowed)
|
|
return;
|
|
|
|
args.Cancel();
|
|
|
|
if (!args.Silent)
|
|
Popup.PopupEntity(Loc.GetString("emergency-shuttle-console-no-early-launches"), ent, args.User);
|
|
}
|
|
}
|