mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 03:28:19 +00:00
cl_show_ids also shows ID in chat (fixes #454)
This commit is contained in:
parent
ff747953b4
commit
d1275f239a
|
@ -666,12 +666,26 @@ void CChat::OnRender()
|
||||||
if(Now > m_aLines[r].m_Time+16*time_freq() && !m_Show)
|
if(Now > m_aLines[r].m_Time+16*time_freq() && !m_Show)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
char aName[64] = "";
|
||||||
|
if(g_Config.m_ClShowIDs && m_aLines[r].m_ClientID != -1 && m_aLines[r].m_aName[0] != '\0')
|
||||||
|
{
|
||||||
|
if (m_aLines[r].m_ClientID >= 10)
|
||||||
|
str_format(aName, sizeof(aName),"%d: ", m_aLines[r].m_ClientID);
|
||||||
|
else
|
||||||
|
str_format(aName, sizeof(aName)," %d: ", m_aLines[r].m_ClientID);
|
||||||
|
str_append(aName, m_aLines[r].m_aName,sizeof(aName));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str_copy(aName, m_aLines[r].m_aName, sizeof(aName));
|
||||||
|
}
|
||||||
|
|
||||||
// get the y offset (calculate it if we haven't done that yet)
|
// get the y offset (calculate it if we haven't done that yet)
|
||||||
if(m_aLines[r].m_YOffset[OffsetType] < 0.0f)
|
if(m_aLines[r].m_YOffset[OffsetType] < 0.0f)
|
||||||
{
|
{
|
||||||
TextRender()->SetCursor(&Cursor, Begin, 0.0f, FontSize, 0);
|
TextRender()->SetCursor(&Cursor, Begin, 0.0f, FontSize, 0);
|
||||||
Cursor.m_LineWidth = LineWidth;
|
Cursor.m_LineWidth = LineWidth;
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
|
TextRender()->TextEx(&Cursor, aName, -1);
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aText, -1);
|
TextRender()->TextEx(&Cursor, m_aLines[r].m_aText, -1);
|
||||||
m_aLines[r].m_YOffset[OffsetType] = Cursor.m_Y + Cursor.m_FontSize;
|
m_aLines[r].m_YOffset[OffsetType] = Cursor.m_Y + Cursor.m_FontSize;
|
||||||
}
|
}
|
||||||
|
@ -710,7 +724,7 @@ void CChat::OnRender()
|
||||||
else
|
else
|
||||||
TextRender()->TextColor(0.8f, 0.8f, 0.8f, Blend);
|
TextRender()->TextColor(0.8f, 0.8f, 0.8f, Blend);
|
||||||
|
|
||||||
TextRender()->TextEx(&Cursor, m_aLines[r].m_aName, -1);
|
TextRender()->TextEx(&Cursor, aName, -1);
|
||||||
|
|
||||||
// render line
|
// render line
|
||||||
if (m_aLines[r].m_ClientID == -1)
|
if (m_aLines[r].m_ClientID == -1)
|
||||||
|
|
Loading…
Reference in a new issue