mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Color authed players in spec (fixes #1497)
This commit is contained in:
parent
1fec65572b
commit
0f9b89fc74
|
@ -116,9 +116,13 @@ void CScoreboard::RenderSpectators(float x, float y, float w)
|
|||
|
||||
// spectator names
|
||||
y += 30.0f;
|
||||
char aBuffer[1024*4];
|
||||
aBuffer[0] = 0;
|
||||
bool Multiple = false;
|
||||
|
||||
CTextCursor Cursor;
|
||||
TextRender()->SetCursor(&Cursor, x+10.0f, y, 22.0f, TEXTFLAG_RENDER);
|
||||
Cursor.m_LineWidth = w-20.0f;
|
||||
Cursor.m_MaxLines = 4;
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; ++i)
|
||||
{
|
||||
const CNetObj_PlayerInfo *pInfo = m_pClient->m_Snap.m_paInfoByName[i];
|
||||
|
@ -126,21 +130,22 @@ void CScoreboard::RenderSpectators(float x, float y, float w)
|
|||
continue;
|
||||
|
||||
if(Multiple)
|
||||
str_append(aBuffer, ", ", sizeof(aBuffer));
|
||||
TextRender()->TextEx(&Cursor, ", ", 2);
|
||||
|
||||
if(m_pClient->m_aClients[pInfo->m_ClientID].m_AuthLevel)
|
||||
TextRender()->TextColor(0.78f, 1.0f, 0.8f, 1.0f);
|
||||
|
||||
if(g_Config.m_ClShowIDs)
|
||||
{
|
||||
char aId[5];
|
||||
str_format(aId,sizeof(aId),"%d: ",pInfo->m_ClientID);
|
||||
str_append(aBuffer, aId, sizeof(aBuffer));
|
||||
char aBuffer[4];
|
||||
int size = str_format(aBuffer, sizeof(aBuffer), "%d: ", pInfo->m_ClientID);
|
||||
TextRender()->TextEx(&Cursor, aBuffer, size);
|
||||
}
|
||||
str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, sizeof(aBuffer));
|
||||
TextRender()->TextEx(&Cursor, m_pClient->m_aClients[pInfo->m_ClientID].m_aName, -1);
|
||||
TextRender()->TextColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
Multiple = true;
|
||||
}
|
||||
CTextCursor Cursor;
|
||||
TextRender()->SetCursor(&Cursor, x+10.0f, y, 22.0f, TEXTFLAG_RENDER);
|
||||
Cursor.m_LineWidth = w-20.0f;
|
||||
Cursor.m_MaxLines = 4;
|
||||
TextRender()->TextEx(&Cursor, aBuffer, -1);
|
||||
}
|
||||
|
||||
void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const char *pTitle)
|
||||
|
|
Loading…
Reference in a new issue