modules changes

* speedup widget destruction checks
* rework outfit module using grid layout and the new design
* fixes in console, terminal, textmessage modules
This commit is contained in:
Eduardo Bart
2012-03-22 18:47:52 -03:00
parent 159eb98df2
commit 33458a3e39
41 changed files with 335 additions and 234 deletions

View File

@@ -4,23 +4,23 @@ function UIProgressBar.create()
local progressbar = UIProgressBar.internalCreate()
progressbar:setFocusable(false)
progressbar:setPhantom(true)
progressbar.m_percent = 0
progressbar.percent = 0
progressbar:updateBackground()
return progressbar
end
function UIProgressBar:setPercent(percent)
self.m_percent = math.max(math.min(percent, 100), 0)
self.percent = math.max(math.min(percent, 100), 0)
self:updateBackground()
end
function UIProgressBar:getPercent()
return self.m_percent
return self.percent
end
function UIProgressBar:updateBackground()
local width = math.max((self.m_percent * self:getWidth())/100, 1)
local width = math.max((self.percent * self:getWidth())/100, 1)
local height = self:getHeight()
self:setBackgroundSize({width=width, height=height})
end