mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-01 00:21:35 +00:00
- added a secret sector color to automap overlay.
- added a score display to both alt HUD and sbarinfo. - simplified code for AltHud status values display. SVN r2141 (trunk)
This commit is contained in:
parent
787c16301c
commit
0997c608f2
4 changed files with 40 additions and 47 deletions
|
@ -167,6 +167,7 @@ CVAR (Color, am_ovtelecolor, 0xffff00, CVAR_ARCHIVE);
|
|||
CVAR (Color, am_intralevelcolor, 0x0000ff, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_interlevelcolor, 0xff0000, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_secretsectorcolor, 0xff00ff, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_ovsecretsectorcolor,0x00ffff, CVAR_ARCHIVE);
|
||||
CVAR (Int, am_map_secrets, 1, CVAR_ARCHIVE);
|
||||
CVAR (Bool, am_drawmapback, true, CVAR_ARCHIVE);
|
||||
CVAR (Color, am_thingcolor_friend, 0xfcfcfc, CVAR_ARCHIVE);
|
||||
|
@ -770,7 +771,8 @@ static void AM_initColors (bool overlayed)
|
|||
{
|
||||
YourColor.FromCVar (am_ovyourcolor);
|
||||
WallColor.FromCVar (am_ovwallcolor);
|
||||
SecretSectorColor = SecretWallColor = WallColor;
|
||||
SecretWallColor = WallColor;
|
||||
SecretSectorColor.FromCVar (am_ovsecretsectorcolor);
|
||||
ThingColor_Item.FromCVar (am_ovthingcolor_item);
|
||||
ThingColor_Friend.FromCVar (am_ovthingcolor_friend);
|
||||
ThingColor_Monster.FromCVar (am_ovthingcolor_monster);
|
||||
|
|
|
@ -599,6 +599,8 @@ class CommandDrawNumber : public CommandDrawString
|
|||
value = AMMO1;
|
||||
else if(sc.Compare("ammo2"))
|
||||
value = AMMO2;
|
||||
else if(sc.Compare("score"))
|
||||
value = SCORE;
|
||||
else if(sc.Compare("ammo")) //request the next string to be an ammo type
|
||||
{
|
||||
value = AMMO;
|
||||
|
@ -798,6 +800,9 @@ class CommandDrawNumber : public CommandDrawString
|
|||
case SECRETS:
|
||||
num = level.found_secrets;
|
||||
break;
|
||||
case SCORE:
|
||||
num = statusBar->CPlayer->mo->Score;
|
||||
break;
|
||||
case TOTALSECRETS:
|
||||
num = level.total_secrets;
|
||||
break;
|
||||
|
@ -925,6 +930,7 @@ class CommandDrawNumber : public CommandDrawString
|
|||
POWERUPTIME,
|
||||
AIRTIME,
|
||||
SELECTEDINVENTORY,
|
||||
SCORE,
|
||||
|
||||
CONSTANT
|
||||
};
|
||||
|
|
|
@ -67,6 +67,7 @@ CVAR (Bool, hud_showsecrets, true,CVAR_ARCHIVE); // Show secrets on HUD
|
|||
CVAR (Bool, hud_showmonsters, true,CVAR_ARCHIVE); // Show monster stats on HUD
|
||||
CVAR (Bool, hud_showitems, false,CVAR_ARCHIVE); // Show item stats on HUD
|
||||
CVAR (Bool, hud_showstats, false, CVAR_ARCHIVE); // for stamina and accuracy.
|
||||
CVAR (Bool, hud_showscore, false, CVAR_ARCHIVE); // for user maintained score
|
||||
|
||||
CVAR (Int, hud_ammo_red, 25, CVAR_ARCHIVE) // ammo percent less than which status is red
|
||||
CVAR (Int, hud_ammo_yellow, 50, CVAR_ARCHIVE) // ammo percent less is yellow more green
|
||||
|
@ -98,6 +99,7 @@ static FTexture * fragpic; // Frags icon
|
|||
static FTexture * invgems[4]; // Inventory arrows
|
||||
|
||||
static int hudwidth, hudheight; // current width/height for HUD display
|
||||
static int statspace;
|
||||
|
||||
void AM_GetPosition(fixed_t & x, fixed_t & y);
|
||||
|
||||
|
@ -198,37 +200,35 @@ static void DrawHudNumber(FFont *font, int color, int num, int x, int y, int tra
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static void DrawStatus(player_t * CPlayer, int x, int y)
|
||||
static void DrawStatLine(int x, int &y, const char *prefix, const char *string)
|
||||
{
|
||||
char tempstr[50];
|
||||
int space;
|
||||
|
||||
if (hud_showstats)
|
||||
{
|
||||
space = SmallFont->StringWidth("Ac: ");
|
||||
|
||||
y -= SmallFont->GetHeight()-1;
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, "Ac:",
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, prefix,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->accuracy);
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+space, y, tempstr,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
y-=SmallFont->GetHeight()-1;
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, "St:",
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->stamina);
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+space, y, tempstr,
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+statspace, y, string,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
}
|
||||
else
|
||||
space=SmallFont->StringWidth("K: ");
|
||||
|
||||
static void DrawStatus(player_t * CPlayer, int x, int y)
|
||||
{
|
||||
char tempstr[50];
|
||||
|
||||
if (hud_showscore)
|
||||
{
|
||||
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->Score);
|
||||
DrawStatLine(x, y, "Sc:", tempstr);
|
||||
}
|
||||
|
||||
if (hud_showstats)
|
||||
{
|
||||
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->accuracy);
|
||||
DrawStatLine(x, y, "Ac:", tempstr);
|
||||
mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->stamina);
|
||||
DrawStatLine(x, y, "St:", tempstr);
|
||||
}
|
||||
|
||||
if (!deathmatch)
|
||||
{
|
||||
|
@ -236,41 +236,20 @@ static void DrawStatus(player_t * CPlayer, int x, int y)
|
|||
// work in cooperative hub games
|
||||
if (hud_showsecrets)
|
||||
{
|
||||
y -= SmallFont->GetHeight()-1;
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, "S:",
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->secretcount : level.found_secrets, level.total_secrets);
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+space, y, tempstr,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
DrawStatLine(x, y, "S:", tempstr);
|
||||
}
|
||||
|
||||
if (hud_showitems)
|
||||
{
|
||||
y -= SmallFont->GetHeight()-1;
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, "I:",
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->itemcount : level.found_items, level.total_items);
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+space, y, tempstr,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
DrawStatLine(x, y, "I:", tempstr);
|
||||
}
|
||||
|
||||
if (hud_showmonsters)
|
||||
{
|
||||
y -= SmallFont->GetHeight()-1;
|
||||
screen->DrawText(SmallFont, hudcolor_statnames, x, y, "K:",
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
|
||||
mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->killcount : level.killed_monsters, level.total_monsters);
|
||||
screen->DrawText(SmallFont, hudcolor_stats, x+space, y, tempstr,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0xc000, TAG_DONE);
|
||||
DrawStatLine(x, y, "K:", tempstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -931,6 +910,10 @@ void HUD_InitHud()
|
|||
KeyTypes.Clear();
|
||||
UnassignedKeyTypes.Clear();
|
||||
|
||||
statspace = SmallFont->StringWidth("Ac:");
|
||||
|
||||
|
||||
|
||||
// Now read custom icon overrides
|
||||
int lump, lastlump = 0;
|
||||
|
||||
|
|
|
@ -609,6 +609,7 @@ EXTERN_CVAR (Color, am_ovtelecolor)
|
|||
EXTERN_CVAR (Color, am_intralevelcolor)
|
||||
EXTERN_CVAR (Color, am_interlevelcolor)
|
||||
EXTERN_CVAR (Color, am_secretsectorcolor)
|
||||
EXTERN_CVAR (Color, am_ovsecretsectorcolor)
|
||||
EXTERN_CVAR (Color, am_thingcolor_friend)
|
||||
EXTERN_CVAR (Color, am_thingcolor_monster)
|
||||
EXTERN_CVAR (Color, am_thingcolor_item)
|
||||
|
@ -644,6 +645,7 @@ static menuitem_t MapColorsItems[] = {
|
|||
{ colorpicker, "2-sided walls (overlay)", {&am_ovotherwallscolor},{0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Not-yet-seen walls (overlay)", {&am_ovunseencolor}, {0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Teleporter (overlay)", {&am_ovtelecolor}, {0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Secret sector (overlay)", {&am_ovsecretsectorcolor}, {0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Actors (overlay) (for cheat)", {&am_ovthingcolor}, {0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Monsters (overlay) (for cheat)", {&am_ovthingcolor_monster}, {0}, {0}, {0}, {0} },
|
||||
{ colorpicker, "Friends (overlay) (for cheat)", {&am_ovthingcolor_friend}, {0}, {0}, {0}, {0} },
|
||||
|
|
Loading…
Reference in a new issue