Proper gameinterface load sequence, thanks @Quintinon

https://github.com/edubart/otclient/pull/677
This commit is contained in:
BenDol 2015-07-19 07:08:21 +12:00
parent 6c5549dd46
commit 0afbfd58ce
1 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,15 @@ function init()
onLoginAdvice = onLoginAdvice,
}, true)
-- Call load AFTER game window has been created and
-- resized to a stable state, otherwise the saved
-- settings can get overridden by false onGeometryChange
-- events
connect(g_app, {
onRun = load,
onExit = save
})
gameRootPanel = g_ui.displayUI('gameinterface')
gameRootPanel:hide()
gameRootPanel:lower()
@ -49,7 +58,6 @@ function init()
setupViewMode(0)
bindKeys()
load()
if g_game.isOnline() then
show()
@ -102,7 +110,6 @@ function unbindWalkKey(key)
end
function terminate()
save()
hide()
hookedMenuOptions = {}