Переименованы прототипы и пути для фоновых изображений лобби, добавлен новый LobbyArtPrototype, внедрена поддержка разных типов фонов (арт, анимация, параллакс).

This commit is contained in:
Vigers Ray 2026-01-07 13:07:27 +01:00
parent 0db1dedb54
commit 2136b0b9f9
7 changed files with 202 additions and 136 deletions

View file

@ -410,16 +410,22 @@ namespace Content.Client.Lobby
Lobby!.LobbyAnimation.Visible = false;
Lobby!.LobbyArt.Visible = false;
Lobby!.ShowParallax = true;
// Load parallax background
UpdateLobbyParallax();
break;
case LobbyBackgroundType.Art:
Lobby!.LobbyAnimation.Visible = false;
Lobby!.LobbyArt.Visible = true;
Lobby!.ShowParallax = false;
// Load art background
UpdateLobbyArt();
break;
case LobbyBackgroundType.Animation:
Lobby!.LobbyAnimation.Visible = true;
Lobby!.LobbyArt.Visible = false;
Lobby!.ShowParallax = false;
// Load animation background
UpdateLobbyAnimation();
break;
}
}
@ -562,7 +568,7 @@ namespace Content.Client.Lobby
return;
}
if (!_protoMan.TryIndex<LobbyBackgroundPrototype>(lobbyArt, out var lobbyArtPrototype))
if (!_protoMan.TryIndex<LobbyArtPrototype>(lobbyArt, out var lobbyArtPrototype))
return;
if (Lobby == null)
@ -577,7 +583,7 @@ namespace Content.Client.Lobby
UnloadResource(_currentArtPath.Value);
}
var imagePath = lobbyArtPrototype.Background.ToString();
var imagePath = lobbyArtPrototype.Background;
// Check if resource is available, request if not
var isAvailable = _netTexturesManager.EnsureResource(imagePath);
@ -664,26 +670,56 @@ namespace Content.Client.Lobby
private void UpdateLobbyAnimation()
{
if (_cfg.GetCVar(SunriseCCVars.LobbyAnimation) != "Random")
return;
SetLobbyAnimation(_gameTicker.LobbyAnimation!);
var animationSetting = _cfg.GetCVar(SunriseCCVars.LobbyAnimation);
if (animationSetting == "Random")
{
// For Random, use the game ticker's selected animation
if (_gameTicker.LobbyAnimation != null)
{
SetLobbyAnimation(_gameTicker.LobbyAnimation);
}
}
else
{
// For specific animation, use the setting
SetLobbyAnimation(animationSetting);
}
}
private void UpdateLobbyArt()
{
if (_cfg.GetCVar(SunriseCCVars.LobbyArt) != "Random")
return;
SetLobbyArt(_gameTicker.LobbyArt!);
var artSetting = _cfg.GetCVar(SunriseCCVars.LobbyArt);
if (artSetting == "Random")
{
// For Random, use the game ticker's selected art
if (_gameTicker.LobbyArt != null)
{
SetLobbyArt(_gameTicker.LobbyArt);
}
}
else
{
// For specific art, use the setting
SetLobbyArt(artSetting);
}
}
private void UpdateLobbyParallax()
{
if (_cfg.GetCVar(SunriseCCVars.LobbyParallax) != "Random")
return;
SetLobbyParallax(_gameTicker.LobbyParallax!);
var parallaxSetting = _cfg.GetCVar(SunriseCCVars.LobbyParallax);
if (parallaxSetting == "Random")
{
// For Random, use the game ticker's selected parallax
if (_gameTicker.LobbyParallax != null)
{
SetLobbyParallax(_gameTicker.LobbyParallax);
}
}
else
{
// For specific parallax, use the setting
SetLobbyParallax(parallaxSetting);
}
}
private void OnNetworkResourceLoaded(string resourcePath)

View file

