How to handle multiple tooltip
Hello,
I have a problem with my tiny addon I made. I get error while its event get triggered by multiple tooltip at once. eg. when you put your mouse on inventory items while switch it and it show other options This is my event handler so far: Code:
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, GetItemGCDInfos) Code:
attempt to call method 'GetItem' (a nil value) And this is my whole code for the sake of this post: Lua Code:
|
noone knows?
I wanted to add that it also appens (obviously) on comparison tooltip (shift key) Edit: Ultimately, is there a way to make errors die silently in lua? |
It looks like it is referring to the line
_, ItemLink = tt:GetItem() Which is in the function mentioned by the line you first posted. It looks like this is one of the functions removed, or being removed based on the dev comments in GameTooltip.lua. Lua Code:
Try using the TooltipUtil route and using your tooltip frame instead of self. |
Thank you for your help
Ok, by using tooltip frame you mean 'GameTooltip' object? It confuses me |
Within your code at that GetItem spot, tt is a tooltip frame. When you register GetItemGCDInfos at the bottom, the UI is feeding your function the current tooltip frame being rendered, which is usually GameTooltip.
Replace tt:GetItem() with TooltipUtil.GetDisplayedItem(tt) |
Hello,
Thank you so much for explainations. And sorry for very late answer. So, as you suggested, I have made it like this: Lua Code:
Unfortunatly, I still got the same error (eg. when I get multiple tooltip like when I put my cursor over the suggested items in the "edit stuff" menu) |
Ok, i'm stupid. I kept the getItem() method call..
Thanks for help, all good now |
All times are GMT -6. The time now is 05:36 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI