]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Show joystick binds in the HUD only when a joystick is active (detected and enabled)
authorterencehill <piuntn@gmail.com>
Mon, 8 May 2017 16:06:19 +0000 (18:06 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 8 May 2017 16:06:19 +0000 (18:06 +0200)
qcsrc/client/main.qc

index 91254e7add6b103f0754e4c60175ee74c2594a8e..a098bd7f9e3d02e3d4a5743248e6f3b2cadec466 100644 (file)
@@ -1232,7 +1232,7 @@ string _getcommandkey(string cmd_name, string command, bool forcename)
        keys = db_get(binddb, command);
        if (keys == "")
        {
-               bool joy_detected = cvar("joy_detected");
+               bool joy_active = cvar("joy_active");
                n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
                for(j = 0; j < n; ++j)
                {
@@ -1240,7 +1240,7 @@ string _getcommandkey(string cmd_name, string command, bool forcename)
                        if(k != -1)
                        {
                                string key = keynumtostring(k);
-                               if(!joy_detected && substring(key, 0, 3) == "JOY")
+                               if(!joy_active && substring(key, 0, 3) == "JOY")
                                        continue;
 
                                if (keys == "")