Quantcast WoWInterface - View Single Post - Highlight Targeted unit
View Single Post
03-04-18, 08:02 PM   #5
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Just a semantic nitpick, but if you're going to name your function instead of just passing it anonymously to oUF, you should change "OnSpawnNamePlates" to something that more accurately reflects when the function is actually called, like "OnAcquireNamePlate". In oUF land, "spawn" is something that happens once per frame, the first time the object is created, but the nameplate callback happens every time a nameplate frame (whether it's newly created or pulled from the pool of existing frames to be reused) gets assigned a unit.

It may not make much difference now, but when you're going back to your code in 6 months or 3 years, having that function named "spawn" is going to confuse you.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote