* Changed LobbyMusiccollection over to a Cvar and edited ContentAudioSystem.cs to use Cvar Values * Addedd Ability to modify the lobbyMusiccollection from the command line * Fixed changing lobby music while in the round * Deleted uneeded duplicate line * Removed additional duplicate lobbyplaylist line * Alphabatized imports and refactored to use Subs.CVar * Added error checking and default behaviour to CVar sub. * Refactored to use TryIndex and Allowed for a empty soundcollection when a sound collection is not found. Edited Cvar comment to reflect changes. * Made _lobbyMusicCollection nullable and addedd handling for null case where used. Also Changed LobbyMusicCollection Cvar over to audio rather than ambience. * Update Content.Server/Audio/ContentAudioSystem.cs --------- Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
70 lines
2.8 KiB
C#
70 lines
2.8 KiB
C#
using Content.Shared.Administration;
|
|
using Content.Shared.CCVar.CVarAccess;
|
|
using Robust.Shared.Configuration;
|
|
|
|
namespace Content.Shared.CCVar;
|
|
|
|
public sealed partial class CCVars
|
|
{
|
|
/// <summary>
|
|
/// How long we'll wait until re-sampling nearby objects for ambience. Should be pretty fast, but doesn't have to match the tick rate.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> AmbientCooldown =
|
|
CVarDef.Create("ambience.cooldown", 0.1f, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// How large of a range to sample for ambience.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> AmbientRange =
|
|
CVarDef.Create("ambience.range", 8f, CVar.REPLICATED | CVar.SERVER);
|
|
|
|
/// <summary>
|
|
/// Maximum simultaneous ambient sounds.
|
|
/// </summary>
|
|
public static readonly CVarDef<int> MaxAmbientSources =
|
|
CVarDef.Create("ambience.max_sounds", 16, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// The minimum value the user can set for ambience.max_sounds
|
|
/// </summary>
|
|
public static readonly CVarDef<int> MinMaxAmbientSourcesConfigured =
|
|
CVarDef.Create("ambience.min_max_sounds_configured", 16, CVar.REPLICATED | CVar.SERVER | CVar.CHEAT);
|
|
|
|
/// <summary>
|
|
/// The maximum value the user can set for ambience.max_sounds
|
|
/// </summary>
|
|
public static readonly CVarDef<int> MaxMaxAmbientSourcesConfigured =
|
|
CVarDef.Create("ambience.max_max_sounds_configured", 64, CVar.REPLICATED | CVar.SERVER | CVar.CHEAT);
|
|
|
|
/// <summary>
|
|
/// Ambience volume.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> AmbienceVolume =
|
|
CVarDef.Create("ambience.volume", 1.5f, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// Ambience music volume.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> AmbientMusicVolume =
|
|
CVarDef.Create("ambience.music_volume", 1.5f, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// Lobby / round end music volume.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> LobbyMusicVolume =
|
|
CVarDef.Create("ambience.lobby_music_volume", 0.50f, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// UI volume.
|
|
/// </summary>
|
|
public static readonly CVarDef<float> InterfaceVolume =
|
|
CVarDef.Create("audio.interface_volume", 0.50f, CVar.ARCHIVE | CVar.CLIENTONLY);
|
|
|
|
/// <summary>
|
|
/// Lobby music collection string
|
|
/// </summary>
|
|
[CVarControl(AdminFlags.VarEdit)]
|
|
public static readonly CVarDef<string> LobbyMusicCollection =
|
|
CVarDef.Create("audio.lobby_music_collection", "LobbyMusic", CVar.REPLICATED | CVar.SERVER);
|
|
}
|