@ -72,7 +72,7 @@ public sealed partial class ExtraTab : Control
var layoutLoc = Loc.GetString($"lobby-parallax-{lobbyParallax.ID}");
lobbyParallaxes.Add(new OptionDropDownCVar<string>.ValueOption(lobbyParallax.ID, layoutLoc));
}
var lobbyArtsPrototypes = _prototypeManager.EnumeratePrototypes<LobbyBackgroundPrototype>();
var lobbyArtsPrototypes = _prototypeManager.EnumeratePrototypes<LobbyArtPrototype>();
foreach (var lobbyArt in lobbyArtsPrototypes)
{
var layoutLoc = Loc.GetString($"lobby-art-{lobbyArt.ID}");

View file

@ -29,7 +29,7 @@ public sealed partial class GameTicker
private void InitializeLobbyBackground()
{
_lobbyArts = _prototypeManager.EnumeratePrototypes<LobbyBackgroundPrototype>()
_lobbyArts = _prototypeManager.EnumeratePrototypes<LobbyArtPrototype>()
.Select(x => x.ID)
.ToList();

View file

@ -0,0 +1,30 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._Sunrise.Lobby;
[Prototype]
public sealed partial class LobbyArtPrototype : IPrototype
{
/// <inheritdoc/>
[IdDataField]
public string ID { get; set; } = default!;
/// <summary>
/// The sprite path to use as the background. This should ideally be 1920x1080.
/// </summary>
[DataField("background", required: true)]
public string Background = default!;
/// <summary>
/// The title of the background to be displayed in the lobby.
/// </summary>
[DataField]
public LocId Title = "lobby-state-background-unknown-title";
/// <summary>
/// The artist who made the art for the background.
/// </summary>
[DataField]
public LocId Artist = "lobby-state-background-unknown-artist";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View file

@ -1,191 +1,191 @@
- type: lobbyBackground
- type: lobbyArt
id: BarLife
background: NetTextures/Lobby/Arts/bar-life.webp
background: /NetTextures/Lobby/Arts/bar-life.webp
- type: lobbyBackground
- type: lobbyArt
id: DeadInSpace
background: NetTextures/Lobby/Arts/dead-in-space.webp
background: /NetTextures/Lobby/Arts/dead-in-space.webp
- type: lobbyBackground
- type: lobbyArt
id: Engineer
background: NetTextures/Lobby/Arts/engineer.webp
background: /NetTextures/Lobby/Arts/engineer.webp
- type: lobbyBackground
- type: lobbyArt
id: BeerSlime
background: NetTextures/Lobby/Arts/beerslime.webp
background: /NetTextures/Lobby/Arts/beerslime.webp
- type: lobbyBackground
- type: lobbyArt
id: Deadsquad
background: NetTextures/Lobby/Arts/deadsquad.webp
background: /NetTextures/Lobby/Arts/deadsquad.webp
- type: lobbyBackground
- type: lobbyArt
id: EngineersChill
background: NetTextures/Lobby/Arts/engineers-chill.webp
background: /NetTextures/Lobby/Arts/engineers-chill.webp
- type: lobbyBackground
- type: lobbyArt
id: IntoSpace
background: NetTextures/Lobby/Arts/into-space.webp
background: /NetTextures/Lobby/Arts/into-space.webp
- type: lobbyBackground
- type: lobbyArt
id: Jailbreak
background: NetTextures/Lobby/Arts/jailbreak.webp
background: /NetTextures/Lobby/Arts/jailbreak.webp
- type: lobbyBackground
- type: lobbyArt
id: Kosmologistika
background: NetTextures/Lobby/Arts/kosmologistika.webp
background: /NetTextures/Lobby/Arts/kosmologistika.webp
- type: lobbyBackground
- type: lobbyArt
id: LizardBar
background: NetTextures/Lobby/Arts/lizard-bar.webp
background: /NetTextures/Lobby/Arts/lizard-bar.webp
- type: lobbyBackground
- type: lobbyArt
id: Lofi
background: NetTextures/Lobby/Arts/lofi.webp
background: /NetTextures/Lobby/Arts/lofi.webp
- type: lobbyBackground
- type: lobbyArt
id: MaintenanceClown
background: NetTextures/Lobby/Arts/maintenance-clown.webp
background: /NetTextures/Lobby/Arts/maintenance-clown.webp
- type: lobbyBackground
- type: lobbyArt
id: NukiesHere
background: NetTextures/Lobby/Arts/nukies-here.webp
background: /NetTextures/Lobby/Arts/nukies-here.webp
- type: lobbyBackground
- type: lobbyArt
id: RegularShift
background: NetTextures/Lobby/Arts/regular-shift.webp
background: /NetTextures/Lobby/Arts/regular-shift.webp
- type: lobbyBackground
- type: lobbyArt
id: Singulord
background: NetTextures/Lobby/Arts/singulord.webp
background: /NetTextures/Lobby/Arts/singulord.webp
- type: lobbyBackground
- type: lobbyArt
id: StarBow14
background: NetTextures/Lobby/Arts/starbow14.webp
background: /NetTextures/Lobby/Arts/starbow14.webp
- type: lobbyBackground
- type: lobbyArt
id: SpaceMudaki
background: NetTextures/Lobby/Arts/space-mudaki.webp
background: /NetTextures/Lobby/Arts/space-mudaki.webp
- type: lobbyBackground
- type: lobbyArt
id: Traitor
background: NetTextures/Lobby/Arts/traitor.webp
background: /NetTextures/Lobby/Arts/traitor.webp
- type: lobbyBackground
- type: lobbyArt
id: TeslaLoose
background: NetTextures/Lobby/Arts/tesla-loose.webp
background: /NetTextures/Lobby/Arts/tesla-loose.webp
- type: lobbyBackground
- type: lobbyArt
id: TeslaLoose2
background: NetTextures/Lobby/Arts/teslaloose.webp
background: /NetTextures/Lobby/Arts/teslaloose.webp
- type: lobbyBackground
- type: lobbyArt
id: NukieDudes
background: NetTextures/Lobby/Arts/nukie-dudes.webp
background: /NetTextures/Lobby/Arts/nukie-dudes.webp
- type: lobbyBackground
- type: lobbyArt
id: MenAtWork
background: NetTextures/Lobby/Arts/men-at-work.webp
background: /NetTextures/Lobby/Arts/men-at-work.webp
- type: lobbyBackground
- type: lobbyArt
id: FleshAnom
background: NetTextures/Lobby/Arts/fleshanom.webp
background: /NetTextures/Lobby/Arts/fleshanom.webp
- type: lobbyBackground
- type: lobbyArt
id: Revenant
background: NetTextures/Lobby/Arts/revenant.webp
background: /NetTextures/Lobby/Arts/revenant.webp
- type: lobbyBackground
- type: lobbyArt
id: RedAlertMed
background: NetTextures/Lobby/Arts/red-alert-med.webp
background: /NetTextures/Lobby/Arts/red-alert-med.webp
- type: lobbyBackground
- type: lobbyArt
id: DeathNettle
background: NetTextures/Lobby/Arts/deathnettle.webp
background: /NetTextures/Lobby/Arts/deathnettle.webp
- type: lobbyBackground
- type: lobbyArt
id: Xeno
background: NetTextures/Lobby/Arts/xeno.webp
background: /NetTextures/Lobby/Arts/xeno.webp
- type: lobbyBackground
- type: lobbyArt
id: ClownSpider
background: NetTextures/Lobby/Arts/clownspider.webp
background: /NetTextures/Lobby/Arts/clownspider.webp
- type: lobbyBackground
- type: lobbyArt
id: XenoAttack
background: NetTextures/Lobby/Arts/xenosattack.webp
background: /NetTextures/Lobby/Arts/xenosattack.webp
- type: lobbyBackground
- type: lobbyArt
id: SingulordCage
background: NetTextures/Lobby/Arts/singulord-cage.webp
background: /NetTextures/Lobby/Arts/singulord-cage.webp
- type: lobbyBackground
- type: lobbyArt
id: GrayTide
background: NetTextures/Lobby/Arts/gray-tide.webp
background: /NetTextures/Lobby/Arts/gray-tide.webp
- type: lobbyBackground
- type: lobbyArt
id: GutsGuts
background: NetTextures/Lobby/Arts/guts-guts.webp
background: /NetTextures/Lobby/Arts/guts-guts.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearBar
background: NetTextures/Lobby/Arts/new-year-bar.webp
background: /NetTextures/Lobby/Arts/new-year-bar.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearSec
background: NetTextures/Lobby/Arts/new-year-sec.webp
background: /NetTextures/Lobby/Arts/new-year-sec.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearSave
background: NetTextures/Lobby/Arts/new-year-save.webp
background: /NetTextures/Lobby/Arts/new-year-save.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearComfort
background: NetTextures/Lobby/Arts/new-year-comfort.webp
background: /NetTextures/Lobby/Arts/new-year-comfort.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearParty
background: NetTextures/Lobby/Arts/new-year-party.webp
background: /NetTextures/Lobby/Arts/new-year-party.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearPine
background: NetTextures/Lobby/Arts/new-year-pine.webp
background: /NetTextures/Lobby/Arts/new-year-pine.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearExplosion
background: NetTextures/Lobby/Arts/new-year-explosion.webp
background: /NetTextures/Lobby/Arts/new-year-explosion.webp
- type: lobbyBackground
- type: lobbyArt
id: SpaceNuke
background: NetTextures/Lobby/Arts/space-nuke.webp
background: /NetTextures/Lobby/Arts/space-nuke.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearPenguins
background: NetTextures/Lobby/Arts/new-year-penguins.webp
background: /NetTextures/Lobby/Arts/new-year-penguins.webp
- type: lobbyBackground
- type: lobbyArt
id: NewYearNuke
background: NetTextures/Lobby/Arts/new-year-nuke.webp
background: /NetTextures/Lobby/Arts/new-year-nuke.webp
- type: lobbyBackground
- type: lobbyArt
id: ArnoldIntelligence
background: NetTextures/Lobby/Arts/arnold-intelligence.webp
background: /NetTextures/Lobby/Arts/arnold-intelligence.webp
- type: lobbyBackground
- type: lobbyArt
id: MimesInTechs
background: NetTextures/Lobby/Arts/mimes-in-techs.webp
background: /NetTextures/Lobby/Arts/mimes-in-techs.webp
- type: lobbyBackground
- type: lobbyArt
id: NukieWar
background: NetTextures/Lobby/Arts/nukie-war.webp
background: /NetTextures/Lobby/Arts/nukie-war.webp
- type: lobbyBackground
- type: lobbyArt
id: EngineersVsZombies
background: NetTextures/Lobby/Arts/engineers-vs-zombies.webp
background: /NetTextures/Lobby/Arts/engineers-vs-zombies.webp
- type: lobbyBackground
- type: lobbyArt
id: Reunion
background: NetTextures/Lobby/Arts/reunion.webp
background: /NetTextures/Lobby/Arts/reunion.webp
- type: lobbyBackground
- type: lobbyArt
id: Prostchitalsanogde
background: NetTextures/Lobby/Arts/prostchitalsanogde.webp
background: /NetTextures/Lobby/Arts/prostchitalsanogde.webp

View file

@ -3,7 +3,7 @@
layers:
- texture:
!type:ImageParallaxTextureSource
path: "/NetTextures/Parallaxes/NES/MirStationParallaxBG.png"
path: "/NetTextures/Parallaxes/MirStationParallaxBG.png"
slowness: 0.998046875
scale: "1, 1"
- texture:
@ -28,7 +28,7 @@
slowness: 0.984352
- texture:
!type:ImageParallaxTextureSource
path: "/NetTextures/Parallaxes/NES/planet2.png"
path: "/NetTextures/Parallaxes/planet2.png"
slowness: 0.998046875
scale: "1, 1"
tiled: false