|
OpenTTD Source 20260421-master-gc2fbc6fdeb
|
GUIs for loading/saving games, scenarios, heightmaps, ... More...
#include "stdafx.h"#include "saveload/saveload.h"#include "error.h"#include "gui.h"#include "gfx_func.h"#include "command_func.h"#include "network/network.h"#include "network/network_content.h"#include "strings_func.h"#include "fileio_func.h"#include "fios.h"#include "window_func.h"#include "tilehighlight_func.h"#include "querystring_gui.h"#include "engine_func.h"#include "landscape_type.h"#include "genworld.h"#include "timer/timer_game_calendar.h"#include "core/geometry_func.hpp"#include "gamelog.h"#include "stringfilter_type.h"#include "misc_cmd.h"#include "gamelog_internal.h"#include "widgets/fios_widget.h"#include "table/sprites.h"#include "table/strings.h"#include "safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | SaveLoadWindow |
Enumerations | |
| enum class | SavegameSorter : uint8_t { Date , Name } |
| The available sorters for FiosItems. More... | |
Functions | |
| bool | FiosItemSorter (const FiosItem &a, const FiosItem &b) |
| Sorts the FiosItems based on the savegame sorter and order. | |
| static void | SortSaveGameList (FileList &file_list) |
| Sort the collected list save games prior to displaying it in the save/load gui. | |
| void | ShowSaveLoadDialog (AbstractFileType abstract_filetype, SaveLoadOperation fop) |
| Launch save/load dialog in the given mode. | |
Variables | |
| LoadCheckData | _load_check_data |
| Data loaded from save during SL_LOAD_CHECK. | |
| static bool | _fios_path_changed |
| static bool | _savegame_sort_dirty |
| static SavegameSorter | _savegame_sorter = SavegameSorter::Date |
| Sorter for savegames. | |
| static bool | _savegame_sorter_ascending = false |
| Sorter for savegames. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_load_dialog_widgets |
| Load game/scenario with optional content download. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_load_heightmap_dialog_widgets |
| Load heightmap with content download. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_load_town_data_dialog_widgets |
| Load town data. | |
| static constexpr std::initializer_list< NWidgetPart > | _nested_save_dialog_widgets |
| Save game/scenario. | |
| static const EnumClassIndexContainer< std::array< TextColour, to_underlying(DetailedFileType::End)>, DetailedFileType > | _fios_colours |
| Text colours of DetailedFileType fios entries in the window. | |
| static WindowDesc | _load_dialog_desc (WDP_CENTER, "load_game", 500, 294, WC_SAVELOAD, WC_NONE, {}, _nested_load_dialog_widgets) |
| Load game/scenario. | |
| static WindowDesc | _load_heightmap_dialog_desc (WDP_CENTER, "load_heightmap", 257, 320, WC_SAVELOAD, WC_NONE, {}, _nested_load_heightmap_dialog_widgets) |
| Load heightmap. | |
| static WindowDesc | _load_town_data_dialog_desc (WDP_CENTER, "load_town_data", 257, 320, WC_SAVELOAD, WC_NONE, {}, _nested_load_town_data_dialog_widgets) |
| Load town data. | |
| static WindowDesc | _save_dialog_desc (WDP_CENTER, "save_game", 500, 294, WC_SAVELOAD, WC_NONE, {}, _nested_save_dialog_widgets) |
| Save game/scenario. | |
GUIs for loading/saving games, scenarios, heightmaps, ...
Definition in file fios_gui.cpp.
|
strong |
The available sorters for FiosItems.
| Enumerator | |
|---|---|
| Date | Sort by date. |
| Name | Sort by name. |
Definition at line 47 of file fios_gui.cpp.
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().
| 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().
|
static |
Sort the collected list save games prior to displaying it in the save/load gui.
| [in,out] | file_list | List of save game files found in the directory. |
Definition at line 322 of file fios_gui.cpp.
References FiosDirectory, FiosDrive, FiosItemSorter(), and FiosParent.
Referenced by SaveLoadWindow::OnPaint().
|
static |
Text colours of DetailedFileType fios entries in the window.
Definition at line 306 of file fios_gui.cpp.
Referenced by SaveLoadWindow::DrawWidget().
|
static |
Definition at line 43 of file fios_gui.cpp.
| LoadCheckData _load_check_data |
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().
|
staticconstexpr |
Load game/scenario with optional content download.
Definition at line 90 of file fios_gui.cpp.
|
staticconstexpr |
Load heightmap with content download.
Definition at line 153 of file fios_gui.cpp.
|
staticconstexpr |
Load town data.
Definition at line 200 of file fios_gui.cpp.
|
staticconstexpr |
Save game/scenario.
Definition at line 242 of file fios_gui.cpp.
|
static |
Definition at line 44 of file fios_gui.cpp.
|
static |
Sorter for savegames.
Definition at line 52 of file fios_gui.cpp.
Referenced by SaveLoadWindow::DrawWidget(), FiosItemSorter(), and SaveLoadWindow::OnClick().
|
static |
Sorter for savegames.
Definition at line 53 of file fios_gui.cpp.
Referenced by SaveLoadWindow::DrawWidget(), FiosItemSorter(), and SaveLoadWindow::OnClick().