Skip to content

Commit 85cf972

Browse files
committed
Midnight: Fix getting crafting info at merchants
1 parent 10e295e commit 85cf972

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Source/CraftingInfo/Main.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
local GetMerchantItemInfo = GetMerchantItemInfo or function(index)
2+
local info = C_MerchantFrame.GetItemInfo(index);
3+
if info then
4+
return info.name, info.texture, info.price, info.stackCount, info.numAvailable, info.isPurchasable, info.isUsable, info.hasExtendedCost, info.currencyID, info.spellID;
5+
end
6+
end
17
function Auctionator.CraftingInfo.CacheVendorPrices()
28
for i = 1, GetMerchantNumItems() do
39
local itemID = GetMerchantItemID(i)

Source/Tooltips/Hooks.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ TooltipHandlers["SetBuybackItem"] = function(tip, slotIndex)
2828
Auctionator.Tooltip.ShowTipWithPricing(tip, itemLink, itemCount)
2929
end
3030

31+
local GetMerchantItemInfo = GetMerchantItemInfo or function(index)
32+
local info = C_MerchantFrame.GetItemInfo(index);
33+
if info then
34+
return info.name, info.texture, info.price, info.stackCount, info.numAvailable, info.isPurchasable, info.isUsable, info.hasExtendedCost, info.currencyID, info.spellID;
35+
end
36+
end
37+
3138
-- This is called when mousing over an item in a merchant window (Merchant Pane)
3239
TooltipHandlers["SetMerchantItem"] = function(tip, index)
3340
local itemLink = GetMerchantItemLink(index)

0 commit comments

Comments
 (0)