Disconnected clients now listed as '(Gone)'.

This commit is contained in:
huwpascoe
2014-08-29 02:29:09 +01:00
parent 9ed9096551
commit ffd17af363
2 changed files with 14 additions and 3 deletions

View File

@@ -454,7 +454,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
flag.GetImageCollection = () => "flags";
var playerName = template.Get<LabelWidget>("PLAYER");
playerName.GetText = () => player.PlayerName + (player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")");
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
playerName.GetText = () =>
{
if (client.State == Network.Session.ClientState.Disconnected)
return player.PlayerName + " (Gone)";
return player.PlayerName + (player.WinState == WinState.Undefined ? "" : " (" + player.WinState + ")");
};
playerName.GetColor = () => player.Color.RGB;
}
}