Re-add destroying for unloading, other clean up:

* Cleaned some module terminate code
* Fixed "reload all" issues
This commit is contained in:
BeniS
2013-02-01 17:32:15 +13:00
parent 35e5dd8af8
commit 7f5dda5c8f
21 changed files with 31 additions and 77 deletions

View File

@@ -123,11 +123,11 @@ function terminate()
disconnect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
logoutButton:destroy()
gameRootPanel:destroy()
end
function onGameStart()
logoutButton:setTooltip(tr('Logout'))
show()
-- open tibia has delay in auto walking
@@ -139,7 +139,6 @@ function onGameStart()
end
function onGameEnd()
logoutButton:setTooltip(tr('Exit'))
setupViewMode(0)
hide()
end
@@ -151,10 +150,13 @@ function show()
gameRootPanel:focus()
gameMapPanel:followCreature(g_game.getLocalPlayer())
updateStretchShrink()
logoutButton:setTooltip(tr('Logout'))
end
function hide()
disconnect(g_app, { onClose = tryExit })
logoutButton:setTooltip(tr('Exit'))
if logoutWindow then
logoutWindow:destroy()
logoutWindow = nil