MCPcopy Create free account
hub / github.com/DFHack/dfhack / command_result plugin_onstatechange

Function command_result plugin_onstatechange

plugins/spectate.cpp:374–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) {
375 switch (event) {
376 case SC_WORLD_LOADED:
377 next_cycle_unpaused_ms = 0;
378 break;
379 case SC_WORLD_UNLOADED:
380 if (is_enabled) {
381 DEBUG(control,out).print("world unloaded; disabling {}\n",
382 plugin_name);
383 is_enabled = false;
384 on_disable(out, true);
385 unit_history.reset();
386 recent_units.reset();
387 }
388 break;
389 default:
390 break;
391 }
392 return CR_OK;
393}
394
395DFhackCExport command_result plugin_onupdate(color_ostream &out) {
396 announcement_settings.on_update(out);

Callers

nothing calls this directly

Calls 3

on_disableFunction · 0.85
printMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected