Skip to content

Commit

Permalink
add con_timestamps 2 to disable timestamps in the notify lines only
Browse files Browse the repository at this point in the history
  • Loading branch information
Razish committed Feb 26, 2024
1 parent 1e8a799 commit 7570986
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions code/client/cl_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ Draws the last few lines of output transparently over the game top
void Con_DrawNotify (void)
{
int x, v;
int lineLimit = con.linewidth;
conChar_t *text;
int i;
int time;
Expand Down Expand Up @@ -631,8 +632,11 @@ void Con_DrawNotify (void)
if (time > con_notifytime->value*1000)
continue;
text = con.text + (i % con.totallines)*con.rowwidth;
if (!con_timestamps->integer)
if (con_timestamps->integer == 0 || con_timestamps->integer == 2) {
// don't show timestamps in the notify lines
text += CON_TIMESTAMP_LEN;
lineLimit -= CON_TIMESTAMP_LEN;
}

// asian language needs to use the new font system to print glyphs...
//
Expand All @@ -644,7 +648,7 @@ void Con_DrawNotify (void)
//
char sTemp[4096]; // ott
sTemp[0] = '\0';
for (x = 0 ; x < con.linewidth ; x++)
for (x = 0 ; x < lineLimit ; x++)
{
if ( text[x].f.color != currentColor ) {
currentColor = text[x].f.color;
Expand All @@ -662,7 +666,7 @@ void Con_DrawNotify (void)
}
else
{
for (x = 0 ; x < con.linewidth ; x++) {
for (x = 0 ; x < lineLimit ; x++) {
if ( text[x].f.character == ' ' ) {
continue;
}
Expand Down
9 changes: 6 additions & 3 deletions codemp/client/cl_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ Draws the last few lines of output transparently over the game top
void Con_DrawNotify (void)
{
int x, v;
int lineLimit = con.linewidth;
conChar_t *text;
int i;
int time;
Expand Down Expand Up @@ -755,8 +756,10 @@ void Con_DrawNotify (void)
if (time > con_notifytime->value*1000)
continue;
text = con.text + (i % con.totallines)*con.rowwidth;
if (!con_timestamps->integer)
if (con_timestamps->integer == 0 || con_timestamps->integer == 2) {
text += CON_TIMESTAMP_LEN;
lineLimit -= CON_TIMESTAMP_LEN;
}

if (cl.snap.ps.pm_type != PM_INTERMISSION && Key_GetCatcher( ) & (KEYCATCH_UI | KEYCATCH_CGAME) ) {
continue;
Expand All @@ -778,7 +781,7 @@ void Con_DrawNotify (void)
//
char sTemp[4096]; // ott
sTemp[0] = '\0';
for (x = 0 ; x < con.linewidth ; x++)
for (x = 0 ; x < lineLimit ; x++)
{
if ( text[x].f.color != currentColor ) {
currentColor = text[x].f.color;
Expand All @@ -796,7 +799,7 @@ void Con_DrawNotify (void)
}
else
{
for (x = 0 ; x < con.linewidth ; x++) {
for (x = 0 ; x < lineLimit ; x++) {
if ( text[x].f.character == ' ' ) {
continue;
}
Expand Down

0 comments on commit 7570986

Please sign in to comment.