| 60 | } |
| 61 | |
| 62 | DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { |
| 63 | if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { |
| 64 | out.printerr("Cannot enable {} without a loaded fort.\n", plugin_name); |
| 65 | return CR_FAILURE; |
| 66 | } |
| 67 | |
| 68 | if (enable != is_enabled) { |
| 69 | set_state(out, enable ? 1 : 0, 0); |
| 70 | } else { |
| 71 | DEBUG(control,out).print("{} from the API, but already {}; no action\n", |
| 72 | is_enabled ? "enabled" : "disabled", |
| 73 | is_enabled ? "enabled" : "disabled"); |
| 74 | } |
| 75 | return CR_OK; |
| 76 | } |
| 77 | |
| 78 | DFhackCExport command_result plugin_shutdown (color_ostream &out) { |
| 79 | DEBUG(control,out).print("shutting down {}\n", plugin_name); |