45 #define LOG_G LOG_STREAM(info, lg::general)
48 #define LOG_NG LOG_STREAM(info, log_engine)
49 #define ERR_NG LOG_STREAM(err, log_engine)
52 #define LOG_RG LOG_STREAM(info, log_enginerefac)
62 LOG_NG <<
"created objects... " << (SDL_GetTicks() - playcontroller.
ticks());
68 if(res == level_result::type::quit) {
69 return level_result::type::quit;
91 if(res == level_result::type::quit) {
92 return level_result::type::quit;
135 #if !defined(ALWAYS_USE_MP_CONTROLLER)
147 LOG_NG <<
"The game was remotely ended";
148 return level_result::type::quit;
151 return level_result::type::quit;
153 LOG_NG <<
"The game was aborted";
154 return level_result::type::quit;
157 return level_result::type::quit;
160 return level_result::type::quit;
165 return level_result::type::quit;
168 return level_result::type::quit;
175 if(res == level_result::type::quit) {
211 _(
"This scenario has ended. Do you want to continue the campaign?"),
222 return level_result::type::quit;
251 return level_result::type::quit;
279 std::string message =
_(
"Unknown scenario: '$scenario|'");
283 return level_result::type::quit;
292 return level_result::type::victory;
level_result::type play_game()
level_result::type playsingle_scenario(end_level_data &end_level)
mp_game_metadata * mp_info_
level_result::type playmp_scenario(end_level_data &end_level)
A config object defines a single node in a WML file, with access to child nodes.
std::string difficulty
The difficulty level the game is being played on.
bool end_credits
whether to show the standard credits at the end
std::string label
Name of the game (e.g.
std::string campaign
The id of the campaign being played.
bool is_normal_mp_game() const
bool is_multiplayer() const
@ yes_no_buttons
Shows a yes and no button.
bool can_start_game() const
config to_config() const
Builds the snapshot config from members and their respective configs.
void update_savegame_snapshot() const
const end_level_data & get_end_level_data() const
std::set< std::string > all_players() const
level_result::type play_scenario(const config &level)
void enable_replay(bool is_unit_test=false)
void add_completed_campaign(const std::string &campaign_id, const std::string &difficulty_level)
game_classification & classification()
void expand_scenario()
copies the content of a [scenario] with the correct id attribute from the game config into this objec...
void expand_mp_options()
adds values of [option]s into [carryover_sides_start][variables] so that they are applied in the next...
std::string get_scenario_id() const
void update_label()
sets classification().label to the correct value.
mp_game_settings & mp_settings()
Multiplayer parameters for this game.
config & get_starting_point()
const config & get_replay_starting_point()
void expand_mp_events()
adds [event]s from [era] and [modification] into this scenario does NOT expand [option]s because vari...
void expand_random_scenario()
takes care of generate_map=, generate_scenario=, map= attributes This should be called before expandi...
void expand_carryover()
merges [carryover_sides_start] into [scenario] and saves the rest into [carryover_sides] Removes [car...
void convert_to_start_save()
converts a normal savegame form the end of a scenaio to a start-of-scenario savefile for the next sce...
replay_recorder_base & get_replay()
config & set_snapshot(config snapshot)
Class for replay saves (either manually or automatically).
bool save_game_automatic(bool ask_for_overwrite=false, const std::string &filename="")
Saves a game without user interaction, unless the file exists and it should be asked to overwrite it.
Class for start-of-scenario saves.
static std::string _(const char *str)
Standard logging facilities (interface).
void switch_theme(const std::string ¤t_theme)
Set and activate the given gui2 theme.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
@ CANCEL
Dialog was closed with the CANCEL button.
bool goto_mp_staging(ng::connect_engine &engine)
Opens the MP Staging screen and sets the game state according to the changes made.
bool goto_mp_wait(bool observe)
Opens the MP Join Game screen and sets the game state according to the changes made.
void clean_saves(const std::string &label)
Delete all autosaves of a certain scenario from the default save directory.
std::string interpolate_variables_into_string(const std::string &str, const string_map *const symbols)
Function which will interpolate variables, starting with '$' in the string 'str' with the equivalent ...
std::map< std::string, t_string > string_map
static lg::log_domain log_engine("engine")
static lg::log_domain log_enginerefac("enginerefac")
Additional information on the game outcome which can be provided by WML.
bool prescenario_save
Should a prescenario be created the next game?
bool replay_save
Should a replay save be made?
bool proceed_to_next_level
whether to proceed to the next scenario, equals is_victory in sp.
Error used for any general game error, e.g.
Error used when game loading fails.
std::map< std::string, addon_version_info > addons
the key is the addon_id
saved_game_mode::type saved_game
Helper class, don't construct this directly.
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...