devo ter pego isso em algum lugar.
Crie 3 arquivos, .lua, .otmod e .otui
.LUA
ThunderPanel = nil
ThunderButton = nil
function init()
ThunderButton = modules.client_topmenu.addRightGameToggleButton('ThunderButton', tr('Thunder Addons'), 'Thunder.png', toggle)
ThunderButton:setOn(false)
ThunderWindow = g_ui.displayUI('Thunder')
connect(g_game, { onGameStart = online,
onGameEnd = destroyWindow })
if not g_game.isOnline() then
ThunderWindow:hide()
end
if ThunderButton:isOn() then
ThunderWindow:hide()
ThunderButton:setOn(false)
else
ThunderWindow:hide()
ThunderButton:setOn(false)
end
end
function terminate()
disconnect(g_game, { onGameStart = online,
onGameEnd = offline})
ThunderButton:destroy()
end
function toggle()
if ThunderButton:isOn() then
ThunderWindow:hide()
ThunderButton:setOn(false)
else
ThunderWindow:show()
ThunderButton:setOn(true)
end
end
function Thunderhide()
ThunderWindow:hide()
ThunderButton:setOn(false)
end
function Thunderhidex()
Teste:show()
end
function onMiniWindowClose()
ThunderButton:setOn(false)
end
.OTUI
MainWindow
id: ThunderWindow
!text: tr('Thunder')
size: 150 150
&save: true
@onEnter: Thunderhide()
@onEscape: Thunderhide()
Button
id: close
!text: tr('hide')
size: 40 15
anchors.bottom: parent.bottom
anchors.right: parent.right
@onClick: Thunderhidex()
Label
id: teste
!text: tr('Olá Xtibia')
anchors.top: Button.top
anchors.left: Button.left
anchors.bottom: parent.bottom
.OTMOD
Module
name: Thunder Addons
description: Addons for thunder Ot
author: Eduardo Vicente (Banana Fight)
website: www.xtibia.com
autoload: true
autoload-priority: 1000
scripts:
- Thunder.lua
dependencies:
- game_interface
@onLoad: init()
@onUnload: terminate()
e o arquivo Teste.OTUI também deve estar na pasta, use qualquer um ai pra testar, se quiser, olha aqui
MainWindow
size: 256 128
!text: tr('Teste')
@onEscape: terminate()
Button
!text: tr('Enviar')
width: 64
anchors.right: next.left
anchors.bottom: parent.bottom
margin-right: 10
@onClick: Thunder:Show()
Button
!text: tr('Fechar')
width: 64
anchors.right: parent.right
anchors.bottom: parent.bottom
@onClick: toggle()
pronto, eu fui editando conforme o post, nem sei se vai funcionar.... tirei os opcodes que tinha e umas funções que criei tambem...
a versão utilizada é o 0.6.2
abç