30 #define ERR_NG LOG_STREAM(err, log_engine)
40 const std::vector<ng::create_engine::level_ptr> campaigns =
43 if(campaigns.empty()) {
48 std::string random_mode =
"", difficulty =
"";
67 random_mode =
"deterministic";
70 random_mode =
"biased";
87 return level->data()[
"id"] == jump_to_campaign.campaign_id;
91 if(campaign == campaigns.end()) {
92 ERR_NG <<
"No such campaign id to jump to: [" << jump_to_campaign.
campaign_id <<
"]";
101 const auto selected_difficulty = difficulty;
103 if(selected_difficulty ==
"FAIL")
return false;
104 if(selected_difficulty ==
"CANCEL") {
A config object defines a single node in a WML file, with access to child nodes.
static const int OPEN_ADDON_MANAGER
const std::string & get_difficulty() const
RNG_MODE get_rng_mode() const
bool show(const unsigned auto_close_time=0)
Shows the window.
int get_retval() const
Returns the cached window exit code.
void prepare_for_new_level()
std::shared_ptr< level > level_ptr
void set_current_level_type(const level_type::type type)
void prepare_for_campaign(const std::string &difficulty="")
std::vector< level_ptr > get_levels_by_type_unfiltered(level_type::type type) const
const mp_game_settings & get_parameters()
void set_current_level(const std::size_t index)
void prepare_for_era_and_mods()
level & current_level() const
const config & data() const
game_classification & classification()
void set_carryover_sides_start(config carryover_sides_start)
std::string get_scenario_id() const
Definitions for the interface to Wesnoth Markup Language (WML).
static std::string _(const char *str)
bool manage_addons()
Shows the add-ons server connection dialog, for access to the various management front-ends.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
@ OK
Dialog was closed with the OK button.
bool select_campaign(saved_game &state, jump_to_campaign_info jump_to_campaign)
bool configure_campaign(saved_game &state, ng::create_engine &create_eng)
static lg::log_domain log_engine("engine")
std::string campaign_id
The ID of the campaign to launch.
std::string scenario_id
The ID of the scenario within the campaign to jump to.
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...