The class for loading a savefile. More...
#include <savegame.hpp>
Public Member Functions | |
loadgame (CVideo &video, const config &game_config, saved_game &gamestate) | |
virtual | ~loadgame () |
bool | load_game () |
Load a game without providing any information. More... | |
bool | load_game (const std::string &filename, const bool show_replay, const bool cancel_orders, const bool select_difficulty, const std::string &difficulty, bool skip_version_check) |
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... | |
bool | show_replay () const |
bool | cancel_orders () const |
const std::string & | filename () const |
Static Public Member Functions | |
static bool | check_version_compatibility (const version_info &version, CVideo &video) |
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 | |
void | show_dialog () |
Display the load-game dialog. More... | |
void | 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 config & | game_config_ |
CVideo & | video_ |
saved_game & | gamestate_ |
std::string | filename_ |
Primary output information. More... | |
std::string | difficulty_ |
Name of the savefile to be loaded. More... | |
config | load_config_ |
The difficulty the save is meant to be loaded with. More... | |
bool | show_replay_ |
Config information of the savefile to be loaded. More... | |
bool | cancel_orders_ |
State of the "show_replay" checkbox in the load-game dialog. More... | |
bool | select_difficulty_ |
State of the "cancel_orders" checkbox in the load-game dialog. More... | |
config | summary_ |
State of the "change_difficulty" checkbox in the load-game dialog. More... | |
The class for loading a savefile.
Definition at line 36 of file savegame.hpp.
savegame::loadgame::loadgame | ( | CVideo & | video, |
const config & | game_config, | ||
saved_game & | gamestate | ||
) |
Definition at line 84 of file savegame.cpp.
|
inlinevirtual |
Definition at line 40 of file savegame.hpp.
|
inline |
Definition at line 62 of file savegame.hpp.
References cancel_orders_.
Referenced by load_game(), and game_launcher::load_game().
|
static |
GUI Dialog sequence which confirms attempts to load saves from previous game versions.
Definition at line 241 of file savegame.cpp.
References _(), preferences::confirm_load_save_from_different_version(), utils::interpolate_variables_into_string(), version_info::major_version(), game_config::min_savegame_version, version_info::minor_version(), gui2::twindow::OK, gui2::show_error_message(), gui2::show_message(), version_info::str(), game_config::test_version, game_config::version, game_config::wesnoth_version, and gui2::tmessage::yes_no_buttons.
|
private |
Call check_version_compatibility above, using the version of this savefile.
Definition at line 236 of file savegame.cpp.
References saved_game::classification(), gamestate_, game_classification::version, and video_.
Referenced by load_game(), and load_multiplayer_game().
Copy era information into the snapshot.
Definition at line 327 of file savegame.cpp.
References config::add_child(), config::child(), and preferences::era().
Referenced by load_multiplayer_game().
|
inline |
|
inlinestatic |
Definition at line 68 of file savegame.hpp.
Referenced by gui2::tgame_load::display_savegame(), gui2::tgame_load::evaluate_summary_string(), load_multiplayer_game(), and show_difficulty_dialog().
bool savegame::loadgame::load_game | ( | ) |
Load a game without providing any information.
Definition at line 152 of file savegame.cpp.
References _(), cancel_orders_, check_version_compatibility(), difficulty_, CVideo::faked(), filename_, savegame::save_index_class::get(), savegame::save_index_manager, select_difficulty_, show_dialog(), gui2::show_error_message(), show_replay_, and video_.
Referenced by game_launcher::load_game().
bool savegame::loadgame::load_game | ( | const std::string & | filename, |
const bool | show_replay, | ||
const bool | cancel_orders, | ||
const bool | select_difficulty, | ||
const std::string & | difficulty, | ||
bool | skip_version_check | ||
) |
Load a game with pre-setting information for the load-game dialog.
Definition at line 180 of file savegame.cpp.
References _(), cancel_orders(), cancel_orders_, check_version_compatibility(), saved_game::classification(), savegame::convert_old_saves(), difficulty_, filename(), filename_, gamestate_, load_config_, savegame::read_save_file(), select_difficulty_, show_dialog(), show_difficulty_dialog(), gui2::show_error_message(), show_replay(), show_replay_, and video_.
bool savegame::loadgame::load_multiplayer_game | ( | ) |
Loading a game from within the multiplayer-create dialog.
Definition at line 289 of file savegame.cpp.
References _(), check_version_compatibility(), saved_game::classification(), copy_era(), filename_, gamestate_, is_replay_save(), load_config_, log_scope, savegame::read_save_file(), saved_game::set_data(), show_dialog(), gui2::show_error_message(), gui2::show_transient_error_message(), gui2::show_transient_message(), summary_, video_, and cursor::WAIT.
void savegame::loadgame::set_gamestate | ( | ) |
Generate the gamestate out of the loaded game config.
Definition at line 284 of file savegame.cpp.
References gamestate_, load_config_, and saved_game::set_data().
Referenced by game_launcher::load_game().
|
private |
Display the load-game dialog.
Definition at line 97 of file savegame.cpp.
References _(), gui2::tgame_load::cancel_orders(), cancel_orders_, gui2::tgame_load::change_difficulty(), gui2::tgame_load::filename(), filename_, game_config_, gui2::tdialog::get_retval(), savegame::get_saves_list(), gui2::twindow::OK, select_difficulty_, gui2::tdialog::show(), gui2::tgame_load::show_replay(), show_replay_, gui2::show_transient_message(), gui2::tgame_load::summary(), summary_, and video_.
Referenced by load_game(), and load_multiplayer_game().
|
private |
Display the difficulty dialog.
Definition at line 121 of file savegame.cpp.
References config::child_range(), difficulty_, game_config_, gui2::tdialog::get_retval(), is_replay_save(), gui2::twindow::OK, gui2::tcampaign_difficulty::selected_difficulty(), gui2::tdialog::show(), summary_, and video_.
Referenced by load_game().
|
inline |
Definition at line 61 of file savegame.hpp.
References show_replay_.
Referenced by load_game(), and game_launcher::load_game().
|
private |
State of the "show_replay" checkbox in the load-game dialog.
Definition at line 91 of file savegame.hpp.
Referenced by cancel_orders(), load_game(), and show_dialog().
|
private |
Name of the savefile to be loaded.
Definition at line 88 of file savegame.hpp.
Referenced by load_game(), and show_difficulty_dialog().
|
private |
Primary output information.
Definition at line 87 of file savegame.hpp.
Referenced by filename(), load_game(), load_multiplayer_game(), and show_dialog().
|
private |
Definition at line 83 of file savegame.hpp.
Referenced by show_dialog(), and show_difficulty_dialog().
|
private |
Definition at line 86 of file savegame.hpp.
Referenced by check_version_compatibility(), load_game(), load_multiplayer_game(), and set_gamestate().
|
private |
The difficulty the save is meant to be loaded with.
Definition at line 89 of file savegame.hpp.
Referenced by load_game(), load_multiplayer_game(), and set_gamestate().
|
private |
State of the "cancel_orders" checkbox in the load-game dialog.
Definition at line 92 of file savegame.hpp.
Referenced by load_game(), and show_dialog().
|
private |
Config information of the savefile to be loaded.
Definition at line 90 of file savegame.hpp.
Referenced by load_game(), show_dialog(), and show_replay().
|
private |
State of the "change_difficulty" checkbox in the load-game dialog.
Definition at line 93 of file savegame.hpp.
Referenced by load_multiplayer_game(), show_dialog(), and show_difficulty_dialog().
|
private |
Definition at line 84 of file savegame.hpp.
Referenced by check_version_compatibility(), load_game(), load_multiplayer_game(), show_dialog(), and show_difficulty_dialog().