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

Function LoadSettings

plugins/channel-safely/channel-safely-plugin.cpp:190–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188 }
189
190 void LoadSettings() {
191 pfeature = World::GetPersistentSiteData(FCONFIG_KEY);
192 psetting = World::GetPersistentSiteData(SCONFIG_KEY);
193
194 if (!pfeature.isValid() || !psetting.isValid()) {
195 pfeature = World::AddPersistentSiteData(FCONFIG_KEY);
196 psetting = World::AddPersistentSiteData(SCONFIG_KEY);
197 SaveSettings();
198 } else {
199 try {
200 config.monitoring = pfeature.ival(MONITOR);
201 config.require_vision = pfeature.ival(VISION);
202 config.insta_dig = false; //pfeature.ival(INSTADIG);
203 config.resurrect = pfeature.ival(RESURRECT);
204 config.riskaverse = pfeature.ival(RISKAVERSE);
205
206 config.ignore_threshold = psetting.ival(IGNORE_THRESH);
207 config.fall_threshold = psetting.ival(FALL_THRESH);
208 config.refresh_freq = psetting.ival(REFRESH_RATE);
209 config.monitor_freq = psetting.ival(MONITOR_RATE);
210 } catch (std::exception &e) {
211 ERR(plugin).print("{}\n", e.what());
212 }
213 }
214 active_workers.clear();
215 }
216
217 void UnpauseEvent(bool full_scan = false){
218 DEBUG(plugin).print("UnpauseEvent()\n");

Callers 1

Calls 6

SaveSettingsFunction · 0.85
ivalMethod · 0.80
isValidMethod · 0.45
printMethod · 0.45
whatMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected