diff --git a/changelog.txt b/changelog.txt index 3b9e4f7..25ffd01 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,8 @@ DD Mmm 19 - 1.51 +add: now showing the cvar's current and latched values in the help panel + add: new console and chat keyboard shortcuts Ctrl-left/right arrow | move caret to previous/next word Shift-left/right arrow | move caret to previous/next argument diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp index 46f7610..1c11cf4 100644 --- a/code/qcommon/common.cpp +++ b/code/qcommon/common.cpp @@ -3480,6 +3480,25 @@ printHelpResult_t Com_PrintHelp( const char* name, printf_t print, qbool printNo else print( S_COLOR_CMD "%s\n", name ); + const cvar_t* const cvar = Cvar_FindVar( name ); + if ( cvar != NULL ) { + const char* const quote1 = cvar->type == CVART_STRING ? "\"" : ""; + const char* const quote2 = cvar->type == CVART_STRING ? "^7\"" : "^7"; + if ( cvar->latchedString != NULL ) { + const char* const combined = + va( "Current: %s" S_COLOR_VAL "%s%s (Latched: %s" S_COLOR_VAL "%s%s)\n", + quote1, cvar->string, quote2, quote1, cvar->latchedString, quote2 ); + if ( strlen( combined ) < CONSOLE_WIDTH ) { + print( combined ); + } else { + print( "Current: %s" S_COLOR_VAL "%s%s\n", quote1, cvar->string, quote2 ); + print( "Latched: %s" S_COLOR_VAL "%s%s\n", quote1, cvar->latchedString, quote2 ); + } + } else { + print( "Current: %s" S_COLOR_VAL "%s" S_COLOR_HELP "%s\n", quote1, cvar->string, quote2 ); + } + } + if ( printModules ) Com_PrintModules( firstModule, moduleMask, print );