]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a way to disable cursormode (just in case)
authorSamual Lenks <samual@xonotic.org>
Sat, 8 Dec 2012 03:09:54 +0000 (22:09 -0500)
committerSamual Lenks <samual@xonotic.org>
Sat, 8 Dec 2012 03:09:54 +0000 (22:09 -0500)
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/mapvoting.qc

index 996302ca322baf32875a115fa5f6f7282643958d..e9c21f9dd229b4e77967617ae4af7e5a956eb5b8 100644 (file)
@@ -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);
index 5d5637473a1ad69bc1dc00c4f1ba20bbb83ff54e..ed56f718381cc0e2ecfe61c29d8e3ed2a59a261c 100644 (file)
@@ -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;
index 16cf6d2e9cefa87677d524483728b3cdbc2a23a9..13f37b70eb9b594cc8c68dcfde1f42936385ea41 100644 (file)
@@ -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;
index d1d5dfc8aec21da63dcada6245c0a9c36184f488..75c1d2c0e4328b362ca38598fc4c4788c323bfa7 100644 (file)
@@ -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)
index 0961096a4dc53a28abadabc9c2f2ee2bbad894a6..7aad4c4ffdd77b543bee03f612b6fe67e85a02f2 100644 (file)
@@ -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)