From f39c4d223d78142e1c11c2b06d1c15a9027abb2c Mon Sep 17 00:00:00 2001 From: eTzmNcbkrng Date: Wed, 31 Mar 2021 14:34:52 +1300 Subject: [PATCH 1/5] Add additional Item information to Tooltip --- ElvUI/Modules/Tooltip/Tooltip.lua | 29 ++++++++++++++++++----------- ElvUI/Settings/Profile.lua | 1 + ElvUI_OptionsUI/Locales/enUS.lua | 1 + ElvUI_OptionsUI/Tooltip.lua | 20 ++++++++++++++++---- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index 968d6a56f..0b90cec77 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -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))) + 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))) 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 @@ -685,8 +694,6 @@ function TT:Initialize() if not E.private.tooltip.enable then return end - SetCVar("showItemLevel", 1) - GameTooltip.StatusBar = GameTooltipStatusBar GameTooltip.StatusBar:Height(self.db.healthBar.height) GameTooltip.StatusBar:SetScript("OnValueChanged", nil) diff --git a/ElvUI/Settings/Profile.lua b/ElvUI/Settings/Profile.lua index 7b05814cb..69eeab730 100644 --- a/ElvUI/Settings/Profile.lua +++ b/ElvUI/Settings/Profile.lua @@ -1151,6 +1151,7 @@ P.tooltip = { targetInfo = true, playerTitles = true, guildRanks = true, + itemDetails = "ID_ONLY", itemCount = "BAGS_ONLY", spellID = true, npcID = true, diff --git a/ElvUI_OptionsUI/Locales/enUS.lua b/ElvUI_OptionsUI/Locales/enUS.lua index a3e642296..c77cb4e4b 100644 --- a/ElvUI_OptionsUI/Locales/enUS.lua +++ b/ElvUI_OptionsUI/Locales/enUS.lua @@ -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 diff --git a/ElvUI_OptionsUI/Tooltip.lua b/ElvUI_OptionsUI/Tooltip.lua index c88be9ccd..fa44925ed 100644 --- a/ElvUI_OptionsUI/Tooltip.lua +++ b/ElvUI_OptionsUI/Tooltip.lua @@ -93,8 +93,8 @@ 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 when mousing over a spell."] }, npcID = { order = 11, @@ -102,9 +102,21 @@ E.Options.args.tooltip = { name = L["NPC IDs"], desc = L["Display the npc ID when mousing over a npc tooltip."], }, - itemCount = { + itemDetails = { order = 12, type = "select", + name = L["Item Details"], + desc = L["Display Item ID 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 = { @@ -115,7 +127,7 @@ E.Options.args.tooltip = { } }, colorAlpha = { - order = 13, + order = 14, type = "range", name = L["OPACITY"], isPercent = true, From 1e884e97d5c6c8e7b77a64e0de8e576dbc17a0e8 Mon Sep 17 00:00:00 2001 From: eTzmNcbkrng Date: Wed, 31 Mar 2021 15:00:09 +1300 Subject: [PATCH 2/5] Remove trailing white space --- ElvUI/Modules/Tooltip/Tooltip.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index 0b90cec77..2d50fddba 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -538,7 +538,7 @@ function TT:GameTooltip_OnTooltipSetItem(tt) end if count or bankCount then - if not itemID and not itemLvl then + if not itemID and not itemLvl then tt:AddLine(" ") end tt:AddDoubleLine(count or " ", bankCount or " ") @@ -739,4 +739,4 @@ local function InitializeCallback() TT:Initialize() end -E:RegisterModule(TT:GetName(), InitializeCallback) \ No newline at end of file +E:RegisterModule(TT:GetName(), InitializeCallback) From 6dad46fa5aaedf2758da8b5ec42f2114091c1d8c Mon Sep 17 00:00:00 2001 From: eTzmNcbkrng Date: Wed, 31 Mar 2021 15:15:49 +1300 Subject: [PATCH 3/5] Fix some descriptions --- ElvUI_OptionsUI/Tooltip.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ElvUI_OptionsUI/Tooltip.lua b/ElvUI_OptionsUI/Tooltip.lua index fa44925ed..ce349746d 100644 --- a/ElvUI_OptionsUI/Tooltip.lua +++ b/ElvUI_OptionsUI/Tooltip.lua @@ -94,19 +94,19 @@ E.Options.args.tooltip = { order = 10, type = "toggle", name = L["Spell IDs"], - desc = L["Display the spell when mousing over a spell."] + 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."], }, itemDetails = { order = 12, type = "select", name = L["Item Details"], - desc = L["Display Item ID or Item Level"], + desc = L["Display the item id and/or item level."], values = { ["ID_ONLY"] = L["Item ID"], ["ILVL_ONLY"] = L["Item Level"], @@ -376,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 \ No newline at end of file +end From 8abfc8e4ef5cde602df760ef814e49d6949ad08d Mon Sep 17 00:00:00 2001 From: eTzmNcbkrng Date: Thu, 1 Apr 2021 15:15:04 +1300 Subject: [PATCH 4/5] Fix error received on items with no iLvl --- ElvUI/Modules/Tooltip/Tooltip.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index 2d50fddba..81ad08990 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -517,10 +517,10 @@ function TT:GameTooltip_OnTooltipSetItem(tt) 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))) + 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))) + itemLvl = format("|cFFCA3C3C%s|r %d", "iLvl", select(4, GetItemInfo(link)) or 0) end if self.db.itemCount == "BAGS_ONLY" then From 56191073cb98a2a4b82567392b5c736bf1370520 Mon Sep 17 00:00:00 2001 From: eTzmNcbkrng Date: Fri, 7 May 2021 12:04:29 +1200 Subject: [PATCH 5/5] Don't display Blizzard Item Levels --- ElvUI/Modules/Tooltip/Tooltip.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ElvUI/Modules/Tooltip/Tooltip.lua b/ElvUI/Modules/Tooltip/Tooltip.lua index 81ad08990..6a87174fd 100644 --- a/ElvUI/Modules/Tooltip/Tooltip.lua +++ b/ElvUI/Modules/Tooltip/Tooltip.lua @@ -694,6 +694,8 @@ function TT:Initialize() if not E.private.tooltip.enable then return end + SetCVar("showItemLevel", 0) + GameTooltip.StatusBar = GameTooltipStatusBar GameTooltip.StatusBar:Height(self.db.healthBar.height) GameTooltip.StatusBar:SetScript("OnValueChanged", nil)