The class for loading a savefile. More...
#include <savegame.hpp>
Public Member Functions | |
loadgame (const std::shared_ptr< save_index_class > &index, saved_game &gamestate) | |
virtual | ~loadgame () |
bool | load_game_ingame () |
Load a game without providing any information. More... | |
bool | load_game () |
Load a game with pre-setting information for the load-game dialog. More... | |
bool | load_multiplayer_game () |
Loading a game from within the multiplayer-create dialog. More... | |
void | set_gamestate () |
Generate the gamestate out of the loaded game config. More... | |
load_game_metadata & | data () |
Static Public Member Functions | |
static bool | check_version_compatibility (const version_info &version) |
GUI Dialog sequence which confirms attempts to load saves from previous game versions. More... | |
static bool | is_replay_save (const config &cfg) |
Private Member Functions | |
bool | show_difficulty_dialog () |
Display the difficulty dialog. More... | |
bool | check_version_compatibility () |
Call check_version_compatibility above, using the version of this savefile. More... | |
void | copy_era (config &cfg) |
Copy era information into the snapshot. More... | |
Private Attributes | |
const game_config_view & | game_config_ |
saved_game & | gamestate_ |
load_game_metadata | load_data_ |
Primary output information. More... | |
The class for loading a savefile.
Definition at line 100 of file savegame.hpp.
savegame::loadgame::loadgame | ( | const std::shared_ptr< save_index_class > & | index, |
saved_game & | gamestate | ||
) |
Definition at line 76 of file savegame.cpp.
|
inlinevirtual |
Definition at line 104 of file savegame.hpp.
|
private |
Call check_version_compatibility above, using the version of this savefile.
Definition at line 218 of file savegame.cpp.
References saved_game::classification(), gamestate_, and game_classification::version.
Referenced by load_game(), load_game_ingame(), and load_multiplayer_game().
|
static |
GUI Dialog sequence which confirms attempts to load saves from previous game versions.
Definition at line 223 of file savegame.cpp.
References _(), prefs::get(), utils::interpolate_variables_into_string(), version_info::major_version(), game_config::min_savegame_version, version_info::minor_version(), gui2::OK, gui2::show_error_message(), gui2::show_message(), version_info::str(), game_config::test_version, game_config::wesnoth_version, and gui2::dialogs::message::yes_no_buttons.
|
private |
Copy era information into the snapshot.
Definition at line 329 of file savegame.cpp.
References config::optional_child().
Referenced by load_multiplayer_game().
|
inline |
Definition at line 119 of file savegame.hpp.
References load_data_.
|
inlinestatic |
Definition at line 127 of file savegame.hpp.
Referenced by gui2::dialogs::game_load::display_savegame_internal(), gui2::dialogs::game_load::evaluate_summary_string(), load_game(), load_game_ingame(), and load_multiplayer_game().
bool savegame::loadgame::load_game | ( | ) |
Load a game with pre-setting information for the load-game dialog.
Definition at line 158 of file savegame.cpp.
References _(), check_version_compatibility(), config::child_range(), saved_game::classification(), savegame::convert_old_saves(), savegame::load_game_metadata::difficulty, ERR_SAVE, gui2::dialogs::game_load::execute(), savegame::load_game_metadata::filename, game_config_, gamestate_, is_replay_save(), savegame::load_game_metadata::load_config, load_data_, savegame::load_game_metadata::manager, savegame::read_save_file(), savegame::load_game_metadata::select_difficulty, show_difficulty_dialog(), gui2::show_error_message(), savegame::load_game_metadata::show_replay, and savegame::load_game_metadata::summary.
bool savegame::loadgame::load_game_ingame | ( | ) |
Load a game without providing any information.
Definition at line 115 of file savegame.cpp.
References _(), check_version_compatibility(), ERR_SAVE, gui2::dialogs::game_load::execute(), savegame::load_game_metadata::filename, game_config_, video::headless(), is_replay_save(), load_data_, savegame::load_game_metadata::manager, savegame::load_game_metadata::select_difficulty, show_difficulty_dialog(), gui2::show_error_message(), savegame::load_game_metadata::show_replay, and savegame::load_game_metadata::summary.
bool savegame::loadgame::load_multiplayer_game | ( | ) |
Loading a game from within the multiplayer-create dialog.
Definition at line 280 of file savegame.cpp.
References _(), check_version_compatibility(), copy_era(), ERR_SAVE, gui2::dialogs::game_load::execute(), savegame::load_game_metadata::filename, game_config_, is_replay_save(), savegame::load_game_metadata::load_config, load_data_, log_scope, savegame::load_game_metadata::manager, savegame::read_save_file(), set_gamestate(), gui2::show_error_message(), savegame::load_game_metadata::show_replay, gui2::show_transient_error_message(), gui2::show_transient_message(), savegame::load_game_metadata::summary, game_classification::type, and cursor::WAIT.
void savegame::loadgame::set_gamestate | ( | ) |
Generate the gamestate out of the loaded game config.
Definition at line 275 of file savegame.cpp.
References gamestate_, savegame::load_game_metadata::load_config, load_data_, and saved_game::set_data().
Referenced by load_multiplayer_game().
|
private |
Display the difficulty dialog.
Definition at line 83 of file savegame.cpp.
References game_config_view::child_range(), savegame::load_game_metadata::difficulty, game_config_, load_data_, savegame::load_game_metadata::select_difficulty, gui2::dialogs::campaign_difficulty::selected_difficulty(), gui2::dialogs::modal_dialog::show(), and savegame::load_game_metadata::summary.
Referenced by load_game(), and load_game_ingame().
|
private |
Definition at line 140 of file savegame.hpp.
Referenced by load_game(), load_game_ingame(), load_multiplayer_game(), and show_difficulty_dialog().
|
private |
Definition at line 142 of file savegame.hpp.
Referenced by check_version_compatibility(), load_game(), and set_gamestate().
|
private |
Primary output information.
Definition at line 144 of file savegame.hpp.
Referenced by data(), load_game(), load_game_ingame(), load_multiplayer_game(), set_gamestate(), and show_difficulty_dialog().