2022-03-13 19:33:19 -07:00
|
|
|
using Robust.Shared.Random;
|
2022-05-12 22:35:13 -07:00
|
|
|
using System.Linq;
|
2024-08-04 11:43:00 +03:00
|
|
|
using Content.Shared._White;
|
2022-03-13 19:33:19 -07:00
|
|
|
|
|
|
|
|
namespace Content.Server.GameTicking;
|
|
|
|
|
|
|
|
|
|
public sealed partial class GameTicker
|
|
|
|
|
{
|
|
|
|
|
[ViewVariables]
|
|
|
|
|
public string? LobbyBackground { get; private set; }
|
|
|
|
|
|
|
|
|
|
[ViewVariables]
|
2024-08-04 11:43:00 +03:00
|
|
|
private List<string>? _lobbyBackgrounds;
|
2022-03-13 19:33:19 -07:00
|
|
|
|
|
|
|
|
private void InitializeLobbyBackground()
|
|
|
|
|
{
|
2024-08-04 11:43:00 +03:00
|
|
|
_lobbyBackgrounds = _prototypeManager.EnumeratePrototypes<AnimatedLobbyScreenPrototype>()
|
|
|
|
|
.Select(x => x.Path)
|
2022-04-14 23:00:59 -05:00
|
|
|
.ToList();
|
|
|
|
|
|
2022-04-16 17:23:22 -05:00
|
|
|
RandomizeLobbyBackground();
|
2022-03-13 19:33:19 -07:00
|
|
|
}
|
|
|
|
|
|
2024-08-04 11:43:00 +03:00
|
|
|
private void RandomizeLobbyBackground()
|
|
|
|
|
{
|
|
|
|
|
LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!) : null;
|
2022-04-16 17:23:22 -05:00
|
|
|
}
|
2022-03-13 19:33:19 -07:00
|
|
|
}
|