Helliot1
Owner of Empire Online
- Joined
- Jul 26, 2017
- Messages
- 315
- Solutions
- 1
- Reaction score
- 58
I create a button in other module, to connect with my Console module, but I can't make this work..
The line 170 is " if consoleToggleChat:isChecked() then"
I get this error on my OtClient
console.lua
actions.otui
The line 170 is " if consoleToggleChat:isChecked() then"
I get this error on my OtClient
Code:
ERROR: protected lua call failed: LUA ERROR:
/game_console/console.lua:170: attempt to index global 'consoleToggleChat' (a nil value)
stack traceback:
[C]: in function '__index'
/game_console/console.lua:170: in function 'toggleChat'
/game_actions/actions.otui:69: [@onCheckChange]:2: in function </game_actions/actions.otui:69: [@onCheckChange]:1>
[C]: in function 'setChecked'
/corelib/ui/uicheckbox.lua:12: in function </corelib/ui/uicheckbox.lua:11>
console.lua
Lua:
function init()
consoleToggleChat = modules.game_actions.actionsWindow:getChildById('button30')
end
function toggleChat()
if consoleToggleChat:isChecked() then
disableChat()
else
enableChat()
end
end
actions.otui
CSS:
MiniWindow
id: actionsWindow
!text: tr('Actions')
height: 197
width: 165
MiniWindowContents
CheckBox2
id: button30
!text: tr('Fightmode')
font: verdana-11px-rounded
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
@onCheckChange: modules.game_console.toggleChat()
Last edited: