Classes | |
class | save_info |
Filename and modification date for a file list. More... | |
struct | save_info_less_time |
A structure for comparing to save_info objects based on their modified time. More... | |
class | create_save_info |
class | save_index_class |
struct | load_game_metadata |
class | load_game_exception |
Exception used to signal that the user has decided to abort a game, and to load another game instead. More... | |
class | savegame |
The base class for all savegame stuff. More... | |
class | ingame_savegame |
Class for "normal" midgame saves. More... | |
class | replay_savegame |
Class for replay saves (either manually or automatically). More... | |
class | autosave_savegame |
Class for autosaves. More... | |
class | oos_savegame |
class | scenariostart_savegame |
Class for start-of-scenario saves. More... | |
Functions | |
void | extract_summary_from_config (const config &, config &) |
static filesystem::scoped_istream | find_save_file (const std::string &dir, const std::string &name, const std::vector< std::string > &suffixes) |
config | read_save_file (const std::string &dir, const std::string &name) |
Read the complete config information out of a savefile. More... | |
bool | save_game_exists (std::string name, compression::format compressed) |
Returns true if there is already a savegame with this name, looking only in the default save directory. More... | |
void | clean_saves (const std::string &label) |
Delete all autosaves of a certain scenario from the default save directory. More... | |
bool | check_version_compatibility (const version_info &version) |
Confirms attempts to load saves from previous game versions. More... | |
bool | check_version_compatibility (const config &cfg) |
void | load_interactive_by_exception () |
load_interactive wrapper for in-game save loading. More... | |
utils::optional< load_game_metadata > | load_interactive () |
utils::optional< load_game_metadata > | load_interactive_for_multiplayer () |
void | set_gamestate (saved_game &gamestate, load_game_metadata &load_data) |
static void | convert_old_saves_1_11_0 (config &cfg) |
static void | convert_old_saves_1_13_0 (config &cfg) |
static void | convert_old_saves_1_13_1 (config &cfg) |
static void | convert_old_saves_1_15_3 (config &cfg) |
void | convert_old_saves (config &cfg) |
converts saves from older versions of wesnoth More... | |
bool | is_replay_save (const config &summary) |
bool savegame::check_version_compatibility | ( | const config & | cfg | ) |
Definition at line 125 of file savegame.cpp.
References cfg, and check_version_compatibility().
bool savegame::check_version_compatibility | ( | const version_info & | version | ) |
Confirms attempts to load saves from previous game versions.
Definition at line 183 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.
Referenced by check_version_compatibility(), load_interactive(), and load_interactive_for_multiplayer().
void savegame::savegame::clean_saves | ( | const std::string & | label | ) |
Delete all autosaves of a certain scenario from the default save directory.
This is only expected to be called when the player starts the next scenario (or finishes the campaign, in the case of the last scenario), so it's expected to correspond to the next scenario being written to the default save directory.
Definition at line 64 of file savegame.cpp.
References _(), savegame::save_index_class::default_saves_dir(), label, and LOG_SAVE.
Referenced by campaign_controller::play_game(), and game_launcher::single_unit_test().
void savegame::savegame::convert_old_saves | ( | config & | cfg | ) |
converts saves from older versions of wesnoth
Definition at line 796 of file savegame.cpp.
References cfg, convert_old_saves_1_11_0(), convert_old_saves_1_13_0(), convert_old_saves_1_13_1(), convert_old_saves_1_15_3(), and LOG_RG.
Referenced by savegame::load_game_metadata::read_file().
|
static |
Definition at line 607 of file savegame.cpp.
References config::add_child(), cfg, config::child_or_empty(), config::child_range(), config::clear_children(), config::empty(), replay::empty(), config::has_child(), LOG_RG, config::mandatory_child(), and config::optional_child().
Referenced by convert_old_saves().
|
static |
Definition at line 704 of file savegame.cpp.
References config::add_child(), cfg, config::child_or_empty(), config::clear_children(), config::empty(), config::has_child(), and config::optional_child().
Referenced by convert_old_saves().
|
static |
Definition at line 749 of file savegame.cpp.
References cfg, config::child_range(), config::optional_child(), config::remove_attribute(), and utils::split().
Referenced by convert_old_saves().
|
static |
Definition at line 785 of file savegame.cpp.
References cfg, and config::child_or_empty().
Referenced by convert_old_saves().
Definition at line 383 of file save_index.cpp.
References config::add_child(), config::child_or_empty(), config::child_range(), config::clear_children(), ERR_SAVE, filesystem::get_independent_binary_file_path(), team::get_side_color_id_from_config(), config::has_child(), config::mandatory_child(), and config::optional_child().
Referenced by savegame::save_index_class::rebuild().
|
static |
Definition at line 284 of file save_index.cpp.
References filesystem::istream_file(), and LOG_SAVE.
Referenced by read_save_file().
|
inline |
Definition at line 103 of file savegame.hpp.
Referenced by gui2::dialogs::game_load::display_savegame_internal(), gui2::dialogs::game_load::evaluate_summary_string(), load_interactive(), and load_interactive_for_multiplayer().
utils::optional< load_game_metadata > savegame::load_interactive | ( | ) |
Definition at line 153 of file savegame.cpp.
References check_version_compatibility(), savegame::save_index_class::default_saves_dir(), gui2::dialogs::game_load::execute(), is_replay_save(), and load_data.
Referenced by game_launcher::load_game_prompt(), and load_interactive_by_exception().
void savegame::savegame::load_interactive_by_exception | ( | ) |
load_interactive wrapper for in-game save loading.
If load_interactive returns a load_game_metadata object, throws load_game_exception with said object as its payload. Otherwise, no exception is thrown.
Definition at line 142 of file savegame.cpp.
References video::headless(), load_data, and load_interactive().
Referenced by play_controller::load_game().
utils::optional< load_game_metadata > savegame::load_interactive_for_multiplayer | ( | ) |
Definition at line 236 of file savegame.cpp.
References _(), check_version_compatibility(), savegame::save_index_class::default_saves_dir(), gui2::dialogs::game_load::execute(), is_replay_save(), load_data, log_scope, gui2::show_transient_error_message(), gui2::show_transient_message(), and cursor::WAIT.
Referenced by gui2::dialogs::mp_create_game::load_game_callback().
config savegame::savegame::read_save_file | ( | const std::string & | dir, |
const std::string & | name | ||
) |
Read the complete config information out of a savefile.
Definition at line 300 of file save_index.cpp.
References cfg, e, config::empty(), lg::err(), find_save_file(), filesystem::is_bzip2_file(), filesystem::is_gzip_file(), LOG_SAVE, io::read(), io::read_bz2(), and io::read_gz().
Referenced by playsingle_controller::hotkey_handler::load_autosave(), savegame::load_game_metadata::read_file(), and savegame::save_index_class::rebuild().
bool savegame::savegame::save_game_exists | ( | std::string | name, |
compression::format | compressed | ||
) |
Returns true if there is already a savegame with this name, looking only in the default save directory.
Only expected to be used to check whether a subsequent save would overwrite an existing file, therefore only expected to be used for the default save dir.
Definition at line 57 of file savegame.cpp.
References savegame::save_index_class::default_saves_dir(), filesystem::file_exists(), and compression::format_extension().
Referenced by savegame::savegame::check_overwrite().
void savegame::set_gamestate | ( | saved_game & | gamestate, |
load_game_metadata & | load_data | ||
) |
Definition at line 278 of file savegame.cpp.
References load_data, saved_game::set_data(), and saved_game::unify_controllers().
Referenced by gui2::dialogs::mp_create_game::load_game_callback(), and game_launcher::load_prepared_game().