Fix player list map icon colors to match map markers
The tab player list and teleport menu now show the correct map marker color for each player. The icon is computed using the same hash as the map renderer (getRandomPlayerMapIcon) and stored by player name, bypassing the unreliable small-ID lookup that produced wrong colors on dedicated servers.
This commit is contained in:
1 parent
35fbc7af17
commit
1b423e48d3
6 files changed
+71
-3
No files matched your search
@@ -512,7 +512,7 @@ UIScene_InGameInfoMenu::PlayerInfo *UIScene_InGameInfoMenu::BuildPlayerInfo(INet
|
||||
}
|
||||
|
||||
info->m_voiceStatus = voiceStatus;
|
||||
info->m_colorState = app.GetPlayerColour(info->m_smallId);
|
||||
info->m_colorState = app.GetPlayerMapIconByName(player->GetOnlineName());
|
||||
info->m_name = playerName;
|
||||
|
||||
return info;
|
||||
|
||||
@@ -193,12 +193,12 @@ void UIScene_TeleportMenu::tick()
|
||||
{
|
||||
m_players[i] = player->GetSmallId();
|
||||
|
||||
short icon = app.GetPlayerColour( m_players[i] );
|
||||
short icon = static_cast<short>(app.GetPlayerMapIconByName(player->GetOnlineName()));
|
||||
|
||||
if(icon != m_playersColourState[i])
|
||||
{
|
||||
m_playersColourState[i] = icon;
|
||||
m_playerList.setPlayerIcon( i, (int)app.GetPlayerColour( m_players[i] ) );
|
||||
m_playerList.setPlayerIcon( i, (int)icon );
|
||||
}
|
||||
|
||||
wstring playerName = L"";
|
||||
|
||||
Reference in new issue
Block a user