• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

doubt button

rohfagundes

New Member
Joined
Jan 18, 2013
Messages
14
Reaction score
0
sorry my english here is Brazilian

How to put when you click a button to open another module?
 
in init() something like:
Lua:
local button = currentWindow:getChildById('yourButtonID')
button.onClick = function() modules.game_yourgamemodule.openMyModule() end
or link the function in otui file.

and in the other module game_yourgamemodule:
Lua:
function openMyModule()
  thisWindow.show()
  -- additional stuff to toggle topmenu button etc here
end

Note that in this code thisWindow is the main window of the other module, currentWindow is the main window of the module which has the button.
 
Excuse me, i've tried the same like Summ said, but it doesn't work.
Coul you instruct us how fix it?
 
Last edited:
Back
Top