Originally Posted by Ammako
Just register ADDON_LOADED alongside PLAYER_LOGIN. OnEvent fires whenever any of the events registered to the frame happen.
I guess if you're doing it with separate functions for each event then you would also need to write the same one but for ADDON_LOADED. Though, for what you're doing, I'm honestly not sure why it needs to be separate from your OnEvent script.
(What does your script at lines 6-9 actually do, anyway?)
|
ADDON_LOADED would have to be registered in the JWFrame:PLAYER_LOGIN() function so it is not activated every time a startup addon loads. You could
Code:
if not JWFrame.ADDON_LOADED then
JWFrame.ADDON_LOADED = JWFrame.PLAYER_LOGIN
JWFrame:RegisterEvent("ADDON_LOADED")
end
But this means it is going to cycle through all addons each time the ADDON_LOADED event is fired (admittedly this won't be very often so the extra processing might not bother JDoubleU00)