Get gear item level question?
I'm working on an addon and I want to report the gear item level but I'm having trouble with
lua errors when I attempt it. Here's what I'm doing: local slotID = GetInventorySlotInfo(Headslot) --this works, returning a 1 local ilvl = C_Item.GetCurrentItemLevel(slotID) --This fails (*temporary) = "bad argument #1 to '?' (Usage: local currentItemLevel = C_Item.GetCurrentItemLevel(itemLocation))" I obviously don't have the correct itemLocation but not sure how to find that. I'm currently attempting to get the gear level when I open the mailbox but I could change this to use the character screen, just not sure what event triggers when I open it. I think I have a solution now. Here is what I'm doing...oops not quite - numbers don't match character screen?? Lua Code:
|
C_Item.GetCurrentItemLevel requires an ItemLocationMixin not slotID
Lua Code:
|
Oh, thanks for reminding me of that change. I haven't updated my item level addon in ages as I forgot that was added a while back.
Nevermind, I already updated to Dragonflight with no issues. Either I didn't need to use that function or I added it. But it did remind me of something I was envisioning adding to it at some point. |
You never know what 11 may bring to the table ;)
|
Working but clunky
Thank you for the help.
It's working now... had a bit of trouble with empty slots and used a clunky workaround by looking at the texture. I'm sure there must be a better way to detect an empty slot but haven't found it yet. Here's what I have now... Lua Code:
|
C_Item.DoesItemExist
Lua Code:
|
Working great now
Thank you for your help!!
It's working the way I want now. Lua Code:
For anyone that needs this the slotName is one of "HeadSlot", "NeckSlot", "ShoulderSlot", "BackSlot"... |
Quote:
|
All times are GMT -6. The time now is 05:32 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI