28 #define ERR_NG LOG_STREAM(err, log_engine)
29 #define WRN_NG LOG_STREAM(warn, log_engine)
30 #define LOG_NG LOG_STREAM(info, log_engine)
31 #define DBG_NG LOG_STREAM(debug, log_engine)
38 , version(cfg[
"version"])
40 , campaign_define(cfg[
"campaign_define"])
41 , campaign_xtra_defines(
utils::
split(cfg[
"campaign_extra_defines"]))
42 , scenario_define(cfg[
"scenario_define"])
43 , era_define(cfg[
"era_define"])
44 , mod_defines(
utils::
split(cfg[
"mod_defines"]))
45 , active_mods(
utils::
split(cfg[
"active_mods"]))
46 , era_id(cfg[
"era_id"])
47 , campaign(cfg[
"campaign"])
48 , campaign_name(cfg[
"campaign_name"])
49 , abbrev(cfg[
"abbrev"])
50 , end_credits(cfg[
"end_credits"].to_bool(true))
51 , end_text(cfg[
"end_text"])
52 , end_text_duration(std::clamp<unsigned>(cfg[
"end_text_duration"].to_unsigned(0), 0, 5000))
54 , random_mode(cfg[
"random_mode"])
55 , oos_debug(cfg[
"oos_debug"].to_bool(false))
89 return campaign.empty() ? campaign_type::multiplayer : campaign_type::scenario;
93 return campaign_type::scenario;
102 struct modevents_entry
104 modevents_entry(
const std::string& _type,
const std::string& _id)
118 std::list<modevents_entry> mods;
119 std::set<std::string> loaded_resources;
120 std::set<std::string> res;
123 mods.emplace_back(
"modification", mod);
132 mods.emplace_back(
"era",
era_id);
136 mods.emplace_back(
"campaign",
campaign);
138 while(!mods.empty()) {
140 const modevents_entry& current = mods.front();
141 if(current.type ==
"resource") {
142 if(!loaded_resources.insert(current.id).second) {
148 if(!cfg[
"addon_id"].empty()) {
149 res.insert(cfg[
"addon_id"]);
152 mods.emplace_back(
"resource", load_res[
"id"].str());
155 ERR_NG <<
"Unable to find config for content " << current.id <<
" of type " << current.type;
160 DBG_NG <<
"Active content for game set to:";
161 for(
const std::string& mod : res) {
A config object defines a single node in a WML file, with access to child nodes.
child_itors child_range(config_key_type key)
std::vector< std::string > campaign_xtra_defines
more customization of data
std::vector< std::string > mod_defines
If there are defines the modifications use to customize data.
std::set< std::string > active_addons(const std::string &scenario_id) const
std::string scenario_define
If there is a define the scenario uses to customize data.
std::string difficulty
The difficulty level the game is being played on.
std::string era_define
If there is a define the era uses to customize data.
game_classification()=default
std::vector< std::string > active_mods
bool end_credits
whether to show the standard credits at the end
std::string label
Name of the game (e.g.
unsigned int end_text_duration
for how long the end-of-campaign text is shown
std::string campaign_define
If there is a define the campaign uses to customize data.
std::string get_tagname() const
std::string campaign
The id of the campaign being played.
std::string abbrev
the campaign abbreviation
bool is_multiplayer() const
std::string end_text
end-of-campaign text
std::string campaign_name
The name of the campaign being played.
static game_config_manager * get()
std::string str() const
Serializes the version number into string form.
const std::string DEFAULT_DIFFICULTY("NORMAL")
The default difficulty setting for campaigns.
static lg::log_domain log_engine("engine")
Interfaces for manipulating version numbers of engine, add-ons, etc.
std::string label
What to show in the filter's drop-down list.
std::string id
Text to match against addon_info.tags()
Standard logging facilities (interface).
Game configuration data as global variables.
const version_info wesnoth_version(VERSION)
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
std::vector< std::string > split(const config_attribute_value &val)
The base template for associating string values with enum values.
static std::string get_string(enum_type key)
Converts a enum to its string equivalent.