From 567a1e4acd379882671e9ee2e27c9ea191e353fe Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 14 Nov 2020 16:24:18 +0100 Subject: [PATCH] Advanced menu tooltips: display cvar value next to cvar name --- qcsrc/menu/menu.qc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index cb61d3943..07486347f 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -507,9 +507,12 @@ string gettooltip() string s; if (menuTooltipItem.cvarName) { - if (getCvarsMulti(menuTooltipItem)) s = - strcat("[", menuTooltipItem.cvarName, " ", getCvarsMulti(menuTooltipItem), "]"); - else s = strcat("[", menuTooltipItem.cvarName, "]"); + string cvar_list = getCvarsMulti(menuTooltipItem); + if (cvar_list) + cvar_list = strcat(menuTooltipItem.cvarName, " ", cvar_list); + else + cvar_list = menuTooltipItem.cvarName; + s = strcat("[", cvar_list, " \"", cvar_string(menuTooltipItem.cvarName), "\"]"); } else if (menuTooltipItem.onClickCommand) { -- 2.39.2