From 13f3bf2331e78d581ff2da85045f43bc60db1483 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 17 Mar 2019 21:35:33 +0100 Subject: [PATCH] - add an option to print the kill, item and secret stats on the alternative HUD with the NewSmallFont. This has to be set in the console, the default is still the regular small font. Mainly added because some mods have really hard to read fonts where it is not easy to decipher the numbers. --- src/g_statusbar/shared_hud.cpp | 1 + wadsrc/static/zscript/ui/statusbar/alt_hud.zs | 30 ++++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/g_statusbar/shared_hud.cpp b/src/g_statusbar/shared_hud.cpp index 998d3f514..7a3350c46 100644 --- a/src/g_statusbar/shared_hud.cpp +++ b/src/g_statusbar/shared_hud.cpp @@ -55,6 +55,7 @@ CVAR(Int,hud_althudscale, 0, CVAR_ARCHIVE) // Scale the hud to 640x400? CVAR(Bool,hud_althud, false, CVAR_ARCHIVE) // Enable/Disable the alternate HUD +CVAR(Bool, hud_althudfont, false, CVAR_ARCHIVE) // Enable/Disable the alternate HUD // These are intentionally not the same as in the automap! CVAR (Bool, hud_showsecrets, true,CVAR_ARCHIVE); // Show secrets on HUD CVAR (Bool, hud_showmonsters, true,CVAR_ARCHIVE); // Show monster stats on HUD diff --git a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs index f8befa09f..f3161df8d 100644 --- a/wadsrc/static/zscript/ui/statusbar/alt_hud.zs +++ b/wadsrc/static/zscript/ui/statusbar/alt_hud.zs @@ -170,14 +170,30 @@ class AltHud ui void DrawStatLine(int x, in out int y, String prefix, String text) { - y -= SmallFont.GetHeight()-1; - screen.DrawText(SmallFont, hudcolor_statnames, x, y, prefix, - DTA_KeepRatio, true, - DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + if (!hud_althudfont) + { + y -= SmallFont.GetHeight()-1; + screen.DrawText(SmallFont, hudcolor_statnames, x, y, prefix, + DTA_KeepRatio, true, + DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); - screen.DrawText(SmallFont, hudcolor_stats, x+statspace, y, text, - DTA_KeepRatio, true, - DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + screen.DrawText(SmallFont, hudcolor_stats, x+statspace, y, text, + DTA_KeepRatio, true, + DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0.75); + } + else + { + double horzscale = 1.5; + int downscale = 2; + y -= NewSmallFont.GetHeight() / downscale; + screen.DrawText(NewSmallFont, hudcolor_statnames, x * horzscale, y * downscale, prefix, + DTA_KeepRatio, true, + DTA_VirtualWidthF, hudwidth * horzscale, DTA_VirtualHeight, hudheight * downscale, DTA_Alpha, 0.75); + + screen.DrawText(NewSmallFont, hudcolor_stats, (x+statspace) * horzscale, y * downscale, text, + DTA_KeepRatio, true, + DTA_VirtualWidthF, hudwidth * horzscale, DTA_VirtualHeight, hudheight * downscale, DTA_Alpha, 0.75); + } } void DrawStatus(PlayerInfo CPlayer, int x, int y)