Remove some unnecessary fields from chrome

This commit is contained in:
Paul Chote
2010-07-13 20:49:04 +12:00
parent 4a7c19cf93
commit 8d2693019d
6 changed files with 29 additions and 28 deletions

View File

@@ -33,14 +33,13 @@ namespace OpenRA.Network
case "Chat":
{
var client = Game.LobbyInfo.Clients.FirstOrDefault(c => c.Index == clientId);
if (client != null && Chrome.chatWidget != null)
Chrome.chatWidget.AddLine(Game.world.PlayerColors()[client.PaletteIndex].Color, client.Name, order.TargetString);
Game.AddChatLine(Game.world.PlayerColors()[client.PaletteIndex].Color, client.Name, order.TargetString);
break;
}
case "TeamChat":
{
var client = Game.LobbyInfo.Clients.FirstOrDefault(c => c.Index == clientId);
if (client != null && Chrome.chatWidget != null)
if (client != null)
{
var player = Game.world.players.Values.FirstOrDefault(p => p.Index == client.Index);
var isAlly = (world.GameHasStarted) ?
@@ -48,15 +47,13 @@ namespace OpenRA.Network
client == Game.LocalClient || (client.Team == Game.LocalClient.Team && client.Team != 0);
if (isAlly)
Chrome.chatWidget.AddLine(Game.world.PlayerColors()[client.PaletteIndex].Color, client.Name + " (Team)", order.TargetString);
Game.AddChatLine(Game.world.PlayerColors()[client.PaletteIndex].Color, client.Name + " (Team)", order.TargetString);
}
break;
}
case "StartGame":
{
if (Chrome.chatWidget != null)
Chrome.chatWidget.AddLine(Color.White, "Server", "The game has started.");
Game.AddChatLine(Color.White, "Server", "The game has started.");
Game.StartGame();
break;
}