Remix Gem Helper

Remix Gem Helper

99.8k Downloads

Cloak tooltip

Dairyman opened this issue ยท 2 comments

commented

You can

local function updateItemTooltip(tooltip)
if not tooltip or not tooltip.GetItem then return end
local link = select(2, tooltip:GetItem())
if not link then return end
local itemID = C_Item.GetItemInfoInstant(link)
if itemID == const.CLOAK_BUFF.ITEM_ID then
tooltip.TextLeft1:SetText((tooltip.TextLeft1:GetText() or "") .. getCloakLevel())
tooltip.TextLeft2:SetText((tooltip.TextLeft2:GetText() or "").. "\n" .. getCloakStats())
end
end

change with

local function updateItemTooltip(tooltip, tooltipData)
    if tooltipData.id ~= const.CLOAK_BUFF.ITEM_ID or not tooltipData.guid then return end
    local guid = tooltipData.guid
    if not guid or not C_Item.IsItemGUIDInInventory(guid) then return end

    tooltip.TextLeft1:SetText((tooltip.TextLeft1:GetText() or "") .. getCloakLevel())
    local stats = getCloakStats()
    if stats then
        tooltip.TextLeft2:SetText((tooltip.TextLeft2:GetText() or "").. "\n" .. stats)
    end
end

Simpler check if it is the cloak and check if it yours so it does not display your stats on other players cloaks. Plus a check for stats as this can be nil when you do not wear the cloak.

commented

Thanks add this

commented

In the future if you wanna update stuff you can also just make a pull request and i'll take a look :)