Disabled AddOn's hooks still ... hooked?
I am writing a plugin for ElvUI that hooks the function that displays the text on the xp, honor, rep, and artifact bars; in and of itself it works totally fine. When it is enabled via its own settings, it does its job. When the toggle off is set, it reverts the text back to the original text because I call the ElvUI's function again.
I thought that would be the end of it, but since I am still writing the thing, I disabled it entirely via the game's AddOns button last night when raiding. In other words, my AddOn was not even loaded. So imagine my surprise when my replacement text for the XP bar still was intact! ElvUI does not support the text I have added. No, this is some kind of legacy of an entirely disabled AddOn. How in the world is that even possible?!? Anyone have any ideas why a disabled AddOn would still be functional? The only clue I have is that once disabled via the AddOn button (technically ACP's button version) and switching AddOn profile setups, I needed to reload the UI, which of course I did. Shouldn't that mean my AddOn is removed from memory, its functions disabled, and its hooks turned off? |
Ye-e-e-ah, apparently it doesn't. I discovered this happening to me (but not with an addon that I'd written - I don't write addons, y'know) several years ago. I was doing ... something (sorry, can't remember what) ... and I had disabled certain addons, but, low and behold - there they were! I found out that to TRULY disable them, I had to disable the addons and restart my computer, THEN they were disabled.
I figured that it was just a glitch or it was something with the system. I don't know, but, it happened several times. I finally gave up trying to do whatever it was 'cause it was just too much of a p-i-t-a. |
A /reload resets the interface to its initial state; regardless of what your addon does, if you've properly disabled it and reloaded your ui it will not be doing it any more. 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. |
Quote:
In pseudocode because pasting my entire module's code is long, here's what happens. Lua Code:
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.... :confused: |
As semlar stated, this is not possible. If there were a bug where the game wasn't flushing the UI on reload, I would think that it would have been discovered by now.
Even the default UI gets rebuilt on a reload. |
All times are GMT -6. The time now is 09:32 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI