mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge branch 'master' into develop
This commit is contained in:
@@ -5,37 +5,41 @@
|
|||||||
-- This method is used by Moose developers and not mission builders.
|
-- This method is used by Moose developers and not mission builders.
|
||||||
ModuleLoader = 'Scripts/Moose/Modules.lua'
|
ModuleLoader = 'Scripts/Moose/Modules.lua'
|
||||||
|
|
||||||
local f=io.open(ModuleLoader,"r")
|
if io then
|
||||||
if f~=nil then
|
local f=io.open(ModuleLoader,"r")
|
||||||
io.close(f)
|
if f~=nil then
|
||||||
|
io.close(f)
|
||||||
|
|
||||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||||
|
|
||||||
local base = _G
|
local base = _G
|
||||||
|
|
||||||
__Moose = {}
|
__Moose = {}
|
||||||
|
|
||||||
__Moose.Include = function( IncludeFile )
|
__Moose.Include = function( IncludeFile )
|
||||||
if not __Moose.Includes[ IncludeFile ] then
|
if not __Moose.Includes[ IncludeFile ] then
|
||||||
__Moose.Includes[IncludeFile] = IncludeFile
|
__Moose.Includes[IncludeFile] = IncludeFile
|
||||||
local f = assert( base.loadfile( IncludeFile ) )
|
local f = assert( base.loadfile( IncludeFile ) )
|
||||||
if f == nil then
|
if f == nil then
|
||||||
error ("Moose: Could not load Moose file " .. IncludeFile )
|
error ("Moose: Could not load Moose file " .. IncludeFile )
|
||||||
else
|
else
|
||||||
env.info( "Moose: " .. IncludeFile .. " dynamically loaded." )
|
env.info( "Moose: " .. IncludeFile .. " dynamically loaded." )
|
||||||
return f()
|
return f()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
__Moose.Includes = {}
|
||||||
|
|
||||||
|
__Moose.Include( 'Scripts/Moose/Modules.lua' )
|
||||||
|
BASE:TraceOnOff( true )
|
||||||
|
env.info( '*** MOOSE INCLUDE END *** ' )
|
||||||
|
|
||||||
|
-- Skip the static part of this file completly
|
||||||
|
do return end
|
||||||
end
|
end
|
||||||
|
else
|
||||||
__Moose.Includes = {}
|
env.info( '*** MOOSE DYNAMIC INCLUDE NOT POSSIBLE (Desanitize io to use it) *** ' )
|
||||||
|
|
||||||
__Moose.Include( 'Scripts/Moose/Modules.lua' )
|
|
||||||
BASE:TraceOnOff( true )
|
|
||||||
env.info( '*** MOOSE INCLUDE END *** ' )
|
|
||||||
|
|
||||||
-- Skip the static part of this file completly
|
|
||||||
do return end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Individual Moose files are not found. Use the static code below.
|
-- Individual Moose files are not found. Use the static code below.
|
||||||
|
|||||||
Reference in New Issue
Block a user