| 338 | } |
| 339 | |
| 340 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { |
| 341 | if (event == DFHack::SC_MAP_LOADED) { |
| 342 | if (enabled && World::isFortressMode()) { |
| 343 | // Determine whether auto gem cutting has been disabled for this fort. |
| 344 | auto config = World::GetPersistentData(CONFIG_KEY); |
| 345 | running = config.isValid() && !config.ival(0); |
| 346 | read_config(out); |
| 347 | } |
| 348 | } else if (event == DFHack::SC_MAP_UNLOADED) { |
| 349 | running = false; |
| 350 | } |
| 351 | |
| 352 | return CR_OK; |
| 353 | } |
| 354 | |
| 355 | DFhackCExport command_result plugin_enable(color_ostream& out, bool enable) { |
| 356 | if (enable != enabled) { |
nothing calls this directly
no test coverage detected