Make the round end sound collection a cvar (#25741)

* Make the round end sound collection a cvar

* Fix comment

* Clarity
This commit is contained in:
DrSmugleaf
2024-03-01 02:08:48 -08:00
committed by GitHub
parent 0ba9df26a0
commit 30ccde0a47
3 changed files with 11 additions and 1 deletions

View File

@@ -26,6 +26,9 @@ namespace Content.Server.GameTicking
private WebhookIdentifier? _webhookIdentifier; private WebhookIdentifier? _webhookIdentifier;
[ViewVariables]
private string? RoundEndSoundCollection { get; set; }
#if EXCEPTION_TOLERANCE #if EXCEPTION_TOLERANCE
[ViewVariables] [ViewVariables]
public int RoundStartFailShutdownCount { get; private set; } = 0; public int RoundStartFailShutdownCount { get; private set; } = 0;
@@ -69,6 +72,7 @@ namespace Content.Server.GameTicking
DiscordRoundEndRole = null; DiscordRoundEndRole = null;
} }
}, true); }, true);
Subs.CVar(_configurationManager, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true);
#if EXCEPTION_TOLERANCE #if EXCEPTION_TOLERANCE
Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true); Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
#endif #endif

View File

@@ -392,7 +392,7 @@ namespace Content.Server.GameTicking
// This ordering mechanism isn't great (no ordering of minds) but functions // This ordering mechanism isn't great (no ordering of minds) but functions
var listOfPlayerInfoFinal = listOfPlayerInfo.OrderBy(pi => pi.PlayerOOCName).ToArray(); 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, RaiseNetworkEvent(new RoundEndMessageEvent(gamemodeTitle, roundEndText, roundDuration, RoundId,
listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal, LobbySong, sound)); listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal, LobbySong, sound));

View File

@@ -369,6 +369,12 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<string> SecretWeightPrototype = public static readonly CVarDef<string> SecretWeightPrototype =
CVarDef.Create("game.secret_weight_prototype", "Secret", CVar.SERVERONLY); 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 * Discord
*/ */