mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix scripts menu
This commit is contained in:
parent
0df5684adf
commit
850a12c2ea
2 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
function run_script(path)
|
||||
__vc_start_app_script(path)
|
||||
__vc_start_app_script(path, path)
|
||||
end
|
||||
|
||||
function refresh()
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ function pack.unload(prefix)
|
|||
events.remove_by_prefix(prefix)
|
||||
end
|
||||
|
||||
function __vc_start_app_script(path)
|
||||
function __vc_start_app_script(path, name)
|
||||
debug.log("starting application script "..path)
|
||||
|
||||
local code = file.read(path)
|
||||
|
|
@ -126,7 +126,11 @@ function __vc_start_app_script(path)
|
|||
end
|
||||
local script_env = setmetatable({app = app or __vc_app}, {__index=_G})
|
||||
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
|
||||
|
||||
gui_util = require "core:internal/gui_util"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue