View Single Post
05-27-11, 11:02 AM   #2
Crepusculu
A Deviate Faerie Dragon
 
Crepusculu's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 16
I am not sure why you are trying to get "rid of a cache of nameplates". Just merely nullify or wipe out your cache table if you want to do that. The purpose of building a cache is to quickly access them rather than call the global variable table every time you want to modify the nameplate.


I would do the following

- collect a reference to all nameplates and continue checking for nameplates as they are created. Nameplates are stored as children on the WorldFrame and do not fire any events when they are created.
- create a custom cast bar for every frame, leave them hidden
- set up a combatlog parser
- grab the spell information on event, and find the matching nameplate to place the spell information
- modify the nameplate custom cast bar to display the information, and add an updater to move the bar
- hide the castbar / remove the updater when spell interrupts or finishes, or when the nameplate is hidden


The general issue that prevents you from just making castbars on each nameplate is the lack of a unique identifier on nameplates. That is to say that when an unit casts a spell in the combatlog, you have a GUID number provided that is unique to that unit. Nameplates don't show their GUID number, although they provide the unit name. You could parse the combatlog and assume that all unit names are unique and assign castbars to nameplates with matching unit names, but you will find duplicate names such as players matching pet names and multiple caster npcs. There are methods around this, but they are not simple.
  Reply With Quote