Skip to content

Commit

Permalink
- fixed redundant map name display on alternative HUD's automap HUD.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Apr 10, 2019
1 parent 1b077c5 commit 31d1f8b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions wadsrc/static/zscript/ui/statusbar/alt_hud.zs
Expand Up @@ -737,11 +737,11 @@ class AltHud ui
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
}

void DrawCoordinates(PlayerInfo CPlayer)
void DrawCoordinates(PlayerInfo CPlayer, bool withmapname)
{
Vector3 pos;
String coordstr;
int h = SmallFont.GetHeight() + 1;
int h = SmallFont.GetHeight();
let mo = CPlayer.mo;

if (!map_point_coordinates || !automapactive)
Expand All @@ -757,16 +757,19 @@ class AltHud ui
int xpos = hudwidth - SmallFont.StringWidth("X: -00000")-6;
int ypos = 18;

screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.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,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);
if (withmapname)
{
screen.DrawText(SmallFont, hudcolor_titl, hudwidth - 6 - SmallFont.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,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);

ypos += 3 * h;
}

ypos += 3 * h;
DrawCoordinateEntry(xpos, ypos, String.Format("X: %.0f", pos.X));
ypos += h;
DrawCoordinateEntry(xpos, ypos, String.Format("Y: %.0f", pos.Y));
Expand Down Expand Up @@ -935,7 +938,7 @@ class AltHud ui
y = DrawAmmo(CPlayer, hudwidth-5, y);
if (hud_showweapons) DrawWeapons(CPlayer, hudwidth - 5, y);
DrawInventory(CPlayer, 144, hudheight - 28);
if (idmypos) DrawCoordinates(CPlayer);
if (idmypos) DrawCoordinates(CPlayer, true);

int h = SmallFont.GetHeight();
y = h;
Expand Down Expand Up @@ -977,7 +980,7 @@ class AltHud ui
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight);

DrawCoordinates(CPlayer);
DrawCoordinates(CPlayer, false);
}

//---------------------------------------------------------------------------
Expand Down

0 comments on commit 31d1f8b

Please sign in to comment.