mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
15 lines
519 B
C++
15 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>();
|
|
}
|
|
}
|