diff --git a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs index 7781254965..66825ed090 100644 --- a/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs +++ b/Content.Server/Shuttles/Systems/ShuttleSystem.EmergencyConsole.cs @@ -5,6 +5,7 @@ using Content.Server.RoundEnd; using Content.Server.Shuttles.Components; using Content.Server.Shuttles.Events; using Content.Server.Station.Components; +using Content.Server.UserInterface; using Content.Shared.Access.Systems; using Content.Shared.CCVar; using Content.Shared.Database; @@ -82,6 +83,18 @@ public sealed partial class ShuttleSystem SubscribeLocalEvent(OnEmergencyAuthorize); SubscribeLocalEvent(OnEmergencyRepeal); SubscribeLocalEvent(OnEmergencyRepealAll); + SubscribeLocalEvent(OnEmergencyOpenAttempt); + } + + private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args) + { + // I'm hoping ActivatableUI checks it's open before allowing these messages. + if (!_configManager.GetCVar(CCVars.EmergencyEarlyLaunchAllowed)) + { + args.Cancel(); + _popup.PopupEntity(Loc.GetString("emergency-shuttle-console-no-early-launches"), uid, Filter.Entities(args.User)); + return; + } } private void SetAuthorizeTime(float obj) diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 588469433d..f7bd265b7c 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -886,6 +886,12 @@ namespace Content.Shared.CCVar * Emergency */ + /// + /// Is the emergency shuttle allowed to be early launched. + /// + public static readonly CVarDef EmergencyEarlyLaunchAllowed = + CVarDef.Create("shuttle.emergency_early_launch_allowed", false, CVar.SERVERONLY); + /// /// How long the emergency shuttle remains docked with the station, in seconds. /// diff --git a/Resources/Locale/en-US/shuttles/emergency.ftl b/Resources/Locale/en-US/shuttles/emergency.ftl index e21f07ba79..d41adc09ad 100644 --- a/Resources/Locale/en-US/shuttles/emergency.ftl +++ b/Resources/Locale/en-US/shuttles/emergency.ftl @@ -18,6 +18,7 @@ emergency-shuttle-good-luck = The Emergency Shuttle is unable to find a station. emergency-shuttle-nearby = The Emergency Shuttle is unable to find a valid docking port. It has warped in {$direction} of the station. # Emergency shuttle console popup / announcement +emergency-shuttle-console-no-early-launches = Early launch is disabled emergency-shuttle-console-auth-left = {$remaining} authorizations needed until shuttle is launched early. emergency-shuttle-console-auth-revoked = Early launch authorization revoked, {$remaining} authorizations needed. emergency-shuttle-console-denied = Access denied