55 std::shared_ptr<save_index_class>
manager {};
109 bool load_game_ingame();
113 bool load_multiplayer_game();
115 void set_gamestate();
124 static bool check_version_compatibility(
const version_info & version);
128 return cfg[
"replay"].to_bool() && !cfg[
"snapshot"].to_bool(
true);
133 bool show_difficulty_dialog();
135 bool check_version_compatibility();
137 void copy_era(
config& cfg);
170 bool save_game_automatic(
bool ask_for_overwrite =
false,
const std::string&
filename =
"");
174 bool save_game_interactive(
const std::string& message,
182 return create_filename(gamestate().get_starting_point()[
"turn_at"]);
186 std::string create_filename(
unsigned int turn_number)
const;
193 bool save_game(
const std::string&
filename =
"");
196 bool check_filename(
const std::string&
filename);
201 const std::string&
title()
const {
return title_; }
225 virtual std::string create_initial_filename(
unsigned int turn_number)
const = 0;
227 virtual int show_save_dialog(
const std::string& message,
DIALOG_TYPE dialog_type);
229 bool check_overwrite();
233 void write_game_to_disk(
const std::string& filename);
259 virtual std::string create_initial_filename(
unsigned int turn_number)
const override;
273 virtual std::string create_initial_filename(
unsigned int turn_number)
const override;
284 void autosave(
const bool disable_autosave,
const int autosave_max,
const int infinite_autosaves);
287 virtual std::string create_initial_filename(
unsigned int turn_number)
const override;
296 void set_title(
const std::string& val) { title_ = val; }
300 virtual int show_save_dialog(
const std::string& message,
DIALOG_TYPE dialog_type)
override;
312 virtual std::string create_initial_filename(
unsigned int turn_number)
const override;
Class for start-of-scenario saves.
The class for loading a savefile.
const game_config_view & game_config_
#define IMPLEMENT_LUA_JAILBREAK_EXCEPTION(type)
Helper macro for classes deriving from lua_jailbreak_exception.
const std::string & filename() const
load_game_metadata load_data_
Primary output information.
Class for "normal" midgame saves.
compression::format compress_saves_
Determines if a confirmation of successful saving the game is shown.
Definitions for the interface to Wesnoth Markup Language (WML).
void set_title(const std::string &val)
Customize the dialog's caption.
load_game_metadata & data()
load_game_exception(load_game_metadata &&data)
const saved_game & gamestate() const
Class for writing a config out to a file in pieces.
std::string create_filename() const
Build the filename according to the specific savegame's needs.
static bool is_replay_save(const config &cfg)
std::string error_message_
void convert_old_saves(config &cfg)
converts saves from older versions of wesnoth
std::unique_ptr< std::ostream > scoped_ostream
Exception used to signal that the user has decided to abortt a game, and to load another game instead...
std::shared_ptr< save_index_class > save_index_manager_
Will (at the time of writing) be save_index_class::default_saves_dir().
void clean_saves(const std::string &label)
Delete all autosaves of a certain scenario from the default save directory.
std::string title_
Title of the savegame dialog.
bool show_confirmation_
Error message to be displayed if the savefile could not be generated.
Declarations for File-IO.
std::size_t index(const std::string &str, const std::size_t index)
Codepoint index corresponding to the nth character in a UTF-8 string.
Class for replay saves (either manually or automatically).
Represents version numbers.
void set_error_message(const std::string &error_message)
Customize the standard error message.
Filename and modification date for a file list.
const std::string & title() const
std::string filename_
Filename of the savegame file on disk.
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 director...
A config object defines a single node in a WML file, with access to child nodes.
Base class for exceptions that want to be thrown 'through' lua.