From 0afbfd58cecd8615a59e531f0c176e38ff7e5cab Mon Sep 17 00:00:00 2001 From: BenDol Date: Sun, 19 Jul 2015 07:08:21 +1200 Subject: [PATCH] Proper gameinterface load sequence, thanks @Quintinon https://github.com/edubart/otclient/pull/677 --- modules/game_interface/gameinterface.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 248afbe8..09930e27 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -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 = {}