login/logout/ctrl+g working correctly

This commit is contained in:
Eduardo Bart
2011-08-29 15:38:01 -03:00
parent 8b2cb410c2
commit f41fd0576c
12 changed files with 131 additions and 36 deletions

View File

@@ -1,3 +1,6 @@
-- private variables
local showCharacterListOnLogout = true
-- private functions
local function onGameKeyPress(self, keyCode, keyChar, keyboardModifiers)
if keyboardModifiers == KeyboardCtrlModifier then
@@ -22,14 +25,28 @@ local function destroyMainInterface()
end
end
-- public functions
function Game.onLogin()
MainMenu.hide()
CharacterList.destroyLoadBox()
createMainInterface()
end
function Game.onConnectionError(message)
CharacterList.destroyLoadBox()
local errorBox = displayErrorBox("Login Error", "Connection error: " .. message)
errorBox.onOk = CharacterList.show
showCharacterListOnLogout = false
end
function Game.onLogout()
MainMenu.show()
CharacterList.show()
if showCharacterListOnLogout then
CharacterList.show()
else
showCharacterListOnLogout = true
end
destroyMainInterface()
end