View Single Post
03-13-14, 07:28 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
A few questions.
  • Is the variable 'c' a local variable, and not in the global namespace?
  • 'c' is not descriptive. What does it do? Where do you use it? In a year, 'c' will not mean anything to you, nor anyone else. If it is colours, call it 'MyAddOnName_UnitColors' or something that tells you what use it serves.
  • In your event handler function, you are not checking for if event == "EVENT_NAME" then...
  • Since you are only checking for focus and target, why register the other events?

As for "is there a better way", if you could be more forthcoming about what you are trying to do overall, that would help. Right now, you haven't posted enough code to properly answer.

Last edited by myrroddin : 03-13-14 at 07:32 PM. Reason: added something
  Reply With Quote