ACE3/addons/nightvision/functions/fnc_decreaseNVGBrightness.sqf

22 lines
689 B
Plaintext
Raw Normal View History

2015-01-12 22:08:37 +00:00
// by commy2
#include "script_component.hpp"
private ["_player", "_vehicle", "_brightness"];
_player = _this select 0;
_vehicle = _this select 1;
2015-01-16 04:43:54 +00:00
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
2015-01-12 22:08:37 +00:00
if (_brightness > -1) then {
_brightness = round (10 * _brightness - 1) / 10;
2015-01-16 04:43:54 +00:00
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
2015-01-12 22:08:37 +00:00
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
playSound "ACE_Sound_Click";
};