feat: world script reloading
This commit is contained in:
@@ -39,7 +39,8 @@
|
||||
</panel>
|
||||
</splitbox>
|
||||
<splitbox id="editorContainer" split-pos="0.8">
|
||||
<container color="#00000080">
|
||||
<container color="#00000080"
|
||||
onclick="document.editor.focused = true document.editor.caret = -1">
|
||||
<container size-func="-1,30" color="#00000020">
|
||||
<image id="lockIcon" src="gui/lock" tooltip="@Read only"
|
||||
interactive="true" onclick="unlock_access()"
|
||||
|
||||
@@ -171,6 +171,8 @@ function run_current_file()
|
||||
func = function() block.reload_script(unit) end
|
||||
elseif script_type == "item" then
|
||||
func = function() item.reload_script(unit) end
|
||||
elseif script_type == "world" then
|
||||
func = function() world.reload_script(unit) end
|
||||
end
|
||||
local output = core.capture_output(func)
|
||||
document.output:add(
|
||||
@@ -387,6 +389,10 @@ local function build_scripts_classification()
|
||||
for id, props in pairs(item.properties) do
|
||||
scripts_classification[props["script-file"]] = {"item", item.name(id)}
|
||||
end
|
||||
local packs = pack.get_installed()
|
||||
for _, packid in ipairs(packs) do
|
||||
scripts_classification[packid..":scripts/world.lua"] = {"world", packid}
|
||||
end
|
||||
end
|
||||
|
||||
local function load_scripts_list()
|
||||
@@ -402,7 +408,6 @@ local function load_scripts_list()
|
||||
for _, packid in ipairs(packs) do
|
||||
collect_scripts(packid..":scripts", filenames)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function on_open(mode)
|
||||
|
||||
+2
-1
@@ -32,7 +32,8 @@
|
||||
"gui/file",
|
||||
"gui/module",
|
||||
"gui/play",
|
||||
"gui/info"
|
||||
"gui/info",
|
||||
"gui/world"
|
||||
],
|
||||
"fonts": [
|
||||
{
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 178 B |
Reference in New Issue
Block a user