From: terencehill Date: Tue, 24 May 2016 13:00:26 +0000 (+0200) Subject: Don't show joypad keys in the HUD if no joypad has been detected X-Git-Tag: xonotic-v0.8.2~887^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9199692ddcefa8ebbf0b9b3bc5922b8b83269288;p=xonotic%2Fxonotic-data.pk3dir.git Don't show joypad keys in the HUD if no joypad has been detected --- 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)