Another thing to keep in mind when disabling things using CVars, is that you have to make sure the CVar is changed after the blizzard user settings are fully loaded for your character, or it will likely have no effect.
I usually add a check for VARIABLES_LOADED whenever I change CVars, as this is when the blizzard settings have been loaded.
Originally Posted by Vrul
SetCVar
I'm not sure why setting that CVar before Blizzard_ArenaUI is loaded isn't working though, unless some other code is unparenting ArenaEnemyFrame1-5 from ArenaEnemyFrames.
|
Probably the above. If we change the CVar when our addon is loaded, there's a chance that the blizzard saved variables are loaded at a later point, thus rendering our CVar change useless as we did it too early in the loading process. The Blizzard_ArenaUI isn't loaded until much later, and the VARIABLES_LOADED event has probably fired long before this, thus the CVar change will have effect.