diff --git a/Content.Client/GameTicking/ClientGameTicker.cs b/Content.Client/GameTicking/ClientGameTicker.cs index c0fa89cbd0..94443ebdc1 100644 --- a/Content.Client/GameTicking/ClientGameTicker.cs +++ b/Content.Client/GameTicking/ClientGameTicker.cs @@ -10,9 +10,11 @@ using Robust.Client.Console; using Robust.Client.Interfaces; using Robust.Client.Interfaces.Input; using Robust.Client.Interfaces.UserInterface; +using Robust.Client.UserInterface; using Robust.Shared.Input; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; +using Robust.Shared.Localization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; @@ -27,6 +29,7 @@ namespace Content.Client.GameTicking [Dependency] private IBaseClient _baseClient; [Dependency] private IChatManager _chatManager; [Dependency] private IClientConsole _console; + [Dependency] private ILocalizationManager _localization; #pragma warning restore 649 [ViewVariables] private bool _areWeReady; @@ -83,11 +86,11 @@ namespace Content.Client.GameTicking { if (difference.TotalSeconds < -5) { - text = "Right Now?"; + text = _localization.GetString("Right Now?"); } else { - text = "Right Now"; + text = _localization.GetString("Right Now"); } } else @@ -95,7 +98,7 @@ namespace Content.Client.GameTicking text = $"{(int) Math.Floor(difference.TotalMinutes)}:{difference.Seconds:D2}"; } - _lobby.StartTime.Text = "Round Starts In: " + text; + _lobby.StartTime.Text = _localization.GetString("Round Starts In: {0}", text); } private void _lobbyStatus(MsgTickerLobbyStatus message) @@ -116,14 +119,14 @@ namespace Content.Client.GameTicking if (_gameStarted) { - _lobby.ReadyButton.Text = "Join"; + _lobby.ReadyButton.Text = _localization.GetString("Join"); _lobby.ReadyButton.ToggleMode = false; _lobby.ReadyButton.Pressed = false; } else { _lobby.StartTime.Text = ""; - _lobby.ReadyButton.Text = "Ready Up"; + _lobby.ReadyButton.Text = _localization.GetString("Ready Up"); _lobby.ReadyButton.ToggleMode = true; _lobby.ReadyButton.Pressed = _areWeReady; } @@ -144,9 +147,11 @@ namespace Content.Client.GameTicking _tickerState = TickerState.InLobby; - _lobby = new LobbyGui(); + _lobby = new LobbyGui(_localization); _userInterfaceManager.StateRoot.AddChild(_lobby); + _lobby.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide, margin: 20); + _chatManager.SetChatBox(_lobby.Chat); _lobby.Chat.DefaultChatFormat = "ooc \"{0}\""; diff --git a/Content.Client/UserInterface/LobbyGui.cs b/Content.Client/UserInterface/LobbyGui.cs index 64f6e65402..21439f80bf 100644 --- a/Content.Client/UserInterface/LobbyGui.cs +++ b/Content.Client/UserInterface/LobbyGui.cs @@ -1,36 +1,86 @@ using Content.Client.Chat; +using Robust.Client.Graphics.Drawing; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; -using Robust.Client.UserInterface.CustomControls; -using Robust.Shared.Utility; +using Robust.Shared.Localization; +using Robust.Shared.Maths; namespace Content.Client.UserInterface { - public class LobbyGui : Control + internal sealed class LobbyGui : PanelContainer { - protected override ResourcePath ScenePath => new ResourcePath("/Scenes/Lobby/Lobby.tscn"); + public Label ServerName { get; } + public Label StartTime { get; } + public Button ReadyButton { get; } + public Button ObserveButton { get; } + public Button LeaveButton { get; } + public ChatBox Chat { get; set; } - public Label ServerName => GetChild