Skip to content

Commit

Permalink
wmlunits: Allow styling unit attributes in the unit tree view
Browse files Browse the repository at this point in the history
  • Loading branch information
irydacea committed Aug 7, 2017
1 parent ee66b96 commit 7e2538a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions data/tools/unit_tree/html_output.py
Expand Up @@ -704,10 +704,16 @@ def uval(name):

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)
Expand Down

0 comments on commit 7e2538a

Please sign in to comment.