|
OpenTTD Source 20260421-master-gc2fbc6fdeb
|
Declarations for savegames operations. More...
#include "gfx_type.h"#include "company_base.h"#include "newgrf_config.h"#include "gamelog.h"#include "network/core/tcp_content_type.h"#include "timer/timer_game_calendar.h"Go to the source code of this file.
Data Structures | |
| struct | LoadCheckData |
| Container for loading in mode SL_LOAD_CHECK. More... | |
| struct | FiosItem |
| Deals with finding savegames. More... | |
| class | FileList |
| List of file information. More... | |
| struct | FiosNumberedSaveName |
| A savegame name automatically numbered. More... | |
Typedefs | |
| using | CompanyPropertiesMap = std::map<uint, std::unique_ptr<CompanyProperties>> |
Enumerations | |
| enum | SaveLoadInvalidateWindowData : uint8_t { SLIWD_RESCAN_FILES , SLIWD_SELECTION_CHANGES , SLIWD_FILTER_CHANGES } |
| Special values for save-load window for the data parameter of InvalidateWindowData. More... | |
Functions | |
| bool | FiosItemSorter (const FiosItem &a, const FiosItem &b) |
| Sorts the FiosItems based on the savegame sorter and order. | |
| bool | FiosItemNameSorter (const FiosItem &a, const FiosItem &b) |
| Sort files by their name. | |
| bool | FiosItemModificationDateSorter (const FiosItem &a, const FiosItem &b) |
| Sort files by their modification date, and name when they are equal. | |
| void | ShowSaveLoadDialog (AbstractFileType abstract_filetype, SaveLoadOperation fop) |
| Launch save/load dialog in the given mode. | |
| void | FiosGetSavegameList (SaveLoadOperation fop, bool show_dirs, FileList &file_list) |
| Get a list of savegames. | |
| void | FiosGetScenarioList (SaveLoadOperation fop, bool show_dirs, FileList &file_list) |
| Get a list of scenarios. | |
| void | FiosGetHeightmapList (SaveLoadOperation fop, bool show_dirs, FileList &file_list) |
| Get a list of heightmaps. | |
| void | FiosGetTownDataList (SaveLoadOperation fop, bool show_dirs, FileList &file_list) |
| Get a list of town data files. | |
| bool | FiosBrowseTo (const FiosItem *item) |
| Browse to a new path based on the passed item, starting at #_fios_path. | |
| std::string | FiosGetCurrentPath () |
| Get the current path/working directory. | |
| std::optional< uint64_t > | FiosGetDiskFreeSpace (const std::string &path) |
| std::string | FiosMakeHeightmapName (std::string_view name) |
| Construct a filename for a height map. | |
| std::string | FiosMakeSavegameName (std::string_view name) |
| Make a save game or scenario filename from a name. | |
| std::tuple< FiosType, std::string > | FiosGetSavegameListCallback (SaveLoadOperation fop, std::string_view file, std::string_view ext) |
| Callback for FiosGetFileList. | |
| std::tuple< FiosType, std::string > | FiosGetScenarioListCallback (SaveLoadOperation fop, std::string_view file, std::string_view ext) |
| Callback for FiosGetFileList. | |
| std::tuple< FiosType, std::string > | FiosGetHeightmapListCallback (SaveLoadOperation fop, std::string_view file, std::string_view ext) |
| void | ScanScenarios () |
| Force a (re)scan of the scenarios. | |
| std::optional< std::string_view > | FindScenario (const ContentInfo &ci, bool md5sum) |
| Find a given scenario based on its unique ID. | |
Variables | |
| LoadCheckData | _load_check_data |
| Data loaded from save during SL_LOAD_CHECK. | |
Declarations for savegames operations.
Definition in file fios.h.
| using CompanyPropertiesMap = std::map<uint, std::unique_ptr<CompanyProperties>> |
| enum SaveLoadInvalidateWindowData : uint8_t |
Special values for save-load window for the data parameter of InvalidateWindowData.
| std::optional< std::string_view > FindScenario | ( | const ContentInfo & | ci, |
| bool | md5sum ) |
Find a given scenario based on its unique ID.
| ci | The content info to compare it to. |
| md5sum | Whether to look at the md5sum or the id. |
std::nullopt. Definition at line 653 of file fios.cpp.
References _scanner, ContentInfo::md5sum, and ContentInfo::unique_id.
Referenced by ContentInfo::GetTextfile(), and HasScenario().
| bool FiosBrowseTo | ( | const FiosItem * | item | ) |
Browse to a new path based on the passed item, starting at #_fios_path.
| *item | Item telling us what to do. |
true when the path got changed. Definition at line 133 of file fios.cpp.
References FiosType::detailed, FiosDirect, FiosDirectory, FiosDrive, FiosParent, and Invalid.
Referenced by ConChangeDirectory(), and SaveLoadWindow::OnClick().
| std::string FiosGetCurrentPath | ( | ) |
Get the current path/working directory.
Definition at line 123 of file fios.cpp.
Referenced by ConPrintWorkingDirectory(), and SaveLoadWindow::DrawWidget().
| std::optional< uint64_t > FiosGetDiskFreeSpace | ( | const std::string & | path | ) |
| void FiosGetHeightmapList | ( | SaveLoadOperation | fop, |
| bool | show_dirs, | ||
| FileList & | file_list ) |
Get a list of heightmaps.
| fop | Purpose of collecting the list. |
| show_dirs | Whether to show directories. |
| file_list | Destination of the found files. |
Definition at line 516 of file fios.cpp.
References FiosGetFileList(), Heightmap, and None.
Referenced by FileList::BuildFileList().
| std::tuple< FiosType, std::string > FiosGetHeightmapListCallback | ( | SaveLoadOperation | fop, |
| std::string_view | file, | ||
| std::string_view | ext ) |
| void FiosGetSavegameList | ( | SaveLoadOperation | fop, |
| bool | show_dirs, | ||
| FileList & | file_list ) |
Get a list of savegames.
| fop | Purpose of collecting the list. |
| show_dirs | Whether to show directories. |
| file_list | Destination of the found files. |
Definition at line 409 of file fios.cpp.
References FiosGetFileList(), FiosGetSavegameListCallback(), None, and Save.
Referenced by FileList::BuildFileList().
| std::tuple< FiosType, std::string > FiosGetSavegameListCallback | ( | SaveLoadOperation | fop, |
| std::string_view | file, | ||
| std::string_view | ext ) |
Callback for FiosGetFileList.
It tells if a file is a savegame or not.
| fop | Purpose of collecting the list. |
| file | Name of the file to check. |
| ext | A pointer to the extension identifier inside file |
Definition at line 380 of file fios.cpp.
References GetFileTitle(), Load, Save, and StrEqualsIgnoreCase().
Referenced by FiosGetSavegameList(), and openttd_main().
| void FiosGetScenarioList | ( | SaveLoadOperation | fop, |
| bool | show_dirs, | ||
| FileList & | file_list ) |
Get a list of scenarios.
| fop | Purpose of collecting the list. |
| show_dirs | Whether to show directories. |
| file_list | Destination of the found files. |
Definition at line 456 of file fios.cpp.
References FiosGetFileList(), FiosGetScenarioListCallback(), Load, None, and Scenario.
Referenced by FileList::BuildFileList().
| std::tuple< FiosType, std::string > FiosGetScenarioListCallback | ( | SaveLoadOperation | fop, |
| std::string_view | file, | ||
| std::string_view | ext ) |
Callback for FiosGetFileList.
It tells if a file is a scenario or not.
| fop | Purpose of collecting the list. |
| file | Name of the file to check. |
| ext | A pointer to the extension identifier inside file |
Definition at line 429 of file fios.cpp.
References GetFileTitle(), Load, Scenario, and StrEqualsIgnoreCase().
Referenced by FiosGetScenarioList(), and openttd_main().
| void FiosGetTownDataList | ( | SaveLoadOperation | fop, |
| bool | show_dirs, | ||
| FileList & | file_list ) |
Get a list of town data files.
| fop | Purpose of collecting the list. |
| show_dirs | Whether to show directories. |
| file_list | Destination of the found files. |
Definition at line 553 of file fios.cpp.
References FiosGetFileList(), FiosGetTownDataListCallback(), Heightmap, and None.
Referenced by FileList::BuildFileList().
Sort files by their modification date, and name when they are equal.
Comparison helper for the sorter, comparing a to b.
| a | The first element. |
| b | The second element. |
true if the first element is less than the second element. Definition at line 45 of file fios.cpp.
References FiosItemNameSorter().
Referenced by FiosItemSorter(), and FiosNumberedSaveName::FiosNumberedSaveName().
Sort files by their name.
Comparison helper for the sorter, comparing a to b.
| a | The first element. |
| b | The second element. |
true if the first element is less than the second element. Definition at line 39 of file fios.cpp.
References EncodedString::GetDecodedString(), and StrNaturalCompare().
Referenced by FiosGetFileList(), FiosItemModificationDateSorter(), and FiosItemSorter().
Sorts the FiosItems based on the savegame sorter and order.
Comparison helper for the sorter, comparing a to b.
| a | The first element. |
| b | The second element. |
true if the first element is less than the second element. Definition at line 56 of file fios_gui.cpp.
References _savegame_sorter, _savegame_sorter_ascending, Date, FiosItemModificationDateSorter(), FiosItemNameSorter(), and Name.
Referenced by FiosGetFileList(), and SortSaveGameList().
| std::string FiosMakeHeightmapName | ( | std::string_view | name | ) |
Construct a filename for a height map.
| name | Filename. |
Definition at line 219 of file fios.cpp.
References FiosMakeFilename(), and GetCurrentScreenshotExtension().
Referenced by SaveLoadWindow::OnTimeout().
| std::string FiosMakeSavegameName | ( | std::string_view | name | ) |
Make a save game or scenario filename from a name.
| name | Name of the file. |
Definition at line 207 of file fios.cpp.
References FiosMakeFilename().
Referenced by SaveLoadWindow::OnTimeout().
| void ScanScenarios | ( | ) |
Force a (re)scan of the scenarios.
Definition at line 681 of file fios.cpp.
References _scanner.
Referenced by NetworkContentDownloadStatusWindow::Close().
| void ShowSaveLoadDialog | ( | AbstractFileType | abstract_filetype, |
| SaveLoadOperation | fop ) |
Launch save/load dialog in the given mode.
| abstract_filetype | Kind of file to handle. |
| fop | File operation to perform (load or save). |
Definition at line 1020 of file fios_gui.cpp.
References _load_dialog_desc, _load_heightmap_dialog_desc, _load_town_data_dialog_desc, _save_dialog_desc, CloseWindowById(), Heightmap, Save, TownData, and WC_SAVELOAD.
Referenced by MenuClickSaveLoad(), FoundTownWindow::OnClick(), NetworkStartServerWindow::OnClick(), SelectGameWindow::OnClick(), and MainToolbarWindow::OnHotkey().
|
extern |
Data loaded from save during SL_LOAD_CHECK.
Definition at line 41 of file fios_gui.cpp.
Referenced by DoLoad(), DATEChunkHandler::LoadCheck(), GLOGChunkHandler::LoadCheck(), MAPSChunkHandler::LoadCheck(), NGRFChunkHandler::LoadCheck(), PATSChunkHandler::LoadCheck(), PLYRChunkHandler::LoadCheck(), SaveLoadWindow::OnClick(), SaveLoadWindow::OnInvalidateData(), openttd_main(), and SlError().