| 197 | }; |
| 198 | |
| 199 | DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) |
| 200 | { |
| 201 | switch (event) { |
| 202 | case SC_WORLD_LOADED: |
| 203 | { |
| 204 | bool enable = World::GetPersistentData("power-meter/enabled").isValid(); |
| 205 | |
| 206 | if (enable) |
| 207 | { |
| 208 | out.print("Enabling the power meter plugin.\n"); |
| 209 | enable_hooks(true); |
| 210 | } |
| 211 | } |
| 212 | break; |
| 213 | case SC_WORLD_UNLOADED: |
| 214 | enable_hooks(false); |
| 215 | break; |
| 216 | default: |
| 217 | break; |
| 218 | } |
| 219 | |
| 220 | return CR_OK; |
| 221 | } |
| 222 | |
| 223 | DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) |
| 224 | { |
nothing calls this directly
no test coverage detected