mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 04:24:54 +02:00
BEAWARE all game functionality is disabled with this commit for a while
* rework client modules * hide main window when loading * remake top menu functions * rework modules autoload * improve path resolving for otml and lua * move core_widgets to core_lib * fix tooltip issues * split some styles * add bit32 lua library * fix assert issues * fix compilation on linux 32 systems * rework gcc compile options * renable and fix some warnings * remove unused constants * speedup sprite cache * move UIGame to lua (not funcional yet) * fix a lot of issues in x11 window * fix crash handler * add some warnings do uiwidget and much more...
This commit is contained in:
@@ -52,7 +52,27 @@ local function tryLogin(charInfo, tries)
|
||||
Settings.set('lastUsedCharacter', charInfo.characterName)
|
||||
end
|
||||
|
||||
|
||||
function onGameLoginError(message)
|
||||
CharacterList.destroyLoadBox()
|
||||
local errorBox = displayErrorBox("Login Error", "Login error: " .. message)
|
||||
errorBox.onOk = CharacterList.show
|
||||
end
|
||||
|
||||
function onGameConnectionError(message)
|
||||
CharacterList.destroyLoadBox()
|
||||
local errorBox = displayErrorBox("Login Error", "Connection error: " .. message)
|
||||
errorBox.onOk = CharacterList.show
|
||||
end
|
||||
|
||||
-- public functions
|
||||
function CharacterList.init()
|
||||
connect(g_game, { onLoginError = onGameLoginError })
|
||||
connect(g_game, { onConnectionError = onGameConnectionError })
|
||||
connect(g_game, { onGameStart = CharacterList.destroyLoadBox })
|
||||
connect(g_game, { onGameEnd = CharacterList.show })
|
||||
end
|
||||
|
||||
function CharacterList.terminate()
|
||||
characterList = nil
|
||||
if charactersWindow then
|
||||
@@ -60,6 +80,7 @@ function CharacterList.terminate()
|
||||
charactersWindow = nil
|
||||
end
|
||||
if loadBox then
|
||||
g_game.cancelLogin()
|
||||
loadBox:destroy()
|
||||
loadBox = nil
|
||||
end
|
||||
@@ -118,6 +139,7 @@ end
|
||||
function CharacterList.show()
|
||||
if not loadBox then
|
||||
charactersWindow:show()
|
||||
charactersWindow:raise()
|
||||
charactersWindow:focus()
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user