Save all the info about mutations into command cache

This commit is contained in:
DarkPhoenix
2019-04-09 18:07:49 +03:00
parent bacb374ea4
commit 86056bf282
4 changed files with 24 additions and 5 deletions

View File

@@ -29,7 +29,14 @@ class FitRemoveModuleCommand(wx.Command):
mod = fit.modules[x]
if not mod.isEmpty:
pyfalog.debug(" -- Removing {}", mod)
self.modCache.append(ModuleInfoCache(mod.modPosition, mod.item.ID, mod.state, mod.charge, mod.baseItemID, mod.mutaplasmidID))
self.modCache.append(ModuleInfoCache(
mod.modPosition,
mod.item.ID,
mod.state,
mod.charge,
mod.baseItemID,
mod.mutaplasmidID,
{m.attrID: m.value for m in mod.mutators.values()}))
fit.modules.toDummy(x)
# if no modules have changes, skip command