Skip to content

Commit

Permalink
- added an option to always display the log and the subtitles with th…
Browse files Browse the repository at this point in the history
…e 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.
  • Loading branch information
coelckers committed Jul 31, 2019
1 parent 045025f commit 154af34
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/console/c_console.cpp
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/g_statusbar/shared_sbar.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down
2 changes: 0 additions & 2 deletions src/gamedata/fonts/v_font.h
Expand Up @@ -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__
2 changes: 1 addition & 1 deletion src/intermission/intermission.cpp
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/zscript/ui/statusbar/strife_sbar.zs
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 ()
Expand Down

0 comments on commit 154af34

Please sign in to comment.