By the help of typeID and subTypeID and global constants LE_ITEM_*, we can get rid of localizedSubtypes.
I really dislike to do localizedSubtypes this.
This is how Blizzard checks item type
--FrameXML/WorldMapFrame.lua
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID = GetItemInfo(itemID);
if ( classID == LE_ITEM_CLASS_WEAPON or classID == LE_ITEM_CLASS_ARMOR or (classID == LE_ITEM_CLASS_GEM and subclassID == LE_ITEM_GEM_ARTIFACTRELIC) ) then
...
end
typeID can be compared with global constants LE_ITEM_CLASS_*, such as LE_ITEM_CLASS_ARMOR,
subTypeID can be compared with global constants LE_ITEM_*_*, such as LE_ITEM_ARMOR_CLOTH.
It seems these constants are not defined in blizzard interface code, so I search those constants by
for k, v in pairs(_G) do
if string.find(k, "LE_ITEM_" then
print(k, v)
end
end
The arguments of GetItemTypeText, SendResponse and AutoPassCheck are changed.
No backward compatibility is broken.
We should remove "link" argument in GetItemTypeText and AutoPassCheck after merged with #57.
It feels redundant
By the help of typeID and subTypeID and global constants
LE_ITEM_*
, we can get rid of localizedSubtypes. I really dislike to do localizedSubtypes this. This is how Blizzard checks item typetypeID can be compared with global constants
LE_ITEM_CLASS_*
, such asLE_ITEM_CLASS_ARMOR
, subTypeID can be compared with global constantsLE_ITEM_*_*
, such asLE_ITEM_ARMOR_CLOTH
.It seems these constants are not defined in blizzard interface code, so I search those constants by
The arguments of GetItemTypeText, SendResponse and AutoPassCheck are changed.
No backward compatibility is broken.
We should remove "link" argument in GetItemTypeText and AutoPassCheck after merged with #57. It feels redundant