Compare commits
2 Commits
066a5aec0d
...
bcc70d7e63
| Author | SHA1 | Date | |
|---|---|---|---|
| bcc70d7e63 | |||
| c87a55ae3f |
12
.vscode/settings.json
vendored
Normal file
12
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"Lua.workspace.library": [
|
||||||
|
"/home/ruffles/.vscode/extensions/pawz.polytoria-lua-1.1.1/api",
|
||||||
|
"${addons}/cc-tweaked/module/library"
|
||||||
|
],
|
||||||
|
"Lua.runtime.version": "Lua 5.3",
|
||||||
|
"Lua.runtime.builtin": {
|
||||||
|
"io": "disable",
|
||||||
|
"os": "disable"
|
||||||
|
},
|
||||||
|
"Lua.workspace.checkThirdParty": false
|
||||||
|
}
|
||||||
@@ -97,9 +97,9 @@ function stratum.loadTransforms(modules,libpath)
|
|||||||
file.close()
|
file.close()
|
||||||
if not contents then error("failed to read file",2) end
|
if not contents then error("failed to read file",2) end
|
||||||
contents = stratum.applyMacros(contents,libpath)
|
contents = stratum.applyMacros(contents,libpath)
|
||||||
local func, err = load(contents,"transforms","t",_ENV)
|
local trans, err = load(contents,"transforms","t",_ENV)
|
||||||
if not func then error(err,2) end
|
if not trans then error(err,2) end
|
||||||
return func()
|
return trans()
|
||||||
end
|
end
|
||||||
|
|
||||||
function stratum.setBackend(backend)
|
function stratum.setBackend(backend)
|
||||||
@@ -109,7 +109,6 @@ function stratum.setBackend(backend)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function stratum.createTransform(name,func)
|
function stratum.createTransform(name,func)
|
||||||
print("registering "..name)
|
|
||||||
local backend = _STRATUMBACKEND
|
local backend = _STRATUMBACKEND
|
||||||
if not backend or not (backend.sendMessage and backend.receiveMessage) then error("stratum backend not defined or defined incorrectly",2) end
|
if not backend or not (backend.sendMessage and backend.receiveMessage) then error("stratum backend not defined or defined incorrectly",2) end
|
||||||
backend.sendMessage({protocol="RegisterTransform",name=name,functionBody=func})
|
backend.sendMessage({protocol="RegisterTransform",name=name,functionBody=func})
|
||||||
|
|||||||
Reference in New Issue
Block a user