mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-04 01:41:42 +00:00
Add new SBARINFO top level "AppendStatusBar", allowing for extra SBARINFO code to be added to custom SBARINFO definitions.
This commit is contained in:
parent
d1abc3eb8c
commit
d54a19c7b7
1 changed files with 11 additions and 3 deletions
|
@ -381,6 +381,7 @@ enum //Key words
|
|||
SBARINFO_MUGSHOT,
|
||||
SBARINFO_CREATEPOPUP,
|
||||
SBARINFO_PROTRUSION,
|
||||
SBARINFO_APPENDSTATUSBAR,
|
||||
};
|
||||
|
||||
enum //Bar types
|
||||
|
@ -410,6 +411,7 @@ static const char *SBarInfoTopLevel[] =
|
|||
"mugshot",
|
||||
"createpopup",
|
||||
"protrusion",
|
||||
"appendstatusbar",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -629,6 +631,7 @@ void SBarInfo::ParseSBarInfo(int lump)
|
|||
sc.MustGetToken(';');
|
||||
break;
|
||||
case SBARINFO_STATUSBAR:
|
||||
case SBARINFO_APPENDSTATUSBAR:
|
||||
{
|
||||
if(!baseSet) //If the user didn't explicitly define a base, do so now.
|
||||
gameType = GAME_Any;
|
||||
|
@ -638,11 +641,16 @@ void SBarInfo::ParseSBarInfo(int lump)
|
|||
sc.MustGetToken(TK_Identifier);
|
||||
barNum = sc.MustMatchString(StatusBars);
|
||||
}
|
||||
if (this->huds[barNum] != NULL)
|
||||
// SBARINFO_APPENDSTATUSBAR shouldn't delete the old HUD if it exists.
|
||||
const bool append = (sc.MustMatchString(SBarInfoTopLevel) == SBARINFO_APPENDSTATUSBAR);
|
||||
if (!append)
|
||||
{
|
||||
delete this->huds[barNum];
|
||||
if (this->huds[barNum] != NULL)
|
||||
{
|
||||
delete this->huds[barNum];
|
||||
}
|
||||
this->huds[barNum] = new SBarInfoMainBlock(this);
|
||||
}
|
||||
this->huds[barNum] = new SBarInfoMainBlock(this);
|
||||
if(barNum == STBAR_AUTOMAP)
|
||||
{
|
||||
automapbar = true;
|
||||
|
|
Loading…
Reference in a new issue