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

Function LoadGRFPresetFromConfig

src/settings.cpp:1564–1573  ·  view source on GitHub ↗

* Load a NewGRF configuration by preset-name. * @param config_name Name of the preset. * @return NewGRF configuration. * @see GetGRFPresetList */

Source from the content-addressed store, hash-verified

1562 * @see GetGRFPresetList
1563 */
1564GRFConfigList LoadGRFPresetFromConfig(std::string_view config_name)
1565{
1566 std::string section("preset-");
1567 section += config_name;
1568
1569 ConfigIniFile ini(_config_file);
1570 GRFConfigList config = GRFLoadConfig(ini, section, false);
1571
1572 return config;
1573}
1574
1575/**
1576 * Save a NewGRF configuration with a preset name.

Callers 1

OnDropdownSelectMethod · 0.85

Calls 1

GRFLoadConfigFunction · 0.85

Tested by

no test coverage detected