WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Wardrobe problem (https://www.wowinterface.com/forums/showthread.php?t=54202)

pkiller162 08-12-16 03:57 PM

Wardrobe problem
 
Trying to alert the user when they have unlocked a new tmog in the wardrobe (very much like the current blizz chat message but for any quality items) and have come up with a solution however it only seems to work half the time. Im new to LUA so might have missed something obvious :P

Every time a TRANSMOG_COLLECTION_UPDATED fires, I get the latest appearance (C_TransmogCollection.GetLatestAppearance) and from that, get the first source from that appearance ID (C_TransmogCollection.GetAppearanceSources) and display its name in the chat (C_TransmogCollection.GetAppearanceSourceInfo contains the items name). This works very well however, it seems like half the time, GetAppearanceSourceInfo returns nil.

For a normal item, the GetAppearanceSourceInfo returns this:
Code:

11 1076 false 132543 true [Expedition Boots] [Expedition Boots] 4
But for an item that didnt work:
Code:

7 1351 false 132606 false []  6
Any idea why this might be the case?

EDIT: Solved! There might be multiple sources for a transmog item, some may even be different armour type. Its not safe just taking the first source as it causes nil values if you cant equip it. Search through them all to find your armour type :)


All times are GMT -6. The time now is 04:57 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI