Arsenal - Restore curator camera state when exiting (#8464)

This commit is contained in:
mharis001 2021-10-02 06:52:50 -04:00 committed by GitHub
parent 310da98c5e
commit 66ce0ba5ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -72,8 +72,15 @@ if (!isNil QGVAR(moduleUsed)) then {
ACE_player switchCamera GVAR(cameraView);
if (isMultiplayer) then {
// Restore curator camera state
if (!isNull curatorCamera) then {
GVAR(curatorCameraData) params ["_position", "_dirAndUp"];
curatorCamera setPosASL _position;
curatorCamera setVectorDirAndUp _dirAndUp;
};
if (isMultiplayer) then {
[QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(center) + "_face"] call CBA_fnc_globalEventJIP;
[QGVAR(center) + "_face", GVAR(center)] call CBA_fnc_removeGlobalEventJIP;
@ -86,6 +93,8 @@ GVAR(currentBox) = objNull;
GVAR(camera) = nil;
GVAR(cameraHelper) = nil;
GVAR(curatorCameraData) = nil;
GVAR(mouseButtonState) = nil;
GVAR(currentLeftPanel) = nil;
GVAR(currentRightPanel) = nil;

View File

@ -334,6 +334,11 @@ if (isNil QGVAR(cameraPosition)) then {
GVAR(cameraPosition) = [5,0,0,[0,0,0.85]];
};
// Save curator camera state so camera position and direction are not modified while using arsenal
if (!isNull curatorCamera) then {
GVAR(curatorCameraData) = [getPosASL curatorCamera, [vectorDir curatorCamera, vectorUp curatorCamera]];
};
GVAR(cameraHelper) = createAgent ["Logic", position GVAR(center) ,[] ,0 ,"none"];
GVAR(cameraHelper) attachTo [GVAR(center), GVAR(cameraPosition) select 3, ""];