WoW:API SetCVar: Difference between revisions

m
Move page script moved page API SetCVar to WoW:API SetCVar without leaving a redirect
(Added information on scriptCVar)
m (Move page script moved page API SetCVar to WoW:API SetCVar without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
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 17: Line 17:
Some options require a call to [[API_RestartGx|RestartGx]]() before they take effect.
Some options require a call to [[API_RestartGx|RestartGx]]() before they take effect.


If you try and pass an invalid CVar you'll get an error, check [[Config.wtf defaults]] for a list of valid CVars.
If you try and pass an invalid CVar you'll get an error, check [[Console variables]] for a list of valid CVars.


By default CVAR_UPDATE is not fired when you call SetCVar, to make sure it does you need to pass the third argument scriptCVar which will be the first argument in the event when it's fired.
By default CVAR_UPDATE is not fired when you call SetCVar, to make sure it does you need to pass the third argument scriptCVar which will be the first argument in the event when it's fired.


__NOTOC__
__NOTOC__
Anonymous user