From bf4914c5f2d3a9f1bde42e92ce8743a6a62e4d04 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Fri, 7 Dec 2012 22:09:54 -0500 Subject: [PATCH] Add a way to disable cursormode (just in case) --- qcsrc/client/View.qc | 2 +- qcsrc/client/autocvars.qh | 1 + qcsrc/client/hud.qc | 4 ++-- qcsrc/client/hud_config.qc | 8 ++++++++ qcsrc/client/mapvoting.qc | 11 ++++++++++- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 996302ca3..e9c21f9dd 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -475,7 +475,7 @@ void CSQC_UpdateView(float w, float h) } // do lockview after event chase camera so that it still applies whenever necessary. - if(autocvar_cl_lockview) + if(autocvar_cl_lockview || (!autocvar_hud_cursormode && (autocvar__hud_configure && spectatee_status <= 0 || intermission > 1))) { setproperty(VF_ORIGIN, freeze_org); setproperty(VF_ANGLES, freeze_ang); diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 5d5637473..ed56f7183 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -157,6 +157,7 @@ float autocvar_g_waypointsprite_timealphaexponent; var float autocvar_g_waypointsprite_turrets = TRUE; var float autocvar_g_waypointsprite_turrets_maxdist = 5000; +var float autocvar_hud_cursormode = TRUE; float autocvar_hud_colorflash_alpha; float autocvar_hud_configure_checkcollisions; float autocvar_hud_configure_grid; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 16cf6d2e9..13f37b70e 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -5192,11 +5192,11 @@ void HUD_Main (void) } if (!hud_configure_prev) { - setcursormode(1); + if(autocvar_hud_cursormode) { setcursormode(1); } hudShiftState = 0; } } - else if (hud_configure_prev) + else if (hud_configure_prev && autocvar_hud_cursormode) setcursormode(0); hud_configure_prev = autocvar__hud_configure; diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index d1d5dfc8a..75c1d2c0e 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -1076,6 +1076,14 @@ void HUD_Panel_Mouse() if(autocvar__menu_alpha == 1) return; + if not(autocvar_hud_cursormode) + { + mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed; + + mousepos_x = bound(0, mousepos_x, vid_conwidth); + mousepos_y = bound(0, mousepos_y, vid_conheight); + } + if(mouseClicked) { if(prevMouseClicked == 0) diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index 0961096a4..7aad4c4ff 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -174,6 +174,14 @@ void MapVote_Draw() if(!mv_active) return; + if not(autocvar_hud_cursormode) + { + mv_mousepos = mv_mousepos + getmousepos(); + + mv_mousepos_x = bound(0, mv_mousepos_x, vid_conwidth); + mv_mousepos_y = bound(0, mv_mousepos_y, vid_conheight); + } + center = (vid_conwidth - 1)/2; xmin = vid_conwidth*0.05; // 5% border must suffice xmax = vid_conwidth - xmin; @@ -330,7 +338,8 @@ void MapVote_Init() precache_sound ("misc/invshot.wav"); mv_active = 1; - setcursormode(1); + if(autocvar_hud_cursormode) { setcursormode(1); } + else { mv_mousepos = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight; } mv_selection = -1; for(n_ssdirs = 0; ; ++n_ssdirs) -- 2.39.2