Changes how the playerNames collection is created.

It's now extracted from the orderManager, like it's done in LobbyLogic.
This is to increase consistency.
This commit is contained in:
Alexander Fast
2014-08-23 21:18:54 +02:00
parent e934df374d
commit af0efda6f5

View File

@@ -43,12 +43,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
chatTraits = world.WorldActor.TraitsImplementing<INotifyChat>().ToList();
var players = world.Players.Where(p => p != world.LocalPlayer && !p.NonCombatant && !p.IsBot).ToList();
var players = world.Players.Where(p => p != world.LocalPlayer && !p.NonCombatant && !p.IsBot);
var disableTeamChat = world.LocalPlayer == null || world.LobbyInfo.IsSinglePlayer || !players.Any(p => p.IsAlliedWith(world.LocalPlayer));
teamChat = !disableTeamChat;
commandNames = chatTraits.OfType<ChatCommands>().SelectMany(x => x.Commands.Keys).Select(x => "/" + x).ToList();
playerNames = players.Select(x => x.PlayerName).ToList();
playerNames = orderManager.LobbyInfo.Clients.Select(c => c.Name).ToList();
var chatPanel = (ContainerWidget)widget;
chatOverlay = chatPanel.Get<ContainerWidget>("CHAT_OVERLAY");