diff --git a/src/logic/scripting/lua/libs/libtext3d.cpp b/src/logic/scripting/lua/libs/libtext3d.cpp index 310f5d78e..0c3957cce 100644 --- a/src/logic/scripting/lua/libs/libtext3d.cpp +++ b/src/logic/scripting/lua/libs/libtext3d.cpp @@ -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}, {"hide", wrap_hud}, @@ -108,5 +122,7 @@ const luaL_Reg text3dlib[] = { {"set_axis_y", wrap_hud}, {"set_rotation", wrap_hud}, {"update_settings", wrap_hud}, + {"get_entity", wrap_hud}, + {"set_entity", wrap_hud}, {nullptr, nullptr} };