Rework "change drone/cargo amount" commands
This commit is contained in:
@@ -148,9 +148,9 @@ class CargoView(d.Display):
|
||||
return
|
||||
|
||||
self.original = fit.cargo if fit is not None else None
|
||||
self.cargo = stuff = fit.cargo[:] if fit is not None else None
|
||||
if stuff is not None:
|
||||
stuff.sort(key=lambda c: (c.item.group.category.name, c.item.group.name, c.item.name))
|
||||
self.cargo = fit.cargo[:] if fit is not None else None
|
||||
if self.cargo is not None:
|
||||
self.cargo.sort(key=lambda c: (c.item.group.category.name, c.item.group.name, c.item.name))
|
||||
|
||||
if event.fitID != self.lastFitId:
|
||||
self.lastFitId = event.fitID
|
||||
@@ -162,8 +162,8 @@ class CargoView(d.Display):
|
||||
|
||||
self.deselectItems()
|
||||
|
||||
self.populate(stuff)
|
||||
self.refresh(stuff)
|
||||
self.populate(self.cargo)
|
||||
self.refresh(self.cargo)
|
||||
event.Skip()
|
||||
|
||||
def removeItem(self, event):
|
||||
@@ -180,7 +180,7 @@ class CargoView(d.Display):
|
||||
if sel != -1:
|
||||
sFit = Fit.getInstance()
|
||||
fit = sFit.getFit(self.mainFrame.getActiveFit())
|
||||
cargo = fit.cargo[sel]
|
||||
cargo = self.cargo[sel]
|
||||
|
||||
sMkt = Market.getInstance()
|
||||
sourceContext = "cargoItem"
|
||||
|
||||
@@ -184,10 +184,10 @@ class DroneView(Display):
|
||||
return
|
||||
|
||||
self.original = fit.drones if fit is not None else None
|
||||
self.drones = stuff = fit.drones[:] if fit is not None else None
|
||||
self.drones = fit.drones[:] if fit is not None else None
|
||||
|
||||
if stuff is not None:
|
||||
stuff.sort(key=self.droneKey)
|
||||
if self.drones is not None:
|
||||
self.drones.sort(key=self.droneKey)
|
||||
|
||||
if event.fitID != self.lastFitId:
|
||||
self.lastFitId = event.fitID
|
||||
@@ -199,7 +199,7 @@ class DroneView(Display):
|
||||
|
||||
self.deselectItems()
|
||||
|
||||
self.update(stuff)
|
||||
self.update(self.drones)
|
||||
event.Skip()
|
||||
|
||||
def addItem(self, event):
|
||||
|
||||
@@ -156,9 +156,9 @@ class ImplantDisplay(d.Display):
|
||||
return
|
||||
|
||||
self.original = fit.implants if fit is not None else None
|
||||
self.implants = stuff = fit.appliedImplants[:] if fit is not None else None
|
||||
if stuff is not None:
|
||||
stuff.sort(key=lambda implant: implant.slot)
|
||||
self.implants = fit.appliedImplants[:] if fit is not None else None
|
||||
if self.implants is not None:
|
||||
self.implants.sort(key=lambda implant: implant.slot)
|
||||
|
||||
if event.fitID != self.lastFitId:
|
||||
self.lastFitId = event.fitID
|
||||
@@ -170,7 +170,7 @@ class ImplantDisplay(d.Display):
|
||||
|
||||
self.deselectItems()
|
||||
|
||||
self.update(stuff)
|
||||
self.update(self.implants)
|
||||
event.Skip()
|
||||
|
||||
def addItem(self, event):
|
||||
|
||||
Reference in New Issue
Block a user