diff options
Diffstat (limited to 'Source/Asura.Framework/scripts/framework.lua')
-rw-r--r-- | Source/Asura.Framework/scripts/framework.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/Asura.Framework/scripts/framework.lua b/Source/Asura.Framework/scripts/framework.lua index 14e7b24..5da0020 100644 --- a/Source/Asura.Framework/scripts/framework.lua +++ b/Source/Asura.Framework/scripts/framework.lua @@ -1,2 +1,21 @@ ---框架入口文件 +package.path = "scripts\\?.lua" + +--loader +local loadfn = function(modulename) + local errmsg = "" + local modulepath = string.gsub(modulename, "%.", "/") + for path in string.gmatch(package.path, "([^;]+)") do + local filename = string.gsub(path, "%?", modulepath) + filename = string.gsub(filename, "\\", "/") + local result = kleiloadlua(filename) + if result then + return result + end + errmsg = errmsg.."\n\tno file '"..filename.."' (checked with custom loader)" + end + return errmsg +end + +table.insert(package.loaders, 1, loadfn) + require "" |