]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Advanced menu tooltips: display cvar value next to cvar name
authorterencehill <piuntn@gmail.com>
Sat, 14 Nov 2020 15:24:18 +0000 (16:24 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 14 Nov 2020 15:24:18 +0000 (16:24 +0100)
qcsrc/menu/menu.qc

index cb61d3943cd0c428e557bec04c1b1fde29fd58a1..07486347f8fb559e830509789cd619c3e239be7c 100644 (file)
@@ -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)
                {