View Single Post
10-31-08, 04:37 PM   #2
Cirk
A Cobalt Mageweaver
 
Cirk's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 226
Originally Posted by Kjado View Post
I step through and do this for all of the items I care about for my addon, however, with a fresh cache (by deleting the Cache folder before starting WoW), GetItemInfo() returns nil later in the addon loading stage, even though I am sure to only call it with arguments I know are valid from my tables. The interesting thing is, if I reload the UI via /console reloadui, etc. a couple times immediately afterwards, the errors cease and the addon works properly.
Although SetHyperlink will cause the item to be loaded into your local cache, this takes time since it requires a request to the server and response back. Also, apparently the cache is of limited size, so items will "age out" of the cache over time, meaning even if the item is in the cache today, it may not be tomorrow.

What I do for this problem in Lootvalue (which faces similar problems to your addon) is just to keep retrying every 200msec (via OnUpdate) while the tooltip is shown to see if we have the data yet.

(I use 200msec since for most players that means one retry cycle, and 200msec is the Blizz default tooltip update delay anyway).

Hope that helps
-- Cirk
__________________
Cirk's Addons
  Reply With Quote