Do not show resist column and mode picker when resists are ignored

This commit is contained in:
DarkPhoenix
2019-08-05 10:41:06 +03:00
parent deb772f0a7
commit 3c6071ad88
5 changed files with 22 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
def activate(self, callingWindow, fullContext, i):
self.settings.set('ignoreResists', not self.settings.get('ignoreResists'))
wx.PostEvent(self.mainFrame, GE.GraphOptionChanged(refreshAxeLabels=True))
wx.PostEvent(self.mainFrame, GE.GraphOptionChanged(refreshAxeLabels=True, refreshColumns=True))
def isChecked(self, i):
return self.settings.get('ignoreResists')

View File

@@ -8,6 +8,7 @@ from graphs.events import ResistModeChanged
from graphs.wrapper import TargetWrapper
from gui.contextMenu import ContextMenuCombined
from service.const import TargetResistMode
from service.settings import GraphSettings
optionMap = OrderedDict((
@@ -26,6 +27,8 @@ class TargetWrapperResists(ContextMenuCombined):
def display(self, callingWindow, srcContext, mainItem, selection):
if srcContext != 'graphTgtList':
return False
if GraphSettings.getInstance().get('ignoreResists'):
return False
if not isinstance(mainItem, TargetWrapper) or not mainItem.isFit:
return False
self.callingWindow = callingWindow