Client: add r_showTexts to aid debugging of env_message and game_text entities
This commit is contained in:
parent
66b773508d
commit
46f6bfc1d3
1 changed files with 21 additions and 2 deletions
|
@ -67,6 +67,7 @@ GameText_DrawMessage(int i, float timer, int highlight)
|
||||||
float btime;
|
float btime;
|
||||||
string finalstr;
|
string finalstr;
|
||||||
|
|
||||||
|
/* typing effect */
|
||||||
if (g_textchannels[i].m_iEffect == 2) {
|
if (g_textchannels[i].m_iEffect == 2) {
|
||||||
/* scan out */
|
/* scan out */
|
||||||
finalstr = substring(g_textchannels[i].m_strMessage, 0,
|
finalstr = substring(g_textchannels[i].m_strMessage, 0,
|
||||||
|
@ -116,10 +117,28 @@ GameText_DrawMessage(int i, float timer, int highlight)
|
||||||
void
|
void
|
||||||
GameText_Draw(void)
|
GameText_Draw(void)
|
||||||
{
|
{
|
||||||
|
vector debugPos = [16,16];
|
||||||
|
|
||||||
|
if (cvar("r_showTexts") > 0)
|
||||||
|
Font_DrawText(debugPos, "Text Debug Information", FONT_CON);
|
||||||
|
|
||||||
|
debugPos[1] += 20;
|
||||||
|
|
||||||
for (int i = 0i; i < 6; i++) {
|
for (int i = 0i; i < 6; i++) {
|
||||||
GameText_DrawMessage(i, g_textchannels[i].m_flTime - g_textchannels[i].m_flFXTime, 0);
|
/* we'll draw the highlight separately */
|
||||||
GameText_DrawMessage(i, g_textchannels[i].m_flTime, 1);
|
GameText_DrawMessage(i, g_textchannels[i].m_flTime - g_textchannels[i].m_flFXTime, 0); /* first pass */
|
||||||
|
|
||||||
|
/* effect 0 has no highlight */
|
||||||
|
if (g_textchannels[i].m_iEffect != 0)
|
||||||
|
GameText_DrawMessage(i, g_textchannels[i].m_flTime, 1); /* second pass */
|
||||||
|
|
||||||
g_textchannels[i].m_flTime += clframetime;
|
g_textchannels[i].m_flTime += clframetime;
|
||||||
|
|
||||||
|
if (cvar("r_showTexts") <= 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Font_DrawText(debugPos, sprintf("Chan %i: E %i T: %f/%f", i, g_textchannels[i].m_iEffect, g_textchannels[i].m_flTime, g_textchannels[i].m_flHoldTime), FONT_CON);
|
||||||
|
debugPos[1] += 20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue