MCPcopy Create free account
hub / github.com/OpenMW/openmw / loadContentConstructor

Function loadContentConstructor

components/lua_ui/content.cpp:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace LuaUi
5{
6 sol::protected_function loadContentConstructor(LuaUtil::LuaState* state)
7 {
8 sol::protected_function loader = state->loadInternalLib("content");
9 sol::set_environment(state->newInternalLibEnvironment(), loader);
10 sol::table metatable = LuaUtil::LuaState::throwIfError(loader()).get<sol::table>();
11 if (metatable["new"].get_type() != sol::type::function)
12 throw std::logic_error("Expected function");
13 return metatable["new"].get<sol::protected_function>();
14 }
15
16 bool isValidContent(const sol::object& object)
17 {

Callers 2

LuaUiContentTestMethod · 0.85
registerUiApiFunction · 0.85

Calls 4

set_environmentFunction · 0.85
loadInternalLibMethod · 0.80
get_typeMethod · 0.45

Tested by 1

LuaUiContentTestMethod · 0.68