mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-13 00:42:40 +00:00
sellvalue: avoid updates to not break other addons
This commit is contained in:
+4
-17
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user