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.
__________________
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