View Single Post
12-27-17, 08:35 PM   #11
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Originally Posted by Ammako View Post
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)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-27-17 at 08:41 PM.
  Reply With Quote