View Single Post
12-30-14, 11:59 AM   #16
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.

Originally Posted by ravagernl View Post
Code:
function addon.PLAYER_LOGIN()
    -- on login (saved variables loaded + spellbook ready, etc...)

    self:KillEvent("PLAYER_LOGIN")
end
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.

Also, why go with "KillEvent" instead of just sticking to convention and naming that "UnregisterEvent" ?
__________________
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