diff options
Diffstat (limited to 'src/qcommon/cvar.c')
-rw-r--r-- | src/qcommon/cvar.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/qcommon/cvar.c b/src/qcommon/cvar.c index 93ab6ae8..336f45b0 100644 --- a/src/qcommon/cvar.c +++ b/src/qcommon/cvar.c @@ -439,6 +439,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) { var->integer = atoi(var->string); var->resetString = CopyString( var_value ); var->validate = qfalse; + var->description = NULL; // link the variable in var->next = cvar_vars; @@ -490,6 +491,10 @@ void Cvar_Print( cvar_t *v ) { if ( v->latchedString ) { Com_Printf( "latched: \"%s\"\n", v->latchedString ); } + + if ( v->description ) { + Com_Printf( "%s\n", v->description ); + } } /* @@ -1121,6 +1126,8 @@ cvar_t *Cvar_Unset(cvar_t *cv) Z_Free(cv->latchedString); if(cv->resetString) Z_Free(cv->resetString); + if(cv->description) + Z_Free(cv->description); if(cv->prev) cv->prev->next = cv->next; @@ -1292,6 +1299,23 @@ void Cvar_CheckRange( cvar_t *var, float min, float max, qboolean integral ) /* ===================== +Cvar_SetDescription +===================== +*/ +void Cvar_SetDescription( cvar_t *var, const char *var_description ) +{ + if( var_description && var_description[0] != '\0' ) + { + if( var->description != NULL ) + { + Z_Free( var->description ); + } + var->description = CopyString( var_description ); + } +} + +/* +===================== Cvar_Register basically a slightly modified Cvar_Get for the interpreted modules |