diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 6d61ff98a2..5aa06f41a0 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -98,7 +98,7 @@ class CfgWeapons { class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Hamr_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_hamr_pip"; class ItemInfo: ItemInfo { @@ -147,7 +147,7 @@ class CfgWeapons { class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Arco_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_arco_pip"; class ItemInfo: ItemInfo { @@ -197,7 +197,7 @@ class CfgWeapons { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_valdada_pip"; class ItemInfo: ItemInfo { @@ -239,7 +239,7 @@ class CfgWeapons { class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_SOS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_sos_pip"; class ItemInfo: ItemInfo { @@ -290,7 +290,7 @@ class CfgWeapons { class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_LRPS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_lrps_pip"; class ItemInfo: ItemInfo { diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index cb3918cbc3..7f68aece74 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -22,3 +22,19 @@ if (!hasInterface) exitWith {}; uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; }; }] call EFUNC(common,addEventHandler); + +// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +["activeCameraChanged", { + if !(_this select 1) then { + deleteVehicle GVAR(camera); + + // PiP technique by BadBenson + GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + GVAR(camera) camSetFov 0.7; + GVAR(camera) camSetTarget ACE_player; + GVAR(camera) camCommit 1; + + "ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; + GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; + }; +}] call EFUNC(common,addEventHandler);