2015-02-18 04:07:29 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Change the brightness of the unit's NVG
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
* 1: Change in brightness (1 or -1) <SCALAR>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, 1] call ace_nightvision_fnc_changeNVGBrightness
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
private ["_brightness"];
|
|
|
|
|
|
|
|
PARAMS_2(_player,_changeInBrightness);
|
|
|
|
|
|
|
|
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
|
|
|
|
|
2015-05-29 20:37:53 +00:00
|
|
|
_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 0.5) max -0.5;
|
2015-02-18 04:07:29 +00:00
|
|
|
|
|
|
|
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
|
|
|
|
|
2015-05-29 20:37:53 +00:00
|
|
|
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (_brightness + 1), 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
|
2015-02-18 04:07:29 +00:00
|
|
|
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
|
|
|
|
|
2015-06-02 20:14:32 +00:00
|
|
|
[format [(localize LSTRING(NVGBrightness)), (_brightness * 10)]] call EFUNC(common,displayTextStructured);
|
2015-02-18 04:07:29 +00:00
|
|
|
playSound "ACE_Sound_Click";
|