diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 8d61d8cb9..6e2775485 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -666,12 +666,26 @@ void CChat::OnRender() if(Now > m_aLines[r].m_Time+16*time_freq() && !m_Show) 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) if(m_aLines[r].m_YOffset[OffsetType] < 0.0f) { TextRender()->SetCursor(&Cursor, Begin, 0.0f, FontSize, 0); 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); m_aLines[r].m_YOffset[OffsetType] = Cursor.m_Y + Cursor.m_FontSize; } @@ -710,7 +724,7 @@ void CChat::OnRender() else 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 if (m_aLines[r].m_ClientID == -1)