mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Merge pull request #4 from svenvandevelde/Improve-MOOSE-to-load-from-Saved-Games-folder-or-from-Mission-File
Fixed it.
This commit is contained in:
commit
0dea644a53
@ -11,20 +11,32 @@ end
|
|||||||
|
|
||||||
Include = {}
|
Include = {}
|
||||||
|
|
||||||
Include.LoadPath = script_path() .. "Mission\\"
|
Include.MissionPath = script_path() .. "Mission\\"
|
||||||
|
Include.ProgramPath = "Scripts\\Moose\\"
|
||||||
|
|
||||||
env.info( "Include.LoadPath = " .. Include.LoadPath )
|
env.info( "Include.MissionPath = " .. Include.MissionPath)
|
||||||
|
env.info( "Include.ProgramPath = " .. Include.ProgramPath)
|
||||||
Include.Files = {}
|
Include.Files = {}
|
||||||
|
|
||||||
Include.File = function( IncludeFile )
|
Include.File = function( IncludeFile )
|
||||||
if not Include.Files[ IncludeFile ] then
|
if not Include.Files[ IncludeFile ] then
|
||||||
Include.Files[IncludeFile] = IncludeFile
|
Include.Files[IncludeFile] = IncludeFile
|
||||||
base.dofile( Include.LoadPath .. "" .. IncludeFile .. ".lua" )
|
local f = base.loadfile( Include.MissionPath .. IncludeFile .. ".lua" )
|
||||||
--local chunk, errMsg = base.loadfile( IncludeFile .. ".lua" )
|
if f == nil then
|
||||||
env.info( "Include:" .. IncludeFile .. " loaded " )
|
local f = base.loadfile( Include.ProgramPath .. IncludeFile .. ".lua" )
|
||||||
|
if f == nil then
|
||||||
|
error ("Could not load MOOSE file " .. IncludeFile .. ".lua" )
|
||||||
|
else
|
||||||
|
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.ProgramPath )
|
||||||
|
return f()
|
||||||
|
end
|
||||||
|
else
|
||||||
|
env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.MissionPath )
|
||||||
|
return f()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Include.File( "Database" )
|
Include.File( "Database" )
|
||||||
|
|
||||||
env.info("Loaded MOOSE")
|
env.info("Loaded MOOSE Include Engine")
|
||||||
Loading…
x
Reference in New Issue
Block a user