Change sorting of fighters - group up by sub-roles as well

This commit is contained in:
DarkPhoenix
2019-04-24 13:28:14 +03:00
parent 5d255547e4
commit 178e3a3d56
2 changed files with 11 additions and 5 deletions

View File

@@ -236,9 +236,15 @@ class FighterDisplay(d.Display):
FIGHTER_ORDER = ('Light Fighter', 'Heavy Fighter', 'Support Fighter')
def fighterKey(self, fighter):
sMkt = Market.getInstance()
groupName = sMkt.getGroupByItem(fighter.item).name
return (self.FIGHTER_ORDER.index(groupName), fighter.item.name)
groupName = Market.getInstance().getGroupByItem(fighter.item).name
orderPos = self.FIGHTER_ORDER.index(groupName)
# Sort support fighters by name, ignore their abilities
if groupName == 'Support Fighter':
abilityEffectIDs = ()
# Group up fighters from various roles
else:
abilityEffectIDs = sorted(a.effectID for a in fighter.abilities)
return orderPos, abilityEffectIDs, fighter.item.name
def fitChanged(self, event):
sFit = Fit.getInstance()

View File

@@ -211,12 +211,12 @@ class Display(wx.ListCtrl):
colItem = self.GetItem(item, i)
oldText = colItem.GetText()
oldImageId = colItem.GetImage()
oldColour = colItem.GetBackgroundColour();
oldColour = colItem.GetBackgroundColour()
newText = col.getText(st)
if newText is False:
col.delayedText(st, self, colItem)
newText = "\u21bb"
newColour = self.columnBackground(colItem, st);
newColour = self.columnBackground(colItem, st)
newImageId = col.getImageId(st)