MCPcopy Create free account
hub / github.com/DFHack/dfhack / do_enable

Function do_enable

plugins/dig.cpp:108–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108static void do_enable(bool enable) {
109 if (enable != is_enabled) {
110 is_enabled = enable;
111 DEBUG(log).print("{}\n", is_enabled ? "enabled" : "disabled");
112 if (enable) {
113 EventManager::registerListener(EventManager::EventType::JOB_STARTED,
114 EventManager::EventHandler(plugin_self, unhide_surrounding_tagged_tiles, 0));
115 } else {
116 EventManager::unregisterAll(plugin_self);
117 }
118 }
119 else {
120 DEBUG(log).print("{}, but already {}; no action\n",
121 is_enabled ? "enabled" : "disabled", is_enabled ? "enabled" : "disabled");
122 }
123}
124
125DFhackCExport command_result plugin_load_site_data(color_ostream &out) {
126 cycle_timestamp = 0;

Callers 7

do_cycleFunction · 0.70
addTileWarmDigFunction · 0.70
addTileDampDigFunction · 0.70
toggle_cur_levelFunction · 0.70
update_tile_maskFunction · 0.70

Calls 2

EventHandlerClass · 0.85
printMethod · 0.45

Tested by

no test coverage detected