Enable spectator team chat in the lobby
This commit is contained in:
@@ -80,8 +80,9 @@ namespace OpenRA.Network
|
||||
// We are still in the lobby
|
||||
if (world == null)
|
||||
{
|
||||
var prefix = order.ExtraData == uint.MaxValue ? "[Spectators] " : "[Team] ";
|
||||
if (orderManager.LocalClient != null && client.Team == orderManager.LocalClient.Team)
|
||||
Game.AddChatLine(client.Color, "[Team] " + client.Name, message);
|
||||
Game.AddChatLine(client.Color, prefix + client.Name, message);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -550,8 +550,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (orderManager.LocalClient == null)
|
||||
return;
|
||||
|
||||
disableTeamChat = orderManager.LocalClient.Team == 0 ||
|
||||
!orderManager.LobbyInfo.Clients.Any(c =>
|
||||
// Check if we are not assigned to any team, and are no spectator
|
||||
// If we are a spectator, check if there are more and enable spectator chat
|
||||
// Otherwise check if our assigned team has more players
|
||||
if (orderManager.LocalClient.Team == 0 && !orderManager.LocalClient.IsObserver)
|
||||
disableTeamChat = true;
|
||||
else if (orderManager.LocalClient.IsObserver)
|
||||
disableTeamChat = !orderManager.LobbyInfo.Clients.Any(c => c != orderManager.LocalClient && c.IsObserver);
|
||||
else
|
||||
disableTeamChat = !orderManager.LobbyInfo.Clients.Any(c =>
|
||||
c != orderManager.LocalClient &&
|
||||
c.Bot == null &&
|
||||
c.Team == orderManager.LocalClient.Team);
|
||||
|
||||
Reference in New Issue
Block a user