Add option to always show Enchanting breakables

If the user really wants to bypass the level check (or the mod is misbehaving), this allows them to show everything.
This commit is contained in:
2022-09-12 13:14:24 -05:00
parent 41592a7c76
commit a65674510e

View File

@ -811,6 +811,25 @@ function Breakables:GetOptions()
order = 22,
}
end
if not IgnoreEnchantingSkillLevelForDisenchant then
opts.args.ignoreEnchantingSkillLevel = {
type = "toggle",
name = L["Ignore Enchanting skill level"],
desc = L["If checked, items won't be hidden if Breakables thinks you don't have the appropriate skill level to disenchant it."],
get = function(info)
return self.settings.ignoreEnchantingSkillLevel
end,
set = function(info, v)
self.settings.ignoreEnchantingSkillLevel = v
self:FindBreakables()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78ignoreEnchantingSkillLevel|r to " .. tostring(self.settings.ignoreEnchantingSkillLevel))
end
end,
order = 10,
}
end
end
if UnitCanPetBattle then
@ -1457,6 +1476,10 @@ function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, i
return true
end
if self.settings.ignoreEnchantingSkillLevel then
return true
end
-- if we couldn't figure out the player's enchanting skill level, err on the side of showing stuff
if self.EnchantingLevel == 0 then
return true