Allow pasting non-mutated modules via ctrl-v

This commit is contained in:
DarkPhoenix
2020-02-03 15:54:22 +03:00
parent fc9337df67
commit f22a4f13e5
2 changed files with 8 additions and 5 deletions

View File

@@ -747,9 +747,12 @@ class MainFrame(wx.Frame):
activeFit = self.getActiveFit()
try:
importType, importData = Port().importFitFromBuffer(clipboard, activeFit)
if importType == "MutatedItem":
# we've imported an Abyssal module, need to fire off the command to add it to the fit
self.command.Submit(cmd.GuiImportLocalMutatedModuleCommand(activeFit, *importData[0]))
if importType == "FittingItem":
baseItem, mutaplasmidItem, mutations = importData[0]
if mutaplasmidItem:
self.command.Submit(cmd.GuiImportLocalMutatedModuleCommand(activeFit, baseItem, mutaplasmidItem, mutations))
else:
self.command.Submit(cmd.GuiAddLocalModuleCommand(activeFit, baseItem.ID))
return
if importType == "AdditionsDrones":
if self.command.Submit(cmd.GuiImportLocalDronesCommand(activeFit, [(i.ID, a) for i, a in importData[0]])):

View File

@@ -256,8 +256,8 @@ class Port:
except:
pass
else:
if baseItem is not None and mutaplasmidItem is not None:
return "MutatedItem", False, ((baseItem, mutaplasmidItem, mutations),)
if baseItem is not None:
return "FittingItem", False, ((baseItem, mutaplasmidItem, mutations),)
# Try to import into one of additions panels
isDrone, droneData = isValidDroneImport(string)
if isDrone: