From 9199692ddcefa8ebbf0b9b3bc5922b8b83269288 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 24 May 2016 15:00:26 +0200 Subject: [PATCH] Don't show joypad keys in the HUD if no joypad has been detected --- qcsrc/client/main.qc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 1767b8f2b..09f78d274 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -1188,16 +1188,21 @@ string getcommandkey(string text, string command) keys = db_get(binddb, command); if (keys == "") { + bool joy_detected = cvar("joy_detected"); n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings for(j = 0; j < n; ++j) { k = stof(argv(j)); if(k != -1) { - if ("" == keys) - keys = keynumtostring(k); + string key = keynumtostring(k); + if(!joy_detected && substring(key, 0, 3) == "JOY") + continue; + + if (keys == "") + keys = key; else - keys = strcat(keys, ", ", keynumtostring(k)); + keys = strcat(keys, ", ", key); ++l; if (autocvar_hud_showbinds_limit > 0 && autocvar_hud_showbinds_limit <= l) -- 2.39.2