* Get the list of known NewGrf presets. * @returns List of preset names. */
| 1542 | * @returns List of preset names. |
| 1543 | */ |
| 1544 | StringList GetGRFPresetList() |
| 1545 | { |
| 1546 | StringList list; |
| 1547 | |
| 1548 | ConfigIniFile ini(_config_file); |
| 1549 | for (const IniGroup &group : ini.groups) { |
| 1550 | if (group.name.starts_with("preset-")) { |
| 1551 | list.push_back(group.name.substr(7)); |
| 1552 | } |
| 1553 | } |
| 1554 | |
| 1555 | return list; |
| 1556 | } |
| 1557 | |
| 1558 | /** |
| 1559 | * Load a NewGRF configuration by preset-name. |
no test coverage detected