|
OpenTTD
|
Declarations for savegames operations. More...
#include "gfx_type.h"#include "company_base.h"#include "newgrf_config.h"#include "network/core/tcp_content.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... | |
Typedefs | |
|
typedef SmallMap< uint, CompanyProperties * > | CompanyPropertiesMap |
Enumerations | |
| enum | FileSlots { CONFIG_SLOT = 0, SOUND_SLOT = 1, FIRST_GRF_SLOT = 2, MAX_FILE_SLOTS = 128 } |
| enum | SortingBits { SORT_ASCENDING = 0, SORT_DESCENDING = 1, SORT_BY_DATE = 0, SORT_BY_NAME = 2 } |
Functions | |
| void | ShowSaveLoadDialog (AbstractFileType abstract_filetype, SaveLoadOperation fop) |
| Launch save/load dialog in the given mode. | |
| void | FiosGetSavegameList (SaveLoadOperation fop, FileList &file_list) |
| Get a list of savegames. | |
| void | FiosGetScenarioList (SaveLoadOperation fop, FileList &file_list) |
| Get a list of scenarios. | |
| void | FiosGetHeightmapList (SaveLoadOperation fop, FileList &file_list) |
| Get a list of heightmaps. | |
| const char * | FiosBrowseTo (const FiosItem *item) |
| Browse to a new path based on the passed item, starting at #_fios_path. | |
| StringID | FiosGetDescText (const char **path, uint64 *total_free) |
| Get descriptive texts. | |
| bool | FiosDelete (const char *name) |
| Delete a file. | |
| void | FiosMakeHeightmapName (char *buf, const char *name, const char *last) |
| Construct a filename for a height map. | |
| void | FiosMakeSavegameName (char *buf, const char *name, const char *last) |
| Make a save game or scenario filename from a name. | |
| FiosType | FiosGetSavegameListCallback (SaveLoadOperation fop, const char *file, const char *ext, char *title, const char *last) |
| Callback for FiosGetFileList. | |
| int CDECL | CompareFiosItems (const FiosItem *a, const FiosItem *b) |
| Compare two FiosItem's. | |
Variables | |
| LoadCheckData | _load_check_data |
| Data loaded from save during SL_LOAD_CHECK. | |
| SortingBits | _savegame_sort_order |
Declarations for savegames operations.
Definition in file fios.h.
| enum FileSlots |
Compare two FiosItem's.
Used with sort when sorting the file list.
| da | A pointer to the first FiosItem to compare. |
| db | A pointer to the second FiosItem to compare. |
Definition at line 52 of file fios.cpp.
Referenced by FiosGetFileList(), and SortSaveGameList().
| const char* 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. |
NULL. Definition at line 152 of file fios.cpp.
References seprintf(), and strecat().
Referenced by SaveLoadWindow::OnClick().
| bool FiosDelete | ( | const char * | name | ) |
Delete a file.
| name | Filename to delete. |
Definition at line 269 of file fios.cpp.
References FiosMakeSavegameName(), and lastof.
Referenced by SaveLoadWindow::OnTimeout().
| StringID FiosGetDescText | ( | const char ** | path, |
| uint64 * | total_free | ||
| ) |
Get descriptive texts.
Returns the path and free space left on the device
| path | string describing the path |
| total_free | total free space in megabytes, optional (can be NULL) |
Definition at line 141 of file fios.cpp.
Referenced by SaveLoadWindow::DrawWidget().
| void FiosGetHeightmapList | ( | SaveLoadOperation | fop, |
| FileList & | file_list | ||
| ) |
Get a list of heightmaps.
| fop | Purpose of collecting the list. |
| file_list | Destination of the found files. |
Definition at line 618 of file fios.cpp.
References FiosGetFileList(), HEIGHTMAP_DIR, lastof, NO_DIRECTORY, and FileScanner::subdir.
Referenced by FileList::BuildFileList().
| void FiosGetSavegameList | ( | SaveLoadOperation | fop, |
| FileList & | file_list | ||
| ) |
Get a list of savegames.
| fop | Purpose of collecting the list. |
| file_list | Destination of the found files. |
Definition at line 492 of file fios.cpp.
References FiosGetFileList(), FiosGetSavegameListCallback(), NO_DIRECTORY, and SAVE_DIR.
Referenced by FileList::BuildFileList().
| FiosType FiosGetSavegameListCallback | ( | SaveLoadOperation | fop, |
| const char * | file, | ||
| const char * | ext, | ||
| char * | title, | ||
| const char * | last | ||
| ) |
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 |
| title | Buffer if a callback wants to lookup the title of the file; NULL to skip the lookup |
| last | Last available byte in buffer (to prevent buffer overflows); not used when title == NULL |
Definition at line 459 of file fios.cpp.
References GetFileTitle(), SAVE_DIR, and SLO_LOAD.
Referenced by FiosGetSavegameList(), and openttd_main().
| void FiosGetScenarioList | ( | SaveLoadOperation | fop, |
| FileList & | file_list | ||
| ) |
Get a list of scenarios.
| fop | Purpose of collecting the list. |
| file_list | Destination of the found files. |
Definition at line 547 of file fios.cpp.
References FiosGetFileList(), FiosGetScenarioListCallback(), lastof, NO_DIRECTORY, SCENARIO_DIR, SLO_LOAD, and FileScanner::subdir.
Referenced by FileList::BuildFileList().
| void FiosMakeHeightmapName | ( | char * | buf, |
| const char * | name, | ||
| const char * | last | ||
| ) |
Construct a filename for a height map.
| buf | Destination buffer. |
| name | Filename. |
| last | Last element of buffer buf. |
Definition at line 255 of file fios.cpp.
References FiosMakeFilename(), GetCurrentScreenshotExtension(), lastof, and strecpy().
Referenced by SaveLoadWindow::OnTimeout().
| void FiosMakeSavegameName | ( | char * | buf, |
| const char * | name, | ||
| const char * | last | ||
| ) |
Make a save game or scenario filename from a name.
| buf | Destination buffer for saving the filename. |
| name | Name of the file. |
| last | Last element of buffer buf. |
Definition at line 242 of file fios.cpp.
References FiosMakeFilename().
Referenced by FiosDelete(), and SaveLoadWindow::OnTimeout().
| 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 767 of file fios_gui.cpp.
References _file_to_saveload, _load_dialog_desc, _load_heightmap_dialog_desc, _save_dialog_desc, FileToSaveLoad::abstract_ftype, DeleteWindowById(), FT_HEIGHTMAP, SLO_SAVE, and WC_SAVELOAD.
Referenced by MenuClickSaveLoad(), SelectGameWindow::OnClick(), NetworkStartServerWindow::OnClick(), and MainToolbarWindow::OnHotkey().
1.8.1.2