mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
major UIWidget rewrite with new features
This commit is contained in:
19
modules/core_widgets/uiprogressbar.lua
Normal file
19
modules/core_widgets/uiprogressbar.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
UIProgressBar = extends(UIWidget)
|
||||
|
||||
function UIProgressBar.create()
|
||||
local progressbar = UIProgressBar.internalCreate()
|
||||
progressbar:setFocusable(false)
|
||||
progressbar:setPhantom(true)
|
||||
progressbar.percent = 100
|
||||
return progressbar
|
||||
end
|
||||
|
||||
function UIProgressBar:setPercent(percent)
|
||||
self:setBackgroundHeight(self:getHeight())
|
||||
self:setBackgroundWidth((percent * self:getWidth())/100)
|
||||
self.percent = percent
|
||||
end
|
||||
|
||||
function UIProgressBar:getPercent()
|
||||
return self.percent
|
||||
end
|
Reference in New Issue
Block a user