New Item API
If any of you have had to deal with getting item info in the past you will love the new item api. I have a bag addon that I use (my version isn't public) and always had problems getting the correct item level since GetItemInfo hadn't been fixed to deal with scaling item level. The new API made it really easy all it took was a few lines.
Lua Code:
I'm creating from the bagID and slotID because the code was already setup that way but you can also set it up from an item link, equipment slot, or the new item location mixin. Lua Code:
I'm still looking into the new api so that is probably just scratching the surface of what you can do with it. If you want the full details you can find them in ItemDocumentation.lua in the API folder and under Item.lua in FrameXML\ObjectAPI. |
I scan the tooltip and pull the scaled item level from there, it works everytime.
This looks interesting. :D |
Quote:
Lua Code:
The way they have item and spell data it needs to make sure everything is loaded before when the player first logs in. ----- Oh and it also has a function to check if an item is soulbound or not. Lua Code:
|
Cool deal, it will certainly be much more efficient than pulling back a tooltip data for every armor or weapon to get the level. :)
|
doesn't seem to work well when using item links
sample link (random weapon from a random level 120 guy in orgrimmar, since my highest char in beta is only 111) Code:
"|cffa335ee|Hitem:154416:3370:::::::111:63:512:11:2:4811:4815:120:::|h[Trogg Saurolisk-Breaker]|h|r" i'll try it again in a month :rolleyes: edit: the problem is that the linkLevel in the itemString returned by GetInventoryItemLink() has to be adjusted, still faster than tooltip scanning |
I think they might have fixed GetDetailedItemLevelInfo(). It appears to be returning the correct level information now.
|
Huh, that'd be interesting if they had fixed that already. I'm going to have to verify that later.
|
and surprising to say the least. I haven't tested scaling down yet. So that could still be borked.
|
False alarm, it's still borked in the same way sadly.
|
Yep..Scaled levels are still wacked out.
|
An old thread, sorry.
I am trying to get the item level, and as far as I can tell, there are two, main API functions GetItemInfo and GetDetailedItemLevelInfo and they are both currently not working properly, definitely for down-scaling. Is there another API we can use? How does the item tooltip deduce the correct iLvl ? Edit: to provide more information, parsing the tooltip is also wrong, I parse "Item Level 280" and on screen it shows as "Item Level 266". |
You can parse the item level out of the tooltip, that is accurate. That's what we're all doing at this point.
Lua Code:
|
I already parse the tooltip, and instead of using GameTooltip:SetInventoryItem as you have suggested, I use GameTooltip:SetHyperlink which allows me to inquire about items not in my bags.
But your comment made me look deeper and I have found one bug (at least) with GetCursorInfo. Imagine Green item, BoE, in guild bank, level = 120 and ilvl = 266. When the item is in the guild bank and I pick it up, I get something like "Sandscout Tunic" ilvl = 280. When the item is in my inventory I get something like "Sandscout tunic of the quickblade" ilvl = 266. |
Yeah that method is from a durability addon I wrote so I can see all my gear I'm wearing. It tracks the items, durability and item levels blah blah blah hehe.. I use a similar but different routine for my bags and bank addon.
Hopefully they'll fix the actual methods and we won't have to jump through these silly hoops. Becareful how much tooltip scanning you do, I ran into a situation were I was doing too much and it was causing my UI to randomly go totally blank lol. It was good stuff. :D |
All times are GMT -6. The time now is 09:57 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI