From b7fa2bd8b3de7e7f0cef83e8b26211d18044abef Mon Sep 17 00:00:00 2001 From: commy2 Date: Sat, 4 Apr 2015 12:06:20 +0200 Subject: [PATCH] disable pip scopes in arsenal --- addons/optics/CfgVehicles.hpp | 2 +- addons/optics/CfgWeapons.hpp | 7 +++++++ addons/optics/XEH_postInit.sqf | 22 +++++++++++++-------- addons/optics/config.cpp | 2 +- addons/optics/functions/fnc_handleFired.sqf | 2 +- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/addons/optics/CfgVehicles.hpp b/addons/optics/CfgVehicles.hpp index 745a6232cc..4ae648964e 100644 --- a/addons/optics/CfgVehicles.hpp +++ b/addons/optics/CfgVehicles.hpp @@ -8,7 +8,7 @@ class CfgVehicles { MACRO_ADDITEM(ACE_optic_Arco_2D,2); MACRO_ADDITEM(ACE_optic_Arco_PIP,2); MACRO_ADDITEM(ACE_optic_MRCO_2D,2); - MACRO_ADDITEM(ACE_optic_MRCO_PIP,2); + //MACRO_ADDITEM(ACE_optic_MRCO_PIP,2); MACRO_ADDITEM(ACE_optic_SOS_2D,2); MACRO_ADDITEM(ACE_optic_SOS_PIP,2); MACRO_ADDITEM(ACE_optic_LRPS_2D,2); diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 66b0b61f0a..c8adc5d090 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -16,6 +16,7 @@ class CfgWeapons { class ACE_optic_DMS: optic_DMS { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_DMS"; + scope = 1; displayName = "LOCALIZE ACE DMS"; //descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1"; weaponInfoType = "ACE_RscWeaponZeroing"; @@ -75,6 +76,7 @@ class CfgWeapons { class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Hamr_PIP"; + scopeArsenal = 1; displayName = "$STR_ACE_optic_hamr_pip"; class ItemInfo: ItemInfo { @@ -118,6 +120,7 @@ class CfgWeapons { class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Arco_PIP"; + scopeArsenal = 1; displayName = "$STR_ACE_optic_arco_pip"; class ItemInfo: ItemInfo { @@ -161,6 +164,8 @@ class CfgWeapons { class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_MRCO_PIP"; + scope = 1; + scopeArsenal = 1; displayName = "$STR_ACE_optic_valdada_pip"; class ItemInfo: ItemInfo { @@ -197,6 +202,7 @@ class CfgWeapons { class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_SOS_PIP"; + scopeArsenal = 1; displayName = "$STR_ACE_optic_sos_pip"; class ItemInfo: ItemInfo { @@ -241,6 +247,7 @@ class CfgWeapons { class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_LRPS_PIP"; + 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 a8b005ad91..cb3918cbc3 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -1,18 +1,24 @@ // by commy2 #include "script_component.hpp" -// 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; +if (!hasInterface) exitWith {}; -"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"]; +0 = 0 spawn { + waituntil {!isNull ACE_player}; + + // 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"]; +}; // save control for fired EH ["infoDisplayChanged", { if (!isNull ((_this select 0) displayCtrl 1713001)) then { - uiNamespace setVariable [QGVAR(RscWeaponInfoPIP), _this select 0]; + uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; }; }] call EFUNC(common,addEventHandler); diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index 80d3af32a9..d0b477caf3 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -9,7 +9,7 @@ class CfgPatches { "ACE_optic_Arco_2D", "ACE_optic_Arco_PIP", "ACE_optic_MRCO_2D", - "ACE_optic_MRCO_PIP", + //"ACE_optic_MRCO_PIP", "ACE_optic_SOS_2D", "ACE_optic_SOS_PIP", "ACE_optic_LRPS_2D", diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index a4c546a6bf..94d18e4354 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -25,7 +25,7 @@ _weapon = _this select 1; // check if compatible scope is used private "_display"; -_display = uiNamespace getVariable [QGVAR(RscWeaponInfoPIP), displayNull]; +_display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull]; if (isNull _display) exitWith {};