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

Function FiosGetScenarioList

src/fios.cpp:468–480  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

466 * @see FiosGetFileList
467 */
468void 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
482std::tuple<FiosType, std::string> FiosGetHeightmapListCallback(SaveLoadOperation, std::string_view file, std::string_view ext)
483{

Callers 1

BuildFileListMethod · 0.85

Calls 2

FioFindDirectoryFunction · 0.85
FiosGetFileListFunction · 0.85

Tested by

no test coverage detected