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

Method initPlayerPackage

components/lua/storage.cpp:194–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192 }
193
194 sol::table LuaStorage::initPlayerPackage(
195 LuaUtil::LuaView& view, LuaStorage* globalStorage, LuaStorage* playerStorage)
196 {
197 sol::table res(view.sol(), sol::create);
198 registerLifeTime(view, res);
199
200 res["globalSection"] = [globalStorage](sol::this_state lua, std::string_view section) {
201 return globalStorage->getReadOnlySection(lua, section);
202 };
203 res["playerSection"] = [playerStorage](sol::this_state lua, std::string_view section) {
204 return playerStorage->getMutableSection(lua, section);
205 };
206 res["allPlayerSections"] = [playerStorage](sol::this_state lua) { return playerStorage->getAllSections(lua); };
207 return LuaUtil::makeReadOnly(res);
208 }
209
210 sol::table LuaStorage::initMenuPackage(LuaUtil::LuaView& view, LuaStorage* globalStorage, LuaStorage* playerStorage)
211 {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected