Quantcast WoWInterface - View Single Post - How can I tell ..
View Single Post
03-23-18, 11:41 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by doofus View Post
2) Convert ItemEquipLocation (as per GetItemInfo) to slot Id as used by GetInventoryItemLink
currently using a table from https://wow.gamepedia.com/ItemEquipLoc but it'd be nicer if there were an API call for this?
There are these global constants:
https://www.townlong-yak.com/framexm...stants.lua#270

GetItemInfo will give you something like "INVTYPE_HEAD", so you could replace "INVTYPE" with "INVSLOT" and look it up in _G.

That said, I don't think the slot IDs have ever changed, so there's not really any compelling reason to look them up dynamically vs. hardcoding a table.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote