- make the switch between game and generic fonts automatic by adding a key value to the language table

This commit is contained in:
Christoph Oelckers 2019-04-12 00:20:42 +02:00
commit c0b322c51a
13 changed files with 108 additions and 88 deletions

View file

@ -132,6 +132,20 @@ CUSTOM_CVAR(Float, teamdamage, 0.f, CVAR_SERVERINFO | CVAR_NOINITCALL)
}
}
bool generic_ui;
void UpdateGenericUI(bool cvar)
{
auto switchstr = GStrings["USE_GENERIC_FONT"];
generic_ui = (cvar || (switchstr && strtoll(switchstr, nullptr, 0)));
}
CUSTOM_CVAR(Bool, ui_generic, false, 0) // This is for allowing to test the generic font system with all languages
{
UpdateGenericUI(self);
}
CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
{
GStrings.UpdateLanguage();
@ -140,4 +154,5 @@ CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOB
// does this even make sense on secondary levels...?
if (Level->info != nullptr) Level->LevelName = Level->info->LookupLevelName();
}
UpdateGenericUI(ui_generic);
}