Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 58
Somebody can help me with this?
I'm trying to create a new simple window from the beginning but the window does not work
Otmod
Otui
Lua
I'm trying to create a new simple window from the beginning but the window does not work
Otmod
CSS:
Module
name: game_actions
description: Manage actions window
author: Helliot
website: www.thelastempire.net
sandboxed: true
scripts: [ actions ]
@onLoad: init()
@onUnload: terminate()
dependencies:
- game_interface
Otui
CSS:
MiniWindow
id: actionsWindow
!text: tr('Actions')
height: 320
@onClose: modules.game_actions.onMiniWindowClose()
&save: true
Lua
Lua:
Actions = {}
actionsWindow = nil
Actions = {}
function init()
connect(g_game, { onOpenActionsWindow = Actions.create,
onGameEnd = Actions.destroy })
end
function terminate()
disconnect(g_game, { onOpenActionsWindow = Actions.create,
onGameEnd = Actions.destroy })
Actions.destroy()
Actions = nil
end
function Actions.create
actionsWindow = g_ui.displayUI('Actions.otui')
end
function Actions.destroy()
if actionsWindow then
actionsWindow:destroy()
actionsWindow = nil
selectedSpell = nil
Actions = {}
end
end