Add explicit placeholders to the lobby.

This commit is contained in:
Pieter-Jan Briers
2019-05-14 08:38:49 +02:00
parent 96fbde3413
commit ad3b3c9f4f
2 changed files with 16 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Client;
using Robust.Client.Console; using Robust.Client.Console;
using Robust.Client.Interfaces; using Robust.Client.Interfaces;
using Robust.Client.Interfaces.Input; using Robust.Client.Interfaces.Input;
using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.Interfaces.UserInterface; using Robust.Client.Interfaces.UserInterface;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Shared.Input; using Robust.Shared.Input;
@@ -30,6 +31,7 @@ namespace Content.Client.GameTicking
[Dependency] private IChatManager _chatManager; [Dependency] private IChatManager _chatManager;
[Dependency] private IClientConsole _console; [Dependency] private IClientConsole _console;
[Dependency] private ILocalizationManager _localization; [Dependency] private ILocalizationManager _localization;
[Dependency] private IResourceCache _resourceCache;
#pragma warning restore 649 #pragma warning restore 649
[ViewVariables] private bool _areWeReady; [ViewVariables] private bool _areWeReady;
@@ -147,7 +149,7 @@ namespace Content.Client.GameTicking
_tickerState = TickerState.InLobby; _tickerState = TickerState.InLobby;
_lobby = new LobbyGui(_localization); _lobby = new LobbyGui(_localization, _resourceCache);
_userInterfaceManager.StateRoot.AddChild(_lobby); _userInterfaceManager.StateRoot.AddChild(_lobby);
_lobby.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide, margin: 20); _lobby.SetAnchorAndMarginPreset(Control.LayoutPreset.Wide, margin: 20);

View File

@@ -1,6 +1,6 @@
using Content.Client.Chat; using Content.Client.Chat;
using Robust.Client.Graphics.Drawing; using Robust.Client.Graphics.Drawing;
using Robust.Client.UserInterface; using Robust.Client.Interfaces.ResourceManagement;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
@@ -16,7 +16,7 @@ namespace Content.Client.UserInterface
public Button LeaveButton { get; } public Button LeaveButton { get; }
public ChatBox Chat { get; set; } public ChatBox Chat { get; set; }
public LobbyGui(ILocalizationManager localization) public LobbyGui(ILocalizationManager localization, IResourceCache resourceCache)
{ {
PanelOverride = new StyleBoxFlat { BackgroundColor = new Color(37, 37, 45)}; PanelOverride = new StyleBoxFlat { BackgroundColor = new Color(37, 37, 45)};
@@ -53,8 +53,11 @@ namespace Content.Client.UserInterface
var leftVBox = new VBoxContainer {SizeFlagsHorizontal = SizeFlags.FillExpand}; var leftVBox = new VBoxContainer {SizeFlagsHorizontal = SizeFlags.FillExpand};
hBox.AddChild(leftVBox); hBox.AddChild(leftVBox);
// Placeholder. leftVBox.AddChild(new Placeholder(resourceCache)
leftVBox.AddChild(new Control {SizeFlagsVertical = SizeFlags.FillExpand}); {
SizeFlagsVertical = SizeFlags.FillExpand,
PlaceholderText = localization.GetString("Character UI\nPlaceholder")
});
var readyButtons = new HBoxContainer(); var readyButtons = new HBoxContainer();
@@ -77,10 +80,15 @@ namespace Content.Client.UserInterface
}); });
leftVBox.AddChild(Chat = new ChatBox {SizeFlagsVertical = SizeFlags.FillExpand}); leftVBox.AddChild(Chat = new ChatBox {SizeFlagsVertical = SizeFlags.FillExpand});
Chat.Input.PlaceHolder = localization.GetString("Talk!");
} }
// Placeholder. // Placeholder.
hBox.AddChild(new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}); hBox.AddChild(new Placeholder(resourceCache)
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
PlaceholderText = localization.GetString("Server Info\nPlaceholder")
});
} }
} }
} }