Skip to content
Permalink
Browse files

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

  • Loading branch information...
coelckers committed Apr 10, 2019
1 parent 31d1f8b commit 5e5780dd6579953a71fd0bd662a98e4f1f2fdd4b
Showing with 14 additions and 9 deletions.
  1. +14 −9 wadsrc/static/zscript/ui/statusbar/alt_hud.zs
@@ -159,7 +159,7 @@ class AltHud ui
let seconds = Thinker.Tics2Seconds(timer);
String s = String.Format("%02i:%02i:%02i", seconds / 3600, (seconds % 3600) / 60, seconds % 60);
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)
{
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_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_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);

ypos += 3 * h;
ypos += 2 * hh + h;
}

DrawCoordinateEntry(xpos, ypos, String.Format("X: %.0f", pos.X));
@@ -955,28 +958,30 @@ class AltHud ui

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;

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;
}

if (am_showtime)
{
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;
}

// 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_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);

0 comments on commit 5e5780d

Please sign in to comment.
You can’t perform that action at this time.