mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 23:01:59 +00:00
(SBARINfO update)
- Added: fullscreenoffsets flag for status bars. This changes the coordinate system to be relative to the top left corner of the screen. This is useful for full screen status bars. - Changed: drawinventorybar will use the width of artibox or invcurs (strife) to determine the spacing. Let me know if this breaks any released mods. - Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar would be shown. - Fixed: If a static inventory bar was used the user still had to press invuse in order to get rid of the "overlay". - Fixed: forcescaled would not work if the height of the bar was 0. - Added: keyslot to drawswitchableimage. - Fixed: The transition effects for the log and keys popups were switched. SVN r1116 (trunk)
This commit is contained in:
parent
3700fda0e8
commit
3908c71510
6 changed files with 236 additions and 114 deletions
|
@ -1,3 +1,17 @@
|
||||||
|
August 6, 2008 (SBARINfO update)
|
||||||
|
- Added: fullscreenoffsets flag for status bars. This changes the coordinate
|
||||||
|
system to be relative to the top left corner of the screen. This is useful
|
||||||
|
for full screen status bars.
|
||||||
|
- Changed: drawinventorybar will use the width of artibox or invcurs (strife)
|
||||||
|
to determine the spacing. Let me know if this breaks any released mods.
|
||||||
|
- Fixed: If a status bar height of 0 was specified in SBarInfo the wrong bar
|
||||||
|
would be shown.
|
||||||
|
- Fixed: If a static inventory bar was used the user still had to press invuse
|
||||||
|
in order to get rid of the "overlay".
|
||||||
|
- Fixed: forcescaled would not work if the height of the bar was 0.
|
||||||
|
- Added: keyslot to drawswitchableimage.
|
||||||
|
- Fixed: The transition effects for the log and keys popups were switched.
|
||||||
|
|
||||||
August 5, 2008 (Changes by Graf Zahl)
|
August 5, 2008 (Changes by Graf Zahl)
|
||||||
- Converted Strife's Crusader, Inquisitor and spectral missiles to
|
- Converted Strife's Crusader, Inquisitor and spectral missiles to
|
||||||
DECORATE.
|
DECORATE.
|
||||||
|
|
|
@ -262,7 +262,7 @@ public:
|
||||||
DBaseStatusBar (int reltop);
|
DBaseStatusBar (int reltop);
|
||||||
void Destroy ();
|
void Destroy ();
|
||||||
|
|
||||||
void SetScaled (bool scale);
|
void SetScaled (bool scale, bool force=false);
|
||||||
|
|
||||||
void AttachMessage (DHUDMessage *msg, uint32 id=0);
|
void AttachMessage (DHUDMessage *msg, uint32 id=0);
|
||||||
DHUDMessage *DetachMessage (DHUDMessage *msg);
|
DHUDMessage *DetachMessage (DHUDMessage *msg);
|
||||||
|
|
|
@ -85,6 +85,7 @@ struct SBarInfoBlock
|
||||||
{
|
{
|
||||||
TArray<SBarInfoCommand> commands;
|
TArray<SBarInfoCommand> commands;
|
||||||
bool forceScaled;
|
bool forceScaled;
|
||||||
|
bool fullScreenOffsets;
|
||||||
int alpha;
|
int alpha;
|
||||||
|
|
||||||
SBarInfoBlock();
|
SBarInfoBlock();
|
||||||
|
@ -135,7 +136,7 @@ struct SBarInfo
|
||||||
void ParseSBarInfo(int lump);
|
void ParseSBarInfo(int lump);
|
||||||
void ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block);
|
void ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block);
|
||||||
void ParseMugShotBlock(FScanner &sc, FMugShotState &state);
|
void ParseMugShotBlock(FScanner &sc, FMugShotState &state);
|
||||||
void getCoordinates(FScanner &sc, SBarInfoCommand &cmd); //retrieves the next two arguments as x and y.
|
void getCoordinates(FScanner &sc, SBarInfoCommand &cmd, bool fullScreenOffsets); //retrieves the next two arguments as x and y.
|
||||||
int getSignedInteger(FScanner &sc); //returns a signed integer.
|
int getSignedInteger(FScanner &sc); //returns a signed integer.
|
||||||
int newImage(const char* patchname);
|
int newImage(const char* patchname);
|
||||||
void Init();
|
void Init();
|
||||||
|
@ -150,11 +151,6 @@ extern SBarInfo *SBarInfoScript;
|
||||||
|
|
||||||
|
|
||||||
// Enums used between the parser and the display
|
// Enums used between the parser and the display
|
||||||
enum //statusbar flags
|
|
||||||
{
|
|
||||||
STATUSBARFLAG_FORCESCALED = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum //gametype flags
|
enum //gametype flags
|
||||||
{
|
{
|
||||||
GAMETYPE_SINGLEPLAYER = 1,
|
GAMETYPE_SINGLEPLAYER = 1,
|
||||||
|
@ -165,18 +161,19 @@ enum //gametype flags
|
||||||
|
|
||||||
enum //drawimage flags
|
enum //drawimage flags
|
||||||
{
|
{
|
||||||
DRAWIMAGE_PLAYERICON = 1,
|
DRAWIMAGE_PLAYERICON = 0x1,
|
||||||
DRAWIMAGE_AMMO1 = 2,
|
DRAWIMAGE_AMMO1 = 0x2,
|
||||||
DRAWIMAGE_AMMO2 = 4,
|
DRAWIMAGE_AMMO2 = 0x4,
|
||||||
DRAWIMAGE_INVENTORYICON = 8,
|
DRAWIMAGE_INVENTORYICON = 0x8,
|
||||||
DRAWIMAGE_TRANSLATABLE = 16,
|
DRAWIMAGE_TRANSLATABLE = 0x10,
|
||||||
DRAWIMAGE_WEAPONSLOT = 32,
|
DRAWIMAGE_WEAPONSLOT = 0x20,
|
||||||
DRAWIMAGE_SWITCHABLE_AND = 64,
|
DRAWIMAGE_SWITCHABLE_AND = 0x40,
|
||||||
DRAWIMAGE_INVULNERABILITY = 128,
|
DRAWIMAGE_INVULNERABILITY = 0x80,
|
||||||
DRAWIMAGE_OFFSET_CENTER = 256,
|
DRAWIMAGE_OFFSET_CENTER = 0x100,
|
||||||
DRAWIMAGE_ARMOR = 512,
|
DRAWIMAGE_ARMOR = 0x200,
|
||||||
DRAWIMAGE_WEAPONICON = 1024,
|
DRAWIMAGE_WEAPONICON = 0x400,
|
||||||
DRAWIMAGE_SIGIL = 2048,
|
DRAWIMAGE_SIGIL = 0x800,
|
||||||
|
DRAWIMAGE_KEYSLOT = 0x1000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum //drawnumber flags
|
enum //drawnumber flags
|
||||||
|
@ -344,14 +341,14 @@ public:
|
||||||
void SetMugShotState(const char* stateName, bool waitTillDone=false, bool reset=false);
|
void SetMugShotState(const char* stateName, bool waitTillDone=false, bool reset=false);
|
||||||
private:
|
private:
|
||||||
void doCommands(SBarInfoBlock &block, int xOffset=0, int yOffset=0, int alpha=FRACUNIT);
|
void doCommands(SBarInfoBlock &block, int xOffset=0, int yOffset=0, int alpha=FRACUNIT);
|
||||||
void DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha, bool translate=false, bool dim=false, bool center=false);
|
void DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, bool translate=false, bool dim=false, bool center=false);
|
||||||
void DrawString(const char* str, int x, int y, int xOffset, int yOffset, int alpha, EColorRange translation, int spacing=0);
|
void DrawString(const char* str, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, EColorRange translation, int spacing=0);
|
||||||
void DrawNumber(int num, int len, int x, int y, int xOffset, int yOffset, int alpha, EColorRange translation, int spacing=0, bool fillzeros=false);
|
void DrawNumber(int num, int len, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, EColorRange translation, int spacing=0, bool fillzeros=false);
|
||||||
void DrawFace(const char *defaultFace, int accuracy, bool xdth, bool animatedgodmode, int x, int y, int xOffset, int yOffset, int alpha);
|
void DrawFace(const char *defaultFace, int accuracy, bool xdth, bool animatedgodmode, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets);
|
||||||
int updateState(bool xdth, bool animatedgodmode);
|
int updateState(bool xdth, bool animatedgodmode);
|
||||||
void DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool alwaysshow,
|
void DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, bool alwaysshow,
|
||||||
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter);
|
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter);
|
||||||
void DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int xOffset, int yOffset, int alpha, int padleft, int padright, int chainsize,
|
void DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, int padleft, int padright, int chainsize,
|
||||||
bool wiggle, bool translate);
|
bool wiggle, bool translate);
|
||||||
FRemapTable* getTranslation();
|
FRemapTable* getTranslation();
|
||||||
|
|
||||||
|
|
|
@ -226,17 +226,28 @@ void DSBarInfo::Draw (EHudState state)
|
||||||
}
|
}
|
||||||
if(SBarInfoScript->huds[hud].forceScaled) //scale the statusbar
|
if(SBarInfoScript->huds[hud].forceScaled) //scale the statusbar
|
||||||
{
|
{
|
||||||
SetScaled(true);
|
SetScaled(true, true);
|
||||||
setsizeneeded = true;
|
setsizeneeded = true;
|
||||||
}
|
}
|
||||||
doCommands(SBarInfoScript->huds[hud], 0, 0, SBarInfoScript->huds[hud].alpha);
|
doCommands(SBarInfoScript->huds[hud], 0, 0, SBarInfoScript->huds[hud].alpha);
|
||||||
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
if(CPlayer->inventorytics > 0 && !(level.flags & LEVEL_NOINVENTORYBAR))
|
||||||
{
|
{
|
||||||
if(state == HUD_StatusBar)
|
if(state == HUD_StatusBar)
|
||||||
|
{
|
||||||
|
// No overlay? Lets cancel it.
|
||||||
|
if(SBarInfoScript->huds[STBAR_INVENTORY].commands.Size() == 0)
|
||||||
|
CPlayer->inventorytics = 0;
|
||||||
|
else
|
||||||
doCommands(SBarInfoScript->huds[STBAR_INVENTORY], 0, 0, SBarInfoScript->huds[STBAR_INVENTORY].alpha);
|
doCommands(SBarInfoScript->huds[STBAR_INVENTORY], 0, 0, SBarInfoScript->huds[STBAR_INVENTORY].alpha);
|
||||||
|
}
|
||||||
else if(state == HUD_Fullscreen)
|
else if(state == HUD_Fullscreen)
|
||||||
|
{
|
||||||
|
if(SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN].commands.Size() == 0)
|
||||||
|
CPlayer->inventorytics = 0;
|
||||||
|
else
|
||||||
doCommands(SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN], 0, 0, SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN].alpha);
|
doCommands(SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN], 0, 0, SBarInfoScript->huds[STBAR_INVENTORYFULLSCREEN].alpha);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(currentPopup != POP_None)
|
if(currentPopup != POP_None)
|
||||||
{
|
{
|
||||||
int popbar = 0;
|
int popbar = 0;
|
||||||
|
@ -385,6 +396,12 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
case SBARINFO_DRAWSWITCHABLEIMAGE: //draw the alt image if we don't have the item else this is like a normal drawimage
|
case SBARINFO_DRAWSWITCHABLEIMAGE: //draw the alt image if we don't have the item else this is like a normal drawimage
|
||||||
{
|
{
|
||||||
|
// DrawSwitchable image allows 2 or 4 images to be supplied.
|
||||||
|
// drawAlt toggles these:
|
||||||
|
// 1 = first image
|
||||||
|
// 2 = second image
|
||||||
|
// 3 = thrid image
|
||||||
|
// 0 = last image
|
||||||
int drawAlt = 0;
|
int drawAlt = 0;
|
||||||
if((cmd.flags & DRAWIMAGE_WEAPONSLOT)) //weaponslots
|
if((cmd.flags & DRAWIMAGE_WEAPONSLOT)) //weaponslots
|
||||||
{
|
{
|
||||||
|
@ -410,6 +427,40 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
drawAlt = 1;
|
drawAlt = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(cmd.flags & DRAWIMAGE_KEYSLOT)
|
||||||
|
{
|
||||||
|
bool found1 = false;
|
||||||
|
bool found2 = false;
|
||||||
|
drawAlt = 1;
|
||||||
|
|
||||||
|
for(AInventory *item = CPlayer->mo->Inventory;item != NULL;item = item->Inventory)
|
||||||
|
{
|
||||||
|
if(item->IsKindOf(RUNTIME_CLASS(AKey)))
|
||||||
|
{
|
||||||
|
int keynum = static_cast<AKey *>(item)->KeyNumber;
|
||||||
|
|
||||||
|
if(keynum == cmd.value)
|
||||||
|
found1 = true;
|
||||||
|
if(cmd.flags & DRAWIMAGE_SWITCHABLE_AND && keynum == cmd.special4) // two keys
|
||||||
|
found2 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cmd.flags & DRAWIMAGE_SWITCHABLE_AND)
|
||||||
|
{
|
||||||
|
if(found1 && found2)
|
||||||
|
drawAlt = 0;
|
||||||
|
else if(found1)
|
||||||
|
drawAlt = 2;
|
||||||
|
else if(found2)
|
||||||
|
drawAlt = 3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(found1)
|
||||||
|
drawAlt = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
else //check the inventory items and draw selected sprite
|
else //check the inventory items and draw selected sprite
|
||||||
{
|
{
|
||||||
AInventory* item = CPlayer->mo->FindInventory(PClass::FindClass(cmd.string[0]));
|
AInventory* item = CPlayer->mo->FindInventory(PClass::FindClass(cmd.string[0]));
|
||||||
|
@ -435,11 +486,11 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
if(drawAlt != 0) //draw 'off' image
|
if(drawAlt != 0) //draw 'off' image
|
||||||
{
|
{
|
||||||
if(cmd.special != -1 && drawAlt == 1)
|
if(cmd.special != -1 && drawAlt == 1)
|
||||||
DrawGraphic(Images[cmd.special], cmd.x, cmd.y, xOffset, yOffset, alpha, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
DrawGraphic(Images[cmd.special], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
||||||
else if(cmd.special2 != -1 && drawAlt == 2)
|
else if(cmd.special2 != -1 && drawAlt == 2)
|
||||||
DrawGraphic(Images[cmd.special2], cmd.x, cmd.y, xOffset, yOffset, alpha, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
DrawGraphic(Images[cmd.special2], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
||||||
else if(cmd.special3 != -1 && drawAlt == 3)
|
else if(cmd.special3 != -1 && drawAlt == 3)
|
||||||
DrawGraphic(Images[cmd.special3], cmd.x, cmd.y, xOffset, yOffset, alpha, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
DrawGraphic(Images[cmd.special3], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -482,7 +533,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
else if(cmd.image_index >= 0)
|
else if(cmd.image_index >= 0)
|
||||||
texture = Images[cmd.image_index];
|
texture = Images[cmd.image_index];
|
||||||
|
|
||||||
DrawGraphic(texture, cmd.x, cmd.y, xOffset, yOffset, alpha, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
DrawGraphic(texture, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET_CENTER));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWNUMBER:
|
case SBARINFO_DRAWNUMBER:
|
||||||
|
@ -609,7 +660,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
translation = cmd.translation3;
|
translation = cmd.translation3;
|
||||||
if((cmd.flags & DRAWNUMBER_WHENNOTZERO) && value == 0)
|
if((cmd.flags & DRAWNUMBER_WHENNOTZERO) && value == 0)
|
||||||
break;
|
break;
|
||||||
DrawNumber(value, cmd.special, cmd.x, cmd.y, xOffset, yOffset, alpha, translation, cmd.special2, fillzeros);
|
DrawNumber(value, cmd.special, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, translation, cmd.special2, fillzeros);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWMUGSHOT:
|
case SBARINFO_DRAWMUGSHOT:
|
||||||
|
@ -620,7 +671,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
xdth = true;
|
xdth = true;
|
||||||
if(cmd.flags & DRAWMUGSHOT_ANIMATEDGODMODE)
|
if(cmd.flags & DRAWMUGSHOT_ANIMATEDGODMODE)
|
||||||
animatedgodmode = true;
|
animatedgodmode = true;
|
||||||
DrawFace(cmd.string[0], cmd.special, xdth, animatedgodmode, cmd.x, cmd.y, xOffset, yOffset, alpha);
|
DrawFace(cmd.string[0], cmd.special, xdth, animatedgodmode, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWSELECTEDINVENTORY:
|
case SBARINFO_DRAWSELECTEDINVENTORY:
|
||||||
|
@ -628,11 +679,11 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
if((cmd.flags & DRAWSELECTEDINVENTORY_ARTIFLASH) && artiflash)
|
if((cmd.flags & DRAWSELECTEDINVENTORY_ARTIFLASH) && artiflash)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[ARTIFLASH_OFFSET+(4-artiflash)], cmd.x, cmd.y, xOffset, yOffset, alpha, false, CPlayer->mo->InvSel->Amount <= 0);
|
DrawGraphic(Images[ARTIFLASH_OFFSET+(4-artiflash)], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawGraphic(TexMan(CPlayer->mo->InvSel->Icon), cmd.x, cmd.y, xOffset, yOffset, alpha, false, CPlayer->mo->InvSel->Amount <= 0);
|
DrawGraphic(TexMan(CPlayer->mo->InvSel->Icon), cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0);
|
||||||
}
|
}
|
||||||
if((cmd.flags & DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER) || CPlayer->mo->InvSel->Amount != 1)
|
if((cmd.flags & DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER) || CPlayer->mo->InvSel->Amount != 1)
|
||||||
{
|
{
|
||||||
|
@ -640,7 +691,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
drawingFont = cmd.font;
|
drawingFont = cmd.font;
|
||||||
}
|
}
|
||||||
DrawNumber(CPlayer->mo->InvSel->Amount, 3, cmd.special2, cmd.special3, xOffset, yOffset, alpha, cmd.translation, cmd.special4);
|
DrawNumber(CPlayer->mo->InvSel->Amount, 3, cmd.special2, cmd.special3, xOffset, yOffset, alpha, block.fullScreenOffsets, cmd.translation, cmd.special4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if((cmd.flags & DRAWSELECTEDINVENTORY_ALTERNATEONEMPTY))
|
else if((cmd.flags & DRAWSELECTEDINVENTORY_ALTERNATEONEMPTY))
|
||||||
|
@ -666,7 +717,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
drawingFont = cmd.font;
|
drawingFont = cmd.font;
|
||||||
}
|
}
|
||||||
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, xOffset, yOffset, alpha, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox, noarrows, alwaysshowcounter);
|
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox, noarrows, alwaysshowcounter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWBAR:
|
case SBARINFO_DRAWBAR:
|
||||||
|
@ -956,7 +1007,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
wiggle = !!(cmd.flags & DRAWGEM_WIGGLE);
|
wiggle = !!(cmd.flags & DRAWGEM_WIGGLE);
|
||||||
}
|
}
|
||||||
DrawGem(Images[cmd.special], Images[cmd.image_index], value, cmd.x, cmd.y, xOffset, yOffset, alpha, cmd.special2, cmd.special3, cmd.special4+1, wiggle, translate);
|
DrawGem(Images[cmd.special], Images[cmd.image_index], value, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, cmd.special2, cmd.special3, cmd.special4+1, wiggle, translate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SBARINFO_DRAWSHADER:
|
case SBARINFO_DRAWSHADER:
|
||||||
|
@ -983,7 +1034,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
{
|
{
|
||||||
drawingFont = cmd.font;
|
drawingFont = cmd.font;
|
||||||
}
|
}
|
||||||
DrawString(cmd.string[0], cmd.x - drawingFont->StringWidth(cmd.string[0]), cmd.y, xOffset, yOffset, alpha, cmd.translation, cmd.special);
|
DrawString(cmd.string[0], cmd.x - drawingFont->StringWidth(cmd.string[0]), cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, cmd.translation, cmd.special);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_DRAWKEYBAR:
|
case SBARINFO_DRAWKEYBAR:
|
||||||
{
|
{
|
||||||
|
@ -1000,9 +1051,9 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
goto FinishDrawKeyBar;
|
goto FinishDrawKeyBar;
|
||||||
}
|
}
|
||||||
if(!vertical)
|
if(!vertical)
|
||||||
DrawGraphic(TexMan[item->Icon], cmd.x+(cmd.special*i), cmd.y, xOffset, yOffset, alpha);
|
DrawGraphic(TexMan[item->Icon], cmd.x+(cmd.special*i), cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets);
|
||||||
else
|
else
|
||||||
DrawGraphic(TexMan[item->Icon], cmd.x, cmd.y+(cmd.special*i), xOffset, yOffset, alpha);
|
DrawGraphic(TexMan[item->Icon], cmd.x, cmd.y+(cmd.special*i), xOffset, yOffset, alpha, block.fullScreenOffsets);
|
||||||
item = item->Inventory;
|
item = item->Inventory;
|
||||||
if(item == NULL)
|
if(item == NULL)
|
||||||
break;
|
break;
|
||||||
|
@ -1156,7 +1207,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws an image with the specified flags
|
//draws an image with the specified flags
|
||||||
void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha,
|
void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets,
|
||||||
bool translate, bool dim, bool center) //flags
|
bool translate, bool dim, bool center) //flags
|
||||||
{
|
{
|
||||||
if (texture == NULL)
|
if (texture == NULL)
|
||||||
|
@ -1168,6 +1219,8 @@ void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yO
|
||||||
y -= (texture->GetHeight()/2)-texture->TopOffset;
|
y -= (texture->GetHeight()/2)-texture->TopOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!fullScreenOffsets)
|
||||||
|
{
|
||||||
// I'll handle the conversion from fixed to int myself for more control
|
// I'll handle the conversion from fixed to int myself for more control
|
||||||
fixed_t fx = (x + ST_X + xOffset) << FRACBITS;
|
fixed_t fx = (x + ST_X + xOffset) << FRACBITS;
|
||||||
fixed_t fy = (y + ST_Y + yOffset) << FRACBITS;
|
fixed_t fy = (y + ST_Y + yOffset) << FRACBITS;
|
||||||
|
@ -1188,8 +1241,20 @@ void DSBarInfo::DrawGraphic(FTexture* texture, int x, int y, int xOffset, int yO
|
||||||
DTA_Alpha, alpha,
|
DTA_Alpha, alpha,
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
screen->DrawTexture(texture, x, y,
|
||||||
|
DTA_DestWidth, texture->GetScaledWidth(),
|
||||||
|
DTA_DestHeight, texture->GetScaledHeight(),
|
||||||
|
DTA_Translation, translate ? getTranslation() : 0,
|
||||||
|
DTA_ColorOverlay, dim ? DIM_OVERLAY : 0,
|
||||||
|
DTA_Alpha, alpha,
|
||||||
|
DTA_HUDRules, HUD_Normal,
|
||||||
|
TAG_DONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DSBarInfo::DrawString(const char* str, int x, int y, int xOffset, int yOffset, int alpha, EColorRange translation, int spacing)
|
void DSBarInfo::DrawString(const char* str, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, EColorRange translation, int spacing)
|
||||||
{
|
{
|
||||||
x += spacing;
|
x += spacing;
|
||||||
while(*str != '\0')
|
while(*str != '\0')
|
||||||
|
@ -1213,6 +1278,8 @@ void DSBarInfo::DrawString(const char* str, int x, int y, int xOffset, int yOffs
|
||||||
}
|
}
|
||||||
if(SBarInfoScript->spacingCharacter == '\0') //If we are monospaced lets use the offset
|
if(SBarInfoScript->spacingCharacter == '\0') //If we are monospaced lets use the offset
|
||||||
x += (character->LeftOffset+1); //ignore x offsets since we adapt to character size
|
x += (character->LeftOffset+1); //ignore x offsets since we adapt to character size
|
||||||
|
if(!fullScreenOffsets)
|
||||||
|
{
|
||||||
int rx = x + ST_X + xOffset;
|
int rx = x + ST_X + xOffset;
|
||||||
int ry = y + ST_Y + yOffset;
|
int ry = y + ST_Y + yOffset;
|
||||||
int rw = character->GetScaledWidth();
|
int rw = character->GetScaledWidth();
|
||||||
|
@ -1225,6 +1292,17 @@ void DSBarInfo::DrawString(const char* str, int x, int y, int xOffset, int yOffs
|
||||||
DTA_Translation, drawingFont->GetColorTranslation(translation),
|
DTA_Translation, drawingFont->GetColorTranslation(translation),
|
||||||
DTA_Alpha, alpha,
|
DTA_Alpha, alpha,
|
||||||
TAG_DONE);
|
TAG_DONE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
screen->DrawTexture(character, x, y,
|
||||||
|
DTA_DestWidth, character->GetScaledWidth(),
|
||||||
|
DTA_DestHeight, character->GetScaledHeight(),
|
||||||
|
DTA_Translation, drawingFont->GetColorTranslation(translation),
|
||||||
|
DTA_Alpha, alpha,
|
||||||
|
DTA_HUDRules, HUD_Normal,
|
||||||
|
TAG_DONE);
|
||||||
|
}
|
||||||
if(SBarInfoScript->spacingCharacter == '\0')
|
if(SBarInfoScript->spacingCharacter == '\0')
|
||||||
x += width + spacing - (character->LeftOffset+1);
|
x += width + spacing - (character->LeftOffset+1);
|
||||||
else //width gets changed at the call to GetChar()
|
else //width gets changed at the call to GetChar()
|
||||||
|
@ -1234,7 +1312,7 @@ void DSBarInfo::DrawString(const char* str, int x, int y, int xOffset, int yOffs
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws the specified number up to len digits
|
//draws the specified number up to len digits
|
||||||
void DSBarInfo::DrawNumber(int num, int len, int x, int y, int xOffset, int yOffset, int alpha, EColorRange translation, int spacing, bool fillzeros)
|
void DSBarInfo::DrawNumber(int num, int len, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, EColorRange translation, int spacing, bool fillzeros)
|
||||||
{
|
{
|
||||||
FString value;
|
FString value;
|
||||||
int maxval = (int) ceil(pow(10., len))-1;
|
int maxval = (int) ceil(pow(10., len))-1;
|
||||||
|
@ -1259,25 +1337,25 @@ void DSBarInfo::DrawNumber(int num, int len, int x, int y, int xOffset, int yOff
|
||||||
x -= int(drawingFont->StringWidth(value)+(spacing * value.Len()));
|
x -= int(drawingFont->StringWidth(value)+(spacing * value.Len()));
|
||||||
else //monospaced, so just multiplay the character size
|
else //monospaced, so just multiplay the character size
|
||||||
x -= int((drawingFont->GetCharWidth((int) SBarInfoScript->spacingCharacter) + spacing) * value.Len());
|
x -= int((drawingFont->GetCharWidth((int) SBarInfoScript->spacingCharacter) + spacing) * value.Len());
|
||||||
DrawString(value, x, y, xOffset, yOffset, alpha, translation, spacing);
|
DrawString(value, x, y, xOffset, yOffset, alpha, fullScreenOffsets, translation, spacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws the mug shot
|
//draws the mug shot
|
||||||
void DSBarInfo::DrawFace(const char *defaultFace, int accuracy, bool xdth, bool animatedgodmode, int x, int y, int xOffset, int yOffset, int alpha)
|
void DSBarInfo::DrawFace(const char *defaultFace, int accuracy, bool xdth, bool animatedgodmode, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets)
|
||||||
{
|
{
|
||||||
FTexture *face = MugShot.GetFace(CPlayer, defaultFace, accuracy, xdth, animatedgodmode);
|
FTexture *face = MugShot.GetFace(CPlayer, defaultFace, accuracy, xdth, animatedgodmode);
|
||||||
if (face != NULL)
|
if (face != NULL)
|
||||||
{
|
{
|
||||||
DrawGraphic(face, x, y, xOffset, yOffset, alpha);
|
DrawGraphic(face, x, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool alwaysshow,
|
void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, bool alwaysshow,
|
||||||
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter)
|
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter)
|
||||||
{ //yes, there is some Copy & Paste here too
|
{ //yes, there is some Copy & Paste here too
|
||||||
AInventory *item;
|
AInventory *item;
|
||||||
int i;
|
int i;
|
||||||
int spacing = (type != GAME_Strife) ? 31 : 35;
|
int spacing = (type != GAME_Strife) ? Images[invBarOffset + imgARTIBOX]->GetScaledWidth() + 1 : Images[invBarOffset + imgCURSOR]->GetScaledWidth() - 1;
|
||||||
|
|
||||||
// If the player has no artifacts, don't draw the bar
|
// If the player has no artifacts, don't draw the bar
|
||||||
CPlayer->mo->InvFirst = ValidateInvFirst(num);
|
CPlayer->mo->InvFirst = ValidateInvFirst(num);
|
||||||
|
@ -1287,7 +1365,7 @@ void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, i
|
||||||
{
|
{
|
||||||
if(drawArtiboxes)
|
if(drawArtiboxes)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
if(type != GAME_Strife) //Strife draws the cursor before the icons
|
if(type != GAME_Strife) //Strife draws the cursor before the icons
|
||||||
DrawGraphic(TexMan(item->Icon), x+i*spacing, y, xOffset, yOffset, alpha, false, item->Amount <= 0);
|
DrawGraphic(TexMan(item->Icon), x+i*spacing, y, xOffset, yOffset, alpha, false, item->Amount <= 0);
|
||||||
|
@ -1295,49 +1373,49 @@ void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, i
|
||||||
{
|
{
|
||||||
if(type == GAME_Heretic)
|
if(type == GAME_Heretic)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*31, y+29, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*spacing, y+29, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
else if(type == GAME_Hexen)
|
else if(type == GAME_Hexen)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*31, y-1, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*spacing, y-1, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
else if(type == GAME_Strife)
|
else if(type == GAME_Strife)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgCURSOR], x+i*35-6, y-2, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgCURSOR], x+i*spacing-6, y-2, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*31, y, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgSELECTBOX], x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(type == GAME_Strife)
|
if(type == GAME_Strife)
|
||||||
DrawGraphic(TexMan(item->Icon), x+i*spacing, y, xOffset, yOffset, alpha, false, item->Amount <= 0);
|
DrawGraphic(TexMan(item->Icon), x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets, false, item->Amount <= 0);
|
||||||
if(alwaysshowcounter || item->Amount != 1)
|
if(alwaysshowcounter || item->Amount != 1)
|
||||||
{
|
{
|
||||||
DrawNumber(item->Amount, 3, counterx+i*spacing, countery, xOffset, yOffset, alpha, translation);
|
DrawNumber(item->Amount, 3, counterx+i*spacing, countery, xOffset, yOffset, alpha, fullScreenOffsets, translation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (; i < num && drawArtiboxes; ++i)
|
for (; i < num && drawArtiboxes; ++i)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, alpha);
|
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
// Is there something to the left?
|
// Is there something to the left?
|
||||||
if (!noArrows && CPlayer->mo->FirstInv() != CPlayer->mo->InvFirst)
|
if (!noArrows && CPlayer->mo->FirstInv() != CPlayer->mo->InvFirst)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[!(gametic & 4) ?
|
DrawGraphic(Images[!(gametic & 4) ?
|
||||||
invBarOffset + imgINVLFGEM1 : invBarOffset + imgINVLFGEM2], (type != GAME_Strife) ? x-12 : x-14, y, xOffset, yOffset, alpha);
|
invBarOffset + imgINVLFGEM1 : invBarOffset + imgINVLFGEM2], (type != GAME_Strife) ? x-12 : x-14, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
// Is there something to the right?
|
// Is there something to the right?
|
||||||
if (!noArrows && item != NULL)
|
if (!noArrows && item != NULL)
|
||||||
{
|
{
|
||||||
DrawGraphic(Images[!(gametic & 4) ?
|
DrawGraphic(Images[!(gametic & 4) ?
|
||||||
invBarOffset + imgINVRTGEM1 : invBarOffset + imgINVRTGEM2], (type != GAME_Strife) ? x+num*31+2 : x+num*35-4, y, xOffset, yOffset, alpha);
|
invBarOffset + imgINVRTGEM1 : invBarOffset + imgINVRTGEM2], (type != GAME_Strife) ? x+num*31+2 : x+num*35-4, y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws heretic/hexen style life gems
|
//draws heretic/hexen style life gems
|
||||||
void DSBarInfo::DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int xOffset, int yOffset, int alpha, int padleft, int padright, int chainsize,
|
void DSBarInfo::DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, int padleft, int padright, int chainsize,
|
||||||
bool wiggle, bool translate)
|
bool wiggle, bool translate)
|
||||||
{
|
{
|
||||||
if(chain == NULL)
|
if(chain == NULL)
|
||||||
|
@ -1350,9 +1428,9 @@ void DSBarInfo::DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y,
|
||||||
y += chainWiggle;
|
y += chainWiggle;
|
||||||
int chainWidth = chain->GetWidth();
|
int chainWidth = chain->GetWidth();
|
||||||
int offset = (int) (((double) (chainWidth-padleft-padright)/100)*value);
|
int offset = (int) (((double) (chainWidth-padleft-padright)/100)*value);
|
||||||
DrawGraphic(chain, x+(offset%chainsize), y, xOffset, yOffset, alpha);
|
DrawGraphic(chain, x+(offset%chainsize), y, xOffset, yOffset, alpha, fullScreenOffsets);
|
||||||
if(gem != NULL)
|
if(gem != NULL)
|
||||||
DrawGraphic(gem, x+padleft+offset, y, xOffset, yOffset, alpha, translate);
|
DrawGraphic(gem, x+padleft+offset, y, xOffset, yOffset, alpha, fullScreenOffsets, translate);
|
||||||
}
|
}
|
||||||
|
|
||||||
FRemapTable* DSBarInfo::getTranslation()
|
FRemapTable* DSBarInfo::getTranslation()
|
||||||
|
|
|
@ -264,6 +264,10 @@ void SBarInfo::ParseSBarInfo(int lump)
|
||||||
{
|
{
|
||||||
this->huds[barNum].forceScaled = true;
|
this->huds[barNum].forceScaled = true;
|
||||||
}
|
}
|
||||||
|
else if(sc.Compare("fullscreenoffsets"))
|
||||||
|
{
|
||||||
|
this->huds[barNum].fullScreenOffsets = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sc.ScriptError("Unkown flag '%s'.", sc.String);
|
sc.ScriptError("Unkown flag '%s'.", sc.String);
|
||||||
|
@ -318,9 +322,9 @@ void SBarInfo::ParseSBarInfo(int lump)
|
||||||
{
|
{
|
||||||
int pop = 0;
|
int pop = 0;
|
||||||
sc.MustGetToken(TK_Identifier);
|
sc.MustGetToken(TK_Identifier);
|
||||||
if(sc.Compare("keys"))
|
if(sc.Compare("log"))
|
||||||
pop = 0;
|
pop = 0;
|
||||||
else if(sc.Compare("log"))
|
else if(sc.Compare("keys"))
|
||||||
pop = 1;
|
pop = 1;
|
||||||
else if(sc.Compare("status"))
|
else if(sc.Compare("status"))
|
||||||
pop = 2;
|
pop = 2;
|
||||||
|
@ -385,6 +389,12 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
cmd.flags = DRAWIMAGE_INVULNERABILITY;
|
cmd.flags = DRAWIMAGE_INVULNERABILITY;
|
||||||
}
|
}
|
||||||
|
else if(sc.Compare("keyslot"))
|
||||||
|
{
|
||||||
|
cmd.flags = DRAWIMAGE_KEYSLOT;
|
||||||
|
sc.MustGetToken(TK_IntConst);
|
||||||
|
cmd.value = sc.Number;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmd.setString(sc, sc.String, 0);
|
cmd.setString(sc, sc.String, 0);
|
||||||
|
@ -397,6 +407,13 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
if(sc.CheckToken(TK_AndAnd))
|
if(sc.CheckToken(TK_AndAnd))
|
||||||
{
|
{
|
||||||
cmd.flags |= DRAWIMAGE_SWITCHABLE_AND;
|
cmd.flags |= DRAWIMAGE_SWITCHABLE_AND;
|
||||||
|
if(cmd.flags & DRAWIMAGE_KEYSLOT)
|
||||||
|
{
|
||||||
|
sc.MustGetToken(TK_IntConst);
|
||||||
|
cmd.special4 = sc.Number;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
sc.MustGetToken(TK_Identifier);
|
sc.MustGetToken(TK_Identifier);
|
||||||
cmd.setString(sc, sc.String, 1);
|
cmd.setString(sc, sc.String, 1);
|
||||||
const PClass* item = PClass::FindClass(sc.String);
|
const PClass* item = PClass::FindClass(sc.String);
|
||||||
|
@ -404,6 +421,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
{
|
{
|
||||||
sc.ScriptError("'%s' is not a type of inventory item.", sc.String);
|
sc.ScriptError("'%s' is not a type of inventory item.", sc.String);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
sc.MustGetToken(TK_StringConst);
|
sc.MustGetToken(TK_StringConst);
|
||||||
cmd.special = newImage(sc.String);
|
cmd.special = newImage(sc.String);
|
||||||
|
@ -465,7 +483,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
cmd.sprite_index.SetInvalid();
|
cmd.sprite_index.SetInvalid();
|
||||||
}
|
}
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
if(sc.CheckToken(','))
|
if(sc.CheckToken(','))
|
||||||
{
|
{
|
||||||
sc.MustGetToken(TK_Identifier);
|
sc.MustGetToken(TK_Identifier);
|
||||||
|
@ -594,7 +612,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
if(!sc.CheckToken('|'))
|
if(!sc.CheckToken('|'))
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
if(sc.CheckToken(','))
|
if(sc.CheckToken(','))
|
||||||
{
|
{
|
||||||
bool needsComma = false;
|
bool needsComma = false;
|
||||||
|
@ -644,7 +662,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
if(!sc.CheckToken('|'))
|
if(!sc.CheckToken('|'))
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
sc.MustGetToken(';');
|
sc.MustGetToken(';');
|
||||||
break;
|
break;
|
||||||
case SBARINFO_DRAWSELECTEDINVENTORY:
|
case SBARINFO_DRAWSELECTEDINVENTORY:
|
||||||
|
@ -706,6 +724,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
if(alternateonempty)
|
if(alternateonempty)
|
||||||
{
|
{
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -762,7 +781,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.ScriptError("Unknown font '%s'.", sc.String);
|
sc.ScriptError("Unknown font '%s'.", sc.String);
|
||||||
|
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
cmd.special2 = cmd.x + 26;
|
cmd.special2 = cmd.x + 26;
|
||||||
cmd.special3 = cmd.y + 22;
|
cmd.special3 = cmd.y + 22;
|
||||||
cmd.translation = CR_GOLD;
|
cmd.translation = CR_GOLD;
|
||||||
|
@ -885,7 +904,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
if(!sc.CheckToken('|'))
|
if(!sc.CheckToken('|'))
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
if(sc.CheckToken(',')) //border
|
if(sc.CheckToken(',')) //border
|
||||||
{
|
{
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
|
@ -925,7 +944,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.ScriptError("Chain size must be a positive number.");
|
sc.ScriptError("Chain size must be a positive number.");
|
||||||
cmd.special4 = sc.Number;
|
cmd.special4 = sc.Number;
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
sc.MustGetToken(';');
|
sc.MustGetToken(';');
|
||||||
break;
|
break;
|
||||||
case SBARINFO_DRAWSHADER:
|
case SBARINFO_DRAWSHADER:
|
||||||
|
@ -954,7 +973,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
cmd.flags |= DRAWSHADER_REVERSE;
|
cmd.flags |= DRAWSHADER_REVERSE;
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
sc.MustGetToken(';');
|
sc.MustGetToken(';');
|
||||||
break;
|
break;
|
||||||
case SBARINFO_DRAWSTRING:
|
case SBARINFO_DRAWSTRING:
|
||||||
|
@ -969,7 +988,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.MustGetToken(TK_StringConst);
|
sc.MustGetToken(TK_StringConst);
|
||||||
cmd.setString(sc, sc.String, 0, -1, false);
|
cmd.setString(sc, sc.String, 0, -1, false);
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
if(sc.CheckToken(',')) //spacing
|
if(sc.CheckToken(',')) //spacing
|
||||||
{
|
{
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
|
@ -990,7 +1009,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
cmd.special = sc.Number;
|
cmd.special = sc.Number;
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
this->getCoordinates(sc, cmd);
|
this->getCoordinates(sc, cmd, block.fullScreenOffsets);
|
||||||
sc.MustGetToken(';');
|
sc.MustGetToken(';');
|
||||||
break;
|
break;
|
||||||
case SBARINFO_GAMEMODE:
|
case SBARINFO_GAMEMODE:
|
||||||
|
@ -1010,6 +1029,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
break;
|
break;
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_PLAYERCLASS:
|
case SBARINFO_PLAYERCLASS:
|
||||||
|
@ -1038,6 +1058,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
}
|
}
|
||||||
FinishPlayerClass:
|
FinishPlayerClass:
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_ASPECTRATIO:
|
case SBARINFO_ASPECTRATIO:
|
||||||
|
@ -1053,6 +1074,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
else
|
else
|
||||||
sc.ScriptError("Unkown aspect ratio: %s", sc.String);
|
sc.ScriptError("Unkown aspect ratio: %s", sc.String);
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_ISSELECTED:
|
case SBARINFO_ISSELECTED:
|
||||||
|
@ -1080,6 +1102,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_USESSECONDARYAMMO:
|
case SBARINFO_USESSECONDARYAMMO:
|
||||||
|
@ -1091,6 +1114,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.ScriptError("Exspected 'not' got '%s' instead.", sc.String);
|
sc.ScriptError("Exspected 'not' got '%s' instead.", sc.String);
|
||||||
}
|
}
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_HASWEAPONPIECE:
|
case SBARINFO_HASWEAPONPIECE:
|
||||||
|
@ -1106,6 +1130,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
sc.ScriptError("Weapon piece number can not be less than 1.");
|
sc.ScriptError("Weapon piece number can not be less than 1.");
|
||||||
cmd.value = sc.Number;
|
cmd.value = sc.Number;
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1138,6 +1163,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
case SBARINFO_ININVENTORY:
|
case SBARINFO_ININVENTORY:
|
||||||
|
@ -1169,6 +1195,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sc.MustGetToken('{');
|
sc.MustGetToken('{');
|
||||||
|
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
|
||||||
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
this->ParseSBarInfoBlock(sc, cmd.subBlock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1202,7 +1229,7 @@ void SBarInfo::ParseMugShotBlock(FScanner &sc, FMugShotState &state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SBarInfo::getCoordinates(FScanner &sc, SBarInfoCommand &cmd)
|
void SBarInfo::getCoordinates(FScanner &sc, SBarInfoCommand &cmd, bool fullScreenOffsets)
|
||||||
{
|
{
|
||||||
bool negative = false;
|
bool negative = false;
|
||||||
negative = sc.CheckToken('-');
|
negative = sc.CheckToken('-');
|
||||||
|
@ -1211,7 +1238,10 @@ void SBarInfo::getCoordinates(FScanner &sc, SBarInfoCommand &cmd)
|
||||||
sc.MustGetToken(',');
|
sc.MustGetToken(',');
|
||||||
negative = sc.CheckToken('-');
|
negative = sc.CheckToken('-');
|
||||||
sc.MustGetToken(TK_IntConst);
|
sc.MustGetToken(TK_IntConst);
|
||||||
|
if(!fullScreenOffsets)
|
||||||
cmd.y = (negative ? -sc.Number : sc.Number) - (200 - this->height);
|
cmd.y = (negative ? -sc.Number : sc.Number) - (200 - this->height);
|
||||||
|
else
|
||||||
|
cmd.y = negative ? -sc.Number : sc.Number;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SBarInfo::getSignedInteger(FScanner &sc)
|
int SBarInfo::getSignedInteger(FScanner &sc)
|
||||||
|
@ -1338,6 +1368,7 @@ SBarInfoCommand::~SBarInfoCommand()
|
||||||
SBarInfoBlock::SBarInfoBlock()
|
SBarInfoBlock::SBarInfoBlock()
|
||||||
{
|
{
|
||||||
forceScaled = false;
|
forceScaled = false;
|
||||||
|
fullScreenOffsets = false;
|
||||||
alpha = FRACUNIT;
|
alpha = FRACUNIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,9 +188,11 @@ void DBaseStatusBar::Destroy ()
|
||||||
//
|
//
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
void DBaseStatusBar::SetScaled (bool scale)
|
//[BL] Added force argument to have forcescaled mean forcescaled.
|
||||||
|
void DBaseStatusBar::SetScaled (bool scale, bool force)
|
||||||
{
|
{
|
||||||
Scaled = RelTop != 0 && (SCREENWIDTH != 320 && scale);
|
Scaled = (RelTop != 0 || force) && (SCREENWIDTH != 320 && scale);
|
||||||
|
|
||||||
if (!Scaled)
|
if (!Scaled)
|
||||||
{
|
{
|
||||||
ST_X = (SCREENWIDTH - 320) / 2;
|
ST_X = (SCREENWIDTH - 320) / 2;
|
||||||
|
|
Loading…
Reference in a new issue