Implant and cargo conversions
This commit is contained in:
@@ -26,6 +26,7 @@ import gui.globalEvents as GE
|
||||
from gui.utils.staticHelpers import DragDropHelper
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
|
||||
class CargoViewDrop(wx.DropTarget):
|
||||
@@ -80,9 +81,7 @@ class CargoView(d.Display):
|
||||
if data[0] == "fitting":
|
||||
self.swapModule(x, y, int(data[1]))
|
||||
elif data[0] == "market":
|
||||
sFit = Fit.getInstance()
|
||||
sFit.addCargo(self.mainFrame.getActiveFit(), int(data[1]), 1)
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=self.mainFrame.getActiveFit()))
|
||||
self.mainFrame.command.Submit(cmd.GuiAddCargoCommand(self.mainFrame.getActiveFit(), int(data[1])))
|
||||
|
||||
def startDrag(self, event):
|
||||
row = event.GetIndex()
|
||||
|
||||
@@ -28,7 +28,7 @@ import gui.globalEvents as GE
|
||||
from eos.saveddata.fit import ImplantLocation
|
||||
from service.fit import Fit
|
||||
from service.market import Market
|
||||
|
||||
import gui.fitCommands as cmd
|
||||
|
||||
class ImplantView(wx.Panel):
|
||||
def __init__(self, parent):
|
||||
@@ -155,9 +155,7 @@ class ImplantDisplay(d.Display):
|
||||
event.Skip()
|
||||
return
|
||||
|
||||
trigger = sFit.addImplant(fitID, event.itemID)
|
||||
if trigger:
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
if self.mainFrame.command.Submit(cmd.GuiAddImplantCommand(fitID, event.itemID)):
|
||||
self.mainFrame.additionsPane.select("Implants")
|
||||
|
||||
event.Skip()
|
||||
@@ -175,10 +173,7 @@ class ImplantDisplay(d.Display):
|
||||
|
||||
def removeImplant(self, implant):
|
||||
fitID = self.mainFrame.getActiveFit()
|
||||
sFit = Fit.getInstance()
|
||||
|
||||
sFit.removeImplant(fitID, self.original.index(implant))
|
||||
wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID))
|
||||
self.mainFrame.command.Submit(cmd.GuiRemoveImplantCommand(fitID, self.original.index(implant)))
|
||||
|
||||
def click(self, event):
|
||||
event.Skip()
|
||||
|
||||
Reference in New Issue
Block a user