lobby update (#554)

This commit is contained in:
ThereDrD0
2024-08-04 11:43:00 +03:00
committed by GitHub
parent 1fbb613f8a
commit 0ce44fbe64
28 changed files with 794 additions and 131 deletions

View File

@@ -14,6 +14,7 @@ using Content.Client.UserInterface.Systems.Chat;
using Content.Client.Voting; using Content.Client.Voting;
using Robust.Client; using Robust.Client;
using Robust.Client.Console; using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
@@ -206,6 +207,7 @@ namespace Content.Client.Lobby
private void LobbyStatusUpdated() private void LobbyStatusUpdated()
{ {
UpdateLobbyUi(); UpdateLobbyUi();
UpdateLobbyBackground();
} }
private void LobbyLateJoinStatusUpdated() private void LobbyLateJoinStatusUpdated()
@@ -278,14 +280,7 @@ namespace Content.Client.Lobby
private void UpdateLobbyBackground() private void UpdateLobbyBackground()
{ {
if (_gameTicker.LobbyBackground != null) if (_gameTicker.LobbyBackground != null)
{ _lobby!.Background.SetRSI(_resourceCache.GetResource<RSIResource>(_gameTicker.LobbyBackground).RSI);
_lobby!.Background.Texture = _resourceCache.GetResource<TextureResource>(_gameTicker.LobbyBackground );
}
else
{
_lobby!.Background.Texture = null;
}
} }
private void SetReady(bool newReady) private void SetReady(bool newReady)

View File

@@ -15,7 +15,8 @@ public sealed class AnimatedBackgroundControl : TextureRect
[Dependency] private readonly IClyde _clyde = default!; [Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private string _rsiPath = "/Textures/Ohio/Lobby/backgrounds/native.rsi"; private string _rsiPath = "/Textures/White/Lobby/backgrounds/native.rsi";
public RSI? _RSI;
private const int States = 1; private const int States = 1;
private IRenderTexture? _buffer; private IRenderTexture? _buffer;
@@ -34,11 +35,11 @@ public sealed class AnimatedBackgroundControl : TextureRect
private void InitializeStates() private void InitializeStates()
{ {
var rsi = _resourceCache.GetResource<RSIResource>(_rsiPath).RSI; _RSI ??= _resourceCache.GetResource<RSIResource>(_rsiPath).RSI;
for (var i = 0; i < States; i++) for (var i = 0; i < States; i++)
{ {
if (!rsi.TryGetState((i + 1).ToString(), out var state)) if (!_RSI.TryGetState((i + 1).ToString(), out var state))
continue; continue;
_frames[i] = state.GetFrames(RsiDirection.South); _frames[i] = state.GetFrames(RsiDirection.South);
@@ -47,6 +48,12 @@ public sealed class AnimatedBackgroundControl : TextureRect
} }
} }
public void SetRSI(RSI? rsi)
{
_RSI = rsi;
InitializeStates();
}
protected override void FrameUpdate(FrameEventArgs args) protected override void FrameUpdate(FrameEventArgs args)
{ {
base.FrameUpdate(args); base.FrameUpdate(args);

View File

@@ -15,7 +15,7 @@ namespace Content.Server.Audio;
public sealed class ContentAudioSystem : SharedContentAudioSystem public sealed class ContentAudioSystem : SharedContentAudioSystem
{ {
[ValidatePrototypeId<SoundCollectionPrototype>] [ValidatePrototypeId<SoundCollectionPrototype>]
private const string LobbyMusicCollection = "LobbyMusicSongs"; private const string LobbyMusicCollection = "LobbyMusicWhitePack";
[Dependency] private readonly AudioSystem _serverAudio = default!; [Dependency] private readonly AudioSystem _serverAudio = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!;

View File

@@ -1,7 +1,6 @@
using Content.Server.GameTicking.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Utility;
using System.Linq; using System.Linq;
using Content.Shared._White;
namespace Content.Server.GameTicking; namespace Content.Server.GameTicking;
@@ -11,21 +10,19 @@ public sealed partial class GameTicker
public string? LobbyBackground { get; private set; } public string? LobbyBackground { get; private set; }
[ViewVariables] [ViewVariables]
private List<ResPath>? _lobbyBackgrounds; private List<string>? _lobbyBackgrounds;
private static readonly string[] WhitelistedBackgroundExtensions = new string[] {"png", "jpg", "jpeg", "webp"};
private void InitializeLobbyBackground() private void InitializeLobbyBackground()
{ {
_lobbyBackgrounds = _prototypeManager.EnumeratePrototypes<LobbyBackgroundPrototype>() _lobbyBackgrounds = _prototypeManager.EnumeratePrototypes<AnimatedLobbyScreenPrototype>()
.Select(x => x.Background) .Select(x => x.Path)
.Where(x => WhitelistedBackgroundExtensions.Contains(x.Extension))
.ToList(); .ToList();
RandomizeLobbyBackground(); RandomizeLobbyBackground();
} }
private void RandomizeLobbyBackground() { private void RandomizeLobbyBackground()
LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!).ToString() : null; {
LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!) : null;
} }
} }

View File

@@ -5,13 +5,13 @@ namespace Content.Shared._White;
/// <summary> /// <summary>
/// This is a prototype for... /// This is a prototype for...
/// </summary> /// </summary>
[Prototype("animatedLobbyScreen")] [Prototype]
public sealed partial class AnimatedLobbyScreenPrototype : IPrototype public sealed partial class AnimatedLobbyScreenPrototype : IPrototype
{ {
/// <inheritdoc/> /// <inheritdoc/>
[IdDataField] [IdDataField]
public string ID { get; } = default!; public string ID { get; } = default!;
[DataField("path")] [DataField(required: true)]
public string Path { get; private set; } = string.Empty; public string Path = default!;
} }

View File

@@ -32,6 +32,21 @@
- /Audio/Lobby/White/Spac_Stac.ogg - /Audio/Lobby/White/Spac_Stac.ogg
- /Audio/Lobby/White/comet_haley.ogg - /Audio/Lobby/White/comet_haley.ogg
- type: soundCollection
id: LobbyMusicWhitePack
files:
- /Audio/Lobby/White/thunderdome.ogg
- /Audio/Lobby/White/singuloose.ogg
- /Audio/Lobby/White/lasers_rip_apart_the_bulkhead.ogg
- /Audio/Lobby/White/every_light_is_blinking_at_once.ogg
- /Audio/Lobby/White/atomicamnesiammx.ogg
- /Audio/Lobby/White/Spac_Stac.ogg
- /Audio/Lobby/White/comet_haley.ogg
- /Audio/Lobby/Songs/CirclesAroundTheSun.ogg
- /Audio/Lobby/Songs/SpaceOddity.ogg
- /Audio/Lobby/Songs/SpaceAsshole.ogg
- /Audio/Lobby/Songs/SpaceShuttle.ogg
- type: soundCollection - type: soundCollection
id: LobbyMusicSS13 id: LobbyMusicSS13
files: files:

View File

@@ -1,18 +1,30 @@
- type: animatedLobbyScreen - type: animatedLobbyScreen
id: FourthLobbyScreen id: SeaLobbyScreen
path: Ohio/Lobby/backgrounds/papich.rsi path: /Textures/White/Lobby/backgrounds/sea.rsi
- type: animatedLobbyScreen
id: RocketLobbyScreen
path: /Textures/White/Lobby/backgrounds/rocket.rsi
- type: animatedLobbyScreen
id: CubeLobbyScreen
path: /Textures/White/Lobby/backgrounds/cube.rsi
- type: animatedLobbyScreen - type: animatedLobbyScreen
id: MilkywayLobbyScreen id: MilkywayLobbyScreen
path: Ohio/Lobby/backgrounds/4.rsi path: /Textures/White/Lobby/backgrounds/milkyway.rsi
- type: animatedLobbyScreen
id: SusLobbyScreen
path: Ohio/Lobby/backgrounds/syndicate.rsi
#- type: animatedLobbyScreen #- type: animatedLobbyScreen
# id: NativeLobbyScreen # id: NativeLobbyScreen
# path: Ohio/Lobby/backgrounds/native.rsi # path: White/Lobby/backgrounds/native.rsi
- type: animatedLobbyScreen
id: CentcommLobbyScreen
path: /Textures/White/Lobby/backgrounds/centcomm.rsi
- type: animatedLobbyScreen
id: VangoghLobbyScreen
path: /Textures/White/Lobby/backgrounds/vangogh.rsi
#- type: animatedLobbyScreen #- type: animatedLobbyScreen
# id: ThirdLobbyScreen # id: ThirdLobbyScreen

View File

@@ -1,98 +0,0 @@
{
"version": 1,
"license": null,
"copyright": null,
"size": {
"x": 498,
"y": 280
},
"states": [
{
"name": "1",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
}
]
}

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 2.3 MiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 MiB

After

Width:  |  Height:  |  Size: 14 MiB

View File

@@ -0,0 +1,494 @@
{
"version": 1,
"license": null,
"copyright": null,
"size": {
"x": 355,
"y": 281
},
"states": [
{
"name": "1",
"delays": [
[
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03,
0.03
]
]
}
]
}

View File

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 272 KiB

View File

Before

Width:  |  Height:  |  Size: 909 KiB

After

Width:  |  Height:  |  Size: 909 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

View File

@@ -0,0 +1,28 @@
{
"version": 1,
"license": null,
"copyright": null,
"size": {
"x": 960,
"y": 540
},
"states": [
{
"name": "1",
"delays": [
[
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1,
0.1
]
]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 MiB

View File

@@ -0,0 +1,213 @@
{
"version": 1,
"license": null,
"copyright": null,
"size": {
"x": 498,
"y": 280
},
"states": [
{
"name": "1",
"delays": [
[
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05,
0.05
]
]
}
]
}

View File

Before

Width:  |  Height:  |  Size: 664 KiB

After

Width:  |  Height:  |  Size: 664 KiB

View File

Before

Width:  |  Height:  |  Size: 14 MiB

After

Width:  |  Height:  |  Size: 14 MiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB