Bidding window sometimes does not show up
taker2one opened this issue ยท 2 comments
Hi everyone,
first of all great work with the addon ๐
While testing before switching from CommunityDKP we noticed a problem with item filter which causes the Bidding-Window to not show up.
I saw in the code the variable canUseItem in BiddingManager\GUI.lua is causing the problem.
I tracked down the root cause why canUseItem is false even if its a usable item.
If an item is auctioned which the client has not in ItemCache the tooltip shows a red one liner "Retrieving item data" which causes the canUseItem variable to be set to false within the OnTooltipSetItem script of the CLMBiddingFakeTooltip.
This is not a problem if you where in range while the pm is looting (or looked into the boss by yourself) cause it seems the tradelog triggers loading the itemdata from the server into the cache.
To be failsafe i would suggest either request itemdata from server if not already cached and wait till itemdata is in cache(asynchronous call) or at least dont use the filter if C_Item.IsItemDataCachedByID(itemId) is false.
Are you up for implementing a fix and submitting a PR?
Solution:
- Implement a call to get the item data.
- Set a timeout of 0.5s via
C_Timer.After
that rechecks the cache. If item is still not in cache then don't apply the filter; if it is, apply the filter and show the window.
The idea here is to keep it simple, even if we could listen for the event that the item has arrived it would not negate the need for a timeout; so for now we implement just the timeout and accept the 0.5s delay even if the item data arrives in the cache before that.