Make sure our handled lists are not sorted
Because we rely on item positions within lists to identify modules for undo/redo stuff
This commit is contained in:
@@ -115,6 +115,9 @@ class HandledList(list):
|
||||
thing.itemID = 0
|
||||
list.remove(self, thing)
|
||||
|
||||
def sort(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class HandledModuleList(HandledList):
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ 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
|
||||
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))
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ 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
|
||||
self.implants = stuff = fit.appliedImplants[:] if fit is not None else None
|
||||
if stuff is not None:
|
||||
stuff.sort(key=lambda implant: implant.slot)
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ class FitAddImplantCommand(wx.Command):
|
||||
cmd.Do()
|
||||
return False
|
||||
self.newPosition = fit.implants.index(newImplant)
|
||||
|
||||
eos.db.commit()
|
||||
return True
|
||||
|
||||
|
||||
@@ -31,6 +31,6 @@ class FitRemoveImplantCommand(wx.Command):
|
||||
from .fitAddImplant import FitAddImplantCommand
|
||||
cmd = FitAddImplantCommand(
|
||||
fitID=self.fitID,
|
||||
boosterInfo=self.savedBoosterInfo,
|
||||
implantInfo=self.savedImplantInfo,
|
||||
position=self.position)
|
||||
return cmd.Do()
|
||||
|
||||
@@ -193,6 +193,9 @@ class BoosterInfo:
|
||||
sideEffect.active = self.sideEffects.get(sideEffect.effectID, sideEffect.active)
|
||||
return booster
|
||||
|
||||
def __repr__(self):
|
||||
return makeReprStr(self, ['itemID', 'state', 'sideEffects'])
|
||||
|
||||
|
||||
class ImplantInfo:
|
||||
|
||||
@@ -220,6 +223,9 @@ class ImplantInfo:
|
||||
implant.active = self.state
|
||||
return implant
|
||||
|
||||
def __repr__(self):
|
||||
return makeReprStr(self, ['itemID', 'state'])
|
||||
|
||||
|
||||
class CargoInfo:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user