]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Main menu art credit system (#41328)
authorMatthew Herber <32679887+Happyrobot33@users.noreply.github.com>
Sun, 23 Nov 2025 13:00:58 +0000 (08:00 -0500)
committerGitHub <noreply@github.com>
Sun, 23 Nov 2025 13:00:58 +0000 (13:00 +0000)
* 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>
Content.Client/Entry/EntryPoint.cs
Content.Client/GameTicking/Managers/ClientGameTicker.cs
Content.Client/Lobby/LobbyState.cs
Content.Client/Lobby/UI/LobbyGui.xaml
Content.Server/GameTicking/GameTicker.LobbyBackground.cs
Content.Server/GameTicking/Prototypes/LobbyBackgroundPrototype.cs [deleted file]
Content.Shared/GameTicking/Prototypes/LobbyBackgroundPrototype.cs [new file with mode: 0644]
Content.Shared/GameTicking/SharedGameTicker.cs
Resources/Locale/en-US/lobby/lobby-state-background.ftl [new file with mode: 0644]
Resources/Locale/en-US/lobby/lobby-state.ftl
Resources/Prototypes/lobbyscreens.yml

index b9f0e0e8e6e6f5e4a189d0e5170619dc42fe8c2f..2266b30c515e53bc2de13d4ffdcc02ffd8858978 100644 (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");
index 4bd91bd06c3403d955e7bc0053f91aa5ff673148..443c6c20a8216cfebcc87b5a26492007d98bfe71 100644 (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; }
index 538266e1a2f4ea2d26c3b4750a7efc447cda5d11..9696da3bc2bd21ce5ec6895e1ce9b260336edf54 100644 (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)
index 9b5c761644a7b4a33408f6501f327298d948a8da..a716ae7c953395507aee3e72c895d12dc76c3084 100644 (file)
                     <!-- 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>
index 2090e3e31f02f1b7352206b0de616ee006081412..82460572f7da26a2dc9a5b6c8dbf08f372fe751f 100644 (file)
@@ -1,4 +1,5 @@
-using Content.Server.GameTicking.Prototypes;
+using Content.Shared.GameTicking.Prototypes;
+using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Utility;
 using System.Linq;
@@ -8,24 +9,37 @@ namespace Content.Server.GameTicking;
 public sealed partial class GameTicker
 {
     [ViewVariables]
-    public string? LobbyBackground { get; private set; }
+    public ProtoId<LobbyBackgroundPrototype>? LobbyBackground { get; private set; }
 
     [ViewVariables]
-    private List<ResPath>? _lobbyBackgrounds;
+    private List<ProtoId<LobbyBackgroundPrototype>>? _lobbyBackgrounds;
 
     private static readonly string[] WhitelistedBackgroundExtensions = new string[] {"png", "jpg", "jpeg", "webp"};
 
     private void InitializeLobbyBackground()
     {
-        _lobbyBackgrounds = _prototypeManager.EnumeratePrototypes<LobbyBackgroundPrototype>()
-            .Select(x => x.Background)
-            .Where(x => WhitelistedBackgroundExtensions.Contains(x.Extension))
-            .ToList();
+        var allprotos = _prototypeManager.EnumeratePrototypes<LobbyBackgroundPrototype>().ToList();
+        _lobbyBackgrounds ??= new List<ProtoId<LobbyBackgroundPrototype>>();
+
+        //create protoids from them
+        foreach (var proto in allprotos)
+        {
+            var ext = proto.Background.Extension;
+            if (!WhitelistedBackgroundExtensions.Contains(ext))
+                continue;
+
+            //create a protoid and add it to the list
+            _lobbyBackgrounds.Add(new ProtoId<LobbyBackgroundPrototype>(proto.ID));
+        }
 
         RandomizeLobbyBackground();
     }
 
-    private void RandomizeLobbyBackground() {
-        LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!).ToString() : null;
+    private void RandomizeLobbyBackground()
+    {
+        if (_lobbyBackgrounds != null && _lobbyBackgrounds.Count != 0)
+            LobbyBackground = _robustRandom.Pick(_lobbyBackgrounds);
+        else
+            LobbyBackground = null;
     }
 }
diff --git a/Content.Server/GameTicking/Prototypes/LobbyBackgroundPrototype.cs b/Content.Server/GameTicking/Prototypes/LobbyBackgroundPrototype.cs
deleted file mode 100644 (file)
index 5201fb3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-using Robust.Shared.Prototypes;
-using Robust.Shared.Utility;
-
-namespace Content.Server.GameTicking.Prototypes;
-
-/// <summary>
-/// Prototype for a lobby background the game can choose.
-/// </summary>
-[Prototype]
-public sealed partial class LobbyBackgroundPrototype : IPrototype
-{
-    /// <inheritdoc/>
-    [IdDataField]
-    public string ID { get; set; } = default!;
-
-    /// <summary>
-    /// The sprite to use as the background. This should ideally be 1920x1080.
-    /// </summary>
-    [DataField("background", required: true)]
-    public ResPath Background = default!;
-}
diff --git a/Content.Shared/GameTicking/Prototypes/LobbyBackgroundPrototype.cs b/Content.Shared/GameTicking/Prototypes/LobbyBackgroundPrototype.cs
new file mode 100644 (file)
index 0000000..0f88d00
--- /dev/null
@@ -0,0 +1,33 @@
+using Robust.Shared.Prototypes;
+using Robust.Shared.Utility;
+
+namespace Content.Shared.GameTicking.Prototypes;
+
+/// <summary>
+/// Prototype for a lobby background the game can choose.
+/// </summary>
+[Prototype]
+public sealed partial class LobbyBackgroundPrototype : IPrototype
+{
+    /// <inheritdoc/>
+    [IdDataField]
+    public string ID { get; set; } = default!;
+
+    /// <summary>
+    /// The sprite to use as the background. This should ideally be 1920x1080.
+    /// </summary>
+    [DataField(required: true)]
+    public ResPath 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";
+}
index 877a849d07740b2e173cf1d22702daf66311a593..57e69d1cf55bfd5769467ca85b474dc072cae451 100644 (file)
@@ -7,6 +7,7 @@ using Robust.Shared.Serialization.Markdown.Mapping;
 using Robust.Shared.Serialization.Markdown.Value;
 using Robust.Shared.Timing;
 using Robust.Shared.Audio;
+using Content.Shared.GameTicking.Prototypes;
 
 namespace Content.Shared.GameTicking
 {
@@ -95,14 +96,14 @@ namespace Content.Shared.GameTicking
     public sealed class TickerLobbyStatusEvent : EntityEventArgs
     {
         public bool IsRoundStarted { get; }
-        public string? LobbyBackground { get; }
+        public ProtoId<LobbyBackgroundPrototype>? LobbyBackground { get; }
         public bool YouAreReady { get; }
         // UTC.
         public TimeSpan StartTime { get; }
         public TimeSpan RoundStartTimeSpan { get; }
         public bool Paused { get; }
 
-        public TickerLobbyStatusEvent(bool isRoundStarted, string? lobbyBackground, bool youAreReady, TimeSpan startTime, TimeSpan preloadTime, TimeSpan roundStartTimeSpan, bool paused)
+        public TickerLobbyStatusEvent(bool isRoundStarted, ProtoId<LobbyBackgroundPrototype>? lobbyBackground, bool youAreReady, TimeSpan startTime, TimeSpan preloadTime, TimeSpan roundStartTimeSpan, bool paused)
         {
             IsRoundStarted = isRoundStarted;
             LobbyBackground = lobbyBackground;
diff --git a/Resources/Locale/en-US/lobby/lobby-state-background.ftl b/Resources/Locale/en-US/lobby/lobby-state-background.ftl
new file mode 100644 (file)
index 0000000..c0046ca
--- /dev/null
@@ -0,0 +1,35 @@
+lobby-state-background-warden-title = Warden
+lobby-state-background-warden-artist = Solbusaur
+
+lobby-state-background-pharmacy-title = Pharmacy
+lobby-state-background-pharmacy-artist = Solbusaur
+
+lobby-state-background-SSXIV-title = SSXIV
+lobby-state-background-SSXIV-artist = Abyssal
+
+lobby-state-background-susstation-title = Susstation
+lobby-state-background-susstation-artist = Alekshhh
+
+lobby-state-background-skellyvstherev-title = Skelly Versus The Rev
+lobby-state-background-skellyvstherev-artist = Hannah 'FairlySadPanda' Dawson
+
+lobby-state-background-doomed-title = Doomed
+lobby-state-background-doomed-artist = brainfood1183
+
+lobby-state-background-blueprint-title = Blueprint
+lobby-state-background-blueprint-artist = data_redacted
+
+lobby-state-background-behonker-title = Behonker
+lobby-state-background-behonker-artist = InCrah
+
+lobby-state-background-terminalstation-title = Terminal Station
+lobby-state-background-terminalstation-artist = aserovich
+
+lobby-state-background-justaweekaway-title = Just a Week Away
+lobby-state-background-justaweekaway-artist = plantyfern
+
+lobby-state-background-janishootout-title = Jani Shootout
+lobby-state-background-janishootout-artist = psychpsyo
+
+lobby-state-background-reclaimernuke-title = Reclaimer Nuke
+lobby-state-background-reclaimernuke-artist = GetOutMarutak
index 0c92923b1c9927d4e733554bf0e1749559357c4a..1a9f4809deb55068fafa9c786244d8c839daeb36 100644 (file)
@@ -21,6 +21,10 @@ lobby-state-song-text = Playing: [color=white]{$songTitle}[/color] by [color=whi
 lobby-state-song-no-song-text = No lobby song playing.
 lobby-state-song-unknown-title = [color=dimgray]Unknown title[/color]
 lobby-state-song-unknown-artist = [color=dimgray]Unknown artist[/color]
+lobby-state-background-text = Menu art: [color=white]{$backgroundTitle}[/color] by [color=white]{$backgroundArtist}[/color]
+lobby-state-background-no-background-text = No menu art loaded.
+lobby-state-background-unknown-title = [color=dimgray]Unknown title[/color]
+lobby-state-background-unknown-artist = [color=dimgray]Unknown artist[/color]
 lobby-state-playtime-comment-normal =
     You've spent {$hours} {$hours ->
     [1]hour
index 8ffa580bc7026324ad3e1904ab5bb80928e2bce9..d0f6da99d5055c727985ef211fe83c7e6ee55ca4 100644 (file)
@@ -1,48 +1,71 @@
 - type: lobbyBackground
   id: Warden
   background: /Textures/LobbyScreens/warden.webp
+  title: lobby-state-background-warden-title
+  artist: lobby-state-background-warden-artist
 
 - type: lobbyBackground
   id: Pharmacy
   background: /Textures/LobbyScreens/pharmacy.webp
+  title: lobby-state-background-pharmacy-title
+  artist: lobby-state-background-pharmacy-artist
 
 - type: lobbyBackground
   id: SSXIV
   background: /Textures/LobbyScreens/ssxiv.webp
+  title: lobby-state-background-SSXIV-title
+  artist: lobby-state-background-SSXIV-artist
 
 - type: lobbyBackground
   id: Susstation
   background: /Textures/LobbyScreens/susstation.webp
+  title: lobby-state-background-susstation-title
+  artist: lobby-state-background-susstation-artist
 
 - type: lobbyBackground
   id: SkellyVsTheRev
   background: /Textures/LobbyScreens/skellyvstherev.webp
+  title: lobby-state-background-skellyvstherev-title
+  artist: lobby-state-background-skellyvstherev-artist
 
 - type: lobbyBackground
   id: Doomed
   background: /Textures/LobbyScreens/doomed.webp
+  title: lobby-state-background-doomed-title
+  artist: lobby-state-background-doomed-artist
 
 - type: lobbyBackground
   id: Blueprint
   background: /Textures/LobbyScreens/blueprint.webp
+  title: lobby-state-background-blueprint-title
+  artist: lobby-state-background-blueprint-artist
 
 - type: lobbyBackground
   id: Behonker
   background: /Textures/LobbyScreens/behonker.webp
+  title: lobby-state-background-behonker-title
+  artist: lobby-state-background-behonker-artist
 
 - type: lobbyBackground
   id: TerminalStation
   background: /Textures/LobbyScreens/terminalstation.webp
+  title: lobby-state-background-terminalstation-title
+  artist: lobby-state-background-terminalstation-artist
 
 - type: lobbyBackground
   id: JustAWeekAway
   background: /Textures/LobbyScreens/justaweekaway.webp
+  title: lobby-state-background-justaweekaway-title
+  artist: lobby-state-background-justaweekaway-artist
 
 - type: lobbyBackground
   id: JaniShootout
   background: /Textures/LobbyScreens/janishootout.webp
+  title: lobby-state-background-janishootout-title
+  artist: lobby-state-background-janishootout-artist
 
 - type: lobbyBackground
   id: ReclaimerNuke
   background: /Textures/LobbyScreens/reclaimer-nuke.webp
-  
\ No newline at end of file
+  title: lobby-state-background-reclaimernuke-title
+  artist: lobby-state-background-reclaimernuke-artist