Merge branch 'main' into update-gfx-pipeline
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
language = "VCM"
|
||||
extensions = ["vcm"]
|
||||
line-comment-start = "#"
|
||||
+42
-40
@@ -8,47 +8,49 @@
|
||||
</panel>
|
||||
</splitbox>
|
||||
<splitbox id="editorContainer" split-pos="0.8">
|
||||
<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()"
|
||||
color="#FFFFFF80" size="16" pos="4,6"
|
||||
hover-color="#1080FF"></image>
|
||||
<panel orientation="horizontal" gravity="top-right"
|
||||
size="60,16" padding="8" interval="8" color="0">
|
||||
<image id="saveIcon" src="gui/save" tooltip="@Save"
|
||||
enabled="false" interactive="true"
|
||||
hover-color="#1080FF"
|
||||
onclick="save_current_file()"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
<image id="infoIcon" src="gui/info" tooltip="@editor.info.tooltip"
|
||||
enabled="true" interactive="true"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
<image id="syncIcon" src="gui/play" tooltip="@Run"
|
||||
enabled="true" interactive="true"
|
||||
hover-color="#1080FF"
|
||||
onclick="run_current_file()"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
</panel>
|
||||
<label id="title" pos="26,8"></label>
|
||||
<splitbox id="codePanel" orientation="horizontal">
|
||||
<container color="#00000080" cursor="text"
|
||||
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()"
|
||||
color="#FFFFFF80" size="16" pos="4,6"
|
||||
hover-color="#1080FF"></image>
|
||||
<panel orientation="horizontal" gravity="top-right"
|
||||
size="60,16" padding="8" interval="8" color="0">
|
||||
<image id="saveIcon" src="gui/save" tooltip="@Save"
|
||||
enabled="false" interactive="true"
|
||||
hover-color="#1080FF"
|
||||
onclick="save_current_file()"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
<image id="infoIcon" src="gui/info" tooltip="@editor.info.tooltip"
|
||||
enabled="true" interactive="true"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
<image id="syncIcon" src="gui/play" tooltip="@Run"
|
||||
enabled="true" interactive="true"
|
||||
hover-color="#1080FF"
|
||||
onclick="run_current_file()"
|
||||
color="#FFFFFF80" size="16"></image>
|
||||
</panel>
|
||||
<label id="title" pos="26,8"></label>
|
||||
</container>
|
||||
<textbox
|
||||
id='editor'
|
||||
pos='0,30'
|
||||
color='0'
|
||||
autoresize='true'
|
||||
margin='0'
|
||||
padding='5'
|
||||
multiline='true'
|
||||
line-numbers='true'
|
||||
oncontrolkey='on_control_combination'
|
||||
size-func="-1,40"
|
||||
text-wrap='false'
|
||||
scroll-step='50'
|
||||
></textbox>
|
||||
</container>
|
||||
<textbox
|
||||
id='editor'
|
||||
pos='0,30'
|
||||
color='0'
|
||||
autoresize='true'
|
||||
margin='0'
|
||||
padding='5'
|
||||
multiline='true'
|
||||
line-numbers='true'
|
||||
oncontrolkey='on_control_combination'
|
||||
size-func="-1,40"
|
||||
text-wrap='false'
|
||||
scroll-step='50'
|
||||
></textbox>
|
||||
<modelviewer size="480" model="stairs" center="0.5,0.5,0.5" cam-rotation="45,-45,0" gravity="top-right"/>
|
||||
</container>
|
||||
<modelviewer id="modelviewer" visible="false" center="0.5,0.5,0.5" cam-rotation="45,-45,0"/>
|
||||
</splitbox>
|
||||
<splitbox orientation="horizontal" split-pos="0.4">
|
||||
<panel id="traceback" padding="4" color="#000000A0">
|
||||
</panel>
|
||||
|
||||
@@ -104,10 +104,29 @@ function unlock_access()
|
||||
)
|
||||
end
|
||||
|
||||
local function reload_model(filename, name)
|
||||
assets.parse_model("xml", document.editor.text, name)
|
||||
end
|
||||
|
||||
function run_current_file()
|
||||
if not current_file.filename then
|
||||
return
|
||||
end
|
||||
|
||||
local info = registry.get_info(current_file.filename)
|
||||
local script_type = info and info.type or "file"
|
||||
local unit = info and info.unit
|
||||
|
||||
if script_type == "model" then
|
||||
print(current_file.filename)
|
||||
clear_output()
|
||||
local _, err = pcall(reload_model, current_file.filename, unit)
|
||||
if err then
|
||||
document.output:paste(string.format("\n[#FF0000]%s[#FFFFFF]", err))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
local chunk, err = loadstring(document.editor.text, current_file.filename)
|
||||
clear_output()
|
||||
if not chunk then
|
||||
@@ -119,9 +138,7 @@ function run_current_file()
|
||||
)
|
||||
return
|
||||
end
|
||||
local info = registry.get_info(current_file.filename)
|
||||
local script_type = info and info.type or "file"
|
||||
local unit = info and info.unit
|
||||
|
||||
save_current_file()
|
||||
|
||||
local func = function()
|
||||
@@ -191,6 +208,7 @@ events.on("core:open_traceback", function(traceback_b64)
|
||||
tb_list.size = srcsize
|
||||
end)
|
||||
|
||||
--- Save the current file in the code editor if has writeable path.
|
||||
function save_current_file()
|
||||
if not current_file.mutable then
|
||||
return
|
||||
@@ -202,7 +220,22 @@ function save_current_file()
|
||||
document.editor.edited = false
|
||||
end
|
||||
|
||||
--- Open a file in the code editor.
|
||||
--- @param filename string - the path to the file to open.
|
||||
--- @param line integer - the line number to focus on (optional).
|
||||
--- @param mutable string - writeable file path (optional).
|
||||
function open_file_in_editor(filename, line, mutable)
|
||||
debug.log("opening file " .. string.escape(filename) .. " in editor")
|
||||
|
||||
local ext = file.ext(filename)
|
||||
if ext == "xml" or ext == "vcm" then
|
||||
document.modelviewer.src = file.stem(filename)
|
||||
document.modelviewer.visible = true
|
||||
else
|
||||
document.modelviewer.visible = false
|
||||
end
|
||||
document.codePanel:refresh()
|
||||
|
||||
local editor = document.editor
|
||||
local source = file.read(filename):gsub('\t', ' ')
|
||||
editor.scroll = 0
|
||||
@@ -225,7 +258,7 @@ end
|
||||
function on_open(mode)
|
||||
registry = require "core:internal/scripts_registry"
|
||||
|
||||
document.editorContainer:setInterval(200, refresh_file_title)
|
||||
document.codePanel:setInterval(200, refresh_file_title)
|
||||
|
||||
clear_traceback()
|
||||
clear_output()
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
markup="md"
|
||||
></textbox>
|
||||
</container>
|
||||
<iframe id="editorRoot" pos="0,30" size-func="-1,gui.get_viewport()[2]-30"
|
||||
src="core:code_editor">
|
||||
<iframe id="editorRoot" pos="0,30" size-func="-1,gui.get_viewport()[2]-30">
|
||||
</iframe>
|
||||
<textbox id='prompt'
|
||||
consumer='submit'
|
||||
|
||||
@@ -104,8 +104,10 @@ function set_mode(mode)
|
||||
|
||||
if mode == 'debug' then
|
||||
document.root.color = {16, 18, 20, 220}
|
||||
document.editorRoot.src = "core:code_editor"
|
||||
else
|
||||
document.root.color = {0, 0, 0, 128}
|
||||
document.editorRoot.src = ""
|
||||
end
|
||||
|
||||
document.prompt.visible = show_prompt
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@box from (0,0,0) to (1,0.5,1) delete (top,south)
|
||||
@box from (0,0.5,0) to (1,1,0.5) delete (bottom,south)
|
||||
@rect from (0,0.5,0.5) right (1,0,0) up (0,0,0.5) texture "$2"
|
||||
@rect from (0,0,0) right (1,0,0) up (0,1,0) texture "$1"
|
||||
@@ -1,6 +0,0 @@
|
||||
<model>
|
||||
<box from="0,0,0" to="1,0.5,1" delete="top,south"/>
|
||||
<box from="0,0.5,0" to="1,1,0.5" delete="bottom,south"/>
|
||||
<rect from="0,0.5,0.5" right="1,0,0" up="0,0,0.5" texture="$2"/>
|
||||
<rect from="0,0,0" right="1,0,0" up="0,1,0" texture="$1"/>
|
||||
</model>
|
||||
@@ -55,7 +55,7 @@ local function load_models_list(packs)
|
||||
local registry = export.registry
|
||||
for _, filename in ipairs(file.list("models")) do
|
||||
local ext = file.ext(filename)
|
||||
if ext == "xml" then
|
||||
if ext == "xml" or ext == "vcm" then
|
||||
registry[filename] = {type="model", unit=file.stem(filename)}
|
||||
table.insert(export.filenames, filename)
|
||||
end
|
||||
|
||||
@@ -291,6 +291,19 @@ console.add_command(
|
||||
end
|
||||
)
|
||||
|
||||
console.add_command(
|
||||
"weather.list",
|
||||
"Show available weather presets list",
|
||||
function(args, kwargs)
|
||||
local filenames = file.list_all_res("presets/weather/")
|
||||
local presets = " "
|
||||
for index, filename in pairs(filenames) do
|
||||
presets = presets .. "\n" .. file.stem(filename)
|
||||
end
|
||||
return "available presets:" .. presets
|
||||
end
|
||||
)
|
||||
|
||||
console.cheats = {
|
||||
"blocks.fill",
|
||||
"tp",
|
||||
|
||||
+13
-4
@@ -19,8 +19,17 @@ Problems=Праблемы
|
||||
Monitor=Маніторынг
|
||||
Debug=Адладка
|
||||
File=Файл
|
||||
Read only=Толькі для чытання
|
||||
Save=Захаваць
|
||||
Grant %{0} pack modification permission?=Выдаць дазвол на мадыфікацыю пака %{0}?
|
||||
Error at line %{0}=Памылка ў радку %{0}
|
||||
Run=Запусціць
|
||||
Filter=Фільтр
|
||||
|
||||
editor.info.tooltip=CTRL+S - Захаваць\nCTRL+R - Запусціць\nCTRL+Z - Скасаваць\nCTRL+Y - Паўтарыць
|
||||
devtools.traceback=Стэк выклікаў (ад апошняга)
|
||||
devtools.output=Вывод
|
||||
|
||||
error.pack-not-found=Не ўдалося знайсці пакет
|
||||
error.dependency-not-found=Выкарыстоўваная залежнасць не знойдзена
|
||||
pack.remove-confirm=Выдаліць увесь кантэнт, які пастаўляецца пакетам/пакетамі, са свету (беззваротна)?
|
||||
@@ -43,7 +52,7 @@ menu.Display=Дысплей
|
||||
menu.Graphics=Графіка
|
||||
menu.missing-content=Адсутнічае Кантэнт!
|
||||
menu.New World=Новы Свет
|
||||
menu.Open worlds folder=Адкрыць папку з сусветамі
|
||||
menu.Open worlds folder=Адкрыць тэчку са сусветамі
|
||||
menu.Worlds=Сусветы
|
||||
menu.Page not found=Старонка не знойдзена
|
||||
menu.Quit=Выхад
|
||||
@@ -51,8 +60,8 @@ menu.Save and Quit to Menu=Захаваць і Выйсці ў Меню
|
||||
menu.Settings=Налады
|
||||
menu.Reset settings=Скінуць налады
|
||||
menu.Contents Menu=Меню кантэнт-пакаў
|
||||
menu.Open data folder=Адкрыць папку з дадзенымі
|
||||
menu.Open content folder=Адкрыць папку [content]
|
||||
menu.Open data folder=Адкрыць тэчку з дадзенымі
|
||||
menu.Open content folder=Адкрыць тэчку [content]
|
||||
|
||||
world.Seed=Зерне
|
||||
world.Name=Назва
|
||||
@@ -112,4 +121,4 @@ player.fast_interaction=Паскоранае ўзаемадзеянне
|
||||
player.flight=Палёт
|
||||
player.drop=Выкінуць прадмет
|
||||
camera.zoom=Прыбліжэнне
|
||||
camera.mode=Змяніць рэжым камеры
|
||||
camera.mode=Змяніць рэжым камеры
|
||||
|
||||
Reference in New Issue
Block a user