- 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:
Christoph Oelckers 2010-10-24 07:31:39 +00:00
commit 2a0c4b9f32
4 changed files with 47 additions and 20 deletions

View file

@ -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);