Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 58
What's wrong with my code ?? The minimize button don't work
actions.Otmod
actions.Otui
actions.Lua
actions.Otmod
CSS:
Module
name: game_actions
description: Manage actions window
author: Helliot
website: http://www.thelastempire.net
sandboxed: true
autoload: true
autoload-priority: 1000
scripts: [ actions ]
@onLoad: init()
@onUnload: terminate()
actions.Otui
CSS:
MiniWindow2
id: actionsWindow
!text: tr('Actions')
size: 165 197
@onClose: modules.game_actions.hide()
&save: true
InsideWindow
id: insidewindow1
size: 151 42
image-border: 3
anchors.top: parent.top
anchors.left: parent.left
margin-top: 25
margin-left: 7
LoginButton
id: button1
!text: tr('Buy Premium Cards')
color: #82ff82
size: 149 20
anchors.top: insidewindow1.top
anchors.left: insidewindow1.left
margin-top: 1
margin-left: 1
LoginButton
id: button2
!text: tr('Open Premium Shop')
color: #82ff82
size: 149 20
anchors.top: button1.bottom
anchors.left: button1.left
margin-top: 1
InsideWindow
id: insidewindow2
size: 151 22
image-border: 3
anchors.top: insidewindow1.bottom
anchors.left: insidewindow1.left
margin-top: 5
LoginButton
id: button3
!text: tr('Autofollow')
color: #c8c8c8
size: 74 20
anchors.top: insidewindow2.top
anchors.left: insidewindow2.left
margin-top: 1
margin-left: 1
LoginButton
id: button3
!text: tr('Fightmode')
color: #c8c8c8
size: 74 20
anchors.top: insidewindow2.top
anchors.left: button3.right
anchors.right: insidewindow2.right
margin-top: 1
margin-left: 1
margin-right: 1
InsideWindow
id: insidewindow3
size: 151 82
image-border: 3
anchors.top: insidewindow2.bottom
anchors.left: insidewindow2.left
margin-top: 5
LoginButton
id: button4
!text: tr('Quests')
color: #c8c8c8
size: 74 20
anchors.top: insidewindow3.top
anchors.left: insidewindow3.left
margin-top: 1
margin-left: 1
LoginButton
id: button5
!text: tr('Spells')
color: #c8c8c8
size: 74 20
anchors.top: insidewindow3.top
anchors.left: button4.right
anchors.right: insidewindow3.right
margin-top: 1
margin-left: 1
margin-right: 1
LoginButton
id: button6
!text: tr('Talents')
color: #c8c8c8
size: 74 20
anchors.top: button4.bottom
anchors.left: button4.left
margin-top: 1
LoginButton
id: button7
!text: tr('Guild')
color: #c8c8c8
size: 74 20
anchors.top: button6.top
anchors.left: button6.right
anchors.right: insidewindow3.right
margin-left: 1
margin-right: 1
LoginButton
id: button8
!text: tr('Options')
color: #c8c8c8
size: 149 20
anchors.top: button6.bottom
anchors.left: button6.left
margin-top: 1
LoginButton
id: button9
!text: tr('Logout')
color: #c8c8c8
size: 149 20
anchors.top: button8.bottom
anchors.left: button8.left
margin-top: 1
actions.Lua
Lua:
local actionsWindow = nil
local actionsButton = nil
function init()
actionsWindow = g_ui.displayUI('actions')
actionsWindow:hide()
actionsButton = modules.client_topmenu.addRightGameToggleButton('actionsButton', tr('Actions'), '/images/topbuttons/actions', toggle)
actionsWindow:disableResize()
end
function terminate()
actionsWindow:destroy()
actionsButton:destroy()
end
function toggle()
if actionsWindow:isVisible() then
actionsWindow:hide()
actionsButton:setOn(false)
else
actionsWindow:show()
actionsButton:setOn(true)
actionsWindow:focus()
end
end
function hide()
actionsWindow:hide()
actionsButton:setOn(false)
end