Improve setting the lobby server title.

This commit is contained in:
Paul Chote
2013-05-10 22:21:29 +12:00
parent 41873d7cc5
commit 38f749ee47
4 changed files with 7 additions and 8 deletions

View File

@@ -97,6 +97,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
Game.AddChatLine += AddChatLine;
Game.ConnectionStateChanged += ConnectionStateChanged;
var name = lobby.GetOrNull<LabelWidget>("SERVER_NAME");
if (name != null)
name.GetText = () => orderManager.LobbyInfo.GlobalSettings.ServerName;
UpdateCurrentMap();
Players = lobby.Get<ScrollPanelWidget>("PLAYERS");
EditablePlayerTemplate = Players.Get("TEMPLATE_EDITABLE_PLAYER");
@@ -343,9 +347,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
else
throw new InvalidOperationException("Server's new map doesn't exist on your system and Downloading turned off");
Map = new Map(Game.modData.AvailableMaps[MapUid].Path);
var title = Ui.Root.Get<LabelWidget>("TITLE");
title.Text = orderManager.LobbyInfo.GlobalSettings.ServerName;
}
void UpdatePlayerList()

View File

@@ -7,10 +7,8 @@ Container@SERVER_LOBBY:
Children:
ColorPreviewManager@COLOR_MANAGER:
RemapIndices: 176, 178, 180, 182, 184, 186, 189, 191, 177, 179, 181, 183, 185, 187, 188, 190
Label@TITLE:
Label@SERVER_NAME:
Width:740
Height: 20
X:0
Y:0-25
Font:BigBold
Contrast:true

View File

@@ -7,7 +7,7 @@ Background@SERVER_LOBBY:
Children:
ColorPreviewManager@COLOR_MANAGER:
RemapIndices: 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240
Label@TITLE:
Label@SERVER_NAME:
X:0
Y:17
Align:Center

View File

@@ -7,7 +7,7 @@ Background@SERVER_LOBBY:
Children:
ColorPreviewManager@COLOR_MANAGER:
RemapIndices: 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95
Label@TITLE:
Label@SERVER_NAME:
X:0
Y:17
Align:Center