View Single Post
09-20-17, 06:33 PM   #4
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Originally Posted by semlar View Post
The only exception to this is persistent CVars and saved variables being loaded by other addons.

Either your addon was not actually disabled, you didn't reload the game, or you're mistaking its effect with one from another addon.
Here's where I'm confused. Just like Jeffy, I disabled my module plugin via Esc - AddOns, then reloaded my UI. My code has nothing to do with CVars, and it does add to ElvUI's SV table, the option is a toggle. I understand that the toggle would still be in Elv's SV table, but it should not do anything with my module turned off and the UI reloaded.

In pseudocode because pasting my entire module's code is long, here's what happens.
Lua Code:
  1. -- Elv enabled, MyModule not installed
  2. bar:SetText("3 / 71")
  3.  
  4. -- Elv enabled, MyModule installed and enabled
  5. bar:SetText("Capped")
  6.  
  7. -- Elv enabled, MyModule installed but disabled via its own options menu
  8. bar:SetText("3 / 71")
  9.  
  10. -- Elv enabled, MyModule installed, enabled as per #2 above, then disabled via Esc - AddOns
  11. -- MyModule's toggle still set to true
  12. bar:SetText("Capped")

Just because MyModule's toggle is set to true should not do anything if there is no function to handle the toggle.

Now you know why I am confused about hooking functions. If MyModule is not even loaded and the UI has been reloaded, then why hasn't bar's text reverted back to pre-MyModule display?

And for the record, I have no other addons that change bar's text to "Capped", hence why among other reasons, I am writing the module. Only MyModule changes the text to "Capped" via secure hook.

ElvUI cannot call MyModule's function that changes the text if MyModule is not even loaded....
  Reply With Quote