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

@@ -56,7 +56,7 @@ function CharacterList.create(characters, premDays)
charactersWindow:destroy()
end
charactersWindow = UI.display('characterlist.otui')
charactersWindow = displayUI('characterlist.otui')
characterList = charactersWindow:getChildById('characterList')
local accountStatusLabel = charactersWindow:getChildById('accountStatusLabel')
charactersWindow.onKeyPress = onCharactersWindowKeyPress
@@ -68,10 +68,8 @@ function CharacterList.create(characters, premDays)
local worldHost = characterInfo[3]
local worldIp = characterInfo[4]
local label = UILabel.create()
characterList:addChild(label)
local label = createWidget('CharacterListLabel', characterList)
label:setText(characterName .. ' (' .. worldName .. ')')
label:setStyle('CharacterListLabel')
label.characterName = characterName
label.worldHost = worldHost
label.worldPort = worldIp

View File

@@ -51,7 +51,7 @@ end
-- public functions
function EnterGame.create()
enterGame = UI.display('entergame.otui')
enterGame = displayUI('entergame.otui')
local account = g_configs.get('account')
local password = g_configs.get('password')