don't let the timer get pushed down by other messages
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2974 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -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, ...);
|
||||
|
||||
@@ -273,14 +273,20 @@ struct hudmessages : consolebuffer<hudline>
|
||||
|
||||
void addline(const char *sf)
|
||||
{
|
||||
consolebuffer<hudline>::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<hudline>::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<hudline>::addline(sf, totalmillis).type = type;
|
||||
|
||||
Reference in New Issue
Block a user