ctrl+g kinda working, but login/logout events still need a remake

This commit is contained in:
Eduardo Bart
2011-08-29 11:14:21 -03:00
parent b859f66952
commit 8b2cb410c2
27 changed files with 323 additions and 148 deletions

View File

@@ -1,13 +1,35 @@
function Game.createMainInterface()
-- private functions
local function onGameKeyPress(self, keyCode, keyChar, keyboardModifiers)
if keyboardModifiers == KeyboardCtrlModifier then
if keyCode == KeyG then
CharacterList.show()
return true
end
end
return false
end
local function createMainInterface()
gameUi = loadUI('/game/ui/gameinterface.otui', UI.root)
gameUi.onKeyPress = onGameKeyPress
end
local function destroyMainInterface()
if gameUi then
gameUi:destroy()
gameUi = nil
end
end
function Game.onLogin()
MainMenu.hide()
CharacterList.destroyLoadBox()
createMainInterface()
end
function Game.onLogout()
gameUi:destroy()
gameUi = nil
mainMenu:show()
MainMenu.show()
CharacterList.show()
destroyMainInterface()
end

View File

@@ -10,6 +10,4 @@ UIWidget
anchors.left: gameMap.right
anchors.top: parent.top
text: Logout
onClick: |
Game.logout()
Game.onLogout()
onClick: Game.logout()