move UIWindow to lua

This commit is contained in:
Eduardo Bart
2012-01-10 21:13:38 -02:00
parent a1374baee1
commit 8ad88c4070
23 changed files with 57 additions and 254 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -1,6 +1,6 @@
MainWindow
id: enterGame
title: Enter Game
text: Enter Game
size: 236 240
@onEnter: EnterGame.doLogin()
@onEscape: EnterGame.hide()