From 7fdcd4aa152c85a85e1e666546053f26fa276e00 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Wed, 7 Aug 2019 23:18:06 +0300 Subject: [PATCH] Do proper attribute conversions on window close --- gui/builtinItemStatsViews/itemMutator.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/builtinItemStatsViews/itemMutator.py b/gui/builtinItemStatsViews/itemMutator.py index 399825ba4..0f4f65fc2 100644 --- a/gui/builtinItemStatsViews/itemMutator.py +++ b/gui/builtinItemStatsViews/itemMutator.py @@ -213,13 +213,18 @@ class ItemMutatorList(wx.ScrolledWindow): def OnWindowClose(self): # Submit mutation changes - fit = Fit.getInstance().getFit(self.carryingFitID) + sFit = Fit.getInstance() + fit = sFit.getFit(self.carryingFitID) if self.mod in fit.modules: currentMutation = {} for slider, m in self.event_mapping.items(): # Sliders may have more up-to-date info than mutator in case we changed # value in slider and without confirming it, decided to close window - currentMutation[m.attrID] = slider.GetValue() + value = slider.GetValue() + value = m.attribute.unit.ComplicateValue(value) + if value != m.value: + value = sFit.changeMutatedValuePrelim(m, value) + currentMutation[m.attrID] = value mainFrame = gui.mainFrame.MainFrame.getInstance() mainFrame.getCommandForFit(self.carryingFitID).Submit(cmd.GuiChangeLocalModuleMutationCommand( fitID=self.carryingFitID,