Thread: Multilanguage
View Single Post
06-27-13, 12:44 PM   #12
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
Originally Posted by Choonstertwo View Post
Shouldn't that __index metamethod be checking the regular tooltip __index table at some point? That's where all the tooltip methods are stored and your metamethod seems to bypass it completely.

Alternatively, use a separate table as a self-generating cache instead of overloading the tooltip itself.
It does use tooltip to store, it's both a table and a widget and if you try tooltip[1234] and it doesn't exist, then it calls the function at __index to do a lookup and store the result string at that position, so next time you call tooltip[1234] it returns the string instead of doing a lookup. I refer to the tooltip object using "self" in the function, it's the same object.
__________________
Profile: Curse | Wowhead
  Reply With Quote