mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
commit
c4d5812b4f
46 changed files with 754 additions and 342 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue