From 667f9a2f112624d9b141c79a628fdc558ed13a4d Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Sat, 12 Aug 2017 23:02:07 -0400 Subject: [PATCH] wmlunits: Fix portrait logic [portrait] was an implementation detail of an early version of the GUI2 [message] dialog back in 1.5.x and it was supposed to go away shortly after the experimentation stage, according to mordante, and especially after ~RIGHT() was implemented. For some bizarre reason, units.w.o has been relying on this tag all along, meaning that many UMC unit portraits, and all mainline portraits since a 1.13.x release are no longer displayed because they are specified using the standard profile= attribute instead. --- data/tools/unit_tree/html_output.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data/tools/unit_tree/html_output.py b/data/tools/unit_tree/html_output.py index 05c13e9de60..0d5c71c3fbb 100644 --- a/data/tools/unit_tree/html_output.py +++ b/data/tools/unit_tree/html_output.py @@ -693,13 +693,11 @@ class HTMLOutput: u.get_text_val("id"), x.name.decode("utf8"))) return None, None image = self.wesnoth.get_unit_value(x, "image") - portrait = x.get_all(tag="portrait") + portrait = self.wesnoth.get_unit_value(x, "profile") if not portrait: bu = self.wesnoth.get_base_unit(u) if bu: - portrait = bu.get_all(tag="portrait") - if portrait: - portrait = portrait[0].get_text_val("image") + portrait = self.wesnoth.get_unit_value(bu, "profile") if not image: if x.name == b"female": baseunit = self.wesnoth.get_base_unit(u)