]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/cursormode
authorterencehill <piuntn@gmail.com>
Sun, 29 Jan 2012 15:39:57 +0000 (16:39 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 29 Jan 2012 15:39:57 +0000 (16:39 +0100)
Conflicts:
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc

qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/csqc_builtins.qc
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc

index d09f5ebb24edc94fdf9158c1b371d6fe71d1c0cf..d054deb651d4d8a00e519a17bf3e4c9caa4fd22c 100644 (file)
@@ -371,9 +371,10 @@ float button_zoom;
 // CSQC_InputEvent : Used to perform actions based on any key pressed, key released and mouse on the client.
 // Return value should be 1 if CSQC handled the input, otherwise return 0 to have the input passed to the engine.
 // All keys are in ascii.
-// bInputType = 0 is key pressed, 1 is key released, 2 is mouse input.
+// bInputType = 0 is key pressed, 1 is key released, 2 and 3 are mouse input.
 // In the case of keyboard input, nPrimary is the ascii code, and nSecondary is 0.
 // In the case of mouse input, nPrimary is xdelta, nSecondary is ydelta.
+// In the case of mouse input after a setcursormode(1) call, nPrimary is xpos, nSecondary is ypos.
 float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
 {
        float bSkipKey;
index f1112b33aa47fbb574dea670058a1ef191dca75c..383f957a815c43339fef982f2787516eec225ce6 100644 (file)
@@ -465,7 +465,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 || (autocvar__hud_configure && spectatee_status <= 0) || intermission > 1)
+       if(autocvar_cl_lockview || intermission > 1)
        {
                setproperty(VF_ORIGIN, freeze_org);
                setproperty(VF_ANGLES, freeze_ang);
index 15e62170bab859eca1b47c9bfa99797e959b006c..0fabb0d0c70b5eb86d9edca2d752efd2e466ee3e 100644 (file)
@@ -125,6 +125,7 @@ void (entity e)                                                                     runstandardplayerphysics = #347;
 
 string (float playernum, string key)                                   getplayerkeyvalue = #348;
 void (string cmdname)                                                  registercmd = #352;
+void(float usecursor)                                                  setcursormode = #343;
 vector ()                                                              getmousepos = #344;
 
 string (string s)                                                      uncolorstring = #170;
index 04f3020cb1e4ff325e63461a4e406940ab8d2465..87b07370493992d51f47f971d14dfc36cb196a17 100644 (file)
@@ -5097,8 +5097,13 @@ void HUD_Main (void)
                        HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha));
                }
                if (!hud_configure_prev)
+               {
+                       setcursormode(1);
                        hudShiftState = 0;
+               }
        }
+       else if (hud_configure_prev)
+               setcursormode(0);
 
        hud_configure_prev = autocvar__hud_configure;
 
index 15b924dd9cb9f6eae222bad1524642f001f52003..d5e84f5277cb0d26c216d590c0406c87c4172cee 100644 (file)
@@ -631,8 +631,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
 {
        string s;
 
-       // we only care for keyboard events
-       if(bInputType != 0 && bInputType != 1)
+       if(bInputType == 2)
                return false;
 
        if(!autocvar__hud_configure)
@@ -642,6 +641,13 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if(autocvar__menu_alpha)
                return true;
 
+       if(bInputType == 3)
+       {
+               mousepos_x = nPrimary;
+               mousepos_y = nSecondary;
+               return true;
+       }
+
        // allow console bind to work
        string con_keys;
        float keys;
@@ -1066,11 +1072,6 @@ void HUD_Panel_Mouse()
        if(autocvar__menu_alpha == 1)
                return;
 
-       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)