wmlunits: Allow styling unit attributes in the unit tree view

This commit is contained in:
Ignacio R. Morelle 2017-08-07 02:36:54 -04:00
parent ee66b96025
commit 7e2538a828

View file

@ -704,10 +704,16 @@ class HTMLOutput:
write('</a>\n</div>\n')
write("<div class=\"attributes\">")
write("%s%s<br />" % (_("Cost: ", "wesnoth-help"), cost))
write("%s%s<br />" % (_("HP: "), hp))
write("%s%s<br />" % (_("MP: "), mp))
write("%s%s<br />" % (_("XP: "), xp))
attributes = (
(_("Cost: ", "wesnoth-help"), cost),
(_("HP: "), hp),
(_("XP: "), xp),
(_("MP: "), mp),
)
for attr_label, attr_value in attributes:
write('<span class="attribute-label">%s</span> <span class="attribute-value">%s</span><br />' % (attr_label.strip(), attr_value))
# Write info about abilities.
anames = self.get_abilities(u)