From 3c289e3e068792d665cf6c27e7c9417c094a6309 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 22 Oct 2010 07:08:05 +0200 Subject: [PATCH] Item Stats fix, still hacky though, needs more work --- gui/itemStats.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gui/itemStats.py b/gui/itemStats.py index b2ec7c6ec..db1b8303f 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -253,12 +253,8 @@ 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.extend(("mass", "capacity", "volume")) names.sort() idNameMap = {} @@ -266,9 +262,12 @@ class ItemParams (wx.Panel): for name in names: info = attrsInfo.get(name) - att = attrs[name] - val = getattr(att, "value", None) - value = val if val is not None else att + if name in ("mass", "capacity", "volume"): + value = getattr(self.item, name, 0) + else: + att = attrs[name] + val = getattr(att, "value", None) + value = val if val is not None else att if self.toggleView != 1: attrName = name