* Save a NewGRF configuration with a preset name. * @param config_name Name of the preset. * @param config NewGRF configuration to save. * @see GetGRFPresetList */
| 1579 | * @see GetGRFPresetList |
| 1580 | */ |
| 1581 | void 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. |
no test coverage detected