stretch meter area

This commit is contained in:
Kistaro Windrider 2024-09-07 16:15:00 -07:00
parent 804eb62ae7
commit 3f7c4f59c0
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -337,28 +337,28 @@ function drawhud()
line(113,127)
draw_gun_info("❎",1,116,3,primary_ship.main_gun)
draw_gun_info("🅾️",1,116,31,primary_ship.special_gun)
draw_gun_info("🅾️",1,116,29,primary_ship.special_gun)
dropshadow("x h",114,59,1)
inset(114,66,119,125)
dropshadow("x h",114,57,1)
inset(114,64,119,125)
fillp(0x5a5a)
vertmeter(115,67,118,124,primary_ship.xp, primary_ship.xptarget, powcols)
vertmeter(115,65,118,124,primary_ship.xp, primary_ship.xptarget, powcols)
inset(120,66,125,125)
-- 57 px vertically
inset(120,64,125,125)
-- 59 px vertically
local mxs, cs, mxh, ch = primary_ship.maxshield, primary_ship.shield, primary_ship.maxhp, primary_ship.hp
if (mxs > 0) and (mxh > 0) then
local split = 57 * (mxs / (mxs + mxh)) \ 1 + 66
local split = 59 * (mxs / (mxs + mxh)) \ 1 + 64
line(121, split, 124, split, 0xba)
vertmeter(121,67,124,split-1,cs, mxs,shlcols)
vertmeter(121,65,124,split-1,cs, mxs,shlcols)
vertmeter(121,split+1,124,124,ch, mxh, hpcols)
elseif mxs > 0 then
vertmeter(121,67,124,124,cs,mxs,shlcols)
vertmeter(121,65,124,124,cs,mxs,shlcols)
elseif mxh > 0 then
vertmeter(121,67,124,124,ch,mxh,hpcols)
vertmeter(121,65,124,124,ch,mxh,hpcols)
else
print("!", 122, 94, 9)
print("!", 121, 93, 8)
print("!", 122, 93, 9)
print("!", 121, 92, 8)
end
fillp(0)
end