WoW:API SetCVar: Difference between revisions

537 bytes removed ,  22 July 2008
m
", the game" -removed
(Updated with new information)
m (", the game" -removed)
Line 8: Line 8:


:;cvar : String - CVar to modify
:;cvar : String - CVar to modify
:;value : New value of the CVar, the game
:;value : New value of the CVar - This value is stored in Config.wtf as plain text. Passing anything other than a string or number is just silly.
:;scriptCVar : String - First argument for the CVAR_UPDATE event, if none is passed then the event isn't fired
:;scriptCVar : String - First argument for the CVAR_UPDATE event, if none is passed then the event isn't fired


Line 22: Line 22:




== Notes ==
From Ohklus: '''Do not overwrite this function!''' You'll have a very hard time finding the reason for those nasty "sry, your addon was blocked cause it called a secure function" errors.
My example: hitting the escape key should just open the game menu. If you overwrite SetCVar you'll get the error each time you press Esc (except when closing a window). The error is released by the Blizzard UI functions [[API_SpellStopCasting]], [[API_SpellStopTargeting]] and [[API_ClearTarget]], because they appear in [[API_ToggleGameMenu]]. I've got no idea why SetCVar is called between hitting Esc and reaching [[API_ToggleGameMenu]].


__NOTOC__
__NOTOC__
Anonymous user