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 {
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 {

View File

@ -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,

View File

@ -12,8 +12,16 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith {
(_display displayCtrl 1713002) ctrlShow false;
(_display displayCtrl 1713005) ctrlShow false;
(_display displayCtrl 1713006) ctrlShow false;
(_display displayCtrl 1713010) ctrlShow false;
(_display displayCtrl 1713011) ctrlShow false;
};
// @todo, all weapon types
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;
@ -26,10 +34,7 @@ if (cameraView == "GUNNER") then {
GVAR(camera) camsetFOV 0.01;
GVAR(camera) camcommit 0;
};
// @todo, all weapon types
private "_optic";
_optic = (primaryWeaponItems ACE_player) select 2;
};
// calculate lighting
private ["_dayOpacity", "_nightOpacity"];
@ -54,3 +59,5 @@ _nightOpacity = [1,0] select (_dayOpacity == 1);
(_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;