fix scripts menu
This commit is contained in:
parent
0df5684adf
commit
850a12c2ea
@ -1,5 +1,5 @@
|
|||||||
function run_script(path)
|
function run_script(path)
|
||||||
__vc_start_app_script(path)
|
__vc_start_app_script(path, path)
|
||||||
end
|
end
|
||||||
|
|
||||||
function refresh()
|
function refresh()
|
||||||
|
|||||||
@ -116,7 +116,7 @@ function pack.unload(prefix)
|
|||||||
events.remove_by_prefix(prefix)
|
events.remove_by_prefix(prefix)
|
||||||
end
|
end
|
||||||
|
|
||||||
function __vc_start_app_script(path)
|
function __vc_start_app_script(path, name)
|
||||||
debug.log("starting application script "..path)
|
debug.log("starting application script "..path)
|
||||||
|
|
||||||
local code = file.read(path)
|
local code = file.read(path)
|
||||||
@ -126,7 +126,11 @@ function __vc_start_app_script(path)
|
|||||||
end
|
end
|
||||||
local script_env = setmetatable({app = app or __vc_app}, {__index=_G})
|
local script_env = setmetatable({app = app or __vc_app}, {__index=_G})
|
||||||
chunk = setfenv(chunk, script_env)
|
chunk = setfenv(chunk, script_env)
|
||||||
return __vc_start_coroutine(chunk, path)
|
if name then
|
||||||
|
return start_coroutine(chunk, name)
|
||||||
|
else
|
||||||
|
return __vc_start_coroutine(chunk)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
gui_util = require "core:internal/gui_util"
|
gui_util = require "core:internal/gui_util"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user