| 238 | } |
| 239 | |
| 240 | void ScriptExtender::OnStatsLoadGuarded(stats::RPGStats::LoadProc* wrapped, stats::RPGStats* mgr, Array<STDString>* paths) |
| 241 | { |
| 242 | // Stats load is scheduled from the client on the shared worker pool |
| 243 | ContextGuard _(ContextType::Client); |
| 244 | |
| 245 | // Ensure that we have an empty extension state ready in case OnStatsLoad() is the first callback |
| 246 | // due to late load |
| 247 | if (!client_.HasExtensionState()) { |
| 248 | client_.ResetExtensionState(); |
| 249 | } |
| 250 | |
| 251 | statLoadOrderHelper_.OnLoadStarted(); |
| 252 | client_.LoadExtensionState(ExtensionStateContext::Load); |
| 253 | |
| 254 | { |
| 255 | ecl::LuaClientPin lua(client_.GetExtensionState()); |
| 256 | if (lua) { |
| 257 | lua->OnModuleLoadStarted(); |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | { |
| 262 | DisableCrashReporting _; |
| 263 | wrapped(mgr, paths); |
| 264 | } |
| 265 | |
| 266 | client_.LoadExtensionState(ExtensionStateContext::Game); |
| 267 | |
| 268 | if (client_.HasExtensionState()) { |
| 269 | client_.GetExtensionState().OnStatsLoaded(); |
| 270 | } |
| 271 | |
| 272 | imgui_.EnableUI(true); |
| 273 | } |
| 274 | |
| 275 | void ScriptExtender::OnStatsLoad(stats::RPGStats::LoadProc* wrapped, stats::RPGStats* mgr, Array<STDString>* paths) |
| 276 | { |
nothing calls this directly
no test coverage detected