View Single Post
10-31-08, 01:19 PM   #1
Kjado
A Deviate Faerie Dragon
 
Kjado's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 10
Problems with forcing cache entries

I wrote a small addon to add some inscription information to tooltips:
http://www.wowinterface.com/download...rindstone.html

I have my association tables implemented via item IDs instead of names to provide cross-localization support automatically. However, by doing this I need to force all of the inscription-related items (herbs, pigments, and inks) from my tables into the user's cache so later calls to GetItemInfo() do not return nil. After doing some research, I found that the following will force an item into the cache:
Code:
tooltip:SetHyperlink("item:" .. id)
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.

Is there some sort of delay on cache entries that would cause these first couple startup iterations to not find the items in the cache even though they had been set via GameTooltip:SetHyperlink()? Or if this isn't the case, is there a more effective way to force data into the cache for later use?
  Reply With Quote