Unit Preview Pane: Make minimal definitions work for unit types
This commit is contained in:
parent
3a183cca3a
commit
f24a0307b9
1 changed files with 22 additions and 0 deletions
|
@ -280,6 +280,28 @@ void unit_preview_pane::set_displayed_type(const unit_type& type)
|
|||
type.genders().front()));
|
||||
}
|
||||
|
||||
if(label_details_) {
|
||||
std::stringstream str;
|
||||
|
||||
str << "<span size='large'> </span>" << "\n";
|
||||
|
||||
str << "<span color='#a69275'>" << type.type_name() << "</span>" << "\n";
|
||||
|
||||
std::string l_str = vgettext("Lvl $lvl", {{"lvl", std::to_string(type.level())}});
|
||||
str << l_str << "\n";
|
||||
|
||||
str << type.alignment() << "\n";
|
||||
|
||||
str << "\n"; // Leave a blank line where traits would be
|
||||
|
||||
str << _("HP: ") << type.hitpoints() << "\n";
|
||||
|
||||
str << _("XP: ") << type.experience_needed(true);
|
||||
|
||||
label_details_->set_label(str.str());
|
||||
label_details_->set_use_markup(true);
|
||||
}
|
||||
|
||||
if(tree_details_) {
|
||||
|
||||
tree_details_->clear();
|
||||
|
|
Loading…
Add table
Reference in a new issue