diff --git a/gui/builtinItemStatsViews/attributeGrouping.py b/gui/builtinItemStatsViews/attributeGrouping.py index c93e97010..6780c176c 100644 --- a/gui/builtinItemStatsViews/attributeGrouping.py +++ b/gui/builtinItemStatsViews/attributeGrouping.py @@ -207,8 +207,15 @@ AttrGroupDict = { "fighterSquadronOrbitRange", ] }, + GuiAttrGroup.SHIP_GROUP : { + "label" : "Can Fit To", + "attributes": [] + }, } +AttrGroupDict[GuiAttrGroup.SHIP_GROUP]["attributes"].extend([("canFitShipGroup{:02d}".format(i+1), "Group") for i in range(20)]) +AttrGroupDict[GuiAttrGroup.SHIP_GROUP]["attributes"].extend([("canFitShipType{:01d}".format(i+1), "Ship") for i in range(20)]) + Group1 = [ GuiAttrGroup.FITTING, GuiAttrGroup.STRUCTURE, @@ -222,6 +229,7 @@ Group1 = [ GuiAttrGroup.ON_DEATH, GuiAttrGroup.JUMP_SYSTEMS, GuiAttrGroup.PROPULSIONS, + GuiAttrGroup.SHIP_GROUP ] CategoryGroups = { diff --git a/gui/builtinItemStatsViews/itemAttributes.py b/gui/builtinItemStatsViews/itemAttributes.py index 20065b6b0..558762d70 100644 --- a/gui/builtinItemStatsViews/itemAttributes.py +++ b/gui/builtinItemStatsViews/itemAttributes.py @@ -173,9 +173,15 @@ class ItemParams(wx.Panel): self.paramList.AssignImageList(self.imageList) def AddAttribute(self, parent, attr): + display = None + + if isinstance(attr, tuple): + display = attr[1] + attr = attr[0] + if attr in self.attrValues and attr not in self.processed_attribs: - data = self.GetData(attr) + data = self.GetData(attr, display) if data is None: return @@ -203,7 +209,7 @@ class ItemParams(wx.Panel): misc_parent = root # We must first deet4ermine if it's categorey already has defined groupings set for it. Otherwise, we default to just using the fitting group - order = CategoryGroups.get(self.item.category.categoryName, [GuiAttrGroup.FITTING]) + order = CategoryGroups.get(self.item.category.categoryName, [GuiAttrGroup.FITTING, GuiAttrGroup.SHIP_GROUP]) # start building out the tree for data in [AttrGroupDict[o] for o in order]: heading = data.get("label") @@ -257,6 +263,8 @@ class ItemParams(wx.Panel): self.paramList.SetColumnWidth(i, wx.LIST_AUTOSIZE) def GetData(self, attr): + + def GetData(self, attr, displayOveride = None): info = self.attrInfo.get(attr) att = self.attrValues[attr] @@ -275,7 +283,7 @@ class ItemParams(wx.Panel): return None if info and info.displayName and self.toggleView == AttributeView.NORMAL: - attrName = info.displayName + attrName = displayOveride or info.displayName else: attrName = attr diff --git a/service/const.py b/service/const.py index 1f83b38a9..d09d809f6 100644 --- a/service/const.py +++ b/service/const.py @@ -101,3 +101,4 @@ class GuiAttrGroup(IntEnum): JUMP_SYSTEMS = auto() PROPULSIONS = auto() FIGHTERS = auto() + SHIP_GROUP = auto() \ No newline at end of file