* Get a list of scenarios. * @param fop Purpose of collecting the list. * @param show_dirs Whether to show directories. * @param file_list Destination of the found files. * @see FiosGetFileList */
| 466 | * @see FiosGetFileList |
| 467 | */ |
| 468 | void FiosGetScenarioList(SaveLoadOperation fop, bool show_dirs, FileList &file_list) |
| 469 | { |
| 470 | static std::optional<std::string> fios_scn_path; |
| 471 | |
| 472 | /* Copy the default path on first run or on 'New Game' */ |
| 473 | if (!fios_scn_path) fios_scn_path = FioFindDirectory(SCENARIO_DIR); |
| 474 | |
| 475 | _fios_path = &(*fios_scn_path); |
| 476 | |
| 477 | std::string base_path = FioFindDirectory(SCENARIO_DIR); |
| 478 | Subdirectory subdir = (fop == SLO_LOAD && base_path == *_fios_path) ? SCENARIO_DIR : NO_DIRECTORY; |
| 479 | FiosGetFileList(fop, show_dirs, &FiosGetScenarioListCallback, subdir, file_list); |
| 480 | } |
| 481 | |
| 482 | std::tuple<FiosType, std::string> FiosGetHeightmapListCallback(SaveLoadOperation, std::string_view file, std::string_view ext) |
| 483 | { |
no test coverage detected