diff --git a/Core/GUI/GameTooltipHooks.lua b/Core/GUI/GameTooltipHooks.lua index 151bf557..a17d74ab 100644 --- a/Core/GUI/GameTooltipHooks.lua +++ b/Core/GUI/GameTooltipHooks.lua @@ -94,7 +94,10 @@ local function onTooltipSetUnit(tooltip, data) local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(v.itemId) if itemLink or itemName or v.name then - if v.known and R.db.profile.hideKnownItemsInTooltip then + if + (v.known and R.db.profile.hideKnownItemsInTooltip) + or (not v.enabled and R.db.profile.hideUntrackedItemsInTooltip) + then GameTooltip:Show() else if not blankAdded and R.db.profile.blankLineBeforeTooltipAdditions then @@ -317,7 +320,10 @@ local function onTooltipSetUnit(tooltip, data) local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(vv.itemId) if itemLink or itemName or vv.name then - if vv.known and R.db.profile.hideKnownItemsInTooltip then + if + (vv.known and R.db.profile.hideKnownItemsInTooltip) + or (not vv.enabled and R.db.profile.hideUntrackedItemsInTooltip) + then GameTooltip:Show() else if not blankAdded and R.db.profile.blankLineBeforeTooltipAdditions then @@ -386,7 +392,10 @@ local function processItem(id, tooltip) local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(v.itemId) if itemLink or itemName or v.name then - if v.known and R.db.profile.hideKnownItemsInTooltip then + if + (v.known and R.db.profile.hideKnownItemsInTooltip) + or (not v.enabled and R.db.profile.hideUntrackedItemsInTooltip) + then tooltip:Show() else if not blankAdded and R.db.profile.blankLineBeforeTooltipAdditions then @@ -448,7 +457,10 @@ local function processItem(id, tooltip) itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(vv.itemId) if itemLink or itemName or vv.name then - if vv.known and R.db.profile.hideKnownItemsInTooltip then + if + (vv.known and R.db.profile.hideKnownItemsInTooltip) + or (not vv.enabled and R.db.profile.hideUntrackedItemsInTooltip) + then tooltip:Show() else if diff --git a/Locales.lua b/Locales.lua index 83d76d07..26700a53 100644 --- a/Locales.lua +++ b/Locales.lua @@ -2,6 +2,8 @@ local L L = LibStub("AceLocale-3.0"):NewLocale("Rarity", "enUS", true) -- L["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"] = true +L["When enabled, Rarity will not add tooltip information for items that aren't being tracked."] = true +L["Hide untracked items in tooltips"] = true L["Reins of Anu'relos, Flame's Guidance"] = true L["Awakened Cache"] = true L["Machine Defense Unit 1-11"] = true diff --git a/Modules/Options/Options.lua b/Modules/Options/Options.lua index 097cc1e9..349bb877 100644 --- a/Modules/Options/Options.lua +++ b/Modules/Options/Options.lua @@ -724,6 +724,20 @@ function R:PrepareOptions() Rarity.GUI:UpdateText() end, }, + hideUntrackedItemsInTooltip = { + type = "toggle", + order = newOrder(), + width = "double", + name = L["Hide untracked items in tooltips"], + desc = L["When enabled, Rarity will not add tooltip information for items that aren't being tracked."], + get = function() + return self.db.profile.hideUntrackedItemsInTooltip + end, + set = function(info, val) + self.db.profile.hideUntrackedItemsInTooltip = val + Rarity.GUI:UpdateText() + end, + }, }, -- args }, -- worldTooltips contentCategory = { diff --git a/Options_Defaults.lua b/Options_Defaults.lua index 8f2a46ef..650899d3 100644 --- a/Options_Defaults.lua +++ b/Options_Defaults.lua @@ -81,6 +81,7 @@ function R:PrepareDefaults() blankLineBeforeTooltipAdditions = true, tooltipAttempts = true, hideKnownItemsInTooltip = false, + hideUntrackedItemsInTooltip = false, takeScreenshot = true, hideUnavailable = true, hideDefeated = false,