- added ability to force internal alternative HUD
Set hud_althud_forceinternal CVAR to disable unwanted HUD customizations
This commit is contained in:
parent
e21c9e0ef8
commit
fdd17403e5
3 changed files with 62 additions and 37 deletions
|
|
@ -334,36 +334,6 @@ void ST_CreateStatusBar(bool bTitleLevel)
|
|||
// Constructor
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static DObject* CreateAltHud(const FName classname)
|
||||
{
|
||||
if (classname == NAME_None)
|
||||
return nullptr;
|
||||
|
||||
auto cls = PClass::FindClass(classname);
|
||||
if (!cls)
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Unknown alternative HUD class \"%s\"\n", classname.GetChars());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!cls->IsDescendantOf(NAME_AltHud))
|
||||
{
|
||||
Printf(TEXTCOLOR_RED "Alternative HUD class \"%s\" is not derived from AltHud\n", classname.GetChars());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto althud = cls->CreateNew();
|
||||
|
||||
IFVIRTUALPTRNAME(althud, NAME_AltHud, Init)
|
||||
{
|
||||
VMValue params[] = { althud };
|
||||
VMCall(func, params, countof(params), nullptr, 0);
|
||||
}
|
||||
|
||||
return althud;
|
||||
}
|
||||
|
||||
DBaseStatusBar::DBaseStatusBar ()
|
||||
{
|
||||
CompleteBorder = false;
|
||||
|
|
@ -376,13 +346,7 @@ DBaseStatusBar::DBaseStatusBar ()
|
|||
ShowLog = false;
|
||||
defaultScale = { (double)CleanXfac, (double)CleanYfac };
|
||||
|
||||
// Create the AltHud object.
|
||||
AltHud = CreateAltHud(gameinfo.althudclass);
|
||||
|
||||
if (!AltHud)
|
||||
AltHud = CreateAltHud(NAME_AltHud);
|
||||
|
||||
assert(AltHud);
|
||||
CreateAltHUD();
|
||||
}
|
||||
|
||||
static void ValidateResolution(int &hres, int &vres)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue