Introduce special cases for cargo swapping when dealing with abyssal modules (#1649)

This commit is contained in:
blitzmann
2018-06-16 21:50:03 -04:00
parent 4e8e5d86c4
commit 5c566bae73
4 changed files with 31 additions and 4 deletions

View File

@@ -118,13 +118,22 @@ class CargoView(d.Display):
# Gather module information to get position
module = fit.modules[modIdx]
if module.item.isAbyssal:
dlg = wx.MessageDialog(self,
"Moving this Abyssal module to the cargo will convert it to the base module. Do you wish to proceed?",
"Confirm", wx.YES_NO | wx.ICON_QUESTION)
result = dlg.ShowModal() == wx.ID_YES
if not result:
return
if dstRow != -1: # we're swapping with cargo
if mstate.cmdDown: # if copying, append to cargo
sFit.addCargo(self.mainFrame.getActiveFit(), module.item.ID)
sFit.addCargo(self.mainFrame.getActiveFit(), module.item.ID if not module.item.isAbyssal else module.baseItemID)
else: # else, move / swap
sFit.moveCargoToModule(self.mainFrame.getActiveFit(), module.position, dstRow)
else: # dragging to blank spot, append
sFit.addCargo(self.mainFrame.getActiveFit(), module.item.ID)
sFit.addCargo(self.mainFrame.getActiveFit(), module.item.ID if not module.item.isAbyssal else module.baseItemID)
if not mstate.cmdDown: # if not copying, remove module
sFit.removeModule(self.mainFrame.getActiveFit(), module.position)