1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/components/lua_ui/content.cpp
2023-01-31 19:50:33 +01:00

22 lines
639 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>();
}
int64_t View::sInstanceCount = 0;
int64_t getInstanceCount()
{
return View::sInstanceCount;
}
}