sellvalue: avoid updates to not break other addons

This commit is contained in:
shagu
2020-06-28 23:24:55 +02:00
parent 15298630f1
commit eb4c63e7fe
+4 -17
View File
@@ -37,25 +37,12 @@ pfUI:RegisterModule("sellvalue", "vanilla:tbc", function ()
end end
end) end)
local hook = SetItemRef local HookSetItemRef = SetItemRef
_G.SetItemRef = function(link, text, button) _G.SetItemRef = function(link, text, button)
local item, _, id = string.find(link, "item:(%d+):.*") local item, _, id = string.find(link, "item:(%d+):.*")
ItemRefTooltip.item = item and id or nil HookSetItemRef(link, text, button)
ItemRefTooltip.link = link if not IsAltKeyDown() and not IsShiftKeyDown() and not IsControlKeyDown() and item then
hook(link, text, button) AddVendorPrices(ItemRefTooltip, tonumber(id), 1)
end
local function OnUpdate()
if this.item then
this:ClearLines()
this:SetHyperlink(this.link)
AddVendorPrices(ItemRefTooltip, tonumber(ItemRefTooltip.item), 1)
end end
end end
if ItemRefTooltip:GetScript("OnUpdate") then
HookScript("OnUpdate", ItemRefTooltip, OnUpdate)
else
ItemRefTooltip:SetScript("OnUpdate", OnUpdate)
end
end) end)