View Single Post
06-30-16, 03:15 AM   #3
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
imho addons should not change any cvar unless the purpose of the addon is to change those settings (turning something on/off) or a feature absolutely requires it (such as scriptProfile).

When addons take it upon themselves to tweak underlying console settings, it can affect the behavior of the UI or other addons that aren't related. Maybe that's an intended effect and in that case it's okay. Otherwsie imho it's better to exhaust all possible alternatives first, even if it means a little extra code to avoid taking a shortcut through the user's system settings. Like in your situation as a last resort I would've just built a separate dialog to replace the default's; it would not be a great deal of code and it would be a lot kinder to the user than tinkering with their system settings.

It's also neat and tidy when all traces of an addon are gone when an addon is disabled. It's messy when there's lingering stuff left over. And for this new cvar, which is not really related to the addon's purpose, the user would've likely forgetten all about that dialog asking about the cvar and it'd still be disabled for them for many years afterwards.

Another workaround for not being able to rely on GetTexture is to hook the SetTexture method on the texture.