mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
change interface style, add top menu
This commit is contained in:
14
modules/topmenu/topmenu.lua
Normal file
14
modules/topmenu/topmenu.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
TopMenu = {}
|
||||
|
||||
-- private variables
|
||||
local topMenu
|
||||
|
||||
-- public functions
|
||||
function TopMenu.create()
|
||||
topMenu = UI.loadAndDisplay("/topmenu/topmenu.otui")
|
||||
end
|
||||
|
||||
function TopMenu.destroy()
|
||||
topMenu:destroy()
|
||||
topMenu = nil
|
||||
end
|
18
modules/topmenu/topmenu.otmod
Normal file
18
modules/topmenu/topmenu.otmod
Normal file
@@ -0,0 +1,18 @@
|
||||
Module
|
||||
name: topmenu
|
||||
description: Create the top menu
|
||||
author: OTClient team
|
||||
website: https://github.com/edubart/otclient
|
||||
version: 0.2
|
||||
autoLoad: true
|
||||
dependencies:
|
||||
- core
|
||||
|
||||
onLoad: |
|
||||
require 'topmenu'
|
||||
TopMenu.create()
|
||||
return true
|
||||
|
||||
onUnload: |
|
||||
TopMenu.destroy()
|
||||
|
52
modules/topmenu/topmenu.otui
Normal file
52
modules/topmenu/topmenu.otui
Normal file
@@ -0,0 +1,52 @@
|
||||
TopPanel
|
||||
id: topMenu
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
focusable: false
|
||||
|
||||
TopButton
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
margin.top: 3
|
||||
margin.left: 6
|
||||
|
||||
UIWidget
|
||||
size: 16 16
|
||||
image: /core_ui/icons/settings.png
|
||||
anchors.centerIn: parent
|
||||
phantom: true
|
||||
|
||||
TopButton
|
||||
anchors.top: prev.top
|
||||
anchors.left: prev.right
|
||||
margin.left: 6
|
||||
|
||||
UIWidget
|
||||
size: 16 16
|
||||
image: /core_ui/icons/login.png
|
||||
anchors.centerIn: parent
|
||||
phantom: true
|
||||
|
||||
TopButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
margin.top: 3
|
||||
margin.right: 6
|
||||
|
||||
UIWidget
|
||||
size: 16 16
|
||||
image: /core_ui/icons/exit.png
|
||||
anchors.centerIn: parent
|
||||
phantom: true
|
||||
|
||||
TopButton
|
||||
anchors.top: prev.top
|
||||
anchors.right: prev.left
|
||||
margin.right: 6
|
||||
|
||||
UIWidget
|
||||
size: 16 16
|
||||
image: /core_ui/icons/logout.png
|
||||
anchors.centerIn: parent
|
||||
phantom: true
|
Reference in New Issue
Block a user