Skip to content

Commit

Permalink
NightVision - Add setting for shutter effects (#6134)
Browse files Browse the repository at this point in the history
Also convert to cba settings
Close #6119
  • Loading branch information
PabstMirror authored and jonpas committed Feb 10, 2018
1 parent 0eeccb1 commit 44b4ed7
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 29 deletions.
33 changes: 5 additions & 28 deletions addons/nightvision/ACE_Settings.hpp
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
class ACE_Settings {
class GVAR(disableNVGsWithSights) {
category = CSTRING(Category);
displayName = CSTRING(DisableNVGsWithSights_DisplayName);
description = CSTRING(DisableNVGsWithSights_description);
typeName = "BOOL";
value = 0;
movedToSQF = 1;
};
class GVAR(fogScaling) {
category = CSTRING(Category);
displayName = CSTRING(fogScaling_DisplayName);
description = CSTRING(fogScaling_Description);
typeName = "SCALAR";
value = 1;
sliderSettings[] = {0, 2, 1, 1};
movedToSQF = 1;
};
class GVAR(noiseScaling) {
category = CSTRING(Category);
displayName = CSTRING(noiseScaling_DisplayName);
description = CSTRING(noiseScaling_Description);
typeName = "SCALAR";
value = 1;
sliderSettings[] = {0, 2, 1, 1};
movedToSQF = 1;
};
class GVAR(effectScaling) {
category = CSTRING(Category);
displayName = CSTRING(effectScaling_DisplayName);
description = CSTRING(effectScaling_Description);
typeName = "SCALAR";
value = 1;
sliderSettings[] = {0, 2, 1, 1};
movedToSQF = 1;
};
class GVAR(aimDownSightsBlur) {
category = CSTRING(Category);
displayName = CSTRING(aimDownSightsBlur_DisplayName);
typeName = "SCALAR";
value = 1;
sliderSettings[] = {0, 2, 1, 1};
movedToSQF = 1;
};
};
2 changes: 2 additions & 0 deletions addons/nightvision/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

#include "initSettings.sqf";

ADDON = true;
2 changes: 1 addition & 1 deletion addons/nightvision/functions/fnc_onFiredPlayer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
TRACE_7("firedEH:",_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile);

if ((!GVAR(running)) || {_weapon == "throw"} || {_weapon == "put"}) exitWith {};
if ((!GVAR(running)) || {!GVAR(shutterEffects)} || {_weapon == "throw"} || {_weapon == "put"}) exitWith {};

private _visibleFireCoef = 1;
if (_unit == ace_player) then {
Expand Down
54 changes: 54 additions & 0 deletions addons/nightvision/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// CBA Settings [ADDON: ace_nightVision]:

[
QGVAR(effectScaling), "SLIDER",
[LSTRING(effectScaling_DisplayName), LSTRING(effectScaling_Description)],
localize LSTRING(Category),
[0,2,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)]
true, // isGlobal
{[QGVAR(effectScaling), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;
[
QGVAR(fogScaling), "SLIDER",
[LSTRING(fogScaling_DisplayName), LSTRING(fogScaling_Description)],
localize LSTRING(Category),
[0,2,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)]
true, // isGlobal
{[QGVAR(fogScaling), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;

[
QGVAR(noiseScaling), "SLIDER",
[LSTRING(noiseScaling_DisplayName), LSTRING(noiseScaling_Description)],
localize LSTRING(Category),
[0,2,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)]
true, // isGlobal
{[QGVAR(noiseScaling), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;

[
QGVAR(aimDownSightsBlur), "SLIDER",
[LSTRING(aimDownSightsBlur_DisplayName)],
localize LSTRING(Category),
[0,2,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)]
true, // isGlobal
{[QGVAR(aimDownSightsBlur), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;

[
QGVAR(disableNVGsWithSights), "CHECKBOX",
[LSTRING(DisableNVGsWithSights_DisplayName), LSTRING(DisableNVGsWithSights_description)],
localize LSTRING(Category),
false, // default value
true, // isGlobal
{[QGVAR(disableNVGsWithSights), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;

[
QGVAR(shutterEffects), "CHECKBOX",
[LSTRING(shutterEffects_DisplayName), LSTRING(shutterEffects_description)],
localize LSTRING(Category),
true, // default value
false, // isGlobal
{[QGVAR(shutterEffects), _this] call EFUNC(common,cbaSettings_settingChanged)}
] call CBA_settings_fnc_init;
6 changes: 6 additions & 0 deletions addons/nightvision/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,11 @@
<Chinese>調整配戴夜視鏡時畫面雜訊的多寡。</Chinese>
<Chinesesimp>调整配戴夜视镜时画面杂讯的多寡。</Chinesesimp>
</Key>
<Key ID="STR_ACE_NightVision_shutterEffects_DisplayName">
<English>Shutter Effects</English>
</Key>
<Key ID="STR_ACE_NightVision_shutterEffects_description">
<English>Rolling shutter effect from muzzle flashes</English>
</Key>
</Package>
</Project>

0 comments on commit 44b4ed7

Please sign in to comment.