Hobinbot@legacy41545296 (talk | contribs) (upgraded deprecated template) |
Shadowed51320@legacy41570690 (talk | contribs) (Added information on scriptCVar) |
||
Line 1: | Line 1: | ||
{{wowapi}} |
{{wowapi}} |
||
+ | Changes a variable located inside Config.wtf |
||
⚫ | |||
+ | |||
⚫ | |||
+ | == Parameters == |
||
− | SetCVar allows you to set the content of the variables defined in the config.wtf file (which is in the WTF directory). |
||
+ | === Arguments === |
||
+ | :;cvar : String - CVar to modify |
||
⚫ | |||
+ | :;value : New value of the CVar, the game |
||
+ | :;scriptCVar : String - First argument for the CVAR_UPDATE event, if none is passed then the event isn't fired |
||
+ | ---- |
||
− | SetCVar("UnitNamePlayer", "1") - enables player nametags. |
||
+ | === Details === |
||
⚫ | |||
+ | Some options require a call to [[API_RestartGx|RestartGx]]() before they take effect. |
||
− | See [[Config.wtf defaults]] for more. |
||
+ | |||
+ | If you try and pass an invalid CVar you'll get an error, check [[Config.wtf defaults]] 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. |
||
+ | |||
+ | __NOTOC__ |
Revision as of 00:01, 18 April 2007
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Changes a variable located inside Config.wtf
SetCVar( "cvar", value[, "scriptCVar"] );
Parameters
Arguments
- cvar
- String - CVar to modify
- value
- New value of the CVar, the game
- scriptCVar
- String - First argument for the CVAR_UPDATE event, if none is passed then the event isn't fired
Details
Settings that are changed using this will be applied to the game UI immediately, however settings are not saved until exit and settings which were previously not defined in Config.wtf are not available to GetCVar until the file has been saved at logout.
Some options require a call to 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.
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.