Include the new-style special notes in the sidebar's unit description

This commit is contained in:
Steve Cotton 2021-05-26 09:54:59 +02:00 committed by Steve Cotton
parent eec7bc7c8f
commit ecf993174b
2 changed files with 7 additions and 0 deletions

View file

@ -13,6 +13,7 @@
### User interface
### WML Engine
### Miscellaneous and Bug Fixes
* The unit description tooltip in the sidebar now includes the text from `[special_note]`s.
## Version 1.15.13
### Add-ons client

View file

@ -192,6 +192,12 @@ static config unit_type(const unit* u)
str << u->type_name();
tooltip << _("Type: ") << "<b>" << u->type_name() << "</b>\n"
<< u->unit_description();
if(const auto& notes = u->unit_special_notes(); !notes.empty()) {
tooltip << "\n\n" << _("Special Notes:") << '\n';
for(const auto& note : notes) {
tooltip << "" << note << '\n';
}
}
return text_report(str.str(), tooltip.str(), has_variations_prefix + "unit_" + u->type_id());
}
REPORT_GENERATOR(unit_type, rc)