diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index 4aa5882d42..25ee218c67 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -770,7 +770,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic while (players.Children.Count > idx) players.RemoveChild(players.Children[idx]); - playerNames = GetPlayerNames().ToList(); + playerNames = orderManager.LobbyInfo.Clients.Select(c => c.Name).ToList(); } void OnGameStart() @@ -779,27 +779,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic onStart(); } - IEnumerable GetPlayerNames() - { - foreach (var container in players.Children) - { - if (container.Id == "TEMPLATE_EDITABLE_PLAYER") - { - var textWidget = container.Children.FirstOrDefault(x => x.Id == "NAME") as TextFieldWidget; - if (textWidget == null) - continue; - yield return textWidget.Text; - } - else if (container.Id == "TEMPLATE_NONEDITABLE_PLAYER") - { - var labelWidget = container.Children.FirstOrDefault(x => x.Id == "NAME") as LabelWidget; - if (labelWidget == null) - continue; - yield return labelWidget.GetText(); - } - } - } - bool AutoCompleteText() { var chatText = lobby.Get("CHAT_TEXTFIELD");