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

Function command_result plugin_enable

plugins/fastdwarf.cpp:62–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62DFhackCExport 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
78DFhackCExport command_result plugin_shutdown (color_ostream &out) {
79 DEBUG(control,out).print("shutting down {}\n", plugin_name);

Callers

nothing calls this directly

Calls 2

set_stateFunction · 0.85
printMethod · 0.45

Tested by

no test coverage detected