| 234 | } |
| 235 | |
| 236 | void LuaStorage::clearTemporaryAndRemoveCallbacks() |
| 237 | { |
| 238 | auto it = mData.begin(); |
| 239 | while (it != mData.end()) |
| 240 | { |
| 241 | it->second->mCallbacks.clear(); |
| 242 | // Note that we don't clear menu callbacks for permanent sections |
| 243 | // because starting/loading a game doesn't reset menu scripts. |
| 244 | if (it->second->mLifeTime == Section::Temporary) |
| 245 | { |
| 246 | it->second->mMenuScriptsCallbacks.clear(); |
| 247 | it->second->mValues.clear(); |
| 248 | it = mData.erase(it); |
| 249 | } |
| 250 | else |
| 251 | ++it; |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | void LuaStorage::load(lua_State* state, const std::filesystem::path& path) |
| 256 | { |