duplicate conjured items breaking tooltip scanning
hi! i'm currently fiddling with a tooltip scan to cache items in my inventory that give artifact power on use. the function checks the tooltip and then pulls the container id and rewarded amount listed in the tooltip into a function to create a button that can be clicked to use the item.
Lua Code:
this works fine, UNTIL i create two separate stacks of conjured items and place them side-by-side in the container (ie. by pressing auto-sort). this will then break tooltip line returns for all items after the first instance of the duplicated item. adding Code:
print:NumLines() any idea what's causing this? |
I don't really understand what you're doing here, but since you break the inner loop at some point, it will only ever find a maximum of one item per bag.
|
here's the full code including the tooltip scan:
https://github.com/obble/iipui/blob/...poweritems.lua and an example of how the tooltip for the item im scanning for is formatted in-game (minus the item level line that wowhead inserts): the break on first return is intentional. its a single action button that displays the first found instance of an item with that matched string (an artifact power item) in the inventory. as i see it there's no point iterating after that, and once the item is used then the function runs again and picks up the next one or runs through with nothing found, and the button doesn't show. this works fine in practice, unless there's two of the same item in sequence in the container (ContainerFrame1Button1 has conjured mana biscuit, ContainerFrame1Button2 has... conjured mana biscuit) wherein either the hyperlink or the id seems to fail or conflict somehow, meaning the tooltip isn't populated with information and returns nil. |
Just tried quickly with ItemRefTooltip, and indeed, setting the same item a second time hides the tooltip, so that'll be your issue I suppose!
|
What happens if you do :ClearLines() before each :Set*
|
appears to work. quick, easy fix — thanks!
|
All times are GMT -6. The time now is 08:28 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI