mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
added config for showing client ids in scoreboard
This commit is contained in:
parent
47714c9468
commit
9cf90fff77
|
@ -17,6 +17,8 @@ MACRO_CONFIG_INT(ClEditor, cl_editor, 0, 0, 1, CFGFLAG_CLIENT, "", -1)
|
|||
|
||||
MACRO_CONFIG_INT(ClEventthread, cl_eventthread, 0, 0, 1, CFGFLAG_CLIENT, "Enables the usage of a thread to pump the events", -1)
|
||||
|
||||
MACRO_CONFIG_INT(ClShowIds, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard", -1)
|
||||
|
||||
MACRO_CONFIG_INT(InpGrab, inp_grab, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Use forceful input grabbing method", -1)
|
||||
|
||||
MACRO_CONFIG_STR(BrFilterString, br_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Server browser filtering string", -1)
|
||||
|
|
|
@ -107,9 +107,12 @@ void CScoreboard::RenderSpectators(float x, float y, float w)
|
|||
{
|
||||
if(Count)
|
||||
str_append(aBuffer, ", ", sizeof(aBuffer));
|
||||
char aId[3];
|
||||
str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientId);
|
||||
str_append(aBuffer, aId, sizeof(aBuffer));
|
||||
if (g_Config.m_ClShowIds)
|
||||
{
|
||||
char aId[4];
|
||||
str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientId);
|
||||
str_append(aBuffer, aId, sizeof(aBuffer));
|
||||
}
|
||||
str_append(aBuffer, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, sizeof(aBuffer));
|
||||
Count++;
|
||||
}
|
||||
|
@ -245,8 +248,9 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
|
|||
FontSizeResize = FontSize;
|
||||
while(TextRender()->TextWidth(0, FontSizeResize, m_pClient->m_aClients[pInfo->m_ClientId].m_aName, -1) > w-163.0f-PingWidth)
|
||||
--FontSizeResize;
|
||||
char aId[64];
|
||||
str_format(aId,sizeof(aId),"%d:",pInfo->m_ClientId);
|
||||
char aId[64] = "";
|
||||
if (g_Config.m_ClShowIds)
|
||||
str_format(aId, sizeof(aId),"%d:", pInfo->m_ClientId);
|
||||
str_append(aId, m_pClient->m_aClients[pInfo->m_ClientId].m_aName,sizeof(aId));
|
||||
TextRender()->Text(0, x+128.0f, y+(FontSize-FontSizeResize)/2, FontSizeResize, aId, -1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue