while upgrading BaudBag to correctly use all features of the reagent bank, I've come across the point where I need to know if an item is a crafting reagent or not.
Going through the API there doesn't seem to be a good way for addons to determine this type of item. The closest I've found is to check the item family (http://wowprogramming.com/docs/api/GetItemFamily) against all specialized profession bags but I'm not sure if that covers all crafting reagents.
It seems, that a crafting reagent is not the same as as reagent. Reagent seemingly refers to now defunct items that where needed to use some talents (like the druids rebirth etc.) in earlier versions of WoW. So back to square one it seems.
I'm a bit confused how WoW determines if an item can go into the reagent bank or not, or how it creates the tooltip entry for 'crafting reagent'. It seems this information is hidden from the LUA accessible API? Or possibly there is a familyType not yet known to us?
I'm a bit confused how WoW determines if an item can go into the reagent bank or not, or how it creates the tooltip entry for 'crafting reagent'. It seems this information is hidden from the LUA accessible API?
The core tooltips aren't built by Lua routines, they're implemented in C and handed back as a finished object. Sometimes the easiest way to get this kind of information in an addon is, not to try and figure out where the information would have come from (since "how WoW determines if such-and-such" is going to be "the game client, like, *knows things*, man"), but rather to just get the resulting tooltip and pull data out of it textually.
Yes, this always feels like a kludge, but it has the distinct advantage of *working*. And you can always cache the information yourself, so that you're not constantly fiddling with invisible tooltips.
(You may be doing this already, I have not looked at your code.)
Personally I haven't done anything with tooltips thus far. What little code for tooltip handling exists in the addon is from one of the former authors. I have read a bit about how to use them and it seems to add awful overhead but if scanning the tooltips is the only way to get that information I guess I have to fiddle around with that. Thanks for the hint, I haven't even thought about scanning the tooltips until now.