From 0fd98a0f440210f7b5cb7c4f8712c7a1126775c1 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Wed, 6 Oct 2010 13:58:23 +0300 Subject: [PATCH] Using attr.displayName resulted in a crash when viewing a ship stats (itemModifiedAttributes objects don't have displayName property ???), removed. Made sure we format values when viewing a ship stats --- gui/itemStats.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/itemStats.py b/gui/itemStats.py index 1e04cba2f..c3042ac4c 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -49,7 +49,7 @@ class ItemStatsDialog(wx.Dialog): if item.icon is not None: self.SetIcon(wx.IconFromBitmap(bitmapLoader.getBitmap(item.icon.iconFile, "pack"))) - self.SetTitle("Item Stats: %s" % item.name) + self.SetTitle("Stats: %s" % item.name) self.SetMinSize((500, 300)) self.SetSize((500, 300)) @@ -171,8 +171,8 @@ class ItemParams (wx.Panel): names.sort() for name in names: - index = self.paramList.InsertStringItem(sys.maxint, attrs[name].displayName.capitalize()) - self.paramList.SetStringItem(index, 1, str(attrs[name]) if stuff is not None else str(formatAmount(attrs[name].value, 3, 0, 0))) + index = self.paramList.InsertStringItem(sys.maxint, name) + self.paramList.SetStringItem(index, 1, str(formatAmount(attrs[name], 3, 0, 0)) if stuff is not None else str(formatAmount(attrs[name].value, 3, 0, 0))) self.paramList.RefreshRows() self.Layout()