Skip to content

Commit f499ee6

Browse files
committed
Chat color now matches lan behavior
1 parent ddb2c4c commit f499ee6

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

‎GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/OnlineServices_RoomsInterface.h‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
#include "NetworkMesh.h"
55
#include "../GameSpy/PeerDefs.h"
66
#include "OnlineServices_Init.h"
7+
#include "Common/MultiplayerSettings.h"
78

89
extern Color PlayerSlotColors[MAX_SLOTS];
910

11+
extern NGMPGame* TheNGMPGame;
12+
1013
enum class EChatMessageType
1114
{
1215
CHAT_MESSAGE_TYPE_NETWORK_ROOM,
1316
CHAT_MESSAGE_TYPE_LOBBY
1417
};
1518
static Color DetermineColorForChatMessage(EChatMessageType chatMessageType, Bool isPublic, Bool isAction, int lobbySlot = -1)
1619
{
17-
Color style;
20+
Color style = GameMakeColor(255, 255, 255, 255);
1821

1922
// TODO_NGMP: Support owner chat again
2023
Bool isOwner = false;
@@ -34,7 +37,21 @@ static Color DetermineColorForChatMessage(EChatMessageType chatMessageType, Bool
3437
}
3538
else
3639
{
37-
style = PlayerSlotColors[lobbySlot];
40+
if (TheNGMPGame)
41+
{
42+
GameSlot* pSlot = TheNGMPGame->getSlot(lobbySlot);
43+
44+
if (pSlot != nullptr)
45+
{
46+
int numColors = TheMultiplayerSettings->getNumColors();
47+
int color = pSlot->getColor();
48+
if (color > -1 && color < numColors)
49+
{
50+
MultiplayerColorDefinition* def = TheMultiplayerSettings->getColor(color);
51+
style = def->getColor();
52+
}
53+
}
54+
}
3855
}
3956
}
4057
else

0 commit comments

Comments
 (0)