reorganize modules

This commit is contained in:
Eduardo Bart
2011-12-05 16:27:07 -02:00
parent ffeb34e0e7
commit cf0aab6d4d
90 changed files with 186 additions and 181 deletions

View File

@@ -0,0 +1,18 @@
TopMenu = {}
-- private variables
local topMenu
-- public functions
function TopMenu.create()
topMenu = UI.display('topmenu.otui')
end
function TopMenu.destroy()
topMenu:destroy()
topMenu = nil
end
function TopMenu.getButton(id)
return topMenu:getChildById(id)
end

View File

@@ -0,0 +1,13 @@
Module
name: client_topmenu
description: Create the top menu
author: OTClient team
website: https://github.com/edubart/otclient
onLoad: |
require 'topmenu'
TopMenu.create()
return true
onUnload: |
TopMenu.destroy()

View File

@@ -0,0 +1,71 @@
TopPanel
id: topMenu
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
focusable: false
TopButton
id: settingsButton
anchors.top: parent.top
anchors.left: parent.left
margin-top: 4
margin-left: 6
tooltip: Options
icon: /core_styles/icons/settings.png
@onClick: Options.create()
TopButton
id: enterGameButton
anchors.top: prev.top
anchors.left: prev.right
margin-left: 6
tooltip: Enter game with a character
icon: /core_styles/icons/login.png
@onClick: |
if Game.isOnline() then
CharacterList.show()
else
EnterGame.show()
end
TopButton
id: motdButton
anchors.top: prev.top
anchors.left: prev.right
margin-left: 6
tooltip: Message of the day
icon: /core_styles/icons/motd.png
visible: false
@onClick: EnterGame.displayMotd()
TopButton
anchors.top: parent.top
anchors.right: parent.right
margin-top: 4
margin-right: 6
tooltip: Logout
icon: /core_styles/icons/logout.png
@onClick: |
if Game.isOnline() then
Game.logout(false)
else
exit()
end
TopButton
anchors.top: parent.top
anchors.right: prev.left
margin-top: 4
margin-right: 6
tooltip: About OTClient
icon: /core_styles/icons/about.png
@onClick: About.create()
FrameCounter
id: frameCounter
anchors.top: parent.top
anchors.right: prev.left
margin-top: 8
margin-right: 12