mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- added a CVAR to decide when to show the map label (ExMy, MAPxx) on the automap HUD. Available settings are Never, Always and Only for hubs.
- made all crosshair related CVARs game specific. They were all global to all supportesd games. SVN r2964 (trunk)
This commit is contained in:
parent
40c75b811d
commit
2a0c4b9f32
4 changed files with 47 additions and 20 deletions
|
@ -381,6 +381,7 @@ DBaseStatusBar *CreateCustomStatusBar(int script=0);
|
|||
|
||||
// Crosshair stuff ----------------------------------------------------------
|
||||
|
||||
void ST_FormatMapName(FString &mapname, const char *mapnamecolor = "");
|
||||
void ST_LoadCrosshair(bool alwaysload=false);
|
||||
extern FTexture *CrosshairImage;
|
||||
|
||||
|
|
|
@ -833,10 +833,9 @@ void DrawHUD()
|
|||
}
|
||||
else
|
||||
{
|
||||
FString mapname;
|
||||
char printstr[256];
|
||||
int seconds;
|
||||
cluster_info_t *thiscluster = FindClusterInfo (level.cluster);
|
||||
bool hub = !!(thiscluster->flags&CLUSTER_HUB);
|
||||
int length=8*SmallFont->GetCharWidth('0');
|
||||
int fonth=SmallFont->GetHeight()+1;
|
||||
int bottom=hudheight-1;
|
||||
|
@ -865,8 +864,8 @@ void DrawHUD()
|
|||
}
|
||||
}
|
||||
|
||||
mysnprintf(printstr, countof(printstr), "%s: %s", level.mapname, level.LevelName.GetChars());
|
||||
screen->DrawText(SmallFont, hudcolor_titl, 1, hudheight-fonth-1, printstr,
|
||||
ST_FormatMapName(mapname);
|
||||
screen->DrawText(SmallFont, hudcolor_titl, 1, hudheight-fonth-1, mapname,
|
||||
DTA_KeepRatio, true,
|
||||
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, TAG_DONE);
|
||||
|
||||
|
|
|
@ -95,12 +95,16 @@ CUSTOM_CVAR (Bool, st_scale, true, CVAR_ARCHIVE)
|
|||
}
|
||||
}
|
||||
|
||||
CVAR (Int, crosshair, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Bool, crosshairforce, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CVAR (Color, crosshaircolor, 0xff0000, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (Bool, crosshairhealth, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (Bool, crosshairscale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (Bool, crosshairgrow, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||
CVAR (Int, crosshair, 0, CVAR_ARCHIVE)
|
||||
CVAR (Bool, crosshairforce, false, CVAR_ARCHIVE)
|
||||
CVAR (Color, crosshaircolor, 0xff0000, CVAR_ARCHIVE);
|
||||
CVAR (Bool, crosshairhealth, true, CVAR_ARCHIVE);
|
||||
CVAR (Bool, crosshairscale, false, CVAR_ARCHIVE);
|
||||
CVAR (Bool, crosshairgrow, false, CVAR_ARCHIVE);
|
||||
CUSTOM_CVAR(Int, am_showmaplabel, 2, CVAR_ARCHIVE)
|
||||
{
|
||||
if (self < 0 || self > 2) self = 2;
|
||||
}
|
||||
|
||||
CVAR (Bool, idmypos, false, 0);
|
||||
|
||||
|
@ -118,6 +122,30 @@ BYTE DBaseStatusBar::DamageToAlpha[114] =
|
|||
230, 231, 232, 233, 234, 235, 235, 236, 237
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Format the map name, include the map label if wanted
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void ST_FormatMapName(FString &mapname, const char *mapnamecolor)
|
||||
{
|
||||
cluster_info_t *cluster = FindClusterInfo (level.cluster);
|
||||
bool ishub = (cluster != NULL && (cluster->flags & CLUSTER_HUB));
|
||||
|
||||
if (am_showmaplabel == 1 || (am_showmaplabel == 2 && !ishub))
|
||||
{
|
||||
mapname << level.mapname << ": ";
|
||||
}
|
||||
mapname << mapnamecolor << level.LevelName;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// Load crosshair definitions
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void ST_LoadCrosshair(bool alwaysload)
|
||||
{
|
||||
int num = 0;
|
||||
|
@ -1270,18 +1298,9 @@ void DBaseStatusBar::Draw (EHudState state)
|
|||
y -= 8;
|
||||
}
|
||||
}
|
||||
cluster_info_t *cluster = FindClusterInfo (level.cluster);
|
||||
if (cluster == NULL || !(cluster->flags & CLUSTER_HUB))
|
||||
{
|
||||
mysnprintf (line, countof(line), "%s: ", level.mapname);
|
||||
}
|
||||
else
|
||||
{
|
||||
*line = 0;
|
||||
}
|
||||
FString mapname;
|
||||
|
||||
mapname.Format("%s%c%c%s", line, TEXTCOLOR_ESCAPE, CR_GREY + 'A', level.LevelName.GetChars());
|
||||
ST_FormatMapName(mapname, TEXTCOLOR_GREY);
|
||||
screen->DrawText (SmallFont, highlight,
|
||||
(SCREENWIDTH - SmallFont->StringWidth (mapname)*CleanXfac)/2, y, mapname,
|
||||
DTA_CleanNoMove, true, TAG_DONE);
|
||||
|
|
|
@ -841,6 +841,13 @@ OptionValue OverlayTypes
|
|||
2, "Overlay Only"
|
||||
}
|
||||
|
||||
OptionValue MaplabelTypes
|
||||
{
|
||||
0, "Never"
|
||||
1, "Always"
|
||||
2, "Not for hubs"
|
||||
}
|
||||
|
||||
OptionMenu AutomapOptions
|
||||
{
|
||||
Title "AUTOMAP OPTIONS"
|
||||
|
@ -858,6 +865,7 @@ OptionMenu AutomapOptions
|
|||
Option "Show time elapsed", "am_showtime", "OnOff"
|
||||
Option "Show total time elapsed", "am_showtotaltime", "OnOff"
|
||||
Option "Show secrets on map", "am_map_secrets", "SecretTypes"
|
||||
Option "Show map label", "am_showmaplabel", "MaplabelTypes"
|
||||
Option "Draw map background", "am_drawmapback", "OnOff"
|
||||
Option "Show keys (cheat)", "am_showkeys", "OnOff"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue