fix protocol 860 death, fix progress bar

This commit is contained in:
Eduardo Bart
2012-01-11 10:48:34 -02:00
parent 0e88b03693
commit dba03d69f6
3 changed files with 8 additions and 2 deletions

View File

@@ -4,13 +4,16 @@ function UIProgressBar.create()
local progressbar = UIProgressBar.internalCreate()
progressbar:setFocusable(false)
progressbar:setPhantom(true)
progressbar.percent = 100
progressbar.percent = 0
progressbar:setBackgroundSize({width = 1, height = 1})
return progressbar
end
function UIProgressBar:setPercent(percent)
self:setBackgroundHeight(self:getHeight())
self:setBackgroundWidth((percent * self:getWidth())/100)
local width = (percent * self:getWidth())/100
if width == 0 then width = 1 end
self:setBackgroundWidth(width)
self.percent = percent
end