From: havoc Date: Fri, 14 Feb 2003 01:17:51 +0000 (+0000) Subject: added con_notify cvar, which controls how many console notify lines are displayed... X-Git-Tag: xonotic-v0.1.0preview~6766 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=7139b3ada26cb263795aa7f965197428c4c7ea7d;ds=sidebyside added con_notify cvar, which controls how many console notify lines are displayed (default 4 like quake, max 32) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2739 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 6c5c6497..bb971ad4 100644 --- a/console.c +++ b/console.c @@ -51,11 +51,12 @@ char *con_text = 0; //seconds cvar_t con_notifytime = {CVAR_SAVE, "con_notifytime","3"}; +cvar_t con_notify = {CVAR_SAVE, "con_notify","4"}; cvar_t logfile = {0, "logfile","0"}; -#define NUM_CON_TIMES 4 +#define MAX_NOTIFYLINES 32 // realtime time the line was generated for transparent notify lines -float con_times[NUM_CON_TIMES]; +float con_times[MAX_NOTIFYLINES]; int con_vislines; @@ -110,7 +111,7 @@ void Con_ClearNotify (void) { int i; - for (i=0 ; i= 0) - con_times[con_current % NUM_CON_TIMES] = realtime; + { + if (con_notify.integer < 0) + Cvar_SetValueQuick(&con_notify, 0); + if (con_notifylines > MAX_NOTIFYLINES) + Cvar_SetValueQuick(&con_notify, MAX_NOTIFYLINES); + if (con_notify.integer > 0) + con_times[con_current % con_notify.integer] = realtime; + } } switch (c) @@ -509,12 +518,16 @@ void Con_DrawNotify (void) extern char chat_buffer[]; char temptext[256]; + if (con_notify.integer < 0) + Cvar_SetValueQuick(&con_notify, 0); + if (con_notifylines > MAX_NOTIFYLINES) + Cvar_SetValueQuick(&con_notify, MAX_NOTIFYLINES); v = 0; - for (i= con_current-NUM_CON_TIMES+1 ; i<=con_current ; i++) + for (i= con_current-con_notify.integer+1 ; i<=con_current ; i++) { if (i < 0) continue; - time = con_times[i % NUM_CON_TIMES]; + time = con_times[i % con_notify.integer]; if (time == 0) continue; time = realtime - time; @@ -554,7 +567,7 @@ void Con_DrawNotify (void) } } - if (v > con_notifylines) + if (con_notifylines < v) con_notifylines = v; }