This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
Hi Ace3,
First of all, I apologize if I'm on a wrong spot to ask regarding this.
After reading a description on AceAddon-3.0.lua file, I couldn't figure out why my module's OnEnable/OnDisable functions not being called and thus I've reached here.
Please have a look at the following codes first.
init.lua: https://pastebin.com/z1CRRD0j
Assassination.lua: https://pastebin.com/74HcbZk6
ADDED WITH AN EDIT
Outlaw.lua: https://pastebin.com/cZi32PDp
Subtlety.lua: https://pastebin.com/Z4UUCVpC
As you can see, I'm manually calling E:ACTIVE_TALENT_GROUP_CHANGED function with an extra parameter called isOnInitialize to pre-set modules enabledState based on player's current specialization. To be honest, they are being set properly and I thought they would call either of OnEnable or OnDisable function, but it didn't... PLEASE REFER TO EDIT
Even after reading a documentation I couldn't get why...
Would this be an intended behaviour? If so... could you please tell me why and how I could solve this case?
Thank you.
EDIT: The initial test was done without modules for assassination and subtlety being created. So, guess I should correct an error. It seems like OnEnable function is successfully being called for the one that is enabled, as I expected. However, the other two modules' OnDisable functions still don't get called on addon's OnInitialize function.
EDIT2: On Specialization change, only the old spec's OnDisable function and new spec's OnEnable function get called (no affects on third spec). Would this be an intended behavior?
EDIT3: I've done further experiment and figured that even if I set an addon's default module state to false, it doesn't call OnDisable function on initialization phase. Does this mean that I have to manually call OnDisable function if needed during the initialization?
OnDisable is only called when a module was previously enabled. If a module is never scheduled for being enabled (because its initial state is disabled), then neither OnEnable or OnDisable will ever be invoked - intentionally so.
To post a comment, please login or register a new account.