mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 12:04:55 +02:00
fix protocol 860 death, fix progress bar
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user