Main menu art credit system (#41328)

* Main menu art credit system

* change to center align in one box

* left align

* Update Resources/Prototypes/lobbyscreens.yml

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>

* add margin

* Update Resources/Prototypes/lobbyscreens.yml

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>

* fix formatting

* change to locale

* FTL file

* locid

* handle null list properly

* remove unneeded using

* push

* One more push

---------

Co-authored-by: Hannah Giovanna Dawson <karakkaraz@gmail.com>
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Matthew Herber
2025-11-23 08:00:58 -05:00
committed by GitHub
parent cc27b6f027
commit 11a6f57d69
11 changed files with 142 additions and 41 deletions

View File

@@ -112,7 +112,6 @@ namespace Content.Client.Entry
_prototypeManager.RegisterIgnore("htnPrimitive");
_prototypeManager.RegisterIgnore("gameMap");
_prototypeManager.RegisterIgnore("gameMapPool");
_prototypeManager.RegisterIgnore("lobbyBackground");
_prototypeManager.RegisterIgnore("gamePreset");
_prototypeManager.RegisterIgnore("noiseChannel");
_prototypeManager.RegisterIgnore("playerConnectionWhitelist");

View File

@@ -11,6 +11,7 @@ using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
using Robust.Shared.Audio;
using Content.Shared.GameTicking.Prototypes;
namespace Content.Client.GameTicking.Managers
{
@@ -28,7 +29,7 @@ namespace Content.Client.GameTicking.Managers
[ViewVariables] public bool AreWeReady { get; private set; }
[ViewVariables] public bool IsGameStarted { get; private set; }
[ViewVariables] public ResolvedSoundSpecifier? RestartSound { get; private set; }
[ViewVariables] public string? LobbyBackground { get; private set; }
[ViewVariables] public ProtoId<LobbyBackgroundPrototype>? LobbyBackground { get; private set; }
[ViewVariables] public bool DisallowedLateJoin { get; private set; }
[ViewVariables] public string? ServerInfoBlob { get; private set; }
[ViewVariables] public TimeSpan StartTime { get; private set; }

View File

@@ -13,6 +13,7 @@ using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
namespace Content.Client.Lobby
@@ -28,6 +29,7 @@ namespace Content.Client.Lobby
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IVoteManager _voteManager = default!;
[Dependency] private readonly ClientsidePlaytimeTrackingManager _playtimeTracking = default!;
[Dependency] private readonly IPrototypeManager _protoMan = default!;
private ClientGameTicker _gameTicker = default!;
private ContentAudioSystem _contentAudioSystem = default!;
@@ -250,15 +252,22 @@ namespace Content.Client.Lobby
private void UpdateLobbyBackground()
{
if (_gameTicker.LobbyBackground != null)
if (_protoMan.TryIndex(_gameTicker.LobbyBackground, out var proto))
{
Lobby!.Background.Texture = _resourceCache.GetResource<TextureResource>(_gameTicker.LobbyBackground );
Lobby!.Background.Texture = _resourceCache.GetResource<TextureResource>(proto.Background);
var markup = Loc.GetString("lobby-state-background-text",
("backgroundTitle", Loc.GetString(proto.Title)),
("backgroundArtist", Loc.GetString(proto.Artist)));
Lobby!.LobbyBackground.SetMarkup(markup);
}
else
{
Lobby!.Background.Texture = null;
}
Lobby!.LobbyBackground.SetMarkup(Loc.GetString("lobby-state-background-no-background-text"));
}
}
private void SetReady(bool newReady)

View File

@@ -51,10 +51,13 @@
<!-- Vertical Padding-->
<Control VerticalExpand="True" />
<!-- Left Bot Panel -->
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Bottom">
<info:DevInfoBanner Name="DevInfoBanner" VerticalExpand="false" Margin="3 3 3 3" />
<PanelContainer StyleClasses="BackgroundPanel">
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Center" />
<PanelContainer StyleClasses="BackgroundPanel" Margin="3 3 3 3">
<BoxContainer Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="3 3 3 3">
<RichTextLabel Name="LobbySong" Access="Public" HorizontalAlignment="Left" />
<RichTextLabel Name="LobbyBackground" Access="Public" HorizontalAlignment="Left" />
</BoxContainer>
</PanelContainer>
</BoxContainer>
</Control>