- allow using the VGA font for map name display on the alternative HUD.

This commit is contained in:
Christoph Oelckers 2019-04-10 21:21:33 +02:00
parent 31d1f8ba50
commit 5e5780dd65

View file

@ -159,7 +159,7 @@ class AltHud ui
let seconds = Thinker.Tics2Seconds(timer); let seconds = Thinker.Tics2Seconds(timer);
String s = String.Format("%02i:%02i:%02i", seconds / 3600, (seconds % 3600) / 60, seconds % 60); String s = String.Format("%02i:%02i:%02i", seconds / 3600, (seconds % 3600) / 60, seconds % 60);
int length = 8 * fnt.GetCharWidth("0"); int length = 8 * fnt.GetCharWidth("0");
DrawHudText(SmallFont, color, s, x-length, y, trans); DrawHudText(fnt, color, s, x-length, y, trans);
} }
//=========================================================================== //===========================================================================
@ -759,15 +759,18 @@ class AltHud ui
if (withmapname) if (withmapname)
{ {
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(Level.MapName), ypos, Level.MapName, let font = generic_hud? NewSmallFont : SmallFont;
int hh = font.GetHeight();
screen.DrawText(font, hudcolor_titl, hudwidth - 6 - font.StringWidth(Level.MapName), ypos, Level.MapName,
DTA_KeepRatio, true, DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight); DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.StringWidth(Level.LevelName), ypos + h, Level.LevelName, screen.DrawText(font, hudcolor_titl, hudwidth - 6 - font.StringWidth(Level.LevelName), ypos + hh, Level.LevelName,
DTA_KeepRatio, true, DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight); DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
ypos += 3 * h; ypos += 2 * hh + h;
} }
DrawCoordinateEntry(xpos, ypos, String.Format("X: %.0f", pos.X)); DrawCoordinateEntry(xpos, ypos, String.Format("X: %.0f", pos.X));
@ -955,12 +958,14 @@ class AltHud ui
virtual void DrawAutomap(PlayerInfo CPlayer) virtual void DrawAutomap(PlayerInfo CPlayer)
{ {
int fonth=SmallFont.GetHeight() + 1; let font = generic_hud? NewSmallFont : SmallFont;
int fonth = font.GetHeight() + 1;
int bottom = hudheight - 1; int bottom = hudheight - 1;
if (am_showtotaltime) if (am_showtotaltime)
{ {
DrawTimeString(SmallFont, hudcolor_ttim, Level.totaltime, hudwidth-2, bottom, 1); DrawTimeString(font, hudcolor_ttim, Level.totaltime, hudwidth-2, bottom, 1);
bottom -= fonth; bottom -= fonth;
} }
@ -968,15 +973,15 @@ class AltHud ui
{ {
if (Level.clusterflags & Level.CLUSTER_HUB) if (Level.clusterflags & Level.CLUSTER_HUB)
{ {
DrawTimeString(SmallFont, hudcolor_time, Level.time, hudwidth-2, bottom, 1); DrawTimeString(font, hudcolor_time, Level.time, hudwidth-2, bottom, 1);
bottom -= fonth; bottom -= fonth;
} }
// Single level time for hubs // Single level time for hubs
DrawTimeString(SmallFont, hudcolor_ltim, Level.maptime, hudwidth-2, bottom, 1); DrawTimeString(font, hudcolor_ltim, Level.maptime, hudwidth-2, bottom, 1);
} }
screen.DrawText(SmallFont, 0, 1, hudheight - fonth - 1, Level.FormatMapName(hudcolor_titl), screen.DrawText(font, Font.CR_BRICK, 2, hudheight - fonth - 1, Level.FormatMapName(hudcolor_titl),
DTA_KeepRatio, true, DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight); DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);