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
|
// We are still in the lobby
|
||||||
if (world == null)
|
if (world == null)
|
||||||
{
|
{
|
||||||
|
var prefix = order.ExtraData == uint.MaxValue ? "[Spectators] " : "[Team] ";
|
||||||
if (orderManager.LocalClient != null && client.Team == orderManager.LocalClient.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;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -550,8 +550,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (orderManager.LocalClient == null)
|
if (orderManager.LocalClient == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disableTeamChat = orderManager.LocalClient.Team == 0 ||
|
// Check if we are not assigned to any team, and are no spectator
|
||||||
!orderManager.LobbyInfo.Clients.Any(c =>
|
// 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 != orderManager.LocalClient &&
|
||||||
c.Bot == null &&
|
c.Bot == null &&
|
||||||
c.Team == orderManager.LocalClient.Team);
|
c.Team == orderManager.LocalClient.Team);
|
||||||
|
|||||||
Reference in New Issue
Block a user