Redesign of the ship browser, its a lot cleaner and extensible now

This commit is contained in:
cncfanatics
2010-10-27 12:14:00 +02:00
parent cf27b102b4
commit 51cfe23f41
4 changed files with 299 additions and 393 deletions

View File

@@ -52,7 +52,10 @@ class AttributeDisplay(ViewColumn):
self.columnText = info.displayName if info.displayName != "" else info.name
def getText(self, mod):
attr = mod.getModifiedItemAttr(self.info.name)
if hasattr(mod, "item"):
attr = mod.getModifiedItemAttr(self.info.name)
else:
attr = mod.getAttribute(self.info.name)
if attr:
return (formatAmount(attr, 3, 0, 3))
else:
@@ -66,4 +69,4 @@ class AttributeDisplay(ViewColumn):
("displayName", bool, False),
("showIcon", bool, True))
AttributeDisplay.register()
AttributeDisplay.register()