Merge pull request #837 from MihailRis/dev

move development to main
This commit is contained in:
MihailRis 2026-05-05 01:03:01 +03:00 • committed by GitHub
commit c4d5812b4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 754 additions and 342 deletions

View file

@ -350,6 +350,7 @@ static int l_start_debug_instance(lua::State* L) {
}
}
auto projectPath = lua::isstring(L, 2) ? lua::require_lstring(L, 2) : "";
auto outputPath = lua::isstring(L, 3) ? lua::require_lstring(L, 3) : "";
const auto& paths = engine->getPaths();
std::vector<std::string> args {
@ -362,7 +363,10 @@ static int l_start_debug_instance(lua::State* L) {
args.emplace_back(io::resolve(std::string(projectPath)).string());
}
platform::new_engine_instance(std::move(args));
platform::new_engine_instance(
std::move(args),
outputPath.empty() ? "" : io::resolve(std::string(outputPath))
);
return lua::pushinteger(L, port);
}

View file

@ -1011,8 +1011,9 @@ static int l_gui_get_env(lua::State* L) {
"document '" + std::string(name) + "' not found"
);
}
lua::getglobal(L, lua::env_name(*doc->getEnvironment()));
return 1;
return lua::getregistry(
L, lua::ENVS_TABLE, lua::env_name(*doc->getEnvironment())
);
}
static int l_gui_str(lua::State* L) {

View file

@ -65,7 +65,7 @@ static int l_set_params(lua::State* L) {
static int l_set_array(lua::State* L) {
size_t index = static_cast<size_t>(lua::tointeger(L, 1));
auto key = lua::require_string(L, 2);
auto data = lua::require_lstring(L, 3);
auto data = lua::bytearray_as_string(L, 3);
auto effect = post_processing->getEffect(index);
if (effect == nullptr) {
return 0;

View file

@ -95,6 +95,20 @@ static int l_set_rotation(lua::State* L) {
return 0;
}
static int l_get_entity(lua::State* L) {
if (auto note = renderer->texts->get(lua::tointeger(L, 1))) {
return lua::pushinteger(L, note->getEntity());
}
return 0;
}
static int l_set_entity(lua::State* L) {
if (auto note = renderer->texts->get(lua::tointeger(L, 1))) {
note->setEntity(lua::touinteger(L, 2));
}
return 0;
}
const luaL_Reg text3dlib[] = {
{"show", wrap_hud<l_show>},
{"hide", wrap_hud<l_hide>},
@ -108,5 +122,7 @@ const luaL_Reg text3dlib[] = {
{"set_axis_y", wrap_hud<l_set_axis_y>},
{"set_rotation", wrap_hud<l_set_rotation>},
{"update_settings", wrap_hud<l_update_settings>},
{"get_entity", wrap_hud<l_get_entity>},
{"set_entity", wrap_hud<l_set_entity>},
{nullptr, nullptr}
};