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

Function SaveGRFPresetToConfig

src/settings.cpp:1581–1589  ·  view source on GitHub ↗

* Save a NewGRF configuration with a preset name. * @param config_name Name of the preset. * @param config NewGRF configuration to save. * @see GetGRFPresetList */

Source from the content-addressed store, hash-verified

1579 * @see GetGRFPresetList
1580 */
1581void SaveGRFPresetToConfig(std::string_view config_name, GRFConfigList &config)
1582{
1583 std::string section("preset-");
1584 section += config_name;
1585
1586 ConfigIniFile ini(_config_file);
1587 GRFSaveConfig(ini, section, config);
1588 ini.SaveToDisk(_config_file);
1589}
1590
1591/**
1592 * Delete a NewGRF configuration by preset name.

Callers 1

OnQueryTextFinishedMethod · 0.85

Calls 2

GRFSaveConfigFunction · 0.85
SaveToDiskMethod · 0.80

Tested by

no test coverage detected