diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index a89f83c0..b4bbe102 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -296,7 +296,8 @@ bool showhudtimer(int maxsecs, int startmillis, const char *msg, bool flash) s_strcat(str, sec); } } - hudeditf(HUDMSG_TIMER, nextticks < maxticks ? (flash ? str : str+2) : msg); + if(nextticks < maxticks) hudeditf(HUDMSG_TIMER|HUDMSG_OVERWRITE, flash ? str : str+2); + else hudeditf(HUDMSG_TIMER, msg); return true; } diff --git a/source/src/protos.h b/source/src/protos.h index 2a7908ca..c861518f 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -475,7 +475,10 @@ extern void pruneundos(int maxremain = 0); enum { HUDMSG_INFO = 0, - HUDMSG_TIMER + HUDMSG_TIMER, + + HUDMSG_TYPE = 0xFF, + HUDMSG_OVERWRITE = 1<<8 }; extern void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater); extern void loadingscreen(const char *fmt = NULL, ...); diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index 2701fad8..d7b5853c 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -273,14 +273,20 @@ struct hudmessages : consolebuffer void addline(const char *sf) { - consolebuffer::addline(sf, totalmillis); + if(conlines.length() && conlines[0].type&HUDMSG_OVERWRITE) + { + conlines[0].millis = totalmillis; + conlines[0].type = HUDMSG_INFO; + s_strcpy(conlines[0].line, sf); + } + else consolebuffer::addline(sf, totalmillis); } void editline(int type, const char *sf) { - if(!conlines.length()) return; - if(conlines.length() && conlines[0].type==type) + if(conlines.length() && ((conlines[0].type&HUDMSG_TYPE)==(type&HUDMSG_TYPE) || conlines[0].type&HUDMSG_OVERWRITE)) { conlines[0].millis = totalmillis; + conlines[0].type = type; s_strcpy(conlines[0].line, sf); } else consolebuffer::addline(sf, totalmillis).type = type;