new lua function for creating widgets: createWidget

This commit is contained in:
Eduardo Bart
2012-01-02 22:42:53 -02:00
parent 9fbdf3f5cb
commit 05230f44e4
29 changed files with 137 additions and 120 deletions

View File

@@ -5,7 +5,7 @@ local vipWindow = nil
-- public functions
function VipList.create()
vipWindow = UI.display('viplist.otui', { parent = Game.gameRightPanel })
vipWindow = displayUI('viplist.otui', { parent = Game.gameRightPanel })
end
function VipList.destroy()
@@ -17,11 +17,9 @@ end
function Game.onAddVip(id, name, online)
local vipList = vipWindow:getChildById('vipList')
local label = UILabel.create()
vipList:addChild(label)
local label = createWidget('VipListLabel', vipList)
label:setId('vip' .. id)
label:setText(name)
label:setStyle('VipListLabel')
if online then
label:setForegroundColor('#00ff00')