View Single Post
02-17-13, 01:41 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by Aanson View Post
What are you passing to 'GetThreatRegion()'?
That seems pretty obvious just from looking at the snippet he posted and you quoted... Plate is a reference to the nameplate object itself. Am I misinterpreting your question?

Anyway, the whole GetThreatRegion() function is extremely inefficient. You should identify all of the nameplate's children and regions once -- the first time you see the nameplate -- and attach them to the nameplate as table key/value pairs, eg. nameplate.threatRegion = x so you can get a reference to each region from a simple table lookup, instead of needing to do a whole chain of function lookups every time.

See http://www.wowinterface.com/forums/s...ad.php?t=44971 for an example.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote