Add speed boost button to spectator free camera

Sometimes you just want a burst of speed rather than to adjust it and then adjust it back. Also swapped the speed/zoom scrolling modifier around.
This commit is contained in:
SilentSpike 2015-08-07 18:59:48 +01:00
parent 1c79c8fa45
commit c5d9ec5d50
2 changed files with 21 additions and 15 deletions

View File

@ -114,7 +114,7 @@ switch (toLower _mode) do {
// Keep unit list and tree up to date // Keep unit list and tree up to date
[FUNC(handleUnits), 21, _display] call CBA_fnc_addPerFrameHandler; [FUNC(handleUnits), 21, _display] call CBA_fnc_addPerFrameHandler;
// Handle unit icons on map and 3D // Handle 3D unit icons
GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)]; GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)];
// Populate the help window // Populate the help window
@ -146,8 +146,9 @@ switch (toLower _mode) do {
[localize LSTRING(freeCamDown),"Z"], [localize LSTRING(freeCamDown),"Z"],
[localize LSTRING(freeCamPan),"RMB (Hold)"], [localize LSTRING(freeCamPan),"RMB (Hold)"],
[localize LSTRING(freeCamDolly),"LMB (Hold)"], [localize LSTRING(freeCamDolly),"LMB (Hold)"],
[localize LSTRING(freeCamSpeed),"Scrollwheel"], [localize LSTRING(freeCamZoom),"Scrollwheel"],
[localize LSTRING(freeCamZoom),"Ctrl + Scrollwheel"], [localize LSTRING(freeCamSpeed),"Ctrl + Scrollwheel"],
[localize LSTRING(freeCamBoost),"Shift (Hold)"],
[localize LSTRING(freeCamNextVis),"N"], [localize LSTRING(freeCamNextVis),"N"],
[localize LSTRING(freeCamPrevVis),"Ctrl + N"], [localize LSTRING(freeCamPrevVis),"Ctrl + N"],
[localize LSTRING(otherControls),""], [localize LSTRING(otherControls),""],
@ -220,9 +221,9 @@ switch (toLower _mode) do {
// Scroll to change speed, modifier for zoom // Scroll to change speed, modifier for zoom
if (GVAR(ctrlKey)) then { if (GVAR(ctrlKey)) then {
[nil,nil,nil,nil,nil,nil, GVAR(camZoom) + _zChange * 0.1] call FUNC(setCameraAttributes);
} else {
[nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + _zChange * 0.2] call FUNC(setCameraAttributes); [nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + _zChange * 0.2] call FUNC(setCameraAttributes);
} else {
[nil,nil,nil,nil,nil,nil, GVAR(camZoom) + _zChange * 0.1] call FUNC(setCameraAttributes);
}; };
}; };
case "onmousemoving": { case "onmousemoving": {
@ -268,31 +269,33 @@ switch (toLower _mode) do {
[_display,nil,nil,true] call FUNC(toggleInterface); [_display,nil,nil,true] call FUNC(toggleInterface);
}; };
case 16: { // Q case 16: { // Q
GVAR(camBoom) = 0.5 * GVAR(camSpeed); GVAR(camBoom) = 0.5 * GVAR(camSpeed) * ([1, 2] select _shift);
}; };
case 17: { // W case 17: { // W
GVAR(camDolly) set [1, GVAR(camSpeed)]; GVAR(camDolly) set [1, GVAR(camSpeed) * ([1, 2] select _shift)];
}; };
case 29: { // Ctrl case 29: { // Ctrl
GVAR(ctrlKey) = true; GVAR(ctrlKey) = true;
}; };
case 30: { // A case 30: { // A
GVAR(camDolly) set [0, -GVAR(camSpeed)]; GVAR(camDolly) set [0, -GVAR(camSpeed) * ([1, 2] select _shift)];
}; };
case 31: { // S case 31: { // S
GVAR(camDolly) set [1, -GVAR(camSpeed)]; GVAR(camDolly) set [1, -GVAR(camSpeed) * ([1, 2] select _shift)];
}; };
case 32: { // D case 32: { // D
GVAR(camDolly) set [0, GVAR(camSpeed)]; GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)];
}; };
case 44: { // Z case 44: { // Z
GVAR(camBoom) = -0.5 * GVAR(camSpeed); GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift);
}; };
case 49: { // N case 49: { // N
if (_ctrl) then { if (GVAR(camMode) == 0) then {
[nil,nil,-1] call FUNC(cycleCamera); if (_ctrl) then {
} else { [nil,nil,-1] call FUNC(cycleCamera);
[nil,nil,1] call FUNC(cycleCamera); } else {
[nil,nil,1] call FUNC(cycleCamera);
};
}; };
}; };
case 50: { // M case 50: { // M

View File

@ -181,6 +181,9 @@
<English>Speed +/-</English> <English>Speed +/-</English>
<Polish>Prędkość +/-</Polish> <Polish>Prędkość +/-</Polish>
</Key> </Key>
<Key ID="STR_ACE_Spectator_freeCamBoost">
<English>Speed Boost</English>
</Key>
<Key ID="STR_ACE_Spectator_freeCamNextVis"> <Key ID="STR_ACE_Spectator_freeCamNextVis">
<English>Next Vision Mode</English> <English>Next Vision Mode</English>
<Polish>Następny tryb wizji</Polish> <Polish>Następny tryb wizji</Polish>