a lot of changes in modules

This commit is contained in:
Eduardo Bart
2012-02-06 17:19:47 -02:00
parent add8505a5b
commit 88301c329a
50 changed files with 488 additions and 322 deletions

View File

@@ -24,6 +24,9 @@ function TopMenu.init()
TopMenu.addRightButton('logoutButton', 'Logout (Ctrl+Q)', '/core_styles/icons/logout.png', onLogout)
Keyboard.bindKeyDown('Ctrl+Q', onLogout)
connect(Game, { onLogin = TopMenu.showGameButtons,
onLogout = TopMenu.hideGameButtons })
end
function TopMenu.terminate()
@@ -33,6 +36,9 @@ function TopMenu.terminate()
gameButtonsPanel = nil
topMenu:destroy()
topMenu = nil
disconnect(Game, { onLogin = TopMenu.showGameButtons,
onLogout = TopMenu.hideGameButtons })
end
function TopMenu.addButton(id, description, icon, callback, right)
@@ -82,6 +88,3 @@ end
function TopMenu.getButton(id)
return topMenu:recursiveGetChildById(id)
end
connect(Game, { onLogin = TopMenu.showGameButtons,
onLogout = TopMenu.hideGameButtons })

View File

@@ -3,6 +3,8 @@ Module
description: Create the top menu
author: OTClient team
website: https://github.com/edubart/otclient
autoload: true
autoload-antecedence: 120
onLoad: |
dofile 'topmenu'