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

Function command_result plugin_enable

plugins/autogems.cpp:355–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355DFhackCExport command_result plugin_enable(color_ostream& out, bool enable) {
356 if (enable != enabled) {
357 if (!INTERPOSE_HOOK(autogem_hook, feed).apply(enable) || !INTERPOSE_HOOK(autogem_hook, render).apply(enable)) {
358 out.printerr("Could not {} autogem hooks!\n", enable? "insert": "remove");
359 return CR_FAILURE;
360 }
361
362 enabled = enable;
363 }
364
365 running = enabled && World::isFortressMode();
366 if (running) {
367 read_config(out);
368 }
369 return CR_OK;
370}
371
372DFhackCExport command_result plugin_init(color_ostream &out, std::vector <PluginCommand> &commands) {
373 commands.push_back(PluginCommand(

Callers

nothing calls this directly

Calls 2

read_configFunction · 0.85
applyMethod · 0.45

Tested by

no test coverage detected