It's not clear to me how to create an EXE (with rtc) from a multi-file GUI project.
Let suppose to have a main multi.wlua file loading other files with their own functions or even top level statement.
Are they required to be structured as modules and loaded with require? May I use dofile() in the main file ?
Should I put the modules in a subfolder to be embedded in the EXE from rtc?
It seems that the following approach is working, do you confirm that it's the correct way?
-- RTC build command
rtc -s -w -o ..\multi.exe modules multi.wlua
-- MAIN FILE multi.wlua
ui = require 'ui'
if embed then oth = require 'other'
else oth = require 'modules/other'
end
win = ui.Window('Multi', 'fixed', 400, 200)
oth.test(win)
win:show()
repeat ui.update() until not win.visible
-- OTHER MODULE FILE: other.lua (stored inside sufolder 'modules')
local other = {}
function other.test(w) w.title = 'TESTED' end
return other