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

Method initGlobalPackage

components/lua/storage.cpp:171–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169 }
170
171 sol::table LuaStorage::initGlobalPackage(LuaUtil::LuaView& view, LuaStorage* globalStorage)
172 {
173 sol::table res(view.sol(), sol::create);
174 registerLifeTime(view, res);
175
176 res["globalSection"] = [globalStorage](sol::this_state lua, std::string_view section) {
177 return globalStorage->getMutableSection(lua, section);
178 };
179 res["allGlobalSections"] = [globalStorage](sol::this_state lua) { return globalStorage->getAllSections(lua); };
180 return LuaUtil::makeReadOnly(res);
181 }
182
183 sol::table LuaStorage::initLocalPackage(LuaUtil::LuaView& view, LuaStorage* globalStorage)
184 {

Callers

nothing calls this directly

Calls 4

makeReadOnlyFunction · 0.85
solMethod · 0.80
getMutableSectionMethod · 0.80
getAllSectionsMethod · 0.80

Tested by

no test coverage detected