diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf index 841477642e..1ed8c46ad5 100644 --- a/addons/spectator/XEH_preInit.sqf +++ b/addons/spectator/XEH_preInit.sqf @@ -17,7 +17,7 @@ PREP(updateInterface); PREP(updateUnits); // Permanent variables -GVAR(camFocus) = -1; +GVAR(camFocus) = 0; GVAR(camMode) = 0; GVAR(camPan) = 0; GVAR(camPos) = [worldSize * 0.5,worldSize * 0.5,0]; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 4f6c001992..781c9f67f5 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -142,7 +142,7 @@ switch (toLower _mode) do { // Scroll to change zoom, modifier for focus if (GVAR(ctrlKey)) then { - //GVAR(camFocus) set [0,(GVAR(camFocus) select 0) - (_zChange * (GVAR(camFocus) select 0) * 0.2)] + GVAR(camFocus) = (GVAR(camFocus) + _zChange) max 0; } else { GVAR(camZoom) = ((GVAR(camZoom) + (_zChange * 0.1)) max 0.01) min 2; }; diff --git a/addons/spectator/functions/fnc_handleToolbar.sqf b/addons/spectator/functions/fnc_handleToolbar.sqf index 32777a770f..d7bdb3d82f 100644 --- a/addons/spectator/functions/fnc_handleToolbar.sqf +++ b/addons/spectator/functions/fnc_handleToolbar.sqf @@ -22,7 +22,11 @@ params ["_display"]; // Kill PFH when display is closed if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; -GVAR(camera) camSetFocus [GVAR(camFocus),1.5]; +if (GVAR(camFocus) == 0) then { + GVAR(camera) camSetFocus [-1,-1]; +} else { + GVAR(camera) camSetFocus [GVAR(camFocus),1]; +}; GVAR(camera) camSetFov -(linearConversion [0.1,2,GVAR(camZoom),-2,-0.1,true]); GVAR(camera) camCommit 0; @@ -33,15 +37,17 @@ private ["_name","_focus","_fov","_speed","_mode","_time","_toolbar"]; // Find all tool values if (GVAR(camMode) == 0) then { + _focus = ["AUTO FOCUS", format ["%1 m", round GVAR(camFocus)]] select (GVAR(camFocus) > 0); + _fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; _name = "None"; _speed = format ["%1 m/s", GVAR(camSpeed)]; } else { + _focus = rank GVAR(camUnit); + _fov = WFSideText GVAR(camUnit); _name = name GVAR(camUnit); _speed = format ["%1 km/h", floor(speed GVAR(camUnit))]; }; -_focus = format ["%1 m", GVAR(camFocus)]; -_fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01]; _mode = ["FREE","FIRST","THIRD"] select GVAR(camMode); _time = [daytime,"HH:MM"] call BIS_fnc_timeToString;