mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #755 from acemod/fixoptics2
Fix for PIP scopes, fix #547
This commit is contained in:
commit
c9a2505031
@ -196,6 +196,31 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player;
|
||||
|
||||
}, 0, []] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
// PFH to raise camera created event. Only works on these cams by BI.
|
||||
#define ALL_CAMERAS [ \
|
||||
missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \
|
||||
missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \
|
||||
uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \
|
||||
uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \
|
||||
missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \
|
||||
]
|
||||
|
||||
GVAR(OldIsCamera) = false;
|
||||
|
||||
[{
|
||||
|
||||
// "activeCameraChanged" event
|
||||
_isCamera = {!isNull _x} count ALL_CAMERAS > 0;
|
||||
if !(_isCamera isEqualTo GVAR(OldIsCamera)) then {
|
||||
// Raise ACE event locally
|
||||
GVAR(OldIsCamera) = _isCamera;
|
||||
["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent);
|
||||
};
|
||||
|
||||
}, 1, []] call cba_fnc_addPerFrameHandler; // feel free to decrease the sleep time if you need it.
|
||||
|
||||
|
||||
[QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable);
|
||||
|
||||
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user