View Single Post
06-10-21, 11:46 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
If buttonName was global, each click would print the last thing it was set to at the time of the click. If say another addon was using buttonName accidently as a global, it could be set to anything at any time before you clicked.

printing self:GetName() just prints that buttons name so you're not relying on having some possibly dubiously scoped variable set to the right name at the right time.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-11-21 at 12:09 AM.
  Reply With Quote