Add number of slots in the rack heading (#1535)

This commit is contained in:
blitzmann
2018-05-19 17:55:17 -04:00
parent 155a3a4e42
commit cb509a832e
3 changed files with 8 additions and 6 deletions

View File

@@ -73,7 +73,7 @@ class BaseName(ViewColumn):
if stuff.slot == Slot.MODE:
return '─ Tactical Mode ─'
else:
return '{} Slots ─'.format(Slot.getName(stuff.slot).capitalize())
return '{} Slots ({})'.format(Slot.getName(stuff.slot).capitalize(), stuff.num)
else:
return ""
elif isinstance(stuff, Module):

View File

@@ -520,7 +520,7 @@ class FittingView(d.Display):
# second loop modifies self.mods, rewrites self.blanks to represent actual index of blanks
for i, (x, slot) in enumerate(self.blanks):
self.blanks[i] = x + i # modify blanks with actual index
self.mods.insert(x + i, Rack.buildRack(slot))
self.mods.insert(x + i, Rack.buildRack(slot, sum(m.slot == slot for m in self.mods)))
if fit.mode:
# Modes are special snowflakes and need a little manual loving
@@ -528,7 +528,7 @@ class FittingView(d.Display):
# while also marking the mode header position in the Blanks list
if sFit.serviceFittingOptions["rackSlots"]:
self.blanks.append(len(self.mods))
self.mods.append(Rack.buildRack(Slot.MODE))
self.mods.append(Rack.buildRack(Slot.MODE, None))
self.mods.append(fit.mode)
else: