Make early launches a cvar (#10213)

Apparently our LRP playerbase sucks.
This commit is contained in:
metalgearsloth
2022-08-01 18:26:25 +10:00
committed by GitHub
parent 8701124195
commit 7d779018b9
3 changed files with 20 additions and 0 deletions

View File

@@ -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<EmergencyShuttleConsoleComponent, EmergencyShuttleAuthorizeMessage>(OnEmergencyAuthorize);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(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)