mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-07 21:59:49 -05:00
HUD: fix health bar not showing bar when low on health
This commit is contained in:
parent
8d460f64dc
commit
e0f1a70311
@ -142,11 +142,15 @@ CoD.Reimagined.HealthBarArea.UpdateHealthBar = function(Menu, ClientInstance)
|
||||
local healthPercent = health / maxHealth
|
||||
local shieldHealthPercent = shieldHealth / 100
|
||||
|
||||
Menu.healthBar:setLeftRight(true, false, Menu.bgDiff, (Menu.width * healthPercent) - Menu.bgDiff)
|
||||
local healthWidth = math.max(3, (Menu.width * healthPercent) - Menu.bgDiff)
|
||||
|
||||
Menu.healthBar:setLeftRight(true, false, Menu.bgDiff, healthWidth)
|
||||
|
||||
if shieldHealthPercent > 0 then
|
||||
local shieldHealthWidth = math.max(3, (Menu.width * shieldHealthPercent) - Menu.bgDiff)
|
||||
|
||||
Menu.shieldBar:setAlpha(1)
|
||||
Menu.shieldBar:setLeftRight(true, false, Menu.bgDiff, (Menu.width * shieldHealthPercent) - Menu.bgDiff)
|
||||
Menu.shieldBar:setLeftRight(true, false, Menu.bgDiff, shieldHealthWidth)
|
||||
Menu.healthBar:setTopBottom(true, false, (Menu.height + Menu.bgDiff) / 2, Menu.height - Menu.bgDiff)
|
||||
Menu.healthText:setText(health .. " | " .. shieldHealth)
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user