mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Handle focus
This commit is contained in:
parent
e406a794f2
commit
e95186f550
@ -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];
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user