Ensure that in variations menu, items are sorted by name within the same meta group and meta level
This commit is contained in:
@@ -88,12 +88,13 @@ class ChangeItemToVariation(ContextMenu):
|
|||||||
|
|
||||||
# Sort items by metalevel, and group within that metalevel
|
# Sort items by metalevel, and group within that metalevel
|
||||||
items = list(self.variations)
|
items = list(self.variations)
|
||||||
|
# Sort all items by name first
|
||||||
|
items.sort(key=lambda x: x.name)
|
||||||
|
# Do not do any extra sorting for implants
|
||||||
if 'implantItem' in context:
|
if 'implantItem' in context:
|
||||||
# sort implants based on name
|
pass
|
||||||
items.sort(key=lambda x: x.name)
|
# Boosters don't have meta or anything concrete that we can rank by. Go by chance to inflict side effect
|
||||||
elif 'boosterItem' in context:
|
elif 'boosterItem' in context:
|
||||||
# boosters don't have meta or anything concrete that we can rank by. Go by chance to inflict side effect
|
|
||||||
items.sort(key=get_boosterrank)
|
items.sort(key=get_boosterrank)
|
||||||
else:
|
else:
|
||||||
# sort by group and meta level
|
# sort by group and meta level
|
||||||
|
|||||||
Reference in New Issue
Block a user