Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions gui/builtinStatsViews/resourcesViewFull.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ def refreshPanel(self, fit):
labelTFT.SetForegroundColour(colorF)
labelUCP.SetForegroundColour(colorC)
labelTCP.SetForegroundColour(colorC)
labelUCP.Refresh()
labelTCP.Refresh()

if fit is not None:
resMax = (
Expand Down
15 changes: 13 additions & 2 deletions gui/builtinViews/fittingView.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,19 @@ def generateMods(self):
]

if fit is not None:
self.mods = fit.modules[:]
self.mods.sort(key=lambda _mod: (slotOrder.index(_mod.slot), _mod.position))
self.mods = [mod for mod in fit.modules if mod is not None]

def _get_sort_key(mod):
slot = getattr(mod, "slot", None)
try:
slot_index = slotOrder.index(slot)
except ValueError:
# During rapid fit switches we may briefly see transient modules
# with unresolved slot references; keep UI stable by sorting them last.
slot_index = len(slotOrder)
return slot_index, getattr(mod, "position", 0)

self.mods.sort(key=_get_sort_key)

# Blanks is a list of indexes that mark non-module positions (such
# as Racks and tactical Modes. This allows us to skip over common
Expand Down