View Single Post
12-30-14, 12:21 PM   #17
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Originally Posted by Phanx View Post
Well, that's not quite relevant to what I was saying; I was talking about a frame that's created for the sole purpose of handling a single hardcoded event, typically just one time, such as delaying something for after saved variables are loaded or after spell information is available. Obviously if your frame is handling more than one event, or if you dynamically register and unregister events, you probably have to check the event, and you are doing that in the code you posted.
If ADDON_LOADED is triggered in response to the AddOn being loaded on demand (or by a loadmanager) then PLAYER_LOGIN doesn't trigger.

I hope this was the result of "I'm too lazy to go find my real code and copy/paste it so here's some badly written fake code instead" and not your actual code, or you should be getting an error since "self" is not defined in that scope since you used a period instead of a colon.
Must..Resist... Well ok.

It indeed is, wrote that from memory and didn't test it, I'm a bit tired and chilling on my laptop

Also, why go with "KillEvent" instead of just sticking to convention and naming that "UnregisterEvent" ?
Because I'm lazy UnregisterEvent is in there too, KillEvent just also kicks the handler function away from the table scope to reduce lookups Could have named it UnregisterEventAndNillifyHandler, but it's a bitch to type.

Last edited by ravagernl : 12-30-14 at 12:34 PM. Reason: damn you bbcode!
  Reply With Quote