Recalc fit when changing implant source
This commit is contained in:
@@ -63,15 +63,11 @@ class ImplantView(wx.Panel):
|
||||
self.rbChar.SetValue(True)
|
||||
|
||||
def OnRadioSelect(self, event):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit = service.Fit.getInstance()
|
||||
activeFitID = self.mainFrame.getActiveFit()
|
||||
fit = sFit.getFit(activeFitID)
|
||||
if self.rbFit.GetValue():
|
||||
fit.implantSource = ImplantLocation.FIT
|
||||
else:
|
||||
fit.implantSource = ImplantLocation.CHARACTER
|
||||
sFit.toggleImplantSource(fitID, ImplantLocation.FIT if self.rbFit.GetValue() else ImplantLocation.CHARACTER)
|
||||
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=activeFitID))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
|
||||
|
||||
class ImplantDisplay(d.Display):
|
||||
|
||||
@@ -721,6 +721,14 @@ class Fit(object):
|
||||
self.recalc(fit)
|
||||
return True
|
||||
|
||||
def toggleImplantSource(self, fitID, source):
|
||||
fit = eos.db.getFit(fitID)
|
||||
fit.implantSource = source
|
||||
|
||||
eos.db.commit()
|
||||
self.recalc(fit)
|
||||
return True
|
||||
|
||||
def toggleBooster(self, fitID, i):
|
||||
fit = eos.db.getFit(fitID)
|
||||
booster = fit.boosters[i]
|
||||
|
||||
Reference in New Issue
Block a user