Locale-independent itemType identification?
Is there a constant for the localized word for "Recipe"?
As GetItemInfo() only returns the localized value for itemType, I cannot think of another way than to hard code the respective word in my addon for every locale. Any other thoughts? |
If its anywhere it will be here.
https://www.townlong-yak.com/framexm...balStrings.lua Unfortunately the best match is this line... AUCTION_CATEGORY_RECIPES = "Recipes" All the others are part of a sentence. |
The 12th and 13th return from GetItemInfo is an ID that matches the type and subtype of returns 6 and 7 respectively.
Doing some digging, here are the ID variables ingame you can match to the 12th return: Code:
LE_ITEM_CLASS_ARMOR = 4 And here are the variables for the 13th return: Code:
LE_ITEM_ARMOR_CLOTH = 1 Usage source from here: https://www.townlong-yak.com/framexm...pFrame.lua#180 Variables are from my own _G dump, they are not declared in the Interface files. |
d'oh of course .. been a long time since I looked at those values.
As pointed out by Kanegasi the itemType and itemSubtype are numbers and are not needed to be localized. The following demonstrates how to return a complete list of localized itemtypes as strings. If you put these into an indexed table and then use the GetItemInfo itemType to retrieve the string value it should ( in theory and if memory servers ) return a localized string of that type. Or the alternative keyed table with the localized string as a key returning the number that relates to that value. You may have to test it out to see if it will suit your requirements. https://wow.gamepedia.com/API_GetAuctionItemClasses It may help with retrieving info from the tooltip but that is not something I have personally needed to do so can't confirm there. |
Quote:
I must have been up too late yesterday for not spotting itemClassID in the API of GetItemInfo myself. So thanks for the hint and especially for your ready-made list of variable names. Also thanks @Xrystal for sharing your thoughts! |
For the record:
The ID variables (e.g. LE_ITEM_CLASS_RECIPE) do not exist any more. Instead, you now use this Enum table (e.g. Enum.ItemClass.Recipe). https://wowpedia.fandom.com/wiki/ItemType |
All times are GMT -6. The time now is 08:18 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI