]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make the round end sound collection a cvar (#25741)
authorDrSmugleaf <DrSmugleaf@users.noreply.github.com>
Fri, 1 Mar 2024 10:08:48 +0000 (02:08 -0800)
committerGitHub <noreply@github.com>
Fri, 1 Mar 2024 10:08:48 +0000 (21:08 +1100)
* Make the round end sound collection a cvar

* Fix comment

* Clarity

Content.Server/GameTicking/GameTicker.CVars.cs
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Shared/CCVar/CCVars.cs

index 6e1fda3e2d702363f0a0a934a2ef524f12d4865f..60ffa660f57105cefc2cab9ceb028dcc23e7a4af 100644 (file)
@@ -26,6 +26,9 @@ namespace Content.Server.GameTicking
 
         private WebhookIdentifier? _webhookIdentifier;
 
+        [ViewVariables]
+        private string? RoundEndSoundCollection { get; set; }
+
 #if EXCEPTION_TOLERANCE
         [ViewVariables]
         public int RoundStartFailShutdownCount { get; private set; } = 0;
@@ -69,6 +72,7 @@ namespace Content.Server.GameTicking
                     DiscordRoundEndRole = null;
                 }
             }, true);
+            Subs.CVar(_configurationManager, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true);
 #if EXCEPTION_TOLERANCE
             Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
 #endif
index ffe26aeb346ad3868a69022d1a8dc2582c78c84e..69624ed5b2803a637e55c2d30258b1b94fb2a650 100644 (file)
@@ -392,7 +392,7 @@ namespace Content.Server.GameTicking
 
             // This ordering mechanism isn't great (no ordering of minds) but functions
             var listOfPlayerInfoFinal = listOfPlayerInfo.OrderBy(pi => pi.PlayerOOCName).ToArray();
-            var sound = _audio.GetSound(new SoundCollectionSpecifier("RoundEnd"));
+            var sound = RoundEndSoundCollection == null ? null : _audio.GetSound(new SoundCollectionSpecifier(RoundEndSoundCollection));
 
             RaiseNetworkEvent(new RoundEndMessageEvent(gamemodeTitle, roundEndText, roundDuration, RoundId,
                 listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal, LobbySong, sound));
index 01dc84c167d272b9da7d40683d9eee8734aa8d62..bfb7081bcb76239de02a66996f03183947e2e8d0 100644 (file)
@@ -369,6 +369,12 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<string> SecretWeightPrototype =
             CVarDef.Create("game.secret_weight_prototype", "Secret", CVar.SERVERONLY);
 
+        /// <summary>
+        /// The id of the sound collection to randomly choose a sound from and play when the round ends.
+        /// </summary>
+        public static readonly CVarDef<string> RoundEndSoundCollection =
+            CVarDef.Create("game.round_end_sound_collection", "RoundEnd", CVar.SERVERONLY);
+
         /*
          * Discord
          */