From 0acd869dfd5338d64918e84e9fd376fd292244b6 Mon Sep 17 00:00:00 2001 From: tmp64 Date: Sun, 29 Sep 2024 12:34:27 +0700 Subject: [PATCH] Client: HUD: Health: Adjust position --- src/game/client/hud/battery.cpp | 4 ++-- src/game/client/hud/health.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/game/client/hud/battery.cpp b/src/game/client/hud/battery.cpp index 1534e9c9..970d603a 100644 --- a/src/game/client/hud/battery.cpp +++ b/src/game/client/hud/battery.cpp @@ -102,8 +102,8 @@ void CHudBattery::Draw(float flTime) y = ScreenHeight - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2; - // this used to just be ScreenWidth/5 but that caused real issues at higher resolutions. Instead, base it on the width of this sprite. - x = 3 * m_rc1.GetWidth(); + // this used to just be ScreenWidth/5 but that caused real issues at higher resolutions. Instead, base it on the width of digit 0 + x = 10 * gHUD.GetSpriteRect(gHUD.m_HUD_number_0).GetWidth(); // make sure we have the right sprite handles if (!m_hSprite1) diff --git a/src/game/client/hud/health.cpp b/src/game/client/hud/health.cpp index 24755d9a..17818277 100644 --- a/src/game/client/hud/health.cpp +++ b/src/game/client/hud/health.cpp @@ -220,7 +220,6 @@ void CHudHealth::Draw(float flTime) SPR_DrawAdditive(0, x, y - iOffset, &m_rcCross); x = CrossWidth + HealthWidth / 2; - y += (int)(gHUD.m_iFontHeight * 0.2f); x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iHealth, r, g, b);