From: FruitieX Date: Wed, 9 Jun 2010 22:38:03 +0000 (+0300) Subject: allow console bind to work in config mode X-Git-Tag: xonotic-v0.1.0preview~541^2~75 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8d1bffe20edff80b49f8b6791692423628de676a;p=xonotic%2Fxonotic-data.pk3dir.git allow console bind to work in config mode --- diff --git a/qcsrc/client/csqc_builtins.qc b/qcsrc/client/csqc_builtins.qc index 83955df8c..603ac552f 100644 --- a/qcsrc/client/csqc_builtins.qc +++ b/qcsrc/client/csqc_builtins.qc @@ -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; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 1f592d194..99ce9eae4 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -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 }