diff --git a/src/command.h b/src/command.h index 718a60abd..9c3e8277e 100644 --- a/src/command.h +++ b/src/command.h @@ -144,6 +144,7 @@ struct consvar_t //NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NULL INT32 flags; // flags see cvflags_t above CV_PossibleValue_t *PossibleValue; // table of possible values void (*func)(void); // called on change, if CV_CALL set + const char *description; INT32 value; // for INT32 and fixed_t const char *string; // value in string char *zstring; // Either NULL or same as string. @@ -204,7 +205,7 @@ struct CVarList; #define CVAR_INIT consvar_t #else #define CVAR_INIT( ... ) \ -{ __VA_ARGS__, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL } +{ __VA_ARGS__, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL } #endif extern CV_PossibleValue_t CV_OnOff[]; diff --git a/src/cvars.cpp b/src/cvars.cpp index d9e5e67ba..a815a6ce4 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -86,6 +86,12 @@ struct consvar_t::Builder return builder; } + Builder& description(const char* description) + { + var_.description = description; + return *this; + } + Builder& save() { var_.flags |= CV_SAVE;