Fixed Exit button not being created

It will now show/hide appropriately instead of not being created and
thus throwing errors.
This commit is contained in:
Jeffrey 2013-01-07 20:22:32 -06:00
parent 4c0c6e635e
commit 5921c8e420
1 changed files with 6 additions and 2 deletions

View File

@ -4,8 +4,12 @@ local exitWindow
local exitButton local exitButton
function Exit.init() function Exit.init()
if not g_game.isOnline() then exitButton = TopMenu.addRightButton('exitButton', tr('Exit Client'), 'exit.png', Exit.tryExit)
exitButton = TopMenu.addRightButton('exitButton', tr('Exit Client'), 'exit.png', Exit.tryExit)
if g_game.isOnline() then
exitButton:hide()
else
exitButton:show()
end end
connect(g_game, { connect(g_game, {