16 #define GETTEXT_DOMAIN "wesnoth-help" 42 #define WRN_HP LOG_STREAM(warn, log_help) 43 #define DBG_HP LOG_STREAM(debug, log_help) 64 std::string lang_policy = (best ?
_(
"Best of") :
_(
"Worst of"));
65 std::string color_policy = (best ?
"green":
"red");
67 return "<format>color='" + color_policy +
"' text='" + lang_policy +
"'</format>";
70 typedef t_translation::ter_list::const_iterator
ter_iter;
72 static std::string
print_behavior_description(ter_iter
start, ter_iter end,
const std::shared_ptr<terrain_type_data> & tdata,
bool first_level =
true,
bool begin_best =
true)
75 if (start == end)
return "";
78 std::optional<ter_iter> last_change_pos;
80 bool best = begin_best;
81 for (ter_iter
i = start;
i != end; ++
i) {
90 if (!last_change_pos) {
91 std::vector<std::string>
names;
92 for (ter_iter
i = start;
i != end; ++
i) {
98 if (names.empty())
return "";
99 if (names.size() == 1)
return names.at(0);
102 if (!first_level) ss <<
"( ";
105 for (std::size_t
i = 1;
i < names.size();
i++) {
106 ss <<
", " << names.at(
i);
109 if (!first_level) ss <<
" )";
111 std::vector<std::string>
names;
112 for (ter_iter
i = *last_change_pos+1;
i != end; ++
i) {
123 if (!first_level) ss <<
"( ";
126 for (
const std::string &
s : names) {
129 if (!first_level) ss <<
" )";
135 std::stringstream ss;
137 if (!type_.icon_image().empty())
138 ss <<
"<img>src='images/buttons/icon-base-32.png~RC(magenta>" << type_.id()
139 <<
")~BLIT("<<
"terrain/" << type_.icon_image() <<
"_30.png)" <<
"'</img> ";
141 if (!type_.editor_image().empty())
142 ss <<
"<img>src='" << type_.editor_image() <<
"'</img> ";
144 if (!type_.help_topic_text().empty())
145 ss <<
"\n\n" << type_.help_topic_text().str() <<
"\n";
152 WRN_HP <<
"When building terrain help topics, we couldn't acquire any terrain types data";
158 std::vector<std::string> special_notes;
160 if(type_.is_village()) {
161 special_notes.push_back(
_(
"Villages allow any unit stationed therein to heal, or to be cured of poison."));
162 }
else if(type_.gives_healing() > 0) {
163 auto symbols =
utils::string_map{{
"amount", std::to_string(type_.gives_healing())}};
166 auto message =
VNGETTEXT(
"This terrain allows units to be cured of poison, or to heal a single hitpoint.",
167 "This terrain allows units to heal $amount hitpoints, or to be cured of poison, as if stationed in a village.",
168 type_.gives_healing(), symbols);
169 special_notes.push_back(std::move(message));
172 if(type_.is_castle()) {
173 special_notes.push_back(
_(
"This terrain is a castle — units can be recruited onto it from a connected keep."));
175 if(type_.is_keep() && type_.is_castle()) {
177 special_notes.push_back(
_(
"This terrain is a keep — a leader can recruit from this hex onto connected castle hexes."));
178 }
else if(type_.is_keep() && !type_.is_castle()) {
180 special_notes.push_back(
_(
"This unusual keep allows a leader to recruit while standing on it, but does not allow a leader on a connected keep to recruit onto this hex."));
183 if(!special_notes.empty()) {
184 ss <<
"\n" <<
_(
"Special Notes:") <<
'\n';
185 for(
const auto& note : special_notes) {
192 if (!type_.is_indivisible()) {
193 ss <<
"\n" <<
_(
"Base Terrain: ");
196 for (
const auto& underlying_terrain : type_.union_type()) {
197 const terrain_type& base = tdata->get_terrain_info(underlying_terrain);
213 ss <<
"\n" <<
_(
"Movement properties: ");
217 ss <<
"\n" <<
_(
"Defense properties: ");
224 ss <<
"ID: " << type_.id() <<
"\n";
226 ss <<
"Village: " << (type_.is_village() ?
"Yes" :
"No") <<
"\n";
227 ss <<
"Gives Healing: " << type_.gives_healing() <<
"\n";
229 ss <<
"Keep: " << (type_.is_keep() ?
"Yes" :
"No") <<
"\n";
230 ss <<
"Castle: " << (type_.is_castle() ?
"Yes" :
"No") <<
"\n";
232 ss <<
"Overlay: " << (type_.is_overlay() ?
"Yes" :
"No") <<
"\n";
233 ss <<
"Combined: " << (type_.is_combined() ?
"Yes" :
"No") <<
"\n";
234 ss <<
"Nonnull: " << (type_.is_nonnull() ?
"Yes" :
"No") <<
"\n";
236 ss <<
"Terrain string: " << type_.number() <<
"\n";
238 ss <<
"Hide in Editor: " << (type_.hide_in_editor() ?
"Yes" :
"No") <<
"\n";
239 ss <<
"Editor Group: " << type_.editor_group() <<
"\n";
241 ss <<
"Light Bonus: " << type_.light_bonus(0) <<
"\n";
243 ss << type_.income_description();
245 if (type_.editor_image().empty()) {
246 ss <<
"\nEditor Image: Empty\n";
248 ss <<
"\nEditor Image: " << type_.editor_image() <<
"\n";
252 ss <<
"\nDebug Mvt Description String:";
258 ss <<
"\nDebug Def Description String:";
277 ss <<
make_link(l[i].first, l[i].second);
280 for(i++; i < l.size(); i++) {
281 ss <<
", " <<
make_link(l[i].first,l[i].second);
289 std::stringstream ss;
290 std::string clear_stringstream;
291 const std::string detailed_description = type_.unit_description();
297 ss <<
_(
"Level") <<
" " << type_.level();
300 ss <<
"<img>src='" << male_type.
image();
301 ss <<
"~RC(" << male_type.
flag_rgb() <<
">red)";
302 if (screen_width >= 1200) ss <<
"~XBRZ(2)";
303 ss <<
"' box='no'</img> ";
306 if (&female_type != &male_type) {
307 ss <<
"<img>src='" << female_type.
image();
308 ss <<
"~RC(" << female_type.
flag_rgb() <<
">red)";
309 if (screen_width >= 1200) ss <<
"~XBRZ(2)";
310 ss <<
"' box='no'</img> ";
313 const std::string &male_portrait = male_type.
small_profile().empty() ?
315 const std::string &female_portrait = female_type.
small_profile().empty() ?
318 const bool has_male_portrait = !male_portrait.empty() && male_portrait != male_type.
image() && male_portrait !=
"unit_image";
319 const bool has_female_portrait = !female_portrait.empty() && female_portrait != male_portrait && female_portrait != female_type.
image() && female_portrait !=
"unit_image";
321 int sz = (has_male_portrait && has_female_portrait ? 300 : 400);
322 if (screen_width <= 1366) {
323 sz = (has_male_portrait && has_female_portrait ? 200 : 300);
324 }
else if (screen_width >= 1920) {
329 if (has_male_portrait) {
330 ss <<
"<img>src='" << male_portrait <<
"~FL(horiz)~SCALE_INTO(" << sz <<
',' << sz <<
")' box='no' align='right' float='yes'</img> ";
334 if (has_female_portrait) {
335 ss <<
"<img>src='" << female_portrait <<
"~FL(horiz)~SCALE_INTO(" << sz <<
',' << sz <<
")' box='no' align='right' float='yes'</img> ";
342 const bool first_reverse_value =
true;
343 bool reverse = first_reverse_value;
344 if (variation_.empty()) {
346 std::vector<std::string> adv_units =
347 reverse ? type_.advances_from() : type_.advances_to();
350 for (
const std::string &adv : adv_units) {
358 ss <<
_(
"Advances from: ");
360 ss <<
_(
"Advances to: ");
367 std::string lang_unit = type->
type_name();
383 }
while(reverse != first_reverse_value);
386 const unit_type* parent = variation_.empty() ? &type_ :
388 if (!variation_.empty()) {
392 for (
const std::string& base_id :
utils::split(type_.get_cfg()[
"base_ids"])) {
394 ss <<
_(
"Base units: ");
404 for (
const std::string &var_id : parent->
variations()) {
412 ss <<
_(
"Variations: ");
433 const std::string race_id = type_.race_id();
434 std::string race_name = type_.race()->plural_name();
435 if (race_name.empty()) {
436 race_name =
_ (
"race^Miscellaneous");
439 ss <<
make_link(race_name,
"..race_" + race_id);
445 std::vector<trait_data> must_have_traits;
446 std::vector<trait_data> random_traits;
447 int must_have_nameless_traits = 0;
449 for(
const config& trait : traits) {
450 const std::string& male_name = trait[
"male_name"].str();
451 const std::string& female_name = trait[
"female_name"].str();
452 std::string trait_name;
453 if (type_.has_gender_variation(
unit_race::MALE) && ! male_name.empty())
454 trait_name = male_name;
456 trait_name = female_name;
457 else if (! trait[
"name"].str().empty())
458 trait_name = trait[
"name"].str();
463 if (lang_trait_name.empty() && trait[
"availability"].str() ==
"musthave") {
464 ++must_have_nameless_traits;
467 const std::string ref_id =
"traits_"+trait[
"id"].str();
468 ((trait[
"availability"].str() ==
"musthave") ? must_have_traits : random_traits).emplace_back(lang_trait_name, ref_id);
471 bool line1 = !must_have_traits.empty();
472 bool line2 = !random_traits.empty() && type_.num_traits() > must_have_traits.size();
475 std::string traits_label =
_(
"Traits");
478 std::stringstream must_have_count;
479 must_have_count <<
" (" << must_have_traits.size() <<
") : ";
480 std::stringstream random_count;
481 random_count <<
" (" << (type_.num_traits() - must_have_traits.size() - must_have_nameless_traits) <<
") : ";
487 ss << must_have_count.str();
489 ss <<
"\n" <<
jump(second_line_whitespace) << random_count.str();
498 ss <<
_(
"Traits") <<
" (" << (type_.num_traits() - must_have_nameless_traits) <<
") : ";
507 if(!type_.abilities_metadata().empty()) {
508 ss <<
_(
"Abilities: ");
512 for(
auto iter = type_.abilities_metadata().begin(); iter != type_.abilities_metadata().end(); ++iter) {
513 const std::string ref_id =
ability_prefix + iter->id + iter->name.base_str();
515 if(iter->name.empty()) {
533 if(!type_.adv_abilities_metadata().empty()) {
534 ss <<
_(
"Ability Upgrades: ");
538 for(
auto iter = type_.adv_abilities_metadata().begin(); iter != type_.adv_abilities_metadata().end(); ++iter) {
539 const std::string ref_id =
ability_prefix + iter->id + iter->name.base_str();
541 if(iter->name.empty()) {
569 if (type_.vision() != type_.movement()) {
575 if (type_.jamming() > 0) {
589 <<
make_link(type_.alignment_description(type_.alignment(), type_.genders().front()),
"time_of_day")
591 if (type_.can_advance() || type_.modification_advancements()) {
595 ss <<
_(
"Required\u00a0XP:") <<
font::nbsp << type_.experience_needed();
599 ss <<
"\n\n" << detailed_description;
600 if(
const auto notes = type_.special_notes(); !notes.empty()) {
601 ss <<
"\n\n" <<
_(
"Special Notes:") <<
'\n';
602 for(
const auto& note : notes) {
608 const auto padding = 4;
611 if (!type_.attacks().empty()) {
613 ss <<
"\n\n<header>text='" <<
escape(
_(
"unit help^Attacks"))
617 std::vector<item> first_row;
619 first_row.push_back(
item(
"", 0));
620 push_header(first_row,
_(
"unit help^Name"));
621 push_header(first_row,
_(
"Strikes"));
622 push_header(first_row,
_(
"Range"));
623 push_header(first_row,
_(
"Type"));
624 push_header(first_row,
_(
"Special"));
625 table.push_back(first_row);
628 std::string lang_weapon = attack.name();
629 std::string lang_type =
string_table[
"type_" + attack.type()];
630 std::vector<item> row;
631 std::stringstream attack_ss;
634 attack_ss <<
"<img>src='" << attack.icon() <<
"'</img>";
635 row.emplace_back(attack_ss.str(),
image_width(attack.icon()));
636 attack_ss.str(clear_stringstream);
643 <<
" " << attack.accuracy_parry_description();
645 attack_ss.str(clear_stringstream);
648 const std::string range_icon =
"icons/profiles/" + attack.range() +
"_attack.png~SCALE_INTO(16,16)";
649 if (attack.min_range() > 1 || attack.max_range() > 1) {
650 attack_ss << attack.min_range() <<
"-" << attack.max_range() <<
' ';
654 attack_ss.str(clear_stringstream);
657 const std::string type_icon =
"icons/profiles/" + attack.type() +
".png~SCALE_INTO(16,16)";
662 std::vector<std::pair<t_string, t_string>> specials = attack.special_tooltips();
663 if (!specials.empty()) {
664 std::string lang_special =
"";
665 const std::size_t specials_size = specials.size();
666 for (std::size_t
i = 0;
i != specials_size; ++
i) {
667 const std::string ref_id = std::string(
"weaponspecial_")
668 + specials[
i].first.base_str();
669 lang_special = (specials[
i].first);
670 attack_ss <<
make_link(lang_special, ref_id);
671 if (
i+1 != specials_size) {
677 table.push_back(row);
683 movetype movement_type = type_.movement_type();
685 if (!traits.empty() && type_.num_traits() > 0) {
686 for (
const config &
t : traits) {
687 if (
t[
"availability"].str() ==
"musthave") {
688 for (
const config & effect :
t.child_range(
"effect")) {
689 if (!effect.child(
"filter")
691 movement_type.
merge(effect, effect[
"replace"].to_bool());
699 ss <<
"\n\n<header>text='" <<
escape(
_(
"Resistances"))
702 std::vector<item> first_res_row;
703 push_header(first_res_row,
_(
"Attack Type"));
704 push_header(first_res_row,
_(
"Resistance"));
705 resistance_table.push_back(first_res_row);
707 for(std::pair<std::string, std::string> dam_it : dam_tab) {
708 std::vector<item> row;
709 int resistance = 100;
711 resistance -= std::stoi(dam_it.second);
712 }
catch(std::invalid_argument&) {}
713 std::string resist = std::to_string(resistance) +
'%';
714 const std::size_t pos = resist.find(
'-');
715 if (pos != std::string::npos) {
719 const std::string lang_type =
string_table[
"type_" + dam_it.first];
720 const std::string type_icon =
"icons/profiles/" + dam_it.first +
".png~SCALE_INTO(16,16)";
722 std::stringstream str;
723 str <<
"<format>color=\"" << color <<
"\" text='"<< resist <<
"'</format>";
724 const std::string markup = str.str();
725 str.str(clear_stringstream);
728 resistance_table.push_back(row);
734 ss <<
"\n\n<header>text='" <<
escape(
_(
"Terrain Modifiers"))
736 std::vector<item> first_row;
738 push_header(first_row,
_(
"Terrain"));
739 push_header(first_row,
_(
"Defense"));
740 push_header(first_row,
_(
"Movement Cost"));
743 if (has_terrain_defense_caps) {
744 push_header(first_row,
_(
"Defense Cap"));
747 const bool has_vision = type_.movement_type().has_vision_data();
749 push_header(first_row,
_(
"Vision Cost"));
751 const bool has_jamming = type_.movement_type().has_jamming_data();
753 push_header(first_row,
_(
"Jamming Cost"));
756 table.push_back(first_row);
758 std::set<terrain_movement_info> terrain_moves;
766 const bool cannot_move = moves > type_.movement();
783 terrain_moves.insert(movement_info);
789 std::vector<item> row;
791 bool high_res =
false;
792 const std::string tc_base = high_res ?
"images/buttons/icon-base-32.png" :
"images/buttons/icon-base-16.png";
793 const std::string terrain_image =
"icons/terrain/terrain_type_" + m.id + (high_res ?
"_30.png" :
".png");
795 const std::string final_image = tc_base +
"~RC(magenta>" + m.id +
")~BLIT(" + terrain_image +
")";
797 row.emplace_back(
"<img>src='" + final_image +
"'</img> " +
805 std::stringstream str;
806 std::stringstream str_unformatted;
807 str <<
"<format>color='" << color <<
"' text='"<< m.defense <<
"%'</format>";
808 str_unformatted << m.defense <<
"%";
812 str.str(clear_stringstream);
813 str_unformatted.str(clear_stringstream);
814 const bool cannot_move = m.movement_cost > type_.movement();
815 double movement_red_to_green = 100.0 - 25.0 * m.movement_cost;
819 str <<
"<format>color='" << movement_color <<
"' text='";
822 if(cannot_move && (m.movement_cost > type_.movement() + 5)) {
824 }
else if(cannot_move) {
825 str_unformatted <<
"(" << m.movement_cost <<
")";
827 str_unformatted << m.movement_cost;
829 if(m.movement_cost != 0) {
830 const int movement_hexes_per_turn = type_.movement() / m.movement_cost;
831 str_unformatted <<
" ";
832 for(
int i = 0;
i < movement_hexes_per_turn; ++
i) {
834 str_unformatted <<
"\u2b23\u200b";
837 str << str_unformatted.str() <<
"'</format>";
841 if (has_terrain_defense_caps) {
842 str.str(clear_stringstream);
843 str_unformatted.str(clear_stringstream);
845 str <<
"<format>color='"<< color <<
"' text='" << m.defense <<
"%'</format>";
846 str_unformatted << m.defense <<
"%";
856 str.str(clear_stringstream);
857 str_unformatted.str(clear_stringstream);
858 const bool cannot_view = m.vision_cost > type_.vision();
859 double vision_red_to_green = 100.0 - 25.0 * m.vision_cost;
863 str <<
"<format>color='" << vision_color <<
"' text='";
866 if(cannot_view && (m.vision_cost > type_.vision() + 5)) {
868 }
else if(cannot_view) {
869 str_unformatted <<
"(" << m.vision_cost <<
")";
871 str_unformatted << m.vision_cost;
873 if(m.vision_cost != 0) {
874 const int vision_hexes_per_turn = type_.vision() / m.vision_cost;
875 str_unformatted <<
" ";
876 for(
int i = 0;
i < vision_hexes_per_turn; ++
i) {
878 str_unformatted <<
"\u2b23\u200b";
881 str << str_unformatted.str() <<
"'</format>";
887 str.str(clear_stringstream);
888 str_unformatted.str(clear_stringstream);
889 const bool cannot_jam = m.jamming_cost > type_.jamming();
890 double jamming_red_to_green = 100.0 - 25.0 * m.jamming_cost;
894 str <<
"<format>color='" << jamming_color <<
"' text='";
897 if (cannot_jam && m.jamming_cost > type_.jamming() + 5) {
899 }
else if(cannot_jam) {
900 str_unformatted <<
"(" << m.jamming_cost <<
")";
902 str_unformatted << m.jamming_cost;
904 if(m.jamming_cost != 0) {
905 const int jamming_hexes_per_turn = type_.jamming() / m.jamming_cost;
906 str_unformatted <<
" ";
907 for(
int i = 0;
i < jamming_hexes_per_turn; ++
i) {
909 str_unformatted <<
"\u2b23\u200b";
912 str << str_unformatted.str() <<
"'</format>";
916 table.push_back(row);
921 WRN_HP <<
"When building unit help topics, the display object was null and we couldn't get the terrain info we need.";
int defense_modifier(const t_translation::terrain_code &terrain) const
Returns the defensive value of the indicated terrain.
int vision_cost(const t_translation::terrain_code &terrain, bool slowed=false) const
Returns the cost to see through the indicated terrain.
const std::string ability_prefix
bool operator<(const terrain_movement_info &other) const
const std::string unit_prefix
void push_tab_pair(std::vector< help::item > &v, const std::string &s, const std::optional< std::string > &image, unsigned padding)
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.
std::map< std::string, t_string > string_map
static lg::log_domain log_help("help")
const std::string unknown_unit_topic
const std::string & big_profile() const
virtual std::string operator()() const
bool terrain_matches(const terrain_code &src, const terrain_code &dest)
Tests whether a specific terrain matches an expression, for matching rules see above.
const std::string & flag_rgb() const
A terrain string which is converted to a terrain is a string with 1 or 2 layers the layers are separa...
unit_type_data unit_types
static bool is_indivisible(t_translation::terrain_code id, const t_translation::ter_list &underlying)
Returns true if a terrain has no underlying types other than itself, in respect of either union...
const int normal_font_size
void merge(const config &new_cfg, bool overwrite=true)
Merges the given config over the existing data, the config should have zero or more children named "m...
The basic "size" of the unit - flying, small land, large land, etc.
bool capped(const t_translation::terrain_code &terrain) const
Returns whether there is a defense cap associated to this terrain.
unsigned image_width(const std::string &filename)
static std::string _(const char *str)
const std::string terrain_prefix
int jamming_cost(const t_translation::terrain_code &terrain, bool slowed=false) const
Returns the cost to "jam" through the indicated terrain.
std::string bold(const std::string &s)
A single unit type that the player may recruit.
bool is_nonnull() const
True if this object represents some sentinel values.
const terrain_code VOID_TERRAIN
VOID_TERRAIN is used for shrouded hexes.
void build_unit_type(const unit_type &ut, unit_type::BUILD_STATUS status) const
Makes sure the provided unit_type is built to the specified level.
static std::string best_str(bool best)
const t_string & editor_name() const
const std::string unicode_minus
std::string generate_table(const table_spec &tab, const unsigned int spacing)
std::vector< std::vector< help::item > > table_spec
std::shared_ptr< terrain_type_data > load_terrain_types_data()
Load the appropriate terrain types data to use.
const terrain_code FOGGED
EXIT_STATUS start(const std::string &filename, bool take_screenshot, const std::string &screenshot_filename)
Main interface for launching the editor from the title screen.
bool hide_if_impassable() const
const t_string & type_name() const
The name of the unit in the current language setting.
terrain_defense & get_defense()
static const std::set< std::string > effects
The set of applicable effects for movement types.
virtual std::string operator()() const
void push_header(std::vector< help::item > &row, const std::string &name) const
std::set< t_translation::terrain_code > & encountered_terrains()
t_translation::ter_list::const_iterator ter_iter
std::map< std::string, t_string, res_compare > string_map_res
const std::string & id() const
The id for this unit_type.
const std::string unicode_figure_dash
boost::iterator_range< const_child_iterator > const_child_itors
static void print_trait_list(std::stringstream &ss, const std::vector< trait_data > &l)
static std::string gettext(const char *str)
const std::string variation_prefix
std::vector< std::string > variations() const
std::string resistance_color(const int resistance)
Maps resistance <= -60 (resistance value <= -60%) to intense red.
std::string make_link(const std::string &text, const std::string &dst)
static map_location::DIRECTION s
bool show_variations_in_help() const
Whether the unit type has at least one help-visible variation.
std::vector< std::string > names
std::string to_hex_string() const
Returns the stored color in rrggbb hex format.
point game_canvas_size()
The size of the game canvas, in drawing coordinates / game pixels.
unsigned screen_width
The screen resolution and pixel pitch should be available for all widgets since their drawing method ...
const std::string unicode_bullet
const std::string & small_profile() const
std::string escape(const std::string &s)
Prepend all chars with meaning inside attributes with a backslash.
int movement_cost(const t_translation::terrain_code &terrain, bool slowed=false) const
Returns the cost to move through the indicated terrain.
const t_string & name() const
const std::string & image() const
std::string jump(const unsigned amount)
const ter_match ALL_OFF_MAP
const std::string weapon_numbers_sep
const unit_type & get_variation(const std::string &id) const
std::vector< std::string > split(const config_attribute_value &val)
static std::string print_behavior_description(ter_iter start, ter_iter end, const std::shared_ptr< terrain_type_data > &tdata, bool first_level=true, bool begin_best=true)
int icompare(const std::string &s1, const std::string &s2)
Case-insensitive lexicographical comparison.
symbol_table string_table
const t_string & variation_name() const
Standard logging facilities (interface).
const std::string & id() const
std::vector< terrain_code > ter_list
utils::string_map_res damage_table() const
Returns a map from attack types to resistances.
const unit_type & get_gender_unit_type(std::string gender) const
Returns a gendered variant of this unit_type.
color_t red_to_green(double val, bool for_text)
Return a color corresponding to the value val red for val=0.0 to green for val=100.0, passing by yellow.
A config object defines a single node in a WML file, with access to child nodes.
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. ...
Transitional API for porting SDL_ttf-based code to Pango.
std::pair< std::string, std::string > trait_data
std::pair< std::string, unsigned > item
bool has_terrain_defense_caps(const std::set< t_translation::terrain_code > &ts) const
Returns whether or not there are any terrain caps with respect to a set of terrains.
int pango_line_width(const std::string &line, int font_size, font::pango_text::FONT_STYLE font_style=font::pango_text::STYLE_NORMAL)
Determine the width of a line of text given a certain font size.