Make TextFieldWidget generic; Hook up teamchat and make it actually work in the lobby

This commit is contained in:
Paul Chote
2010-07-10 21:15:21 +12:00
parent 50f3aecf53
commit d91fc0d8e7
4 changed files with 31 additions and 8 deletions

View File

@@ -43,9 +43,10 @@ namespace OpenRA.Network
if (client != null && Chrome.chatWidget != null)
{
var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index);
var isAlly = player != null && Game.world.LocalPlayer != null
&& player.Stances[Game.world.LocalPlayer] == Stance.Ally;
var isAlly = (world.GameHasStarted) ?
player != null && Game.world.LocalPlayer != null && player.Stances[Game.world.LocalPlayer] == Stance.Ally :
client.Team == Game.LocalClient.Team;
if (isAlly)
Chrome.chatWidget.AddLine(client, "(Team) " + order.TargetString);
}