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

Method initMenuPackage

components/lua/storage.cpp:210–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208 }
209
210 sol::table LuaStorage::initMenuPackage(LuaUtil::LuaView& view, LuaStorage* globalStorage, LuaStorage* playerStorage)
211 {
212 sol::table res(view.sol(), sol::create);
213 registerLifeTime(view, res);
214
215 res["playerSection"] = [playerStorage](sol::this_state lua, std::string_view section) {
216 return playerStorage->getMutableSection(lua, section, /*forMenuScripts=*/true);
217 };
218 res["globalSection"] = [globalStorage](sol::this_state lua, std::string_view section) {
219 return globalStorage->getReadOnlySection(lua, section);
220 };
221 res["allPlayerSections"] = [playerStorage](sol::this_state lua) { return playerStorage->getAllSections(lua); };
222 return LuaUtil::makeReadOnly(res);
223 }
224
225 sol::table LuaStorage::initLoadPackage(LuaUtil::LuaView& view, LuaStorage* playerStorage)
226 {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected