diff --git a/Content.Client/Lobby/LobbyState.cs b/Content.Client/Lobby/LobbyState.cs index 1361ca57cd2..4677245509e 100644 --- a/Content.Client/Lobby/LobbyState.cs +++ b/Content.Client/Lobby/LobbyState.cs @@ -5,19 +5,21 @@ using Content.Client.Message; using Content.Client.UserInterface.Systems.Chat; using Content.Client.Voting; +using Content.Shared.CCVar; using Robust.Client; using Robust.Client.Console; using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; +using Robust.Shared.Configuration; using Robust.Shared.Timing; - namespace Content.Client.Lobby { public sealed class LobbyState : Robust.Client.State.State { [Dependency] private readonly IBaseClient _baseClient = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IClientConsoleHost _consoleHost = default!; [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; @@ -49,7 +51,17 @@ protected override void Startup() _voteManager.SetPopupContainer(Lobby.VoteContainer); LayoutContainer.SetAnchorPreset(Lobby, LayoutContainer.LayoutPreset.Wide); - Lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you... + + var lobbyNameCvar = _cfg.GetCVar(CCVars.ServerLobbyName); + var serverName = _baseClient.GameInfo?.ServerName ?? string.Empty; + + Lobby.ServerName.Text = string.IsNullOrEmpty(lobbyNameCvar) + ? Loc.GetString("ui-lobby-title", ("serverName", serverName)) + : lobbyNameCvar; + + var width = _cfg.GetCVar(CCVars.ServerLobbyRightPanelWidth); + Lobby.RightSide.SetWidth = width; + UpdateLobbyUi(); Lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed; diff --git a/Content.Client/Lobby/UI/LobbyGui.xaml b/Content.Client/Lobby/UI/LobbyGui.xaml index 4a158fd811f..615d8cb2711 100644 --- a/Content.Client/Lobby/UI/LobbyGui.xaml +++ b/Content.Client/Lobby/UI/LobbyGui.xaml @@ -62,14 +62,12 @@ - - diff --git a/Content.Shared/CCVar/CCVars.Server.cs b/Content.Shared/CCVar/CCVars.Server.cs index 2c861584afc..88e7b251ba0 100644 --- a/Content.Shared/CCVar/CCVars.Server.cs +++ b/Content.Shared/CCVar/CCVars.Server.cs @@ -40,4 +40,17 @@ public sealed partial class CCVars /// public static readonly CVarDef ServerUptimeRestartMinutes = CVarDef.Create("server.uptime_restart_minutes", 0, CVar.SERVERONLY); + + /// + /// This will be the title shown in the lobby + /// If empty, the title will be {ui-lobby-title} + the server's full name from the hub + /// + public static readonly CVarDef ServerLobbyName = + CVarDef.Create("server.lobby_name", "", CVar.REPLICATED | CVar.SERVER); + + /// + /// The width of the right side (chat) panel in the lobby + /// + public static readonly CVarDef ServerLobbyRightPanelWidth = + CVarDef.Create("server.lobby_right_panel_width", 650, CVar.REPLICATED | CVar.SERVER); } diff --git a/Resources/Locale/en-US/lobby/lobby-gui.ftl b/Resources/Locale/en-US/lobby/lobby-gui.ftl index e7f131e93b0..14cc85a5a99 100644 --- a/Resources/Locale/en-US/lobby/lobby-gui.ftl +++ b/Resources/Locale/en-US/lobby/lobby-gui.ftl @@ -1,4 +1,4 @@ -ui-lobby-title = Lobby +ui-lobby-title = Lobby: {$serverName} ui-lobby-ahelp-button = AHelp ui-lobby-options-button = Options ui-lobby-leave-button = Leave