Patch Merge of PR #1156 - Optics for tripplehead

This commit is contained in:
PabstMirror 2015-05-27 11:28:06 -05:00
parent c365008330
commit 30adc2d463
3 changed files with 50 additions and 26 deletions

View File

@ -41,7 +41,7 @@ class RscInGameUI {
}; };
class ACE_RscWeapon_base: RscWeaponZeroing { 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 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; idc = 154;
@ -70,9 +70,9 @@ class RscInGameUI {
colorText[] = {1,1,1,0}; colorText[] = {1,1,1,0};
colorBackground[] = {0,0,0,0}; colorBackground[] = {0,0,0,0};
x = safezoneX+0.5*safezoneW-0.5*SIZEX; 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; w = SIZEX;
h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); h = SIZEX*(4/3);
}; };
class ReticleNight: ReticleDay { class ReticleNight: ReticleDay {
@ -86,15 +86,32 @@ class RscInGameUI {
idc = 1713005; idc = 1713005;
text = ""; text = "";
x = safezoneX+0.5*safezoneW-0.5*SIZEX; 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; w = SIZEX;
h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); h = SIZEX*(4/3);
}; };
class BodyNight: BodyDay { class BodyNight: BodyDay {
idc = 1713006; idc = 1713006;
text = ""; 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 { class ACE_RscWeapon_Hamr: ACE_RscWeapon_base {
@ -185,4 +202,4 @@ _ctrl ctrlSetPosition [
]; ];
_ctrl ctrlCommit 0 _ctrl ctrlCommit 0
*/ */

View File

@ -52,7 +52,7 @@ _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN
private ["_sizeX", "_sizeY"]; private ["_sizeX", "_sizeY"];
_sizeX = (0.75+_recoilScope)/(getResolution select 5); _sizeX = (0.75+_recoilScope)/(getResolution select 5);
_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); _sizeY = _sizeX*(4/3);
private "_positionReticle"; private "_positionReticle";
_positionReticle = [ _positionReticle = [
@ -83,7 +83,7 @@ _positionBody = [
// Bring them all back // Bring them all back
_sizeX = 0.75/(getResolution select 5); _sizeX = 0.75/(getResolution select 5);
_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); _sizeY = _sizeX*(4/3);
_positionReticle = [ _positionReticle = [
safezoneX+0.5*safezoneW-0.5*_sizeX, safezoneX+0.5*safezoneW-0.5*_sizeX,

View File

@ -12,24 +12,29 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith {
(_display displayCtrl 1713002) ctrlShow false; (_display displayCtrl 1713002) ctrlShow false;
(_display displayCtrl 1713005) ctrlShow false; (_display displayCtrl 1713005) ctrlShow false;
(_display displayCtrl 1713006) ctrlShow false; (_display displayCtrl 1713006) ctrlShow false;
}; (_display displayCtrl 1713010) ctrlShow false;
(_display displayCtrl 1713011) 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;
}; };
// @todo, all weapon types // @todo, all weapon types
private "_optic"; private ["_optic", "_isPIP"];
_optic = (primaryWeaponItems ACE_player) select 2; _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 // calculate lighting
private ["_dayOpacity", "_nightOpacity"]; private ["_dayOpacity", "_nightOpacity"];
@ -48,9 +53,11 @@ _nightOpacity = [1,0] select (_dayOpacity == 1);
(_display displayCtrl 1713002) ctrlCommit 0; (_display displayCtrl 1713002) ctrlCommit 0;
(_display displayCtrl 1713005) ctrlCommit 0; (_display displayCtrl 1713005) ctrlCommit 0;
(_display displayCtrl 1713006) ctrlCommit 0; (_display displayCtrl 1713006) ctrlCommit 0;
*/ */
(_display displayCtrl 1713001) ctrlShow true; (_display displayCtrl 1713001) ctrlShow true;
(_display displayCtrl 1713002) ctrlShow true; (_display displayCtrl 1713002) ctrlShow true;
(_display displayCtrl 1713005) ctrlShow true; (_display displayCtrl 1713005) ctrlShow true;
(_display displayCtrl 1713006) ctrlShow true; (_display displayCtrl 1713006) ctrlShow true;
(_display displayCtrl 1713010) ctrlShow _isPIP;
(_display displayCtrl 1713011) ctrlShow _isPIP;