Nightvision - Add setting for blur when ADS (#5924)

* Nightvision - Add setting for blur when ADS

* Allow blocking brightness control
This commit is contained in:
PabstMirror 2017-12-18 10:38:03 -06:00 committed by jonpas
parent 0a31a24fdf
commit c8b9483b44
4 changed files with 14 additions and 3 deletions

View File

@ -22,4 +22,11 @@ class ACE_Settings {
value = 1;
sliderSettings[] = {0, 2, 1, 1};
};
class GVAR(aimDownSightsBlur) {
category = CSTRING(Category);
displayName = CSTRING(aimDownSightsBlur_DisplayName);
typeName = "SCALAR";
value = 1;
sliderSettings[] = {0, 2, 1, 1};
};
};

View File

@ -66,6 +66,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode ACE_player != 1)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting)
// Statement
[ACE_player, 1] call FUNC(changeNVGBrightness);
@ -77,6 +78,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
if ((currentVisionMode ACE_player != 1)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting)
// Statement
[ACE_player, -1] call FUNC(changeNVGBrightness);

View File

@ -88,8 +88,8 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then {
// Modify blur if looking down scope
if ((cameraView == "GUNNER") && {[ACE_player] call CBA_fnc_canUseWeapon}) then {
if (currentWeapon ACE_player == "") exitWith {};
if (currentWeapon ACE_player == primaryWeapon ACE_player) exitWith {_blurFinal = _blurFinal * ST_NVG_CAMERA_BLUR_SIGHTS_RIFLE}; // Rifles are bad
if (currentWeapon ACE_player == handgunWeapon ACE_player) exitWith {_blurFinal = _blurFinal * ST_NVG_CAMERA_BLUR_SIGHTS_PISTOL}; // Pistols aren't so bad
if (currentWeapon ACE_player == primaryWeapon ACE_player) exitWith {_blurFinal = _blurFinal * linearConversion [0, 1, GVAR(aimDownSightsBlur), 1, ST_NVG_CAMERA_BLUR_SIGHTS_RIFLE]}; // Rifles are bad
if (currentWeapon ACE_player == handgunWeapon ACE_player) exitWith {_blurFinal = _blurFinal * linearConversion [0, 1, GVAR(aimDownSightsBlur), 1, ST_NVG_CAMERA_BLUR_SIGHTS_PISTOL]}; // Pistols aren't so bad
};
// Scale effects based on ace_nightvision_effectScaling setting
@ -98,7 +98,6 @@ if (CBA_missionTime < GVAR(nextEffectsUpdate)) then {
private _radialBlurPower = 0.0025 * GVAR(effectScaling);
_brightFinal = linearConversion [0, 1, GVAR(effectScaling), 1, _brightFinal];
_contrastFinal = linearConversion [0, 1, GVAR(effectScaling), 1, _contrastFinal];
_blurFinal = _blurFinal * GVAR(effectScaling);
// Setup all effects

View File

@ -262,5 +262,8 @@
<Japanese>ぼかしと粒子、明度効果 [0 に設定で全効果を無効化します]</Japanese>
<Italian>Effetti di sfocatura, sgranatura e luminosità [Importare a 0 disabiliterà TUTTI gli effetti della visione notturna]</Italian>
</Key>
<Key ID="STR_ACE_NightVision_aimDownSightsBlur_DisplayName">
<English>Aim Down Sights Blur</English>
</Key>
</Package>
</Project>