Files
wwdpublic/Content.Server/GameTicking/GameTicker.LobbyBackground.cs
2025-01-21 14:57:03 +03:00

25 lines
758 B
C#

using Robust.Shared.Random;
using System.Linq;
using Content.Shared._White;
namespace Content.Server.GameTicking;
public sealed partial class GameTicker
{
[ViewVariables]
public AnimatedLobbyScreenPrototype? AnimatedLobbyScreen { get; private set; } // WD EDIT
[ViewVariables]
private List<AnimatedLobbyScreenPrototype> _lobbyBackgrounds = []; // WD EDIT
private void InitializeLobbyBackground()
{
_lobbyBackgrounds = _prototypeManager.EnumeratePrototypes<AnimatedLobbyScreenPrototype>() // WD EDIT
.ToList();
RandomizeLobbyBackground();
}
private void RandomizeLobbyBackground() => AnimatedLobbyScreen = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!) : null; // WD EDIT
}