From 5921c8e4207a9c7f8818865f2a08ba31b44a27e2 Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Mon, 7 Jan 2013 20:22:32 -0600 Subject: [PATCH] Fixed Exit button not being created It will now show/hide appropriately instead of not being created and thus throwing errors. --- modules/client_exit/exit.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/client_exit/exit.lua b/modules/client_exit/exit.lua index 14db6b66..2859f1bf 100644 --- a/modules/client_exit/exit.lua +++ b/modules/client_exit/exit.lua @@ -4,8 +4,12 @@ local exitWindow local exitButton 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 connect(g_game, {