46 #include <boost/algorithm/string.hpp>
54 #define WRN_HP LOG_STREAM(warn, log_help)
55 #define DBG_HP LOG_STREAM(debug, log_help)
111 PLAIN_LOG <<
"Maximum section depth has been reached. Maybe circular dependency?";
113 else if (section_cfg !=
nullptr) {
115 std::string
id =
level == 0 ?
"toplevel" : (*section_cfg)[
"id"].str();
118 std::stringstream ss;
119 ss <<
"Invalid ID, used for internal purpose: '" <<
id <<
"'";
123 std::string title =
level == 0 ?
"" : (*section_cfg)[
"title"].str();
127 for(
const std::string& sec_id : sections) {
128 if (
auto child_cfg = help_cfg->
find_child(
"section",
"id", sec_id))
135 std::stringstream ss;
136 ss <<
"Help-section '" << sec_id <<
"' referenced from '"
137 <<
id <<
"' but could not be found.";
143 if ((*section_cfg)[
"sort_sections"] ==
"yes") {
147 bool sort_topics =
false;
148 bool sort_generated =
true;
150 if ((*section_cfg)[
"sort_topics"] ==
"yes") {
152 sort_generated =
false;
153 }
else if ((*section_cfg)[
"sort_topics"] ==
"no") {
155 sort_generated =
false;
156 }
else if ((*section_cfg)[
"sort_topics"] ==
"generated") {
158 sort_generated =
true;
159 }
else if (!(*section_cfg)[
"sort_topics"].empty()) {
160 std::stringstream ss;
161 ss <<
"Invalid sort option: '" << (*section_cfg)[
"sort_topics"] <<
"'";
165 std::vector<topic> generated_topics =
generate_topics(sort_generated,(*section_cfg)[
"generator"]);
166 std::vector<topic> topics;
170 if (
auto topic_cfg = help_cfg->
find_child(
"topic",
"id", topic_id))
172 std::string text = topic_cfg[
"text"];
174 topic child_topic(topic_cfg[
"title"], topic_cfg[
"id"], text);
176 std::stringstream ss;
177 ss <<
"Invalid ID, used for internal purpose: '" <<
id <<
"'";
180 topics.push_back(child_topic);
183 std::stringstream ss;
184 ss <<
"Help-topic '" << topic_id <<
"' referenced from '" <<
id
185 <<
"' but could not be found." << std::endl;
191 std::sort(topics.begin(),topics.end(),
title_less());
192 std::sort(generated_topics.begin(),
194 std::merge(generated_topics.begin(),
195 generated_topics.end(),topics.begin(),topics.end()
200 topics.begin(), topics.end());
202 generated_topics.begin(), generated_topics.end());
210 if (
cfg !=
nullptr) {
219 std::vector<topic> res;
226 }
else if (
generator ==
"weapon_specials") {
228 }
else if (
generator ==
"time_of_days") {
234 if (parts.size() > 1 && parts[0] ==
"units") {
236 }
else if (parts[0] ==
"era" && parts.size()>1) {
239 WRN_HP <<
"Found a topic generator that I didn't recognize: " <<
generator;
253 DBG_HP <<
"Generating eras...";
257 if (parts.size() > 1 && parts[0] ==
"units") {
260 WRN_HP <<
"Found a section generator that I didn't recognize: " <<
generator;
267 std::string empty_string =
"";
272 if (parts.size() > 1 && parts[0] ==
"contents") {
273 if (parts[1] ==
"generated") {
295 return markup::span_color((time_of_day_bonus > 0 ?
"green" : (time_of_day_bonus < 0 ?
"red" :
"white")), time_of_day_bonus);
300 std::vector<topic> topics;
301 std::stringstream toplevel;
304 toplevel <<
_(
"Only available during a scenario.");
305 topics.emplace_back(
_(
"Time of Day Schedule"),
"..schedule", toplevel.str());
312 const std::string
id =
"time_of_day_" + time.id;
314 const std::string image_lawful =
markup::img(
"icons/alignments/alignment_lawful_30.png");
315 const std::string image_neutral =
markup::img(
"icons/alignments/alignment_neutral_30.png");
316 const std::string image_chaotic =
markup::img(
"icons/alignments/alignment_chaotic_30.png");
317 const std::string image_liminal =
markup::img(
"icons/alignments/alignment_liminal_30.png");
318 std::stringstream text, row_ss;
333 text <<
image <<
'\n'
334 << time.description.str() <<
'\n'
341 topics.emplace_back(time.name.str(),
id, text.str());
344 topics.emplace_back(
_(
"Time of Day Schedule"),
"..schedule",
markup::tag(
"table", toplevel.str()));
350 std::vector<topic> topics;
352 std::map<t_string, std::string> special_description;
353 std::map<t_string, std::set<std::string, string_less>> special_units;
362 for(
const auto& [name, description] : atk.special_tooltips()) {
363 special_description.emplace(name, description);
365 if (!
type.hide_help()) {
367 std::string type_name =
type.type_name();
369 const std::string section_prefix =
type.show_variations_in_help() ?
".." :
"";
374 special_units[name].insert(link);
379 for(
const config& adv :
type.modification_advancements()) {
381 if(effect[
"apply_to"] ==
"new_attack" && effect.has_child(
"specials")) {
382 for(
const auto [key, special] : effect.mandatory_child(
"specials").all_children_view()) {
383 if(!special[
"name"].empty()) {
384 special_description.emplace(special[
"name"].t_str(), special[
"description"].t_str());
385 if(!
type.hide_help()) {
387 std::string type_name =
type.type_name();
389 const std::string section_prefix =
type.show_variations_in_help() ?
".." :
"";
394 special_units[special[
"name"].t_str()].insert(link);
398 }
else if(effect[
"apply_to"] ==
"attack" && effect.has_child(
"set_specials")) {
399 for(
const auto [key, special] : effect.mandatory_child(
"set_specials").all_children_view()) {
400 if(!special[
"name"].empty()) {
401 special_description.emplace(special[
"name"].t_str(), special[
"description"].t_str());
402 if(!
type.hide_help()) {
404 std::string type_name =
type.type_name();
406 const std::string section_prefix =
type.show_variations_in_help() ?
".." :
"";
411 special_units[special[
"name"].t_str()].insert(link);
420 for(
const auto& [name, description] : special_description) {
422 std::string
id =
"weaponspecial_" + name.base_str();
423 std::stringstream text;
425 text <<
"\n\n" <<
markup::tag(
"header",
_(
"Units with this special attack")) <<
"\n";
426 for(
const std::string& type_id : special_units[name]) {
430 topics.emplace_back(name,
id, text.str());
434 std::sort(topics.begin(), topics.end(),
title_less());
440 std::vector<topic> topics;
442 std::map<std::string, const unit_type::ability_metadata*> ability_topic_data;
443 std::map<std::string, std::set<std::string, string_less>> ability_units;
450 const std::string topic_ref = ability.id + ability.name.base_str();
452 ability_topic_data.emplace(topic_ref, &ability);
454 if(!
type.hide_help()) {
459 ability_units[topic_ref].insert(link);
472 parse(
type, ability);
476 parse(
type, ability);
480 for(
const auto& a : ability_topic_data) {
481 if (a.second->name.empty()) {
484 std::ostringstream text;
485 text << a.second->description;
486 text <<
"\n\n" <<
markup::tag(
"header",
_(
"Units with this ability")) <<
"\n";
488 for(
const auto& u : ability_units[a.first]) {
492 topics.emplace_back(a.second->name,
ability_prefix + a.first, text.str());
496 std::sort(topics.begin(), topics.end(),
title_less());
504 std::vector<topic> topics;
507 if(era && !era[
"hide_help"].to_bool()) {
510 std::vector<std::string> faction_links;
511 for (
const topic &
t : topics) {
515 std::stringstream text;
517 if (!description.
empty()) {
518 text << description.
t_str() <<
"\n";
524 std::sort(faction_links.begin(), faction_links.end());
525 for (
const std::string &link : faction_links) {
529 topics.emplace_back(era[
"name"],
".." +
era_prefix + era[
"id"].str(), text.str());
536 std::vector<topic> topics;
538 const std::string&
id =
f[
"id"];
542 std::stringstream text;
545 if (!description.
empty()) {
546 text << description.
t_str() <<
"\n";
550 const std::vector<std::string> recruit_ids =
utils::split(
f[
"recruit"]);
551 std::set<std::string> races;
552 std::set<std::string> alignments;
554 for (
const std::string & u_id : recruit_ids) {
566 if (!races.empty()) {
568 text <<
_(
"Races: ") << *(it++);
569 while(it != races.end()) {
570 text <<
", " << *(it++);
575 if (!alignments.empty()) {
577 text <<
_(
"Alignments: ") << *(it++);
578 while(it != alignments.end()) {
579 text <<
", " << *(it++);
585 const std::vector<std::string> leaders =
587 for (
const std::string &link : leaders) {
594 const std::vector<std::string> recruit_links =
596 for (
const std::string &link : recruit_links) {
600 const std::string name =
f[
"name"];
602 topics.emplace_back(name, ref_id, text.str());
605 std::sort(topics.begin(), topics.end(),
title_less());
614 std::map<std::string, const config> trait_list;
618 trait_list.emplace(trait[
"id"], trait);
622 std::set<std::string> races;
633 races.insert(
type.race_id());
643 for (
const config& trait :
type.possible_traits()) {
644 trait_list.emplace(trait[
"id"], trait);
654 for(
const auto& race_id : races) {
656 for(
const config & trait : r->additional_traits()) {
657 trait_list.emplace(trait[
"id"], trait);
662 std::vector<topic> topics;
663 for(
auto& a : trait_list) {
664 std::string
id =
"traits_" + a.first;
665 const config& trait = a.second;
667 std::string name = trait[
"male_name"].str();
668 if (name.empty()) name = trait[
"female_name"].str();
669 if (name.empty()) name = trait[
"name"].str();
670 if (name.empty())
continue;
672 std::stringstream text;
673 if (!trait[
"help_text"].empty()) {
674 text << trait[
"help_text"];
675 }
else if (!trait[
"description"].empty()) {
676 text << trait[
"description"];
678 text <<
_(
"No description available.");
682 topics.emplace_back(name,
id, text.str());
686 std::sort(topics.begin(), topics.end(),
title_less());
697 PLAIN_LOG <<
"Unknown unit type : " << type_id;
701 }
else if (!
type->hide_help()) {
702 std::string name =
type->type_name();
705 const std::string section_prefix =
type->show_variations_in_help() ?
".." :
"";
719 std::vector<std::string> links_list;
720 for (
const std::string &type_id : type_id_list) {
722 if (!unit_link.empty())
723 links_list.push_back(unit_link);
727 std::sort(links_list.begin(), links_list.end());
734 std::set<std::string, string_less> races;
735 std::set<std::string, string_less> visible_races;
742 races.insert(
type.race_id());
743 if(!
type.hide_help())
744 visible_races.insert(
type.race_id());
749 std::set<std::string, string_less> last_sweep = visible_races;
750 while(!last_sweep.empty()) {
751 std::set<std::string, string_less> current_sweep;
752 for(
const auto& race_id : last_sweep) {
754 const auto& help_taxonomy = r->help_taxonomy();
755 if(!help_taxonomy.empty() && !visible_races.count(help_taxonomy) &&
unit_types.
find_race(help_taxonomy)) {
756 current_sweep.insert(help_taxonomy);
757 races.insert(help_taxonomy);
758 visible_races.insert(help_taxonomy);
762 last_sweep = std::move(current_sweep);
765 struct taxonomy_queue_type
767 std::string parent_id;
770 std::vector<taxonomy_queue_type> taxonomy_queue;
774 for(
const auto& race_id : races) {
778 bool hidden = (visible_races.count(race_id) == 0);
783 std::string help_taxonomy;
785 title = r->plural_name();
786 help_taxonomy = r->help_taxonomy();
788 title =
_(
"race^Miscellaneous");
791 section_cfg[
"title"] = title;
793 section_cfg[
"sections_generator"] =
"units:" + race_id;
794 section_cfg[
"generator"] =
"units:" + race_id;
798 if(help_taxonomy.empty()) {
801 bool parent_hidden = (visible_races.count(help_taxonomy) == 0);
803 taxonomy_queue.push_back({std::move(parent_id), std::move(race_section)});
808 bool process_queue_again =
true;
809 while(process_queue_again && !taxonomy_queue.empty()) {
810 process_queue_again =
false;
811 auto to_process = std::exchange(taxonomy_queue, {});
813 for(
auto& x : to_process) {
816 parent->add_section(x.content);
817 process_queue_again =
true;
819 taxonomy_queue.push_back(std::move(x));
825 for(
auto& x : taxonomy_queue) {
833 if (era[
"hide_help"].to_bool()) {
837 DBG_HP <<
"Adding help section: " << era[
"id"].str();
841 section_cfg[
"id"] =
era_prefix + era[
"id"].str();
842 section_cfg[
"title"] = era[
"name"];
844 section_cfg[
"generator"] =
"era:" + era[
"id"].str();
858 WRN_HP <<
"When building terrain help sections, couldn't acquire terrain types data, aborting.";
862 std::map<std::string, section> base_map;
870 bool hidden =
info.hide_help();
873 ==
prefs::get().encountered_terrains().end() && !
info.is_overlay())
879 std::make_shared<terrain_topic_generator>(
info)
883 if (
info.has_default_base()) {
884 for (
const auto base : tdata->underlying_union_terrain(
info.default_base())) {
886 base_terrains.emplace_back(base);
892 const terrain_type& base_info = tdata->get_terrain_info(base);
897 section& base_section = base_map[base_info.
id()];
902 if (base_info.
id() ==
info.id())
904 base_section.
topics.push_back(terrain_topic);
908 std::vector<section> sorted_sections;
909 for (
const auto& pair : base_map) {
910 sorted_sections.push_back(pair.second);
913 std::sort(sorted_sections.begin(), sorted_sections.end(),
section_less());
915 for (
const section&
s : sorted_sections) {
922 for (
const unit_type_data::unit_type_map::value_type &
i :
unit_types.
types()) {
925 if (
type.race_id() != race)
928 if (!
type.show_variations_in_help())
932 for (
const std::string &variation_id :
type.variations()) {
934 const unit_type &var_type =
type.get_variation(variation_id);
938 base_unit.
topics.emplace_back(topic_name, var_ref, std::make_shared<unit_topic_generator>(var_type, variation_id));
941 const std::string type_name =
type.type_name();
944 base_unit.
id = ref_id;
945 base_unit.
title = type_name;
953 std::vector<topic> topics;
954 std::set<std::string, string_less> race_units;
955 std::set<std::string, string_less> race_topics;
956 std::set<std::string> alignments;
958 for (
const unit_type_data::unit_type_map::value_type &
i :
unit_types.
types())
962 if (
type.race_id() != race)
970 const std::string type_name =
type.type_name() + (
type.id() ==
type.type_name().str() ?
"" : debug_suffix);
971 const std::string real_prefix =
type.show_variations_in_help() ?
".." :
"";
973 topics.emplace_back(type_name, ref_id, std::make_shared<unit_topic_generator>(
type));
975 if (!
type.hide_help()) {
979 race_units.insert(link);
986 std::string race_id =
"..race_"+race;
987 std::string race_name;
988 std::string race_description;
989 std::string race_help_taxonomy;
991 race_name = r->plural_name();
992 race_description = r->description();
993 race_help_taxonomy = r->help_taxonomy();
995 for (
const config &additional_topic : r->additional_topics())
997 std::string
id = additional_topic[
"id"];
998 std::string title = additional_topic[
"title"];
999 std::string text = additional_topic[
"text"];
1001 topics.emplace_back(title,
id,text);
1003 race_topics.insert(link);
1006 race_name =
_ (
"race^Miscellaneous");
1011 std::map<std::string, t_string> subgroups;
1013 if (r.second.help_taxonomy() == race) {
1014 if (!r.second.plural_name().empty())
1015 subgroups[r.first] = r.second.plural_name();
1017 subgroups[r.first] = r.first;
1021 std::stringstream text;
1023 if (!race_description.empty()) {
1024 text << race_description <<
"\n\n";
1027 if (!alignments.empty()) {
1029 text << (alignments.size() > 1 ?
_(
"Alignments: ") :
_(
"Alignment: ")) << *(it++);
1030 while(it != alignments.end()) {
1031 text <<
", " << *(it++);
1036 if (!race_help_taxonomy.empty()) {
1038 symbols[
"topic_id"] =
"..race_"+race_help_taxonomy;
1040 symbols[
"help_taxonomy"] = r->plural_name();
1044 symbols[
"help_taxonomy"] = race_help_taxonomy;
1048 text <<
VGETTEXT(
"This is a group of units, all of whom are <ref dst='$topic_id'>$help_taxonomy</ref>.", symbols) <<
"\n\n";
1051 if (!subgroups.empty()) {
1052 if (!race_help_taxonomy.empty()) {
1053 text <<
markup::tag(
"header",
_(
"Subgroups of units within this group")) <<
"\n";
1055 text <<
markup::tag(
"header",
_(
"Groups of units within this race")) <<
"\n";
1057 for (
const auto &sg : subgroups) {
1063 if (!race_help_taxonomy.empty()) {
1064 text <<
markup::tag(
"header",
_(
"Units of this group")) <<
"\n";
1066 text <<
markup::tag(
"header",
_(
"Units of this race")) <<
"\n";
1068 for (
const auto &u : race_units) {
1072 topics.emplace_back(race_name, race_id, text.str());
1075 std::sort(topics.begin(), topics.end(),
title_less());
1088 if (encountered_units.find(
type.id()) != encountered_units.end()) {
1093 if (
type.id() ==
"Fog Clearer") {
1102 auto section_cfg = help_cfg->
find_child(
"section",
"id", section_name);
1104 return std::string();
1107 std::ostringstream res;
1112 typedef std::pair<std::string,std::string> link;
1113 std::vector<link> topics_links;
1116 for(
const std::string&
topic : topics) {
1118 std::string
id = topic_cfg[
"id"];
1120 topics_links.emplace_back(topic_cfg[
"title"],
id);
1124 if (section_cfg[
"sort_topics"] ==
"yes") {
1125 std::sort(topics_links.begin(),topics_links.end());
1128 for(
const auto& [text, target] : topics_links) {
1138 std::stringstream res;
1168 return sec.
id ==
id;
1189 topic_list::const_iterator tit =
1191 if (tit != sec.
topics.end()) {
1210 for (
const auto &subsection : sec.
sections) {
1228 std::vector<std::string> hidden_sections;
1229 std::vector<std::string> hidden_topics;
1234 const std::string
id =
section[
"id"];
1240 hidden_sections.push_back(
id);
1246 const std::string
id =
topic[
"id"];
1248 if(
find_topic(toplevel_section,
id) ==
nullptr) {
1250 hidden_topics.push_back(
id);
1256 if(hidden_sections.empty() && hidden_topics.empty()) {
1257 return {std::move(toplevel_section),
section{}};
1260 config hidden_config = help_config;
1271 return {std::move(toplevel_section),
parse_config(&hidden_config)};
1273 }
catch(
const parse_error&
e) {
1274 PLAIN_LOG <<
"Parse error when parsing help text: '" <<
e.message <<
"'";
1280 return (hidden ?
"." :
"");
1284 return (
id.empty() ||
id[0] !=
'.');
1293 if (
id ==
"toplevel") {
1299 if (
id.
compare(0, 8,
"ability_") == 0) {
1302 if (
id.
compare(0, 14,
"weaponspecial_") == 0) {
1305 if (
id ==
"hidden") {
int generic_combat_modifier(int lawful_bonus, unit_alignments::type alignment, bool is_fearless, int max_liminal_bonus)
Returns the amount that a unit's damage should be multiplied by due to a given lawful_bonus.
Various functions that implement attacks and attack calculations.
Variant for storing WML attributes.
bool empty() const
Tests for an attribute that either was never set or was set to "".
A config object defines a single node in a WML file, with access to child nodes.
config & add_child(std::string_view key)
optional_config_impl< config > optional_child(std::string_view key, int n=0)
Equivalent to mandatory_child, but returns an empty optional if the nth child was not found.
child_itors child_range(std::string_view key)
void clear_children(T... keys)
optional_config_impl< config > find_child(std::string_view key, const std::string &name, const std::string &value)
Returns the first child of tag key with a name attribute containing value.
std::string debug() const
static game_config_manager * get()
const std::shared_ptr< terrain_type_data > & terrain_types() const
const game_config_view & game_config() const
const config & child_or_empty(std::string_view key) const
optional_const_config find_child(std::string_view key, const std::string &name, const std::string &value) const
To be used as a function object to locate sections and topics with a specified ID.
To be used as a function object when sorting section lists on the title.
To be used as a function object when sorting topic lists on the title.
std::shared_ptr< topic_generator > generator_
const config & parsed_text() const
std::set< std::string > & encountered_units()
bool hide_help() const
For instances created from a [terrain_type] tag, the value in the tag (with default false).
bool is_nonnull() const
True if this object represents some sentinel values.
const std::string & id() const
const t_string & editor_name() const
int get_max_liminal_bonus() const
const std::vector< time_of_day > & times() const
const unit_type * find(const std::string &key, unit_type::BUILD_STATUS status=unit_type::FULL) const
Finds a unit_type by its id() and makes sure it is built to the specified level.
const race_map & races() const
const unit_race * find_race(const std::string &) const
const unit_type_map & types() const
config_array_view traits() const
A single unit type that the player may recruit.
const std::string & id() const
The id for this unit_type.
const t_string & variation_name() const
static std::string _(const char *str)
std::string id
Text to match against addon_info.tags()
static lg::log_domain log_help("help")
Standard logging facilities (interface).
const std::string unicode_bullet
Game configuration data as global variables.
std::vector< topic > generate_unit_topics(const bool sort_generated, const std::string &race)
std::string hidden_symbol(bool hidden)
void generate_unit_sections(const config *, section &sec, int, const bool, const std::string &race)
@ HIDDEN_BUT_SHOW_MACROS
Although the unit itself is hidden, traits reachable via this unit are not hidden.
@ NO_DESCRIPTION
Ignore this unit for documentation purposes.
void generate_races_sections(const config *help_cfg, section &sec, int level)
bool topic_is_referenced(const std::string &topic_id, const config &cfg)
Return true if the topic with id topic_id is referenced from another section in the config,...
std::vector< topic > generate_time_of_day_topics(const bool)
void generate_terrain_sections(section &sec, int)
std::string make_unit_link(const std::string &type_id)
return a hyperlink with the unit's name and pointing to the unit page return empty string if this uni...
const std::string unit_prefix
const std::string variation_prefix
void parse_config_internal(const config *help_cfg, const config *section_cfg, section &sec, int level)
Recursive function used by parse_config.
bool is_visible_id(const std::string &id)
std::vector< topic > generate_faction_topics(const config &era, const bool sort_generated)
void generate_sections(const config *help_cfg, const std::string &generator, section &sec, int level)
Dispatch generators to their appropriate functions.
UNIT_DESCRIPTION_TYPE description_type(const unit_type &type)
Return the type of description that should be shown for a unit of the given kind.
const std::string race_prefix
const std::string ability_prefix
std::vector< std::string > make_unit_links_list(const std::vector< std::string > &type_id_list, bool ordered)
return a list of hyperlinks to unit's pages (ordered or not)
std::vector< topic > generate_topics(const bool sort_generated, const std::string &generator)
const section * find_section(const section &sec, const std::string &id)
Search for the section with the specified identifier in the section and its subsections.
static std::string time_of_day_bonus_colored(const int time_of_day_bonus)
const std::string terrain_prefix
std::vector< topic > generate_weapon_special_topics(const bool sort_generated)
std::vector< topic > generate_ability_topics(const bool sort_generated)
const std::string unknown_unit_topic
const int max_section_level
bool section_is_referenced(const std::string §ion_id, const config &cfg)
Return true if the section with id section_id is referenced from another section in the config,...
std::shared_ptr< terrain_type_data > load_terrain_types_data()
Load the appropriate terrain types data to use.
bool is_valid_id(const std::string &id)
Return true if the id is valid for user defined topics and sections.
std::string generate_contents_links(const std::string §ion_name, config const *help_cfg)
std::string generate_topic_text(const std::string &generator, const config *help_cfg, const section &sec)
const topic * find_topic(const section &sec, const std::string &id)
Search for the topic with the specified identifier in the section and its subsections.
section parse_config(const config *cfg)
Parse a help config, return the top level section.
std::vector< topic > generate_era_topics(const bool sort_generated, const std::string &era_id)
std::vector< topic > generate_trait_topics(const bool sort_generated)
const std::string default_show_topic
std::pair< section, section > generate_contents()
Generate the help contents from the configurations given to the manager.
void generate_era_sections(const config *help_cfg, section &sec, int level)
const std::string era_prefix
const std::string faction_prefix
bool is_scope_active(scope s)
Functions to load and save images from/to disk.
std::string img(const std::string &src, const std::string &align, bool floating)
Generates a Help markup tag corresponding to an image.
std::string make_link(const std::string &text, const std::string &dst)
Generates a Help markup tag corresponding to a reference or link.
std::string span_color(const color_t &color, Args &&... data)
Applies Pango markup to the input specifying its display color.
std::string tag(std::string_view tag, Args &&... data)
Wraps the given data in the specified tag.
config parse_text(const std::string &text)
Parse a xml style marked up text string.
rng * generator
This generator is automatically synced during synced context.
::tod_manager * tod_manager
std::vector< terrain_code > ter_list
int compare(const std::string &s1, const std::string &s2)
Case-sensitive lexicographical comparison.
@ STRIP_SPACES
REMOVE_EMPTY: remove empty elements.
std::vector< std::string > quoted_split(const std::string &val, char c, int flags, char quote)
This function is identical to split(), except it does not split when it otherwise would if the previo...
bool contains(const Container &container, const Value &value)
Returns true iff value is found in container.
std::string join(const T &v, const std::string &s=",")
Generates a new string joining container items in a list.
std::map< std::string, t_string > string_map
std::vector< std::string > split(const config_attribute_value &val)
auto * find(Container &container, const Value &value)
Convenience wrapper for using find on a container without needing to comare to end()
std::string::const_iterator iterator
Thrown when the help system fails to parse something.
A section contains topics and sections along with title and ID.
bool operator<(const section &) const
Comparison on the ID.
void add_section(const section &s)
Allocate memory for and add the section.
bool operator==(const section &) const
Two sections are equal if their IDs are equal.
A topic contains a title, an id and some text.
bool operator==(const topic &) const
Two topics are equal if their IDs are equal.
bool operator<(const topic &) const
Comparison on the ID.
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
Object which defines a time of day with associated bonuses, image, sounds etc.
static map_location::direction s
unit_type_data unit_types