View Single Post
04-10-20, 06:59 PM   #4
Xruptor
A Flamescale Wyrmkin
 
Xruptor's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 137
Originally Posted by Ketho View Post
Can you try hooking GameTooltip:SetMerchantCostItem()

https://github.com/Gethe/wow-ui-sour...Frame.xml#L328
Okay yep that was it. Apparently that particular function is only use for those specific token situations. Otherwise the others are used. It's quite an obscure function as it's not really documented anywhere properly. I had to tweak the code but it works. You basically have to work with the merchant item index and the index of the currency from GetMerchantCurrencies(). Since apparently some items are paid with multiple token currencies.

Many thanks for your help! It was driving me crazy. Here is the code that works.

Code:
		hooksecurefunc(objTooltip, "SetMerchantCostItem", function(self, index, currencyIndex)

                        local currencyID = select(currencyIndex, GetMerchantCurrencies())
			if currencyID then
				local name, currentAmount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered, rarity = GetCurrencyInfo(currencyID)
				if name and icon then
					print(name, icon, currencyID)
				end
			end

		end)
__________________
Click HERE for the ultimate idiot test.

if (sizeof(sadness) > sizeof(happiness)) { initDepression(); }

Last edited by Xruptor : 04-13-20 at 08:42 AM.
  Reply With Quote