From 7e2538a828a3a5ad6a3526ff1f133756f244f9eb Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Mon, 7 Aug 2017 02:36:54 -0400 Subject: [PATCH] wmlunits: Allow styling unit attributes in the unit tree view --- data/tools/unit_tree/html_output.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/data/tools/unit_tree/html_output.py b/data/tools/unit_tree/html_output.py index f00bb5e27d9b..a67bfcbb1c63 100644 --- a/data/tools/unit_tree/html_output.py +++ b/data/tools/unit_tree/html_output.py @@ -704,10 +704,16 @@ def uval(name): write('\n\n') write("
") - write("%s%s
" % (_("Cost: ", "wesnoth-help"), cost)) - write("%s%s
" % (_("HP: "), hp)) - write("%s%s
" % (_("MP: "), mp)) - write("%s%s
" % (_("XP: "), xp)) + + attributes = ( + (_("Cost: ", "wesnoth-help"), cost), + (_("HP: "), hp), + (_("XP: "), xp), + (_("MP: "), mp), + ) + + for attr_label, attr_value in attributes: + write('%s %s
' % (attr_label.strip(), attr_value)) # Write info about abilities. anames = self.get_abilities(u)