Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NightVision - Add setting for shutter effects #6134

Merged
merged 1 commit into from
Feb 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>