Adds lobby music (#3620)
* Adds lobby music * Add UI toggle for lobby music * Pick the song serverside so everyone gets the same song * Add more songs * Fixes * Catch-all end lobby music * Rename it * Catchall ambience cvar change * Wait until we receive the lobby song to start playing one * Fix toggling ready status resetting the song * Comment * Expend the last of my sanity fixing latejoin lobby music * Update Content.Client/GameObjects/EntitySystems/BackgroundAudioSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/EntitySystems/BackgroundAudioSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update Content.Client/GameObjects/EntitySystems/BackgroundAudioSystem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Move the var Co-authored-by: ike709 <sparebytes@protonmail.com> Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -91,6 +91,7 @@ namespace Content.Shared.GameTicking
|
||||
#endregion
|
||||
|
||||
public bool IsRoundStarted { get; set; }
|
||||
public string? LobbySong { get; set; }
|
||||
public bool YouAreReady { get; set; }
|
||||
// UTC.
|
||||
public TimeSpan StartTime { get; set; }
|
||||
@@ -99,6 +100,7 @@ namespace Content.Shared.GameTicking
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
||||
{
|
||||
IsRoundStarted = buffer.ReadBoolean();
|
||||
LobbySong = buffer.ReadString();
|
||||
|
||||
if (IsRoundStarted)
|
||||
{
|
||||
@@ -108,11 +110,13 @@ namespace Content.Shared.GameTicking
|
||||
YouAreReady = buffer.ReadBoolean();
|
||||
StartTime = new TimeSpan(buffer.ReadInt64());
|
||||
Paused = buffer.ReadBoolean();
|
||||
|
||||
}
|
||||
|
||||
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
||||
{
|
||||
buffer.Write(IsRoundStarted);
|
||||
buffer.Write(LobbySong);
|
||||
|
||||
if (IsRoundStarted)
|
||||
{
|
||||
@@ -122,6 +126,7 @@ namespace Content.Shared.GameTicking
|
||||
buffer.Write(YouAreReady);
|
||||
buffer.Write(StartTime.Ticks);
|
||||
buffer.Write(Paused);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user