From 31e1f37e17fcaa1d81e95aafac51a2dbf6263745 Mon Sep 17 00:00:00 2001 From: mharis001 Date: Sat, 16 Nov 2019 05:07:11 -0500 Subject: [PATCH 1/3] Fix optics camera restart handling for Zeus --- addons/optics/fnc_restartCamera.sqf | 9 ++++++--- addons/optics/script_component.hpp | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/addons/optics/fnc_restartCamera.sqf b/addons/optics/fnc_restartCamera.sqf index 34324bba5..caecc3c52 100644 --- a/addons/optics/fnc_restartCamera.sqf +++ b/addons/optics/fnc_restartCamera.sqf @@ -21,9 +21,12 @@ Author: commy2 ---------------------------------------------------------------------------- */ -if (!GVAR(usePipOptics)) exitWith {}; -if (configProperties [configFile >> "CBA_PIPItems"] isEqualTo []) exitWith {}; -if (isNull (uiNamespace getVariable ["RscDisplayMission", displayNull])) exitWith {}; +if ( + !GVAR(usePipOptics) + || {configProperties [configFile >> "CBA_PIPItems"] isEqualTo []} + || {isNull (uiNamespace getVariable ["RscDisplayMission", displayNull])} + || {!isNull (uiNamespace getVariable ["RscDisplayCurator", displayNull])} +) exitWith {}; params ["_unit", ["_reset", true]]; diff --git a/addons/optics/script_component.hpp b/addons/optics/script_component.hpp index fb0d12c64..6d36320a1 100644 --- a/addons/optics/script_component.hpp +++ b/addons/optics/script_component.hpp @@ -1,9 +1,9 @@ -#define COMPONENT optics +#define COMPONENT optics #include "\x\cba\addons\main\script_mod.hpp" -//#define DEBUG_MODE_FULL -//#define DISABLE_COMPILE_CACHE -//#define DEBUG_ENABLED_OPTICS +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define DEBUG_ENABLED_OPTICS #ifdef DEBUG_ENABLED_OPTICS #define DEBUG_MODE_FULL From 9c0b94316252ce54f80af69d8210ed1c8d31d02c Mon Sep 17 00:00:00 2001 From: mharis001 Date: Sat, 16 Nov 2019 07:00:30 -0500 Subject: [PATCH 2/3] Switch to checking curatorCamera on arsenal close --- addons/optics/XEH_preInit.sqf | 2 +- addons/optics/fnc_restartCamera.sqf | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf index a1f2188bb..e145684f9 100644 --- a/addons/optics/XEH_preInit.sqf +++ b/addons/optics/XEH_preInit.sqf @@ -96,7 +96,7 @@ GVAR(inArsenal) = false; GVAR(inArsenal) = false; private _unit = call CBA_fnc_currentUnit; _unit call FUNC(changeCarryHandleOpticClass); - [FUNC(restartCamera), [_unit, true]] call CBA_fnc_execNextFrame; + [FUNC(restartCamera), [_unit, isNull curatorCamera]] call CBA_fnc_execNextFrame; }] call CBA_fnc_addEventHandler; [missionNamespace, "arsenalClosed", { diff --git a/addons/optics/fnc_restartCamera.sqf b/addons/optics/fnc_restartCamera.sqf index caecc3c52..c3b70f2f4 100644 --- a/addons/optics/fnc_restartCamera.sqf +++ b/addons/optics/fnc_restartCamera.sqf @@ -25,7 +25,6 @@ if ( !GVAR(usePipOptics) || {configProperties [configFile >> "CBA_PIPItems"] isEqualTo []} || {isNull (uiNamespace getVariable ["RscDisplayMission", displayNull])} - || {!isNull (uiNamespace getVariable ["RscDisplayCurator", displayNull])} ) exitWith {}; params ["_unit", ["_reset", true]]; From 83e276c419719bcd8fd412dcd8320a45d5ad9255 Mon Sep 17 00:00:00 2001 From: mharis001 Date: Sat, 16 Nov 2019 11:19:02 -0500 Subject: [PATCH 3/3] Revert back to display check --- addons/optics/XEH_preInit.sqf | 2 +- addons/optics/fnc_restartCamera.sqf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/optics/XEH_preInit.sqf b/addons/optics/XEH_preInit.sqf index e145684f9..a1f2188bb 100644 --- a/addons/optics/XEH_preInit.sqf +++ b/addons/optics/XEH_preInit.sqf @@ -96,7 +96,7 @@ GVAR(inArsenal) = false; GVAR(inArsenal) = false; private _unit = call CBA_fnc_currentUnit; _unit call FUNC(changeCarryHandleOpticClass); - [FUNC(restartCamera), [_unit, isNull curatorCamera]] call CBA_fnc_execNextFrame; + [FUNC(restartCamera), [_unit, true]] call CBA_fnc_execNextFrame; }] call CBA_fnc_addEventHandler; [missionNamespace, "arsenalClosed", { diff --git a/addons/optics/fnc_restartCamera.sqf b/addons/optics/fnc_restartCamera.sqf index c3b70f2f4..caecc3c52 100644 --- a/addons/optics/fnc_restartCamera.sqf +++ b/addons/optics/fnc_restartCamera.sqf @@ -25,6 +25,7 @@ if ( !GVAR(usePipOptics) || {configProperties [configFile >> "CBA_PIPItems"] isEqualTo []} || {isNull (uiNamespace getVariable ["RscDisplayMission", displayNull])} + || {!isNull (uiNamespace getVariable ["RscDisplayCurator", displayNull])} ) exitWith {}; params ["_unit", ["_reset", true]];