DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { switch (event) { case DFHack::SC_MAP_LOADED: monitor.reset(); break; case DFHack::SC_MAP_UNLOADED: break; default: break; } return CR_OK; }
DFhackCExport command_result plugin_onupdate ( color_ostream &out ) { if(!Maps::IsValid()) return CR_OK; if (DFHack::World::ReadPauseState()) return CR_OK; if (world->frame_counter % DELTA_TICKS != 0) return CR_OK; monitor.doCycle(); return CR_OK; }
DFhackCExport command_result plugin_onupdate ( color_ostream &out ) { if(!Maps::IsValid()) return CR_OK; static decltype(world->frame_counter) last_frame_count = 0; if (DFHack::World::ReadPauseState()) return CR_OK; if (world->frame_counter - last_frame_count < DELTA_TICKS) return CR_OK; last_frame_count = world->frame_counter; monitor.doCycle(); return CR_OK; }
DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { if (!gps) return CR_FAILURE; if (enable != is_enabled) { depot_info.reset(); monitor.reset(); if (!INTERPOSE_HOOK(trade_hook, feed).apply(enable) || !INTERPOSE_HOOK(trade_hook, render).apply(enable)) return CR_FAILURE; is_enabled = enable; } return CR_OK; }