mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
new lua function for creating widgets: createWidget
This commit is contained in:
@@ -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
|
||||
|
@@ -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')
|
||||
|
Reference in New Issue
Block a user