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:
parent
4c0c6e635e
commit
5921c8e420
|
@ -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, {
|
||||||
|
|
Loading…
Reference in New Issue