From 42181d63f3c9b75eff4f21fe7ae00b95608d92ed Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Thu, 21 Oct 2010 21:18:25 +0200 Subject: [PATCH] Expose mass, capacity & volume in item stats (raw for now, not pwetty) --- gui/itemStats.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gui/itemStats.py b/gui/itemStats.py index ad5051094..b2ec7c6ec 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -253,6 +253,11 @@ class ItemParams (wx.Panel): attrs = self.stuff.chargeModifiedAttributes if self.stuff is not None else self.item.attributes attrsInfo = self.item.attributes if self.stuff is None else self.stuff.charge.attributes + attrs["volume"] = self.item.volume + attrs["capacity"] = self.item.capacity + if self.item.mass != 0: + attrs["mass"] = self.item.mass + names = list(attrs.iterkeys()) names.sort() @@ -261,7 +266,9 @@ class ItemParams (wx.Panel): for name in names: info = attrsInfo.get(name) - value = attrs[name] if self.stuff is not None else attrs[name].value + att = attrs[name] + val = getattr(att, "value", None) + value = val if val is not None else att if self.toggleView != 1: attrName = name