mirror of
https://github.com/ENSL/NS.git
synced 2024-11-21 20:21:14 +00:00
add 4 digit health and armor support
- fix armor number spacing
This commit is contained in:
parent
92db73eb89
commit
2f6ddf68bb
3 changed files with 11 additions and 2 deletions
|
@ -154,6 +154,7 @@ int CHudBattery::Draw(float flTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
x += (m_prc1->right - m_prc1->left) * gHUD.m_Health.m_fHealthScale;
|
x += (m_prc1->right - m_prc1->left) * gHUD.m_Health.m_fHealthScale;
|
||||||
|
x += ((gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left) / 2) * gHUD.m_Health.m_fHealthScale;
|
||||||
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b, 255, gHUD.m_Health.m_fHealthScale, CHud::a_southwest);
|
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b, 255, gHUD.m_Health.m_fHealthScale, CHud::a_southwest);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -340,7 +340,7 @@ int CHudHealth::Draw(float flTime)
|
||||||
|
|
||||||
gHUD.DrawHudFill(x, y, iWidth, iHeight, r ,g , b, a, m_fHealthScale);
|
gHUD.DrawHudFill(x, y, iWidth, iHeight, r ,g , b, a, m_fHealthScale);
|
||||||
|
|
||||||
gHUD.m_Battery.m_iAnchorX = x + + iWidth + HealthWidth / 2;
|
gHUD.m_Battery.m_iAnchorX = x + iWidth + HealthWidth / 2;
|
||||||
gHUD.m_Battery.m_iAnchorY = initialY;
|
gHUD.m_Battery.m_iAnchorY = initialY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -577,10 +577,18 @@ int CHud::DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int
|
||||||
|
|
||||||
if (iNumber > 0)
|
if (iNumber > 0)
|
||||||
{
|
{
|
||||||
|
// Draw 1000's
|
||||||
|
if (iNumber >= 1000)
|
||||||
|
{
|
||||||
|
k = iNumber / 1000;
|
||||||
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
|
x += iWidth;
|
||||||
|
}
|
||||||
|
|
||||||
// SPR_Draw 100's
|
// SPR_Draw 100's
|
||||||
if (iNumber >= 100)
|
if (iNumber >= 100)
|
||||||
{
|
{
|
||||||
k = iNumber / 100;
|
k = (iNumber % 1000) / 100;
|
||||||
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue