From 154af34cd9ccd399270449ed3ea0e1a72c60bb31 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers <coelckers@users.noreply.github.com> Date: Wed, 31 Jul 2019 17:02:39 +0200 Subject: [PATCH] - added an option to always display the log and the subtitles with the generic font. If this is on it will disable the status bar's pop screen for the log and always use the HUD overlay instead. --- src/console/c_console.cpp | 5 ----- src/g_statusbar/shared_sbar.cpp | 6 +++--- src/gamedata/fonts/v_font.h | 2 -- src/intermission/intermission.cpp | 2 +- wadsrc/static/zscript/ui/statusbar/strife_sbar.zs | 4 ++-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/console/c_console.cpp b/src/console/c_console.cpp index 7b9a0ae58..199c5a752 100644 --- a/src/console/c_console.cpp +++ b/src/console/c_console.cpp @@ -581,11 +581,6 @@ CUSTOM_CVAR (Int, msgmidcolor2, 4, CVAR_ARCHIVE) setmsgcolor (PRINTLEVELS+1, self); } -FFont * C_GetDefaultHUDFont() -{ - return generic_ui? NewSmallFont : SmallFont; -} - void C_InitConback() { conback = TexMan.CheckForTexture ("CONBACK", ETextureType::MiscPatch); diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 293edf355..aec788b56 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -86,7 +86,7 @@ EXTERN_CVAR (Int, con_scaletext) EXTERN_CVAR(Bool, vid_fps) EXTERN_CVAR(Bool, inter_subtitles) CVAR(Int, hud_scale, 0, CVAR_ARCHIVE); - +CVAR(Bool, log_vgafont, false, CVAR_ARCHIVE) DBaseStatusBar *StatusBar; @@ -1231,10 +1231,10 @@ void DBaseStatusBar::DrawLog () if (text.IsNotEmpty()) { // This uses the same scaling as regular HUD messages - auto scale = active_con_scaletext(generic_ui); + auto scale = active_con_scaletext(generic_ui || log_vgafont); hudwidth = SCREENWIDTH / scale; hudheight = SCREENHEIGHT / scale; - FFont *font = C_GetDefaultHUDFont(); + FFont *font = (generic_ui || log_vgafont)? NewSmallFont : SmallFont; int linelen = hudwidth<640? Scale(hudwidth,9,10)-40 : 560; auto lines = V_BreakLines (font, linelen, text[0] == '$'? GStrings(text.GetChars()+1) : text.GetChars()); diff --git a/src/gamedata/fonts/v_font.h b/src/gamedata/fonts/v_font.h index 2c9d1aeb6..960476054 100644 --- a/src/gamedata/fonts/v_font.h +++ b/src/gamedata/fonts/v_font.h @@ -191,7 +191,5 @@ EColorRange V_ParseFontColor (const uint8_t *&color_value, int normalcolor, int FFont *V_GetFont(const char *fontname, const char *fontlumpname = nullptr); void V_InitFontColors(); -FFont * C_GetDefaultHUDFont(); - #endif //__V_FONT_H__ diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 2d39b24ad..22226b563 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -84,7 +84,7 @@ void DrawFullscreenSubtitle(const char *text) auto scale = active_con_scaletext(generic_ui); int hudwidth = SCREENWIDTH / scale; int hudheight = SCREENHEIGHT / scale; - FFont *font = C_GetDefaultHUDFont(); + FFont *font = generic_ui? NewSmallFont : SmallFont; int linelen = hudwidth < 640 ? Scale(hudwidth, 9, 10) - 40 : 560; auto lines = V_BreakLines(font, linelen, text); diff --git a/wadsrc/static/zscript/ui/statusbar/strife_sbar.zs b/wadsrc/static/zscript/ui/statusbar/strife_sbar.zs index 5adf3ee6e..3a7c3e072 100644 --- a/wadsrc/static/zscript/ui/statusbar/strife_sbar.zs +++ b/wadsrc/static/zscript/ui/statusbar/strife_sbar.zs @@ -109,7 +109,7 @@ class StrifeStatusBar : BaseStatusBar override void ShowPop (int popnum) { Super.ShowPop(popnum); - if (popnum == CurrentPop || (popnum == POP_LOG && generic_ui)) + if (popnum == CurrentPop || (popnum == POP_LOG && MustDrawLog(0))) { if (popnum == POP_Keys) { @@ -146,7 +146,7 @@ class StrifeStatusBar : BaseStatusBar override bool MustDrawLog(int state) { // Tell the base class to draw the log if the pop screen won't be displayed. - return generic_ui; + return generic_ui || log_vgafont; } void Reset ()