Hi, I turned Topmenu into a Suspended Menu, and left only 1 button to test, I would like to know how to make this button execute another script.
example;
clicking this button will launch Client_Options, opening the Options window.
Lua code:
Otui code:
example;
clicking this button will launch Client_Options, opening the Options window.
Lua code:
Lua:
function init()
menuWindow = g_ui.displayUI('menu.otui')
menuWindow:hide()
menuButton = modules.client_topmenu.addLeftButton('menuButton', tr('Menu'), '/images/topbuttons/menu', onoff, true)
g_keyboard.bindKeyDown('Ctrl+Z', toggle)
menuWindow:disableResize()
local mw = g_ui.createWidget('Panel')
mw:setParent(modules.game_interface.getRootPanel())
end
function terminate()
menuWindow:hide()
end
function onoff()
if menuWindow:isVisible() then
menuWindow:hide()
else
menuWindow:show()
end
end
Otui code:
Code:
Panel
id: menuWindow
!text: tr("")
font: terminus-14px-bold
text-align: center, top
color: black
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.left
anchors.bottom: parent.top
margin-left: 32
margin-top: 0
margin-right: -190
margin-bottom: -240
width: 190
height: 240
@onEnter: mods.client_menu.hide()
@onEscape: mods.client_menu.hide()
Button
id: optionsButton
size: 190 40
anchors.left: parent.left
anchors.top: parent.top
icon: /images/game/menu/botaoBranco
$hover !disabled:
icon: /images/game/menu/botaoLaranja
Last edited: