MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SaveToConfig

Method SaveToConfig

src/window.cpp:176–188  ·  view source on GitHub ↗

* Save all WindowDesc settings to _windows_file. */

Source from the content-addressed store, hash-verified

174 * Save all WindowDesc settings to _windows_file.
175 */
176void WindowDesc::SaveToConfig()
177{
178 /* Sort the stuff to get a nice ini file on first write */
179 std::sort(_window_descs->begin(), _window_descs->end(), DescSorter);
180
181 IniFile ini;
182 ini.LoadFromDisk(_windows_file, NO_DIRECTORY);
183 for (WindowDesc *wd : *_window_descs) {
184 if (wd->ini_key.empty()) continue;
185 IniSaveWindowSettings(ini, wd->ini_key, wd);
186 }
187 ini.SaveToDisk(_windows_file);
188}
189
190/**
191 * Read default values from WindowDesc configuration an apply them to the window.

Callers

nothing calls this directly

Calls 6

IniSaveWindowSettingsFunction · 0.85
LoadFromDiskMethod · 0.80
SaveToDiskMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected