View Single Post
08-15-16, 03:02 AM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Originally Posted by Galaxy119 View Post
Scold accepted. I am still learning LUA, I thought the only way to get it to update only the nameplate that was added was to make it do the change when it was added via event handler.
An event handler works exactly like hooksecurefunc, except for what triggers it. Events are obvious, but a hook is called every time the function it's hooking is called, no matter what called it. One or the other, not both.

For example, if I use hooksecurefunc('PlaySound',printsound) with printsound dumping the name of the sound to chat, it will print many uses of UI sounds in the default UI and any addons that use that function for sounds. In your case, WoW is already using the update function for the nameplates, it's better to hook that than rely on the event spam in combat.
  Reply With Quote