OpenTTD Source 20241224-master-gf74b0cf984
fios_gui.cpp File Reference

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
 

Functions

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 constexpr NWidgetPart _nested_load_dialog_widgets []
 Load game/scenario with optional content download.
 
static constexpr NWidgetPart _nested_load_heightmap_dialog_widgets []
 Load heightmap with content download.
 
static constexpr NWidgetPart _nested_load_town_data_dialog_widgets []
 Load town data.
 
static constexpr NWidgetPart _nested_save_dialog_widgets []
 Save game/scenario.
 
static const TextColour _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, 0, _nested_load_dialog_widgets)
 Load game/scenario.
 
static WindowDesc _load_heightmap_dialog_desc (WDP_CENTER, "load_heightmap", 257, 320, WC_SAVELOAD, WC_NONE, 0, _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, 0, _nested_load_town_data_dialog_widgets)
 Load town data.
 
static WindowDesc _save_dialog_desc (WDP_CENTER, "save_game", 500, 294, WC_SAVELOAD, WC_NONE, 0, _nested_save_dialog_widgets)
 Save game/scenario.
 

Detailed Description

GUIs for loading/saving games, scenarios, heightmaps, ...

Definition in file fios_gui.cpp.

Function Documentation

◆ ShowSaveLoadDialog()

void ShowSaveLoadDialog ( AbstractFileType  abstract_filetype,
SaveLoadOperation  fop 
)

Launch save/load dialog in the given mode.

Parameters
abstract_filetypeKind of file to handle.
fopFile operation to perform (load or save).

Definition at line 986 of file fios_gui.cpp.

References _load_dialog_desc, _load_heightmap_dialog_desc, _load_town_data_dialog_desc, _save_dialog_desc, CloseWindowById(), FT_HEIGHTMAP, FT_TOWN_DATA, SLO_SAVE, and WC_SAVELOAD.

Referenced by MenuClickSaveLoad(), SelectGameWindow::OnClick(), NetworkStartServerWindow::OnClick(), FoundTownWindow::OnClick(), and MainToolbarWindow::OnHotkey().

◆ SortSaveGameList()

static void SortSaveGameList ( FileList file_list)
static

Sort the collected list save games prior to displaying it in the save/load gui.

Parameters
[in,out]file_listList of save game files found in the directory.

Definition at line 301 of file fios_gui.cpp.

Referenced by SaveLoadWindow::OnPaint().

Variable Documentation

◆ _fios_colours

const TextColour _fios_colours[]
static
Initial value:
= {
TC_LIGHT_BROWN,
TC_ORANGE,
TC_YELLOW,
TC_ORANGE,
TC_LIGHT_BROWN,
TC_LIGHT_BLUE,
TC_DARK_GREEN,
TC_DARK_GREEN,
TC_ORANGE,
}

Text colours of DetailedFileType fios entries in the window.

Definition at line 283 of file fios_gui.cpp.

Referenced by SaveLoadWindow::DrawWidget().

◆ _fios_path_changed

bool _fios_path_changed
static

Definition at line 43 of file fios_gui.cpp.

◆ _load_check_data

◆ _nested_load_dialog_widgets

constexpr NWidgetPart _nested_load_dialog_widgets[]
staticconstexpr

Load game/scenario with optional content download.

Definition at line 67 of file fios_gui.cpp.

◆ _nested_load_heightmap_dialog_widgets

constexpr NWidgetPart _nested_load_heightmap_dialog_widgets[]
staticconstexpr

Load heightmap with content download.

Definition at line 130 of file fios_gui.cpp.

◆ _nested_load_town_data_dialog_widgets

constexpr NWidgetPart _nested_load_town_data_dialog_widgets[]
staticconstexpr

Load town data.

Definition at line 177 of file fios_gui.cpp.

◆ _nested_save_dialog_widgets

constexpr NWidgetPart _nested_save_dialog_widgets[]
staticconstexpr

Save game/scenario.

Definition at line 219 of file fios_gui.cpp.

◆ _savegame_sort_dirty

bool _savegame_sort_dirty
static

Definition at line 44 of file fios_gui.cpp.