From 7570986019c4347538934ac3b932ec525b70821a Mon Sep 17 00:00:00 2001 From: Razish Date: Tue, 27 Feb 2024 02:42:43 +1100 Subject: [PATCH] add con_timestamps 2 to disable timestamps in the notify lines only --- code/client/cl_console.cpp | 10 +++++++--- codemp/client/cl_console.cpp | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/code/client/cl_console.cpp b/code/client/cl_console.cpp index f175cbcaf5..4d38c69711 100644 --- a/code/client/cl_console.cpp +++ b/code/client/cl_console.cpp @@ -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; @@ -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... // @@ -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; @@ -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; } diff --git a/codemp/client/cl_console.cpp b/codemp/client/cl_console.cpp index 68968dd941..444ed16015 100644 --- a/codemp/client/cl_console.cpp +++ b/codemp/client/cl_console.cpp @@ -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; @@ -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; @@ -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; @@ -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; }