diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index 068bb0aa20..b7d2005d77 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -41,7 +41,7 @@ class RscInGameUI { }; class ACE_RscWeapon_base: RscWeaponZeroing { - controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay"}; // don't change this order + controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // don't change this order class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used idc = 154; @@ -70,9 +70,9 @@ class RscInGameUI { colorText[] = {1,1,1,0}; colorBackground[] = {0,0,0,0}; x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); w = SIZEX; - h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + h = SIZEX*(4/3); }; class ReticleNight: ReticleDay { @@ -86,15 +86,32 @@ class RscInGameUI { idc = 1713005; text = ""; x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); w = SIZEX; - h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + h = SIZEX*(4/3); }; class BodyNight: BodyDay { idc = 1713006; text = ""; }; + + //These are just black side panels to cover the areas that the optics p3d doesn't cover + //It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else + //Reference PR #1156: + class trippleHeadLeft: RscText { + idc = 1713010; + x = "safeZoneXAbs"; + Y = "safezoneY"; + W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + H = "safeZoneH"; + colorBackground[] = {0,0,0,1}; + }; + class trippleHeadRight: trippleHeadLeft { + idc = 1713011; + x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; + colorBackground[] = {0,0,0,1}; + }; }; class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { @@ -177,12 +194,12 @@ _ctrl = (D displayCtrl 1713006); _sizeX = 1.54/(getResolution select 5); _sizeY = _sizeX*safezoneW/safezoneH; -_ctrl ctrlSetPosition [ +_ctrl ctrlSetPosition [ safezoneX+0.5*safezoneW-0.5*_sizeX, safezoneY+0.5*safezoneH-0.5*_sizeY, - _sizeX, - _sizeY + _sizeX, + _sizeY ]; _ctrl ctrlCommit 0 -*/ + */ diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index 51da4c8ead..f0399c37fc 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -52,7 +52,7 @@ _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN private ["_sizeX", "_sizeY"]; _sizeX = (0.75+_recoilScope)/(getResolution select 5); -_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); +_sizeY = _sizeX*(4/3); private "_positionReticle"; _positionReticle = [ @@ -83,7 +83,7 @@ _positionBody = [ // Bring them all back _sizeX = 0.75/(getResolution select 5); -_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); +_sizeY = _sizeX*(4/3); _positionReticle = [ safezoneX+0.5*safezoneW-0.5*_sizeX, diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index 30cdb927c7..7abee8f122 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -12,24 +12,29 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith { (_display displayCtrl 1713002) ctrlShow false; (_display displayCtrl 1713005) ctrlShow false; (_display displayCtrl 1713006) ctrlShow false; -}; - -GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; -GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; -GVAR(camera) camCommitPrepared 0; - -// @todo, check if that needs to be done at all -if (cameraView == "GUNNER") then { - GVAR(camera) camsetFOV 0.7; - GVAR(camera) camcommit 0; -} else { - GVAR(camera) camsetFOV 0.01; - GVAR(camera) camcommit 0; + (_display displayCtrl 1713010) ctrlShow false; + (_display displayCtrl 1713011) ctrlShow false; }; // @todo, all weapon types -private "_optic"; +private ["_optic", "_isPIP"]; _optic = (primaryWeaponItems ACE_player) select 2; +_isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QUOTE(PATHTOF(models\ace_optics_pip.p3d)); + +if (_isPIP) then { + GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; + GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; + GVAR(camera) camCommitPrepared 0; + + // @todo, check if that needs to be done at all + if (cameraView == "GUNNER") then { + GVAR(camera) camsetFOV 0.7; + GVAR(camera) camcommit 0; + } else { + GVAR(camera) camsetFOV 0.01; + GVAR(camera) camcommit 0; + }; +}; // calculate lighting private ["_dayOpacity", "_nightOpacity"]; @@ -48,9 +53,11 @@ _nightOpacity = [1,0] select (_dayOpacity == 1); (_display displayCtrl 1713002) ctrlCommit 0; (_display displayCtrl 1713005) ctrlCommit 0; (_display displayCtrl 1713006) ctrlCommit 0; -*/ + */ (_display displayCtrl 1713001) ctrlShow true; (_display displayCtrl 1713002) ctrlShow true; (_display displayCtrl 1713005) ctrlShow true; (_display displayCtrl 1713006) ctrlShow true; +(_display displayCtrl 1713010) ctrlShow _isPIP; +(_display displayCtrl 1713011) ctrlShow _isPIP;