From 341f3a253ecbeb612f70a1854b09c96d28f6030e Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Tue, 21 Jul 2015 18:44:24 +0100 Subject: [PATCH] Stop dolly on mouse button release --- .../functions/fnc_handleInterface.sqf | 21 ++++++++++--------- .../spectator/functions/fnc_handleMouse.sqf | 6 +++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 3f198f47d5..7555fa2682 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -128,6 +128,7 @@ switch (toLower _mode) do { _args params ["_ctrl","_button"]; GVAR(mouse) set [_button,false]; + if (_button == 0) then { GVAR(camDolly) = [0,0]; }; }; case "onmousezchanged": { _args params ["_ctrl","_zChange"]; @@ -168,19 +169,19 @@ switch (toLower _mode) do { GVAR(camBoom) = 0.5; }; case 17: { // W - GVAR(camDolly) set [0, GVAR(camSpeed)]; + GVAR(camDolly) set [1, GVAR(camSpeed)]; }; case 29: { // Ctrl GVAR(ctrlKey) = true; }; case 30: { // A - GVAR(camDolly) set [1, -GVAR(camSpeed)]; - }; - case 31: { // S GVAR(camDolly) set [0, -GVAR(camSpeed)]; }; + case 31: { // S + GVAR(camDolly) set [1, -GVAR(camSpeed)]; + }; case 32: { // D - GVAR(camDolly) set [1, GVAR(camSpeed)]; + GVAR(camDolly) set [0, GVAR(camSpeed)]; }; case 35: { // H [_display,nil,true] call FUNC(toggleInterface); @@ -223,20 +224,20 @@ switch (toLower _mode) do { GVAR(camBoom) = 0; }; case 17: { // W - GVAR(camDolly) set [0, 0]; + GVAR(camDolly) set [1, 0]; }; case 29: { // Ctrl GVAR(ctrlKey) = false; }; case 30: { // A - GVAR(camDolly) set [1, 0]; - }; - case 31: { // S GVAR(camDolly) set [0, 0]; }; - case 32: { // D + case 31: { // S GVAR(camDolly) set [1, 0]; }; + case 32: { // D + GVAR(camDolly) set [0, 0]; + }; case 44: { // Z GVAR(camBoom) = 0; }; diff --git a/addons/spectator/functions/fnc_handleMouse.sqf b/addons/spectator/functions/fnc_handleMouse.sqf index 9e839d0645..fe690b090e 100644 --- a/addons/spectator/functions/fnc_handleMouse.sqf +++ b/addons/spectator/functions/fnc_handleMouse.sqf @@ -30,9 +30,9 @@ _oldY = GVAR(mousePos) select 1; _deltaX = _oldX - _x; _deltaY = _oldY - _y; -if (_leftButton && _rightButton) then { - GVAR(camDolly) set [0, _deltaX * GVAR(camSpeed)]; - GVAR(camDolly) set [1, _deltaY * GVAR(camSpeed)]; +if (_leftButton) then { + GVAR(camDolly) set [0, _deltaX * -10 * GVAR(camSpeed)]; + GVAR(camDolly) set [1, _deltaY * 10 * GVAR(camSpeed)]; } else { if (_rightButton) then { GVAR(camPan) = GVAR(camPan) - (_deltaX * 360);