From 8d1bffe20edff80b49f8b6791692423628de676a Mon Sep 17 00:00:00 2001 From: FruitieX Date: Thu, 10 Jun 2010 01:38:03 +0300 Subject: [PATCH] allow console bind to work in config mode --- qcsrc/client/csqc_builtins.qc | 1 + qcsrc/client/hud.qc | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) 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 } -- 2.39.2