From 3bd66f174dd2291b8e3c8e66979f284da7c720e5 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 18 May 2014 01:45:28 -0400 Subject: [PATCH] Added skill prereq tooltip compact option to preferences --- .../pyfaGeneralPreferences.py | 23 +++++++++++-------- gui/characterSelection.py | 2 +- service/fit.py | 3 ++- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py index 9f7ae718a..4b9c4c3e0 100644 --- a/gui/builtinPreferenceViews/pyfaGeneralPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py @@ -37,6 +37,9 @@ class PFGeneralPref ( PreferenceView): self.cbGlobalForceReload = wx.CheckBox( panel, wx.ID_ANY, u"Factor in reload time", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbGlobalForceReload, 0, wx.ALL|wx.EXPAND, 5 ) + self.cbCompactSkills = wx.CheckBox( panel, wx.ID_ANY, u"Compact skills needed tooltip", wx.DefaultPosition, wx.DefaultSize, 0 ) + mainSizer.Add( self.cbCompactSkills, 0, wx.ALL|wx.EXPAND, 5 ) + self.cbFitColorSlots = wx.CheckBox( panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbFitColorSlots, 0, wx.ALL|wx.EXPAND, 5 ) @@ -48,7 +51,6 @@ class PFGeneralPref ( PreferenceView): labelSizer.Add( self.cbRackLabels, 0, wx.ALL|wx.EXPAND, 5 ) mainSizer.Add( labelSizer, 0, wx.LEFT|wx.EXPAND, 30 ) - # Needs to be implemented - save active fittings and reapply when starting pyfa #self.cbReopenFits = wx.CheckBox( panel, wx.ID_ANY, u"Reopen Fits", wx.DefaultPosition, wx.DefaultSize, 0 ) #mainSizer.Add( self.cbReopenFits, 0, wx.ALL|wx.EXPAND, 5 ) @@ -56,16 +58,14 @@ class PFGeneralPref ( PreferenceView): defCharSizer = wx.BoxSizer( wx.HORIZONTAL ) self.sFit = service.Fit.getInstance() - useGlobalChar = self.sFit.serviceFittingOptions["useGlobalCharacter"] - useGlobalDmgPattern = self.sFit.serviceFittingOptions["useGlobalDamagePattern"] - useGlobalForceReload = self.sFit.serviceFittingOptions["useGlobalForceReload"] - self.cbGlobalChar.SetValue(useGlobalChar) - self.cbGlobalDmgPattern.SetValue(useGlobalDmgPattern) - self.cbGlobalForceReload.SetValue(useGlobalForceReload) + self.cbGlobalChar.SetValue(self.sFit.serviceFittingOptions["useGlobalCharacter"]) + self.cbGlobalDmgPattern.SetValue(self.sFit.serviceFittingOptions["useGlobalDamagePattern"]) + self.cbGlobalForceReload.SetValue(self.sFit.serviceFittingOptions["useGlobalForceReload"]) self.cbFitColorSlots.SetValue(self.sFit.serviceFittingOptions["colorFitBySlot"] or False) self.cbRackSlots.SetValue(self.sFit.serviceFittingOptions["rackSlots"] or False) self.cbRackLabels.SetValue(self.sFit.serviceFittingOptions["rackLabels"] or False) + self.cbCompactSkills.SetValue(self.sFit.serviceFittingOptions["compactSkills"] or False) self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange) self.cbGlobalDmgPattern.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalDmgPatternStateChange) @@ -73,7 +73,8 @@ class PFGeneralPref ( PreferenceView): self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot) self.cbRackSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackSlots) self.cbRackLabels.Bind(wx.EVT_CHECKBOX, self.onCBGlobalRackLabels) - + self.cbCompactSkills.Bind(wx.EVT_CHECKBOX, self.onCBCompactSkills) + self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False) panel.SetSizer( mainSizer ) @@ -115,7 +116,11 @@ class PFGeneralPref ( PreferenceView): def OnCBGlobalDmgPatternStateChange(self, event): self.sFit.serviceFittingOptions["useGlobalDamagePattern"] = self.cbGlobalDmgPattern.GetValue() event.Skip() - + + def onCBCompactSkills(self, event): + self.sFit.serviceFittingOptions["compactSkills"] = self.cbCompactSkills.GetValue() + event.Skip() + def getImage(self): return bitmapLoader.getBitmap("prefs_settings", "icons") diff --git a/gui/characterSelection.py b/gui/characterSelection.py index 3ac23382e..6c26a3290 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -156,7 +156,7 @@ class CharacterSelection(wx.Panel): self.skillReqsStaticBitmap.SetBitmap(self.greenSkills) else: tip = "Skills required:\n" - condensed = True # @todo replace with preference option + condensed = cFit.serviceFittingOptions["compactSkills"] if condensed: dict = self._buildSkillsTooltipCondensed(reqs) for key in sorted(dict): diff --git a/service/fit.py b/service/fit.py index 9b6f5b6a0..da4d26ff6 100644 --- a/service/fit.py +++ b/service/fit.py @@ -89,7 +89,8 @@ class Fit(object): "useGlobalForceReload": False, "colorFitBySlot": False, "rackSlots": False, - "rackLabels": False} + "rackLabels": False, + "compactSkills": False} self.serviceFittingOptions = SettingsProvider.getInstance().getSettings("pyfaServiceFittingOptions", serviceFittingDefaultOptions)