-
Notifications
You must be signed in to change notification settings - Fork 3
/
Fix-6.2.lua
63 lines (53 loc) · 1.22 KB
/
Fix-6.2.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
local myname, ns = ...
-- It seems that patch 6.2 or 7.0 broke GameTooltip:GetItem() if the source was
-- GameTooltip:SetMerchantItem()
-- *sigh*
local link
local OrigGetItem = GameTooltip.GetItem
local OrigSetMerchantItem = GameTooltip.SetMerchantItem
function GameTooltip:SetMerchantItem(id, ...)
link = GetMerchantItemLink(id)
return OrigSetMerchantItem(self, id, ...)
end
function GameTooltip:GetItem(...)
if link then
local name = GetItemInfo(link)
return name, link
end
return OrigGetItem(self, ...)
end
-- This is so dirty. I hate it. I'M SORRY OK‽
local methods = {
"SetAction",
"SetAuctionItem",
"SetAuctionSellItem",
"SetBagItem",
"SetBuybackItem",
"SetHyperlink",
"SetInboxItem",
"SetInventoryItem",
"SetLootItem",
"SetLootRollItem",
"SetMerchantCostItem",
"SetMerchantItem",
"SetPetAction",
"SetQuestItem",
"SetQuestLogItem",
"SetQuestRewardSpell",
"SetSendMailItem",
"SetShapeshift",
"SetTalent",
"SetTradePlayerItem",
"SetTradeTargetItem",
"SetTrainerService",
"SetUnit",
"SetUnitBuff",
"SetUnitDebuff",
}
for _,m in pairs(methods) do
local orig = GameTooltip[m]
GameTooltip[m] = function(self, ...)
link = nil
return orig(self, ...)
end
end