]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
allow console bind to work in config mode
authorFruitieX <rasse@rasse-lappy.localdomain>
Wed, 9 Jun 2010 22:38:03 +0000 (01:38 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Wed, 9 Jun 2010 22:38:03 +0000 (01:38 +0300)
qcsrc/client/csqc_builtins.qc
qcsrc/client/hud.qc

index 83955df8ca30680f44589f7049427e5a222848c6..603ac552fbd0dccb6d78d8a1918e95dc59457deb 100644 (file)
@@ -281,6 +281,7 @@ string(string info, string key) infoget = #227;
 string(string info, string key, string value, ...) infoadd = #226;
 string(string in) uri_escape = #510;
 
+float stringtokeynum(string keyname) = #341;
 string keynumtostring(float keynum) = #520;
 string findkeysforcommand(string command) = #521;
 
index 1f592d1945421029cda8aa788d16da54cbe35782..99ce9eae49e4dc5aba2d00b54cdc8772495bdb56 100644 (file)
@@ -1166,6 +1166,19 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if(!hud_configure)
                return false;
 
+       // allow console bind to work
+       string con_keys;
+       float keys;
+       con_keys = findkeysforcommand("toggleconsole");
+       keys = tokenize(con_keys);
+
+       float hit_con_bind, i;
+       for (i = 0; i < keys; ++i)
+       {
+               if(nPrimary == stof(argv(i)))
+                       hit_con_bind = 1;
+       }
+
        prevMouseClicked = mouseClicked;
        if(nPrimary == K_MOUSE1)
        {
@@ -1181,6 +1194,9 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        else if(nPrimary == K_ESCAPE)
                cvar_set("_hud_configure", "0");
 
+       else if(hit_con_bind)
+               return false;
+
        return true; // Suppress ALL other input
 }