mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Done fixed for SLMOD. Need to retest.
This commit is contained in:
@@ -3,25 +3,13 @@ local base = _G
|
||||
|
||||
Include = {}
|
||||
|
||||
Include.Path = function()
|
||||
local str = debug.getinfo(2, "S").source
|
||||
return str:match("(.*/)"):sub(1,-2):gsub("\\","/")
|
||||
end
|
||||
|
||||
Include.File = function( IncludeFile )
|
||||
if not Include.Files[ IncludeFile ] then
|
||||
Include.Files[IncludeFile] = IncludeFile
|
||||
env.info( "Include:" .. IncludeFile .. " from " .. Include.ProgramPath )
|
||||
local f = assert( base.loadfile( Include.ProgramPath .. IncludeFile .. ".lua" ) )
|
||||
if f == nil then
|
||||
env.info( "Include:" .. IncludeFile .. " from " .. Include.MissionPath )
|
||||
local f = assert( base.loadfile( Include.MissionPath .. IncludeFile .. ".lua" ) )
|
||||
if f == nil then
|
||||
error ("Could not load MOOSE file " .. IncludeFile .. ".lua" )
|
||||
else
|
||||
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.MissionPath )
|
||||
return f()
|
||||
end
|
||||
error ("Could not load MOOSE file " .. IncludeFile .. ".lua" )
|
||||
else
|
||||
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.ProgramPath )
|
||||
return f()
|
||||
@@ -30,10 +18,8 @@ Include.File = function( IncludeFile )
|
||||
end
|
||||
|
||||
Include.ProgramPath = "Scripts/Moose/"
|
||||
Include.MissionPath = Include.Path()
|
||||
|
||||
env.info( "Include.ProgramPath = " .. Include.ProgramPath)
|
||||
env.info( "Include.MissionPath = " .. Include.MissionPath)
|
||||
|
||||
Include.Files = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user