1
0
mirror of https://gitlab.com/rubenwardy/awards.git synced 2024-12-29 12:10:38 +01:00

Stop progress bars going out of bounds

Fixes #21
This commit is contained in:
rubenwardy 2016-08-01 21:04:00 +01:00
parent 00eeeb3eef
commit f6515c12b8

View File

@ -335,6 +335,9 @@ function awards.getFormspec(name, to, sid)
label = res.label label = res.label
end end
if perc then if perc then
if perc > 1 then
perc = 1
end
formspec = formspec .. "background[0,4.80;" .. barwidth ..",0.25;awards_progress_gray.png]" formspec = formspec .. "background[0,4.80;" .. barwidth ..",0.25;awards_progress_gray.png]"
formspec = formspec .. "background[0,4.80;" .. (barwidth * perc) ..",0.25;awards_progress_green.png]" formspec = formspec .. "background[0,4.80;" .. (barwidth * perc) ..",0.25;awards_progress_green.png]"
if label then if label then