27 #define ERR_NG LOG_STREAM(err, log_engine)
28 #define WRN_NG LOG_STREAM(warn, log_engine)
29 #define LOG_NG LOG_STREAM(info, log_engine)
30 #define DBG_NG LOG_STREAM(debug, log_engine)
37 , version(cfg[
"version"])
39 , campaign_define(cfg[
"campaign_define"])
40 , campaign_xtra_defines(
utils::
split(cfg[
"campaign_extra_defines"]))
41 , scenario_define(cfg[
"scenario_define"])
42 , era_define(cfg[
"era_define"])
43 , mod_defines(
utils::
split(cfg[
"mod_defines"]))
44 , active_mods(
utils::
split(cfg[
"active_mods"]))
45 , era_id(cfg[
"era_id"])
46 , campaign(cfg[
"campaign"])
47 , campaign_name(cfg[
"campaign_name"])
48 , abbrev(cfg[
"abbrev"])
49 , end_credits(cfg[
"end_credits"].to_bool(true))
50 , end_text(cfg[
"end_text"])
51 , end_text_duration(std::clamp<unsigned>(cfg[
"end_text_duration"].to_unsigned(0), 0, 5000))
53 , random_mode(cfg[
"random_mode"])
54 , oos_debug(cfg[
"oos_debug"].to_bool(false))
87 return campaign.empty() ? campaign_type::multiplayer : campaign_type::scenario;
91 return campaign_type::scenario;
100 struct modevents_entry
102 modevents_entry(
const std::string& _type,
const std::string& _id)
116 std::list<modevents_entry> mods;
117 std::set<std::string> loaded_resources;
118 std::set<std::string> res;
121 mods.emplace_back(
"modification", mod);
130 mods.emplace_back(
"era",
era_id);
134 mods.emplace_back(
"campaign",
campaign);
136 while(!mods.empty()) {
138 const modevents_entry& current = mods.front();
139 if(current.type ==
"resource") {
140 if(!loaded_resources.insert(current.id).second) {
146 if(!cfg[
"addon_id"].empty()) {
147 res.insert(cfg[
"addon_id"]);
150 mods.emplace_back(
"resource", load_res[
"id"].str());
153 ERR_NG <<
"Unable to find config for content " << current.id <<
" of type " << current.type;
158 DBG_NG <<
"Active content for game set to:";
159 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.