Stop dolly on mouse button release

This commit is contained in:
SilentSpike 2015-07-21 18:44:24 +01:00
parent f65b18f558
commit 341f3a253e
2 changed files with 14 additions and 13 deletions

View File

@ -128,6 +128,7 @@ switch (toLower _mode) do {
_args params ["_ctrl","_button"]; _args params ["_ctrl","_button"];
GVAR(mouse) set [_button,false]; GVAR(mouse) set [_button,false];
if (_button == 0) then { GVAR(camDolly) = [0,0]; };
}; };
case "onmousezchanged": { case "onmousezchanged": {
_args params ["_ctrl","_zChange"]; _args params ["_ctrl","_zChange"];
@ -168,19 +169,19 @@ switch (toLower _mode) do {
GVAR(camBoom) = 0.5; GVAR(camBoom) = 0.5;
}; };
case 17: { // W case 17: { // W
GVAR(camDolly) set [0, GVAR(camSpeed)]; GVAR(camDolly) set [1, GVAR(camSpeed)];
}; };
case 29: { // Ctrl case 29: { // Ctrl
GVAR(ctrlKey) = true; GVAR(ctrlKey) = true;
}; };
case 30: { // A case 30: { // A
GVAR(camDolly) set [1, -GVAR(camSpeed)];
};
case 31: { // S
GVAR(camDolly) set [0, -GVAR(camSpeed)]; GVAR(camDolly) set [0, -GVAR(camSpeed)];
}; };
case 31: { // S
GVAR(camDolly) set [1, -GVAR(camSpeed)];
};
case 32: { // D case 32: { // D
GVAR(camDolly) set [1, GVAR(camSpeed)]; GVAR(camDolly) set [0, GVAR(camSpeed)];
}; };
case 35: { // H case 35: { // H
[_display,nil,true] call FUNC(toggleInterface); [_display,nil,true] call FUNC(toggleInterface);
@ -223,20 +224,20 @@ switch (toLower _mode) do {
GVAR(camBoom) = 0; GVAR(camBoom) = 0;
}; };
case 17: { // W case 17: { // W
GVAR(camDolly) set [0, 0]; GVAR(camDolly) set [1, 0];
}; };
case 29: { // Ctrl case 29: { // Ctrl
GVAR(ctrlKey) = false; GVAR(ctrlKey) = false;
}; };
case 30: { // A case 30: { // A
GVAR(camDolly) set [1, 0];
};
case 31: { // S
GVAR(camDolly) set [0, 0]; GVAR(camDolly) set [0, 0];
}; };
case 32: { // D case 31: { // S
GVAR(camDolly) set [1, 0]; GVAR(camDolly) set [1, 0];
}; };
case 32: { // D
GVAR(camDolly) set [0, 0];
};
case 44: { // Z case 44: { // Z
GVAR(camBoom) = 0; GVAR(camBoom) = 0;
}; };

View File

@ -30,9 +30,9 @@ _oldY = GVAR(mousePos) select 1;
_deltaX = _oldX - _x; _deltaX = _oldX - _x;
_deltaY = _oldY - _y; _deltaY = _oldY - _y;
if (_leftButton && _rightButton) then { if (_leftButton) then {
GVAR(camDolly) set [0, _deltaX * GVAR(camSpeed)]; GVAR(camDolly) set [0, _deltaX * -10 * GVAR(camSpeed)];
GVAR(camDolly) set [1, _deltaY * GVAR(camSpeed)]; GVAR(camDolly) set [1, _deltaY * 10 * GVAR(camSpeed)];
} else { } else {
if (_rightButton) then { if (_rightButton) then {
GVAR(camPan) = GVAR(camPan) - (_deltaX * 360); GVAR(camPan) = GVAR(camPan) - (_deltaX * 360);