MOOSE/Moose Setup/Moose Templates/Moose_Dynamic_Loader.lua
kaltokri 4fda8cc5fb Easy debugging for all Moosers #2093
Enables everybody to use load Moose from an external full path.
This is needed to use PyCharm with EmmyLua Debugger.
Needs also De-Sanitize to load mission script with full path.
2024-01-10 14:12:17 +01:00

25 lines
617 B
Lua

env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
local base = _G
__Moose = {}
__Moose.Include = function( IncludeFile )
if not __Moose.Includes[ IncludeFile ] then
__Moose.Includes[IncludeFile] = IncludeFile
local f = assert( base.loadfile( IncludeFile ) )
if f == nil then
error ("Moose: Could not load Moose file " .. IncludeFile )
else
env.info( "Moose: " .. IncludeFile .. " dynamically loaded." )
return f()
end
end
end
__Moose.Includes = {}
if not MOOSE_DEVELOPMENT_FOLDER then
MOOSE_DEVELOPMENT_FOLDER='Scripts'
end
__Moose.Include( MOOSE_DEVELOPMENT_FOLDER..'/Moose/Modules.lua' )