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

Function DeleteGRFPresetFromConfig

src/settings.cpp:1595–1603  ·  view source on GitHub ↗

* Delete a NewGRF configuration by preset name. * @param config_name Name of the preset. */

Source from the content-addressed store, hash-verified

1593 * @param config_name Name of the preset.
1594 */
1595void DeleteGRFPresetFromConfig(std::string_view config_name)
1596{
1597 std::string section("preset-");
1598 section += config_name;
1599
1600 ConfigIniFile ini(_config_file);
1601 ini.RemoveGroup(section);
1602 ini.SaveToDisk(_config_file);
1603}
1604
1605/**
1606 * Handle changing a value. This performs validation of the input value and

Callers 1

OnClickMethod · 0.85

Calls 2

RemoveGroupMethod · 0.80
SaveToDiskMethod · 0.80

Tested by

no test coverage detected