- 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 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 - 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 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. 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(); 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(); StatusBar = CreateCustomStatusBar();
} }
@ -1579,7 +1595,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
StatusBar->NewGame (); StatusBar->NewGame ();
setsizeneeded = true; 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. // Set the initial quest log text for Strife.
for (i = 0; i < MAXPLAYERS; ++i) for (i = 0; i < MAXPLAYERS; ++i)

View file

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

View file

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

View file

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