mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- Added SBARINFO update #5 by blzut3:
- Fixed: Playerclass still didn't work due to comparing of improper numbers. - Fixed: The arrows on drawinventorybar had a hard coded location instead of relative to the specified coordinates. - Added noarrows flag to drawinventorybar to remove the blue arrows drawn when there are more items to the left or right of the viewable bar. - Added forcescaled flag to the statusbar command. This is ignored on the inventory and inventoryfullscreen types. - Added obituary fix for Strife peasants by Karate Chris. - Added fix for loading during demo playback by Karate Chris. SVN r672 (trunk)
This commit is contained in:
parent
d7add9ce76
commit
1f0fa7c457
5 changed files with 61 additions and 13 deletions
|
@ -1,4 +1,14 @@
|
||||||
January 6, 2008 (Changes by Graf Zahl)
|
January 6, 2008 (Changes by Graf Zahl)
|
||||||
|
- Added SBARINFO update #5 by blzut3:
|
||||||
|
- Fixed: Playerclass still didn't work due to comparing of improper numbers.
|
||||||
|
- Fixed: The arrows on drawinventorybar had a hard coded location instead of
|
||||||
|
relative to the specified coordinates.
|
||||||
|
- Added noarrows flag to drawinventorybar to remove the blue arrows drawn when
|
||||||
|
there are more items to the left or right of the viewable bar.
|
||||||
|
- Added forcescaled flag to the statusbar command. This is ignored on the
|
||||||
|
inventory and inventoryfullscreen types.
|
||||||
|
- Added obituary fix for Strife peasants by Karate Chris.
|
||||||
|
- Added fix for loading during demo playback by Karate Chris.
|
||||||
- Added scoreboard fix by Karate Chris.
|
- Added scoreboard fix by Karate Chris.
|
||||||
- Added teamgame fix for menu by Karate Chris.
|
- Added teamgame fix for menu by Karate Chris.
|
||||||
- Added GZDoom's Sector_Outside sector type which forces outside fog
|
- Added GZDoom's Sector_Outside sector type which forces outside fog
|
||||||
|
|
|
@ -1689,6 +1689,7 @@ void G_DoLoadGame ()
|
||||||
char *map;
|
char *map;
|
||||||
|
|
||||||
gameaction = ga_nothing;
|
gameaction = ga_nothing;
|
||||||
|
demoplayback = false;
|
||||||
|
|
||||||
FILE *stdfile = fopen (savename.GetChars(), "rb");
|
FILE *stdfile = fopen (savename.GetChars(), "rb");
|
||||||
if (stdfile == NULL)
|
if (stdfile == NULL)
|
||||||
|
|
|
@ -32,6 +32,11 @@ EXTERN_CVAR(Int, fraglimit)
|
||||||
|
|
||||||
SBarInfo *SBarInfoScript;
|
SBarInfo *SBarInfoScript;
|
||||||
|
|
||||||
|
enum //statusbar flags
|
||||||
|
{
|
||||||
|
STATUSBARFLAG_FORCESCALED = 1,
|
||||||
|
};
|
||||||
|
|
||||||
enum //gametype flags
|
enum //gametype flags
|
||||||
{
|
{
|
||||||
GAMETYPE_SINGLEPLAYER = 1,
|
GAMETYPE_SINGLEPLAYER = 1,
|
||||||
|
@ -82,6 +87,7 @@ enum //drawinventorybar flags
|
||||||
{
|
{
|
||||||
DRAWINVENTORYBAR_ALWAYSSHOW = 1,
|
DRAWINVENTORYBAR_ALWAYSSHOW = 1,
|
||||||
DRAWINVENTORYBAR_NOARTIBOX = 2,
|
DRAWINVENTORYBAR_NOARTIBOX = 2,
|
||||||
|
DRAWINVENTORYBAR_NOARROWS = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum //drawgem flags
|
enum //drawgem flags
|
||||||
|
@ -228,6 +234,18 @@ int SBarInfo::ParseSBarInfo(int lump)
|
||||||
{
|
{
|
||||||
SC_MustGetToken(TK_Identifier);
|
SC_MustGetToken(TK_Identifier);
|
||||||
int barNum = SC_MustMatchString(StatusBars);
|
int barNum = SC_MustMatchString(StatusBars);
|
||||||
|
while(SC_CheckToken(','))
|
||||||
|
{
|
||||||
|
SC_MustGetToken(TK_Identifier);
|
||||||
|
if(SC_Compare("forcescaled"))
|
||||||
|
{
|
||||||
|
this->huds[barNum].forceScaled = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SC_ScriptError("Unkown flag '%s'.", sc_String);
|
||||||
|
}
|
||||||
|
}
|
||||||
SC_MustGetToken('{');
|
SC_MustGetToken('{');
|
||||||
if(barNum == STBAR_AUTOMAP)
|
if(barNum == STBAR_AUTOMAP)
|
||||||
{
|
{
|
||||||
|
@ -526,6 +544,10 @@ void SBarInfo::ParseSBarInfoBlock(SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
cmd.flags += DRAWINVENTORYBAR_NOARTIBOX;
|
cmd.flags += DRAWINVENTORYBAR_NOARTIBOX;
|
||||||
}
|
}
|
||||||
|
else if(SC_Compare("noarrows"))
|
||||||
|
{
|
||||||
|
cmd.flags += DRAWINVENTORYBAR_NOARROWS;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SC_ScriptError("Unknown flag '%s'.", sc_String);
|
SC_ScriptError("Unknown flag '%s'.", sc_String);
|
||||||
|
@ -763,11 +785,11 @@ void SBarInfo::ParseSBarInfoBlock(SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
foundClass = true;
|
foundClass = true;
|
||||||
if(i == 0)
|
if(i == 0)
|
||||||
cmd.special = c;
|
cmd.special = PlayerClasses[c].Type->ClassIndex;
|
||||||
else if(i == 1)
|
else if(i == 1)
|
||||||
cmd.special2 = c;
|
cmd.special2 = PlayerClasses[c].Type->ClassIndex;
|
||||||
else //should be 2
|
else //should be 2
|
||||||
cmd.special3 = c;
|
cmd.special3 = PlayerClasses[c].Type->ClassIndex;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -868,6 +890,11 @@ SBarInfoCommand::SBarInfoCommand() //sets the default values for more predicable
|
||||||
font = V_GetFont("CONFONT");
|
font = V_GetFont("CONFONT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SBarInfoBlock::SBarInfoBlock()
|
||||||
|
{
|
||||||
|
forceScaled = false;
|
||||||
|
}
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ST_FACENORMALRIGHT,
|
ST_FACENORMALRIGHT,
|
||||||
|
@ -1144,6 +1171,11 @@ public:
|
||||||
{
|
{
|
||||||
hud = 0;
|
hud = 0;
|
||||||
}
|
}
|
||||||
|
if(SBarInfoScript->huds[hud].forceScaled) //scale the statusbar
|
||||||
|
{
|
||||||
|
SetScaled(true);
|
||||||
|
setsizeneeded = true;
|
||||||
|
}
|
||||||
doCommands(SBarInfoScript->huds[hud]);
|
doCommands(SBarInfoScript->huds[hud]);
|
||||||
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
||||||
{
|
{
|
||||||
|
@ -1491,15 +1523,18 @@ private:
|
||||||
{
|
{
|
||||||
bool alwaysshow = false;
|
bool alwaysshow = false;
|
||||||
bool artibox = true;
|
bool artibox = true;
|
||||||
|
bool noarrows = false;
|
||||||
if((cmd.flags & DRAWINVENTORYBAR_ALWAYSSHOW))
|
if((cmd.flags & DRAWINVENTORYBAR_ALWAYSSHOW))
|
||||||
alwaysshow = true;
|
alwaysshow = true;
|
||||||
if((cmd.flags & DRAWINVENTORYBAR_NOARTIBOX))
|
if((cmd.flags & DRAWINVENTORYBAR_NOARTIBOX))
|
||||||
artibox = false;
|
artibox = false;
|
||||||
|
if((cmd.flags & DRAWINVENTORYBAR_NOARROWS))
|
||||||
|
noarrows = true;
|
||||||
if(drawingFont != cmd.font)
|
if(drawingFont != cmd.font)
|
||||||
{
|
{
|
||||||
drawingFont = cmd.font;
|
drawingFont = cmd.font;
|
||||||
}
|
}
|
||||||
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox);
|
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox, noarrows);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWBAR:
|
case SBARINFO_DRAWBAR:
|
||||||
|
@ -1677,7 +1712,7 @@ private:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SBARINFO_PLAYERCLASS:
|
case SBARINFO_PLAYERCLASS:
|
||||||
int spawnClass = CPlayer->GetSpawnClass();
|
int spawnClass = CPlayer->cls->ClassIndex;
|
||||||
if(cmd.special == spawnClass || cmd.special2 == spawnClass || cmd.special3 == spawnClass)
|
if(cmd.special == spawnClass || cmd.special2 == spawnClass || cmd.special3 == spawnClass)
|
||||||
{
|
{
|
||||||
doCommands(cmd.subBlock);
|
doCommands(cmd.subBlock);
|
||||||
|
@ -1855,8 +1890,8 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawInventoryBar(int type, int num, int x, int y, bool alwaysshow,
|
void DrawInventoryBar(int type, int num, int x, int y, bool alwaysshow,
|
||||||
int counterx, int countery, EColorRange translation, bool drawArtiboxes) //yes, there is some Copy & Paste here too
|
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows)
|
||||||
{
|
{ //yes, there is some Copy & Paste here too
|
||||||
const AInventory *item;
|
const AInventory *item;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1892,16 +1927,16 @@ private:
|
||||||
DrawImage (Images[invBarOffset + imgARTIBOX], x+i*31, y);
|
DrawImage (Images[invBarOffset + imgARTIBOX], x+i*31, y);
|
||||||
}
|
}
|
||||||
// Is there something to the left?
|
// Is there something to the left?
|
||||||
if (CPlayer->mo->FirstInv() != CPlayer->mo->InvFirst)
|
if (!noArrows && CPlayer->mo->FirstInv() != CPlayer->mo->InvFirst)
|
||||||
{
|
{
|
||||||
DrawImage (Images[!(gametic & 4) ?
|
DrawImage (Images[!(gametic & 4) ?
|
||||||
invBarOffset + imgINVLFGEM1 : invBarOffset + imgINVLFGEM2], 38, 2);
|
invBarOffset + imgINVLFGEM1 : invBarOffset + imgINVLFGEM2], x-12, y);
|
||||||
}
|
}
|
||||||
// Is there something to the right?
|
// Is there something to the right?
|
||||||
if (item != NULL)
|
if (!noArrows && item != NULL)
|
||||||
{
|
{
|
||||||
DrawImage (Images[!(gametic & 4) ?
|
DrawImage (Images[!(gametic & 4) ?
|
||||||
invBarOffset + imgINVRTGEM1 : invBarOffset + imgINVRTGEM2], 269, 2);
|
invBarOffset + imgINVRTGEM1 : invBarOffset + imgINVRTGEM2], x+num*31+2, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,8 @@ struct SBarInfoCommand; //we need to be able to use this before it is defined.
|
||||||
struct SBarInfoBlock
|
struct SBarInfoBlock
|
||||||
{
|
{
|
||||||
TArray<SBarInfoCommand> commands;
|
TArray<SBarInfoCommand> commands;
|
||||||
|
bool forceScaled;
|
||||||
|
SBarInfoBlock();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SBarInfoCommand
|
struct SBarInfoCommand
|
||||||
|
|
|
@ -654,8 +654,8 @@ OB_ACOLYTE = "%o was zealously shot down by an Acolyte.";
|
||||||
OB_MACIL = "%o should have never rebelled against Macil.";
|
OB_MACIL = "%o should have never rebelled against Macil.";
|
||||||
OB_REBEL = "%o was gunned down by a Rebel.";
|
OB_REBEL = "%o was gunned down by a Rebel.";
|
||||||
OB_BEGGAR = "%o was beaten to death by the poor.";
|
OB_BEGGAR = "%o was beaten to death by the poor.";
|
||||||
OB_PEASANT = "%o should have never picked fights with civilians."
|
OB_PEASANT = "%o should have never picked a fight with a civilian.";
|
||||||
OB_ALIENSPECTE = "%o was struck down by the Spectre";
|
OB_ALIENSPECTE = "%o was struck down by the Spectre.";
|
||||||
OB_ENTITY = "%o felt the wrath of The One God.";
|
OB_ENTITY = "%o felt the wrath of The One God.";
|
||||||
OB_LOREMASTER = "%o couldn't escape from the Lore Master's grasp.";
|
OB_LOREMASTER = "%o couldn't escape from the Lore Master's grasp.";
|
||||||
OB_PROGRAMMER = "%o was deleted by the Programmer.";
|
OB_PROGRAMMER = "%o was deleted by the Programmer.";
|
||||||
|
|
Loading…
Reference in a new issue