Thread Tools Display Modes
03-23-18, 05:19 PM   #1
doofus
A Chromatic Dragonspawn
Join Date: Feb 2018
Posts: 158
How can I tell ..

1) If I can equip an item properly (eg NOT DK and cloth) - other than checking if it is leather/cloth etc and having hard-coded things like "Paladin=plate". Is there a proper API function for this?

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?
  Reply With Quote
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How can I tell ..

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off