Make new option for new mutated item names

This commit is contained in:
DarkPhoenix
2021-10-26 17:48:18 +03:00
parent 066f697186
commit a7da9e20a5
3 changed files with 24 additions and 2 deletions

View File

@@ -149,6 +149,14 @@ class PFGeneralPref(PreferenceView):
_t('When disabled, reloads charges just in selected modules. Action can be reversed by holding Ctrl or Alt key while changing charge.')))
mainSizer.Add(self.cbReloadAll, 0, wx.ALL | wx.EXPAND, 5)
self.cbExpMutants = wx.CheckBox(panel, wx.ID_ANY, _t("Include more information in names of mutated items"),
wx.DefaultPosition, wx.DefaultSize, 0)
if "wxGTK" not in wx.PlatformInfo:
self.cbExpMutants.SetCursor(helpCursor)
self.cbExpMutants.SetToolTip(wx.ToolTip(
_t('Use short mutaplasmid name and base item name instead of actual item name. Works if EVE data language is set to English.')))
mainSizer.Add(self.cbExpMutants, 0, wx.ALL | wx.EXPAND, 5)
self.rbAddLabels = wx.RadioBox(panel, -1, _t("Extra info in Additions panel tab names"), wx.DefaultPosition, wx.DefaultSize,
[_t("None"), _t("Quantity of active items"), _t("Quantity of all items")], 1, wx.RA_SPECIFY_COLS)
mainSizer.Add(self.rbAddLabels, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.BOTTOM, 10)
@@ -169,6 +177,7 @@ class PFGeneralPref(PreferenceView):
self.cbOpenFitInNew.SetValue(self.sFit.serviceFittingOptions["openFitInNew"])
self.cbShowShipBrowserTooltip.SetValue(self.sFit.serviceFittingOptions["showShipBrowserTooltip"])
self.cbReloadAll.SetValue(self.sFit.serviceFittingOptions["ammoChangeAll"])
self.cbExpMutants.SetValue(self.sFit.serviceFittingOptions["expandedMutantNames"])
self.rbAddLabels.SetSelection(self.sFit.serviceFittingOptions["additionsLabels"])
self.cbGlobalChar.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalCharStateChange)
@@ -184,6 +193,7 @@ class PFGeneralPref(PreferenceView):
self.cbOpenFitInNew.Bind(wx.EVT_CHECKBOX, self.onCBOpenFitInNew)
self.cbShowShipBrowserTooltip.Bind(wx.EVT_CHECKBOX, self.onCBShowShipBrowserTooltip)
self.cbReloadAll.Bind(wx.EVT_CHECKBOX, self.onCBReloadAll)
self.cbExpMutants.Bind(wx.EVT_CHECKBOX, self.onCBExpMutants)
self.cbRackLabels.Enable(self.sFit.serviceFittingOptions["rackSlots"] or False)
@@ -266,6 +276,11 @@ class PFGeneralPref(PreferenceView):
def onCBReloadAll(self, event):
self.sFit.serviceFittingOptions["ammoChangeAll"] = self.cbReloadAll.GetValue()
def onCBExpMutants(self, event):
self.sFit.serviceFittingOptions["expandedMutantNames"] = self.cbExpMutants.GetValue()
fitID = self.mainFrame.getActiveFit()
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
def OnAddLabelsChange(self, event):
self.sFit.serviceFittingOptions["additionsLabels"] = event.GetInt()
fitID = self.mainFrame.getActiveFit()

View File

@@ -70,7 +70,10 @@ class BaseName(ViewColumn):
stuff = stuff.item
if isinstance(stuff, Drone):
return "%dx %s" % (stuff.amount, stuff.fullName)
if FitSvc.getInstance().serviceFittingOptions["expandedMutantNames"]:
return "%dx %s" % (stuff.amount, stuff.fullName)
else:
return "%dx %s" % (stuff.amount, stuff.item.name)
elif isinstance(stuff, Fighter):
return "%d/%d %s" % \
(stuff.amount, stuff.getModifiedItemAttr("fighterSquadronMaxSize"), stuff.item.name)
@@ -117,7 +120,10 @@ class BaseName(ViewColumn):
if stuff.isEmpty:
return "%s Slot" % FittingSlot(stuff.slot).name.capitalize()
else:
return stuff.fullName
if FitSvc.getInstance().serviceFittingOptions["expandedMutantNames"]:
return stuff.fullName
else:
return stuff.item.customName
elif isinstance(stuff, Implant):
return stuff.item.name
elif isinstance(stuff, TargetProfile):

View File

@@ -93,6 +93,7 @@ class Fit:
"marketSearchDelay": 250,
"ammoChangeAll": False,
"additionsLabels": 1,
"expandedMutantNames": False,
}
self.serviceFittingOptions = SettingsProvider.getInstance().getSettings(