Improved on drag/drop for cargo and fitting views. Can now copy rather than swap

This commit is contained in:
blitzmann
2014-05-07 17:12:52 -04:00
parent 0c42848d52
commit d9e61a3305
4 changed files with 48 additions and 26 deletions

View File

@@ -346,13 +346,14 @@ class FittingView(d.Display):
def swapCargo(self, x, y, srcIdx):
'''Swap a module from cargo to fitting window'''
mstate = wx.GetMouseState()
dstRow, _ = self.HitTest((x, y))
if dstRow != -1 and dstRow not in self.blanks:
module = self.mods[dstRow]
cFit = service.Fit.getInstance()
cFit.swapModuleWithCargo(self.mainFrame.getActiveFit(), module.position, srcIdx)
cFit.moveCargoToModule(self.mainFrame.getActiveFit(), module.position, srcIdx, mstate.CmdDown() and module.isEmpty)
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))