View Single Post
07-17-05, 08:37 PM   #25
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
Originally Posted by Legorol
I don't see the difference between "object", "table" or "class", since in Lua they are the same thing, they are all just tables. GameTooltip is just as much a Lua-table as say MyAddOnClass.
Right, the "foo.bar" syntax uses "foo" as the name of a table and "bar" as an entry in the table. That works for tables and classes (since classes are just fancy tables).

The "foo:bar" syntax uses "foo" as the name of an object, then fetches the metatable info to find the object class. The trace function is inserted into the class table, but stats are only collected if the object instance matches "foo" at call time. I'm not sure I'm explaining it well. (And maybe I misinterpreted Kaelten's original request...)

As you have guessed, Blizzard uses a natively (read, in C) implemented __index function in a metatable attached to every XML-generated object that's using a non-Lua method to dispatch calls, so you are hosed, in principle. In practice however, complete lists of methods for all known XML-generated object types are available
Did you ever try replacing __index? Hooking that would yield all sorts of interesting information about frame methods. I'll poke around a bit in the metatable info and see what I can do.

(BTW, cedar's half up! woot! gonna be nice to trade the hammer for a keyboard and get back to coding...
  Reply With Quote