- further work on generic HUD

Some reorganization to avoid code duplication plus making the log screen capable of using the generic font. This also means that the popup for the log in Strife's status bar will be disabled when in generic mode - this popup with its special font would be a bit problematic.
This commit is contained in:
Christoph Oelckers 2019-04-10 00:45:32 +02:00
commit f1105f2e13
9 changed files with 27 additions and 12 deletions

View file

@ -599,9 +599,15 @@ CUSTOM_CVAR (Int, msgmidcolor2, 4, CVAR_ARCHIVE)
EColorRange C_GetDefaultFontColor()
{
// Ideally this should analyze the SmallFont and pick a matching color.
if (!generic_hud) return CR_UNTRANSLATED;
return gameinfo.gametype == GAME_Doom ? CR_RED : gameinfo.gametype == GAME_Chex ? CR_GREEN : gameinfo.gametype == GAME_Strife ? CR_GOLD : CR_GRAY;
}
FFont * C_GetDefaultHUDFont()
{
return generic_hud? NewSmallFont : SmallFont;
}
void C_InitConback()
{
conback = TexMan.CheckForTexture ("CONBACK", ETextureType::MiscPatch);
@ -1103,7 +1109,7 @@ void FNotifyBuffer::Draw()
else
color = PrintColors[notify.PrintLevel];
if (color == CR_UNTRANSLATED && hud_generic)
if (color == CR_UNTRANSLATED)
{
color = C_GetDefaultFontColor();
}