mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-31 10:40:33 +00:00
- Added Gez's patch to show the berserk icon on the alt. HUD and added a menu option for this setting.
SVN r4002 (trunk)
This commit is contained in:
parent
21ada0b3f6
commit
b3ada01bbd
2 changed files with 22 additions and 5 deletions
|
@ -78,13 +78,15 @@ CVAR (Int, hud_armor_red, 25, CVAR_ARCHIVE) // armor amount less than which
|
||||||
CVAR (Int, hud_armor_yellow, 50, CVAR_ARCHIVE) // armor amount less than which status is yellow
|
CVAR (Int, hud_armor_yellow, 50, CVAR_ARCHIVE) // armor amount less than which status is yellow
|
||||||
CVAR (Int, hud_armor_green, 100, CVAR_ARCHIVE) // armor amount above is blue, below is green
|
CVAR (Int, hud_armor_green, 100, CVAR_ARCHIVE) // armor amount above is blue, below is green
|
||||||
|
|
||||||
|
CVAR (Bool, hud_berserk_health, true, CVAR_ARCHIVE); // when found berserk pack instead of health box
|
||||||
|
|
||||||
CVAR (Int, hudcolor_titl, CR_YELLOW, CVAR_ARCHIVE) // color of automap title
|
CVAR (Int, hudcolor_titl, CR_YELLOW, CVAR_ARCHIVE) // color of automap title
|
||||||
CVAR (Int, hudcolor_time, CR_RED, CVAR_ARCHIVE) // color of level/hub time
|
CVAR (Int, hudcolor_time, CR_RED, CVAR_ARCHIVE) // color of level/hub time
|
||||||
CVAR (Int, hudcolor_ltim, CR_ORANGE, CVAR_ARCHIVE) // color of single level time
|
CVAR (Int, hudcolor_ltim, CR_ORANGE, CVAR_ARCHIVE) // color of single level time
|
||||||
CVAR (Int, hudcolor_ttim, CR_GOLD, CVAR_ARCHIVE) // color of total time
|
CVAR (Int, hudcolor_ttim, CR_GOLD, CVAR_ARCHIVE) // color of total time
|
||||||
CVAR (Int, hudcolor_xyco, CR_GREEN, CVAR_ARCHIVE) // color of coordinates
|
CVAR (Int, hudcolor_xyco, CR_GREEN, CVAR_ARCHIVE) // color of coordinates
|
||||||
|
|
||||||
CVAR (Int, hudcolor_statnames, CR_RED, CVAR_ARCHIVE) // For the letters befóre the stats
|
CVAR (Int, hudcolor_statnames, CR_RED, CVAR_ARCHIVE) // For the letters before the stats
|
||||||
CVAR (Int, hudcolor_stats, CR_GREEN, CVAR_ARCHIVE) // For the stats values themselves
|
CVAR (Int, hudcolor_stats, CR_GREEN, CVAR_ARCHIVE) // For the stats values themselves
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +97,7 @@ static FFont * IndexFont; // The font for the inventory indices
|
||||||
|
|
||||||
// Icons
|
// Icons
|
||||||
static FTexture * healthpic; // Health icon
|
static FTexture * healthpic; // Health icon
|
||||||
|
static FTexture * berserkpic; // Berserk icon (Doom only)
|
||||||
static FTexture * fragpic; // Frags icon
|
static FTexture * fragpic; // Frags icon
|
||||||
static FTexture * invgems[4]; // Inventory arrows
|
static FTexture * invgems[4]; // Inventory arrows
|
||||||
|
|
||||||
|
@ -267,16 +270,22 @@ static void DrawStatus(player_t * CPlayer, int x, int y)
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
static void DrawHealth(int health, int x, int y)
|
static void DrawHealth(player_t *CPlayer, int x, int y)
|
||||||
{
|
{
|
||||||
|
int health = CPlayer->health;
|
||||||
|
|
||||||
// decide on the color first
|
// decide on the color first
|
||||||
int fontcolor =
|
int fontcolor =
|
||||||
health < hud_health_red ? CR_RED :
|
health < hud_health_red ? CR_RED :
|
||||||
health < hud_health_yellow ? CR_GOLD :
|
health < hud_health_yellow ? CR_GOLD :
|
||||||
health <= hud_health_green ? CR_GREEN :
|
health <= hud_health_green ? CR_GREEN :
|
||||||
CR_BLUE;
|
CR_BLUE;
|
||||||
|
|
||||||
DrawImageToBox(healthpic, x, y, 31, 17);
|
const bool haveBerserk = hud_berserk_health
|
||||||
|
&& NULL != berserkpic
|
||||||
|
&& NULL != CPlayer->mo->FindInventory< APowerStrength >();
|
||||||
|
|
||||||
|
DrawImageToBox(haveBerserk ? berserkpic : healthpic, x, y, 31, 17);
|
||||||
DrawHudNumber(HudFont, fontcolor, health, x + 33, y + 17);
|
DrawHudNumber(HudFont, fontcolor, health, x + 33, y + 17);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -858,7 +867,7 @@ void DrawHUD()
|
||||||
DrawStatus(CPlayer, 5, hudheight-75);
|
DrawStatus(CPlayer, 5, hudheight-75);
|
||||||
DrawFrags(CPlayer, 5, hudheight-70);
|
DrawFrags(CPlayer, 5, hudheight-70);
|
||||||
}
|
}
|
||||||
DrawHealth(CPlayer->health, 5, hudheight-45);
|
DrawHealth(CPlayer, 5, hudheight-45);
|
||||||
DrawArmor(CPlayer->mo->FindInventory<ABasicArmor>(),
|
DrawArmor(CPlayer->mo->FindInventory<ABasicArmor>(),
|
||||||
CPlayer->mo->FindInventory<AHexenArmor>(), 5, hudheight-20);
|
CPlayer->mo->FindInventory<AHexenArmor>(), 5, hudheight-20);
|
||||||
i=DrawKeys(CPlayer, hudwidth-4, hudheight-10);
|
i=DrawKeys(CPlayer, hudwidth-4, hudheight-10);
|
||||||
|
@ -936,6 +945,7 @@ void HUD_InitHud()
|
||||||
|
|
||||||
default:
|
default:
|
||||||
healthpic = TexMan.FindTexture("MEDIA0");
|
healthpic = TexMan.FindTexture("MEDIA0");
|
||||||
|
berserkpic = TexMan.FindTexture("PSTRA0");
|
||||||
HudFont=FFont::FindFont("HUDFONT_DOOM");
|
HudFont=FFont::FindFont("HUDFONT_DOOM");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -973,6 +983,12 @@ void HUD_InitHud()
|
||||||
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
||||||
if (tex.isValid()) healthpic = TexMan[tex];
|
if (tex.isValid()) healthpic = TexMan[tex];
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("Berserk"))
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
FTextureID tex = TexMan.CheckForTexture(sc.String, FTexture::TEX_MiscPatch);
|
||||||
|
if (tex.isValid()) berserkpic = TexMan[tex];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const PClass * ti = PClass::FindClass(sc.String);
|
const PClass * ti = PClass::FindClass(sc.String);
|
||||||
|
|
|
@ -790,6 +790,7 @@ OptionMenu "AltHUDOptions"
|
||||||
Option "Show monster count", "hud_showmonsters", "OnOff"
|
Option "Show monster count", "hud_showmonsters", "OnOff"
|
||||||
Option "Show item count", "hud_showitems", "OnOff"
|
Option "Show item count", "hud_showitems", "OnOff"
|
||||||
Option "Show stamina and accuracy", "hud_showstats", "OnOff"
|
Option "Show stamina and accuracy", "hud_showstats", "OnOff"
|
||||||
|
Option "Show berserk", "hud_berserk_health", "OnOff"
|
||||||
Slider "Red ammo display below %", "hud_ammo_red", 0, 100, 1, 0
|
Slider "Red ammo display below %", "hud_ammo_red", 0, 100, 1, 0
|
||||||
Slider "Yellow ammo display below %", "hud_ammo_yellow", 0, 100, 1, 0
|
Slider "Yellow ammo display below %", "hud_ammo_yellow", 0, 100, 1, 0
|
||||||
Slider "Red health display below", "hud_health_red", 0, 100, 1, 0
|
Slider "Red health display below", "hud_health_red", 0, 100, 1, 0
|
||||||
|
|
Loading…
Reference in a new issue