29 #define ERR_NG LOG_STREAM(err, log_engine) 39 const std::vector<ng::create_engine::level_ptr> campaigns =
42 if(campaigns.empty()) {
47 std::string random_mode =
"", difficulty =
"";
69 random_mode =
"deterministic";
72 random_mode =
"biased";
87 if(campaign == campaigns.end()) {
88 ERR_NG <<
"No such campaign id to jump to: [" << jump_to_campaign.
campaign_id <<
"]" << std::endl;
97 const auto selected_difficulty = difficulty;
99 if(selected_difficulty ==
"FAIL")
return false;
100 if(selected_difficulty ==
"CANCEL") {
std::string scenario_id
The ID of the scenario within the campaign to jump to.
std::shared_ptr< level > level_ptr
This shows the dialog which allows the user to choose which campaign to play.
Add a special kind of assert to validate whether the input from WML doesn't contain any problems that...
void set_current_level(const std::size_t index)
static std::string _(const char *str)
bool show(const unsigned auto_close_time=0)
Shows the window.
const mp_game_settings & get_parameters()
static lg::log_domain log_engine("engine")
void prepare_for_era_and_mods()
Definitions for the interface to Wesnoth Markup Language (WML).
std::string get_scenario_id() const
const config & data() const
void show() const
Shows the error in a dialog.
void set_current_level_type(const level::TYPE type)
const std::string & get_difficulty() const
void prepare_for_campaign(const std::string &difficulty="")
std::vector< level_ptr > get_levels_by_type_unfiltered(level::TYPE type) const
Helper class, don't construct this directly.
level & current_level() const
int get_retval() const
Returns the cached window exit code.
bool select_campaign(saved_game &state, jump_to_campaign_info jump_to_campaign)
bool configure_campaign(saved_game &state, ng::create_engine &create_eng)
game_classification & classification()
void set_carryover_sides_start(config carryover_sides_start)
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
Dialog was closed with the OK button.
A config object defines a single node in a WML file, with access to child nodes.
void prepare_for_new_level()
RNG_MODE get_rng_mode() const
std::string campaign_id
The ID of the campaign to launch.