1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 11:59:55 +00:00
openmw/components/lua_ui/content.cpp

14 lines
519 B
C++

#include "content.hpp"
namespace LuaUi::Content
{
sol::protected_function loadConstructor(LuaUtil::LuaState* state)
{
sol::function loader = state->loadInternalLib("content");
sol::set_environment(state->newInternalLibEnvironment(), loader);
sol::table metatable = loader().get<sol::table>();
if (metatable["new"].get_type() != sol::type::function)
throw std::logic_error("Expected function");
return metatable["new"].get<sol::protected_function>();
}
}