| 164 | } |
| 165 | |
| 166 | DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { |
| 167 | if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { |
| 168 | out.printerr("Cannot enable {} without a loaded fort.\n", plugin_name); |
| 169 | return CR_FAILURE; |
| 170 | } |
| 171 | |
| 172 | if (enable != is_enabled) { |
| 173 | is_enabled = enable; |
| 174 | DEBUG(control,out).print("{} from the API; persisting\n", |
| 175 | is_enabled ? "enabled" : "disabled"); |
| 176 | config.set_bool(CONFIG_IS_ENABLED, is_enabled); |
| 177 | if (enable) |
| 178 | impregnateMany(out); |
| 179 | } else { |
| 180 | DEBUG(control,out).print("{} from the API, but already {}; no action\n", |
| 181 | is_enabled ? "enabled" : "disabled", |
| 182 | is_enabled ? "enabled" : "disabled"); |
| 183 | } |
| 184 | return CR_OK; |
| 185 | } |
| 186 | |
| 187 | DFhackCExport command_result plugin_load_site_data (color_ostream &out) { |
| 188 | cycle_timestamp = 0; |
nothing calls this directly
no test coverage detected