Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shared] add con_timestamps 2 to disable timestamps in the notify lines only #1216

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, if there are multiple notify lines it will start printing the timestamp from line 2 at the end of line 1 🤦

}

// 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
10 changes: 7 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,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;
}

if (cl.snap.ps.pm_type != PM_INTERMISSION && Key_GetCatcher( ) & (KEYCATCH_UI | KEYCATCH_CGAME) ) {
continue;
Expand All @@ -778,7 +782,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 +800,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
Loading