- Applied Blzut3's sbarinfo update #11:

* SBarInfo will also accept a '|' between flags for those who are really
    bothered by the indefinite "arguments" in the middle of the statement.
  * Added: completeBorder. When set to true SBarInfo will draw the border where
    the status bar normally goes.
  * Fixed: I forgot to accept TK_None on "base" and "statusbar".
  * Fixed: "base" was apparently broken when the SBarInfo init code was moved to
    d_main.cpp. Also, if "base Strife" was used then it would not use the
    default log message of "find help".


SVN r736 (trunk)
This commit is contained in:
Randy Heit 2008-02-09 03:55:41 +00:00
parent 0bb9fc1e2d
commit 0f3a1cc8b1
5 changed files with 70 additions and 9 deletions

View file

@ -1,4 +1,13 @@
February 8, 2008
- Applied Blzut3's sbarinfo update #11:
* SBarInfo will also accept a '|' between flags for those who are really
bothered by the indefinite "arguments" in the middle of the statement.
* Added: completeBorder. When set to true SBarInfo will draw the border where
the status bar normally goes.
* Fixed: I forgot to accept TK_None on "base" and "statusbar".
* Fixed: "base" was apparently broken when the SBarInfo init code was moved to
d_main.cpp. Also, if "base Strife" was used then it would not use the
default log message of "find help".
- Fixed: D_ReadUserInfoString() parsed the final element of a compact string
as the empty string. Since that was the player class, this meant that any
games with more than one class would pick a random class in multiplayer.

View file

@ -1547,7 +1547,23 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
{
int cstype = SBarInfoScript->GetGameType();
if (cstype == GAME_Any || cstype == gameinfo.gametype)
if(cstype == GAME_Doom) //Did the user specify a "base"
{
StatusBar = CreateDoomStatusBar ();
}
else if(cstype == GAME_Heretic)
{
StatusBar = CreateHereticStatusBar();
}
else if(cstype == GAME_Hexen)
{
StatusBar = CreateHexenStatusBar();
}
else if(cstype == GAME_Strife)
{
StatusBar = CreateStrifeStatusBar();
}
else //Use the default, empty or custom.
{
StatusBar = CreateCustomStatusBar();
}
@ -1579,7 +1595,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
StatusBar->NewGame ();
setsizeneeded = true;
if (gameinfo.gametype == GAME_Strife)
if (gameinfo.gametype == GAME_Strife || (SBarInfoScript != NULL && SBarInfoScript->GetGameType() == GAME_Strife))
{
// Set the initial quest log text for Strife.
for (i = 0; i < MAXPLAYERS; ++i)

View file

@ -17,6 +17,7 @@
#include "sc_man.h"
#include "gi.h"
#include "r_translate.h"
#include "r_main.h"
static FRandom pr_chainwiggle; //use the same method of chain wiggling as heretic.
@ -29,6 +30,7 @@ static FRandom pr_chainwiggle; //use the same method of chain wiggling as hereti
#define ARTIFLASH_OFFSET (invBarOffset+6)
EXTERN_CVAR(Int, fraglimit)
EXTERN_CVAR(Int, screenblocks)
SBarInfo *SBarInfoScript;
@ -135,6 +137,7 @@ static const char *SBarInfoTopLevel[] =
"base",
"height",
"interpolatehealth",
"completeborder",
"statusbar",
NULL
};
@ -143,6 +146,7 @@ enum
SBARINFO_BASE,
SBARINFO_HEIGHT,
SBARINFO_INTERPOLATEHEALTH,
SBARINFO_COMPLETEBORDER,
SBARINFO_STATUSBAR,
};
@ -234,7 +238,8 @@ void SBarInfo::ParseSBarInfo(int lump)
switch(sc.MustMatchString(SBarInfoTopLevel))
{
case SBARINFO_BASE:
sc.MustGetToken(TK_Identifier);
if(!sc.CheckToken(TK_None))
sc.MustGetToken(TK_Identifier);
if(sc.Compare("Doom"))
gameType = GAME_Doom;
else if(sc.Compare("Heretic"))
@ -261,7 +266,7 @@ void SBarInfo::ParseSBarInfo(int lump)
}
else
{
sc.TokenMustBe(TK_False);
sc.MustGetToken(TK_False);
interpolateHealth = false;
}
if(sc.CheckToken(',')) //speed param
@ -271,10 +276,26 @@ void SBarInfo::ParseSBarInfo(int lump)
}
sc.MustGetToken(';');
break;
case SBARINFO_COMPLETEBORDER: //draws the border instead of an HOM
if(sc.CheckToken(TK_True))
{
completeBorder = true;
}
else
{
sc.MustGetToken(TK_False);
completeBorder = false;
}
sc.MustGetToken(';');
break;
case SBARINFO_STATUSBAR:
{
sc.MustGetToken(TK_Identifier);
int barNum = sc.MustMatchString(StatusBars);
int barNum = 0;
if(!sc.CheckToken(TK_None))
{
sc.MustGetToken(TK_Identifier);
barNum = sc.MustMatchString(StatusBars);
}
while(sc.CheckToken(','))
{
sc.MustGetToken(TK_Identifier);
@ -529,7 +550,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
cmd.flags += DRAWMUGSHOT_ANIMATEDGODMODE;
else
sc.ScriptError("Unknown flag '%s'.", sc.String);
sc.MustGetToken(',');
if(!sc.CheckToken('|'))
sc.MustGetToken(',');
}
this->getCoordinates(sc, cmd);
sc.MustGetToken(';');
@ -561,7 +583,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
sc.MustGetToken(',');
break;
}
sc.MustGetToken(',');
if(!sc.CheckToken('|'))
sc.MustGetToken(',');
}
sc.MustGetToken(TK_IntConst);
cmd.x = sc.Number;
@ -631,7 +654,8 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
{
sc.ScriptError("Unknown flag '%s'.", sc.String);
}
sc.MustGetToken(',');
if(!sc.CheckToken('|'))
sc.MustGetToken(',');
}
sc.MustGetToken(TK_IntConst);
cmd.value = sc.Number;
@ -1014,6 +1038,7 @@ void SBarInfo::Init()
{
automapbar = false;
interpolateHealth = false;
completeBorder = false;
interpolationSpeed = 8;
height = 0;
}
@ -1241,6 +1266,13 @@ public:
int hud = 2;
if(state == HUD_StatusBar)
{
if(SBarInfoScript->completeBorder) //Fill the statusbar with the border before we draw.
{
FTexture *b = TexMan[gameinfo.border->b];
R_DrawBorder(viewwindowx, viewwindowy + realviewheight + b->GetHeight(), viewwindowx + realviewwidth, SCREENHEIGHT);
if(screenblocks == 10)
screen->FlatFill(viewwindowx, viewwindowy + realviewheight, viewwindowx + realviewwidth, viewwindowy + realviewheight + b->GetHeight(), b, true);
}
if(SBarInfoScript->automapbar && automapactive)
{
hud = 3;

View file

@ -46,6 +46,7 @@ struct SBarInfo
SBarInfoBlock huds[6];
bool automapbar;
bool interpolateHealth;
bool completeBorder;
int interpolationSpeed;
int height;
int gameType;

View file

@ -932,6 +932,9 @@ $alias menu/dismiss PlatformStop
$alias menu/choose DoorCloseLight
$alias menu/clear PlatformStop
// Hexen does not have ripslop sound like Heretic
misc/ripslop dsempty
$limit DoorCloseLight 4
$limit PuppyBeat 0