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

@@ -15,7 +15,8 @@ public sealed class AnimatedBackgroundControl : TextureRect
[Dependency] private readonly IClyde _clyde = 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 IRenderTexture? _buffer;
@@ -34,11 +35,11 @@ public sealed class AnimatedBackgroundControl : TextureRect
private void InitializeStates()
{
var rsi = _resourceCache.GetResource<RSIResource>(_rsiPath).RSI;
_RSI ??= _resourceCache.GetResource<RSIResource>(_rsiPath).RSI;
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;
_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)
{
base.FrameUpdate(args);