Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option that allows hiding untracked items from tooltips #761

Merged
merged 2 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Core/GUI/GameTooltipHooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Locales.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions Modules/Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions Options_Defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function R:PrepareDefaults()
blankLineBeforeTooltipAdditions = true,
tooltipAttempts = true,
hideKnownItemsInTooltip = false,
hideUntrackedItemsInTooltip = false,
takeScreenshot = true,
hideUnavailable = true,
hideDefeated = false,
Expand Down