From: terencehill Date: Sun, 29 Jan 2012 15:39:57 +0000 (+0100) Subject: Merge branch 'master' into terencehill/cursormode X-Git-Tag: xonotic-v0.7.0~196^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7e0864d035fea38e3127a0728909641536c1a99d;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'master' into terencehill/cursormode Conflicts: qcsrc/client/hud.qc qcsrc/client/hud_config.qc --- 7e0864d035fea38e3127a0728909641536c1a99d diff --cc qcsrc/client/View.qc index b64fe3660,f1112b33a..383f957a8 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@@ -445,10 -465,10 +465,10 @@@ 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) { - R_SetView(VF_ORIGIN, freeze_org); - R_SetView(VF_ANGLES, freeze_ang); + setproperty(VF_ORIGIN, freeze_org); + setproperty(VF_ANGLES, freeze_ang); } else { diff --cc qcsrc/client/csqc_builtins.qc index dd7b18da3,15e62170b..0fabb0d0c --- a/qcsrc/client/csqc_builtins.qc +++ b/qcsrc/client/csqc_builtins.qc @@@ -120,12 -120,11 +120,12 @@@ void (string s, ...) print = #339 void (float scale) setsensitivityscale = #346; - void (float framenum) RetrieveMovementFrame = #345; - void () DefaultPlayerPhysics = #347; + float (float framenum) getinputstate = #345; + void (entity e) runstandardplayerphysics = #347; - string (float playernum, string key) getplayerkey = #348; + 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; diff --cc qcsrc/client/hud.qc index f8e68fc2b,04f3020cb..87b073704 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@@ -4989,12 -5096,9 +5096,14 @@@ void HUD_Main (void HUD_Panel_UpdatePosSizeForId(highlightedPanel); 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; diff --cc qcsrc/client/hud_config.qc index 0c47ffa2d,15b924dd9..d5e84f527 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@@ -627,13 -638,10 +637,17 @@@ float HUD_Panel_InputEvent(float bInput if(!autocvar__hud_configure) return false; + // block any input while a menu dialog is fading + 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; @@@ -1052,15 -1060,17 +1066,12 @@@ void HUD_Panel_Mouse( /* print("menu_enabled: ", ftos(menu_enabled), "\n"); print("Highlighted: ", ftos(highlightedPanel), "\n"); - print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n"); + print("Menu theAlpha: ", ftos(autocvar__menu_alpha), "\n"); */ - // instantly hide the editor cursor if we open the HUDExit dialog - // as hud_fade_alpha doesn't decrease to 0 in this case - // TODO: find a way to fade the cursor out even in this case - if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha)) + 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)