You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

-- private variables
local showCharacterListOnLogout = true
-- 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()
13 years ago
gameUi = loadUI('/game/ui/gameinterface.otui', UI.root)
gameUi.onKeyPress = onGameKeyPress
13 years ago
end
local function destroyMainInterface()
if gameUi then
gameUi:destroy()
gameUi = nil
end
end
-- public functions
function Game.onLogin()
MainMenu.hide()
CharacterList.destroyLoadBox()
createMainInterface()
13 years ago
end
function Game.onConnectionError(message)
CharacterList.destroyLoadBox()
local errorBox = displayErrorBox("Login Error", "Connection error: " .. message)
errorBox.onOk = CharacterList.show
showCharacterListOnLogout = false
end
13 years ago
function Game.onLogout()
MainMenu.show()
if showCharacterListOnLogout then
CharacterList.show()
else
showCharacterListOnLogout = true
end
destroyMainInterface()
13 years ago
end