]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add CVar for disabling loadout item role timers (#36775)
authorCentronias <me@centronias.com>
Wed, 3 Sep 2025 11:04:44 +0000 (04:04 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Sep 2025 11:04:44 +0000 (13:04 +0200)
Content.Client/Lobby/LobbyUIController.cs
Content.IntegrationTests/PoolManager.Cvars.cs
Content.Shared/CCVar/CCVars.Game.cs
Content.Shared/Preferences/Loadouts/Effects/JobRequirementLoadoutEffect.cs
Resources/ConfigPresets/Build/development.toml

index 121e8dbe71f47aa4312aff3580d8bbd42343042e..ec052adea55a50deb02c8b27cd847191d6cc490b 100644 (file)
@@ -72,6 +72,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
         });
 
         _configurationManager.OnValueChanged(CCVars.GameRoleTimers, _ => RefreshProfileEditor());
+        _configurationManager.OnValueChanged(CCVars.GameRoleLoadoutTimers, _ => RefreshProfileEditor());
 
         _configurationManager.OnValueChanged(CCVars.GameRoleWhitelist, _ => RefreshProfileEditor());
     }
index 2c51bdbc3a3c9b3c3f02f0ca7239d910b7e80223..8cf2b626dc6fb33824d2da7820a49eaf89dc68d6 100644 (file)
@@ -21,6 +21,7 @@ public static partial class PoolManager
         (CCVars.NPCMaxUpdates.Name,           "999999"),
         (CVars.ThreadParallelCount.Name,      "1"),
         (CCVars.GameRoleTimers.Name,          "false"),
+        (CCVars.GameRoleLoadoutTimers.Name,   "false"),
         (CCVars.GameRoleWhitelist.Name,       "false"),
         (CCVars.GridFill.Name,                "false"),
         (CCVars.PreloadGrids.Name,            "false"),
index 00e6ff93aed19fbc0e525387ea194c579dceb789..7fad7b480d6f13c959a7af0f7a9115eb60a47584 100644 (file)
@@ -109,6 +109,12 @@ public sealed partial class CCVars
     public static readonly CVarDef<bool>
         GameRoleTimers = CVarDef.Create("game.role_timers", true, CVar.SERVER | CVar.REPLICATED);
 
+    /// <summary>
+    /// If role loadout items should be restricted based on time.
+    /// </summary>
+    public static readonly CVarDef<bool>
+        GameRoleLoadoutTimers = CVarDef.Create("game.role_loadout_timers", true, CVar.SERVER | CVar.REPLICATED);
+
     /// <summary>
     ///     Override default role requirements using a <see cref="JobRequirementOverridePrototype"/>
     /// </summary>
index 2f7e7b7c4877c0a64966a8b8b043ffed7be3d599..b9bf4b38bcd16bce6fdd088cbf982e4b975e28f9 100644 (file)
@@ -1,6 +1,8 @@
 using System.Diagnostics.CodeAnalysis;
+using Content.Shared.CCVar;
 using Content.Shared.Players.PlayTimeTracking;
 using Content.Shared.Roles;
+using Robust.Shared.Configuration;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Utility;
@@ -17,7 +19,10 @@ public sealed partial class JobRequirementLoadoutEffect : LoadoutEffect
 
     public override bool Validate(HumanoidCharacterProfile profile, RoleLoadout loadout, ICommonSession? session, IDependencyCollection collection, [NotNullWhen(false)] out FormattedMessage? reason)
     {
-        if (session == null)
+        var configurationManager = collection.Resolve<IConfigurationManager>();
+        var timersDisabled = !configurationManager.GetCVar(CCVars.GameRoleLoadoutTimers);
+
+        if (session == null || timersDisabled)
         {
             reason = FormattedMessage.Empty;
             return true;
index cad04c66c2056d01be013fbe9c76fcc464673e8d..7849124a1853d9684bf3e3036bc93808875e483f 100644 (file)
@@ -4,6 +4,7 @@ lobbyenabled = false
 # Dev map for faster loading & convenience
 map = "Dev"
 role_timers = false
+role_loadout_timers = false
 
 [events]
 enabled = false