tilkinsc / KiwiItemInfo

WoW Classic Addon | Shows iLvl (with colors) | Weapon/Armor Differences(shift hover) | Vendor Prices (unit/stack) | Highlights All Grey Named Items with LCTRL | Provides an Item Database for Searching in-client
MIT License
4 stars 8 forks source link

Item Compare doesn't evaluate items correctly if it were to unequip, say your shield #4

Closed tilkinsc closed 4 years ago

tilkinsc commented 4 years ago

Due date: Unknown

tilkinsc commented 4 years ago

Delayed

tilkinsc commented 4 years ago

I'll start this when I get home.

tilkinsc commented 4 years ago

So I started work on this. It is interesting. It appears that I have no way to do it prettier than to make local-to-file variables outside an event function to keep track of the current tooltips, as they appear 1 by 1 and execute OnTooltipSetItem event twicefor GameTooltip. Also, OnTooltipCleared also pops twice.

So, the OnTooltipSetItem handler can set the data it needs as the tooltip pops up and draw any data it has to the tooltip. The OnTooltipCleared can reset the data to nil when nothing is being compared. However, a latch needs to be used with the OnTooltipCleared method. This is a bit brutal and a bit more hectic than I like.

Once I figure out how I want it organized and such, I will release a beta.

A way to get around this is if I get the current items equipped and reinvent what will happen, then wait for all tooltips to be present before actually operating. The latch may be able to be removed if I check if the tooltips in question are actually shown to the player.