From 5aecd3dd7a0f126bd68b8bcbb827b209b450e295 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 30 Dec 2010 21:44:39 +0100 Subject: [PATCH] Access directly these autocvars --- qcsrc/client/Main.qc | 8 ++++---- qcsrc/client/View.qc | 4 ---- qcsrc/client/hud.qc | 5 ++--- qcsrc/client/main.qh | 2 -- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 49467ce15d..1f958e98a4 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1406,7 +1406,7 @@ string getcommandkey(string text, string command) string keys; float n, j, k, l; - if (!hud_showbinds) + if (!autocvar_hud_showbinds) return text; keys = db_get(binddb, command); @@ -1424,7 +1424,7 @@ string getcommandkey(string text, string command) keys = strcat(keys, ", ", keynumtostring(k)); ++l; - if (hud_showbinds_limit > 0 && hud_showbinds_limit >= l) break; + if (autocvar_hud_showbinds_limit > 0 && autocvar_hud_showbinds_limit >= l) break; } } @@ -1432,12 +1432,12 @@ string getcommandkey(string text, string command) } if ("" == keys) { - if (hud_showbinds > 1) + if (autocvar_hud_showbinds > 1) return strcat(text, " (not bound)"); else return text; } - else if (hud_showbinds > 1) + else if (autocvar_hud_showbinds > 1) return strcat(text, " (", keys, ")"); else return keys; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 6f2bb6e025..5d16181c8c 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -547,10 +547,6 @@ void CSQC_UpdateView(float w, float h) // Draw the Engine Status Bar (the default Quake HUD) R_SetView(VF_DRAWENGINEHUD, 0); - // fetch this one only once per frame - hud_showbinds = autocvar_hud_showbinds; - hud_showbinds_limit = autocvar_hud_showbinds_limit; - // Update the mouse position /* mousepos_x = vid_conwidth; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 09f7c36807..8f690bb18a 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -773,7 +773,6 @@ void HUD_Weapons(void) } float weapons_st = getstati(STAT_WEAPONS); - float label = autocvar_hud_panel_weapons_label; for(i = 0; i < weapon_cnt; ++i) { @@ -813,9 +812,9 @@ void HUD_Weapons(void) { drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL); - if(label == 1) // weapon number + if(autocvar_hud_panel_weapons_label == 1) // weapon number drawstring(wpnpos, ftos(weapid), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); - else if(label == 2) // bind + else if(autocvar_hud_panel_weapons_label == 2) // bind drawstring(wpnpos, getcommandkey(ftos(weapid), strcat("impulse ", ftos(weapid))), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); // draw ammo status bar diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 3219d338f9..5f15d41a02 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -121,8 +121,6 @@ float ignore_minus_zoom; float warmup_stage; string getcommandkey(string text, string command); -float hud_showbinds; -float hud_showbinds_limit; string vote_called_vote; float ready_waiting; -- 2.39.2