Change background color to red when there's a slot overflow (only

happens on T3 atm)
This commit is contained in:
cncfanatics
2010-10-30 17:20:14 +02:00
parent 0fc3957ef9
commit 7b73c0868a

View File

@@ -249,4 +249,15 @@ class FittingView(d.Display):
else:
event.Skip()
def refresh(self, stuff):
d.Display.refresh(self, stuff)
sFit = service.Fit.getInstance()
fit = sFit.getFit(self.activeFitID)
slotMap = {}
for slotType in Slot.getTypes():
slot = Slot.getValue(slotType)
slotMap[slot] = fit.getSlotsFree(slot) < 0
for i, mod in enumerate(self.mods):
if slotMap[mod.slot]:
self.SetItemBackgroundColour(i, wx.Colour(255, 51, 51))