mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 03:24:55 +02:00
move UIWindow to lua
This commit is contained in:
@@ -10,8 +10,10 @@ local function onCharactersWindowKeyPress(self, keyCode, keyText, keyboardModifi
|
||||
if keyboardModifiers == KeyboardNoModifier then
|
||||
if keyCode == KeyUp or keyCode == KeyTab then
|
||||
characterList:focusPreviousChild(ActiveFocusReason)
|
||||
return true
|
||||
elseif keyCode == KeyDown then
|
||||
characterList:focusNextChild(ActiveFocusReason)
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
@@ -59,7 +61,7 @@ function CharacterList.create(characters, premDays)
|
||||
charactersWindow = displayUI('characterlist.otui')
|
||||
characterList = charactersWindow:getChildById('characterList')
|
||||
local accountStatusLabel = charactersWindow:getChildById('accountStatusLabel')
|
||||
charactersWindow.onKeyPress = onCharactersWindowKeyPress
|
||||
connect(charactersWindow, {onKeyPress = onCharactersWindowKeyPress })
|
||||
|
||||
local focusLabel
|
||||
for i,characterInfo in ipairs(characters) do
|
||||
|
@@ -10,7 +10,7 @@ CharacterListLabel < Label
|
||||
|
||||
MainWindow
|
||||
id: charactersWindow
|
||||
title: Character List
|
||||
text: Character List
|
||||
size: 250 248
|
||||
@onEnter: CharacterList.doLogin()
|
||||
@onEscape: CharacterList.destroy()
|
||||
@@ -23,6 +23,8 @@ MainWindow
|
||||
margin-bottom: 5
|
||||
margin-left: 16
|
||||
margin-right: 16
|
||||
padding: 1
|
||||
focusable: false
|
||||
|
||||
Label
|
||||
id: accountStatusLabel
|
||||
|
@@ -1,6 +1,6 @@
|
||||
MainWindow
|
||||
id: enterGame
|
||||
title: Enter Game
|
||||
text: Enter Game
|
||||
size: 236 240
|
||||
@onEnter: EnterGame.doLogin()
|
||||
@onEscape: EnterGame.hide()
|
||||
|
Reference in New Issue
Block a user