Make sure to do fit recalculation if it was changed after the last one

This commit is contained in:
DarkPhoenix
2019-09-30 17:20:22 +03:00
parent 576cf56735
commit 9d554f9c68
3 changed files with 7 additions and 0 deletions

View File

@@ -55,12 +55,14 @@ class GuiChangeProjectedItemsProjectionRangeCommand(wx.Command):
itemID=pDroneItemID,
projectionRange=self.projectionRange)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFighterPosition in self.pFighterPositions:
cmd = CalcChangeProjectedFighterProjectionRangeCommand(
fitID=self.fitID,
position=pFighterPosition,
projectionRange=self.projectionRange)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFitID in self.pFitIDs:
cmd = CalcChangeProjectedFitProjectionRangeCommand(
fitID=self.fitID,

View File

@@ -72,18 +72,21 @@ class GuiChangeProjectedItemStatesCommand(wx.Command):
itemID=pDroneItemID,
state=False if self.proposedState == 'inactive' else True)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFighterPosition in self.pFighterPositions:
cmd = CalcChangeProjectedFighterStateCommand(
fitID=self.fitID,
position=pFighterPosition,
state=False if self.proposedState == 'inactive' else True)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFitID in self.pFitIDs:
cmd = CalcChangeProjectedFitStateCommand(
fitID=self.fitID,
projectedFitID=pFitID,
state=False if self.proposedState == 'inactive' else True)
results.append(self.internalHistory.submit(cmd))
needRecalc = cmd.needsGuiRecalc
success = any(results)
sFit = Fit.getInstance()
if needRecalc:

View File

@@ -49,9 +49,11 @@ class GuiRemoveProjectedItemsCommand(wx.Command):
for pDroneItemID in self.pDroneItemIDs:
cmd = CalcRemoveProjectedDroneCommand(fitID=self.fitID, itemID=pDroneItemID, amount=self.amount)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFighterPosition in sorted(self.pFighterPositions, reverse=True):
cmd = CalcRemoveProjectedFighterCommand(fitID=self.fitID, position=pFighterPosition)
results.append(self.internalHistory.submit(cmd))
needRecalc = True
for pFitID in self.pFitIDs:
cmd = CalcRemoveProjectedFitCommand(fitID=self.fitID, projectedFitID=pFitID, amount=self.amount)
results.append(self.internalHistory.submit(cmd))