Make modification of mutated stats undoable

This commit is contained in:
DarkPhoenix
2019-05-02 00:18:17 +03:00
parent bbc8fd0f97
commit b3ef55cb7f
8 changed files with 151 additions and 15 deletions

View File

@@ -147,6 +147,7 @@ class ItemStatsDialog(wx.Dialog):
def closeEvent(self, event):
self.closeWindow()
self.container.onParentClose()
event.Skip()
def closeWindow(self):
@@ -156,6 +157,7 @@ class ItemStatsDialog(wx.Dialog):
self.Destroy()
class ItemStatsContainer(wx.Panel):
def __init__(self, parent, stuff, item, context=None):
wx.Panel.__init__(self, parent)
sMkt = Market.getInstance()
@@ -214,3 +216,8 @@ class ItemStatsContainer(wx.Panel):
tab, _ = self.nbContainer.HitTest(event.Position)
if tab != -1:
self.nbContainer.SetSelection(tab)
def onParentClose(self):
mutaPanel = getattr(self, 'mutator', None)
if mutaPanel is not None:
mutaPanel.submitMutationChanges()