Allow imports of mutated drone groups via ctrl-v and additions panel context menus
This commit is contained in:
@@ -14,7 +14,7 @@ class GuiImportCargosCommand(wx.Command):
|
||||
self.internalHistory = InternalCommandHistory()
|
||||
self.fitID = fitID
|
||||
self.cargos = {}
|
||||
for itemID, amount in cargos:
|
||||
for itemID, amount, mutation in cargos:
|
||||
if itemID not in self.cargos:
|
||||
self.cargos[itemID] = 0
|
||||
self.cargos[itemID] += amount
|
||||
|
||||
@@ -18,11 +18,19 @@ class GuiImportLocalDronesCommand(wx.Command):
|
||||
|
||||
def Do(self):
|
||||
results = []
|
||||
for itemID, amount in self.drones:
|
||||
cmd = CalcAddLocalDroneCommand(
|
||||
fitID=self.fitID,
|
||||
droneInfo=DroneInfo(itemID=itemID, amount=amount, amountActive=0),
|
||||
forceNewStack=True)
|
||||
for itemID, amount, mutation in self.drones:
|
||||
if mutation:
|
||||
mutaplasmid, attrs = mutation
|
||||
info = DroneInfo(
|
||||
itemID=mutaplasmid.resultingItem.ID,
|
||||
amount=amount,
|
||||
amountActive=0,
|
||||
baseItemID=itemID,
|
||||
mutaplasmidID=mutaplasmid.ID,
|
||||
mutations=attrs)
|
||||
else:
|
||||
info = DroneInfo(itemID=itemID, amount=amount, amountActive=0)
|
||||
cmd = CalcAddLocalDroneCommand(fitID=self.fitID, droneInfo=info, forceNewStack=True)
|
||||
results.append(self.internalHistory.submit(cmd))
|
||||
success = any(results)
|
||||
eos.db.flush()
|
||||
|
||||
@@ -18,7 +18,7 @@ class GuiImportLocalFightersCommand(wx.Command):
|
||||
|
||||
def Do(self):
|
||||
results = []
|
||||
for itemID, amount in self.fighters:
|
||||
for itemID, amount, mutation in self.fighters:
|
||||
cmd = CalcAddLocalFighterCommand(fitID=self.fitID, fighterInfo=FighterInfo(itemID=itemID, amount=amount, state=False))
|
||||
results.append(self.internalHistory.submit(cmd))
|
||||
success = any(results)
|
||||
|
||||
Reference in New Issue
Block a user