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 additional Item information to Tooltip #799

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
31 changes: 20 additions & 11 deletions ElvUI/Modules/Tooltip/Tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -512,27 +512,36 @@ function TT:GameTooltip_OnTooltipSetItem(tt)

local num = GetItemCount(link)
local numall = GetItemCount(link, true)
local left, right, bankCount
local itemID, itemLvl, count, bankCount

if self.db.spellID then
left = format("|cFFCA3C3C%s|r %d", ID, tonumber(match(link, ":(%d+)")))
if self.db.itemDetails == "ID_ONLY" then
itemID = format("|cFFCA3C3C%s|r %d", ID, tonumber(match(link, ":(%d+)")))
elseif self.db.itemDetails == "ILVL_ONLY" then
itemLvl = format("|cFFCA3C3C%s|r %d", "iLvl", select(4, GetItemInfo(link)) or 0)
elseif self.db.itemDetails == "BOTH" then
itemID = format("|cFFCA3C3C%s|r %d", ID, tonumber(match(link, ":(%d+)")))
itemLvl = format("|cFFCA3C3C%s|r %d", "iLvl", select(4, GetItemInfo(link)) or 0)
end

if self.db.itemCount == "BAGS_ONLY" then
right = format("|cFFCA3C3C%s|r %d", L["Count"], num)
count = format("|cFFCA3C3C%s|r %d", L["Count"], num)
elseif self.db.itemCount == "BANK_ONLY" then
bankCount = format("|cFFCA3C3C%s|r %d", L["Bank"], (numall - num))
elseif self.db.itemCount == "BOTH" then
right = format("|cFFCA3C3C%s|r %d", L["Count"], num)
count = format("|cFFCA3C3C%s|r %d", L["Count"], num)
bankCount = format("|cFFCA3C3C%s|r %d", L["Bank"], (numall - num))
end

if left or right then
if itemID or itemLvl then
tt:AddLine(" ")
tt:AddDoubleLine(left or " ", right or " ")
tt:AddDoubleLine(itemID or " ", itemLvl or " ")
end
if bankCount then
tt:AddDoubleLine(" ", bankCount)

if count or bankCount then
if not itemID and not itemLvl then
tt:AddLine(" ")
end
tt:AddDoubleLine(count or " ", bankCount or " ")
end

tt.itemCleared = true
Expand Down Expand Up @@ -685,7 +694,7 @@ function TT:Initialize()

if not E.private.tooltip.enable then return end

SetCVar("showItemLevel", 1)
SetCVar("showItemLevel", 0)

GameTooltip.StatusBar = GameTooltipStatusBar
GameTooltip.StatusBar:Height(self.db.healthBar.height)
Expand Down Expand Up @@ -732,4 +741,4 @@ local function InitializeCallback()
TT:Initialize()
end

E:RegisterModule(TT:GetName(), InitializeCallback)
E:RegisterModule(TT:GetName(), InitializeCallback)
1 change: 1 addition & 0 deletions ElvUI/Settings/Profile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@ P.tooltip = {
targetInfo = true,
playerTitles = true,
guildRanks = true,
itemDetails = "ID_ONLY",
itemCount = "BAGS_ONLY",
spellID = true,
npcID = true,
Expand Down
1 change: 1 addition & 0 deletions ElvUI_OptionsUI/Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ L["Item Count Font"] = true
L["Item Count"] = true
L["Item Level Threshold"] = true
L["Item Level"] = true
L["Item ID"] = true
L["JustifyH"] = true
L["Key Down"] = true
L["Keybind Mode"] = true
Expand Down
24 changes: 18 additions & 6 deletions ElvUI_OptionsUI/Tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,30 @@ E.Options.args.tooltip = {
spellID = {
order = 10,
type = "toggle",
name = L["Spell/Item IDs"],
desc = L["Display the spell or item ID when mousing over a spell or item tooltip."]
name = L["Spell IDs"],
desc = L["Display the spell id when mousing over a spell tooltip."]
},
npcID = {
order = 11,
type = "toggle",
name = L["NPC IDs"],
desc = L["Display the npc ID when mousing over a npc tooltip."],
desc = L["Display the npc id when mousing over a npc."],
},
itemCount = {
itemDetails = {
order = 12,
type = "select",
name = L["Item Details"],
desc = L["Display the item id and/or item level."],
values = {
["ID_ONLY"] = L["Item ID"],
["ILVL_ONLY"] = L["Item Level"],
["BOTH"] = L["Both"],
["NONE"] = L["NONE"]
}
},
itemCount = {
order = 13,
type = "select",
name = L["Item Count"],
desc = L["Display how many of a certain item you have in your possession."],
values = {
Expand All @@ -115,7 +127,7 @@ E.Options.args.tooltip = {
}
},
colorAlpha = {
order = 13,
order = 14,
type = "range",
name = L["OPACITY"],
isPercent = true,
Expand Down Expand Up @@ -364,4 +376,4 @@ for i = 1, 8 do
name = L["FACTION_STANDING_LABEL"..i],
disabled = function() return not E.Tooltip.Initialized or not E.db.tooltip.useCustomFactionColors end,
}
end
end