ACE3/addons/nightvision/functions/fnc_changeNVGBrightness.sqf

33 lines
835 B
Plaintext
Raw Normal View History

2015-02-18 04:07:29 +00:00
/*
* Author: commy2
* Change the brightness of the unit's NVG.
2015-02-18 04:07:29 +00:00
*
* Arguments:
* 0: The Unit <OBJECT>
2016-01-29 00:19:02 +00:00
* 1: Change in brightness (1 or -1) <NUMBER>
2015-02-18 04:07:29 +00:00
*
* Return Value:
* None
2015-02-18 04:07:29 +00:00
*
* Example:
* [player, 1] call ace_nightvision_fnc_changeNVGBrightness
*
* Public: No
*/
#include "script_component.hpp"
2015-09-16 15:55:23 +00:00
params ["_player", "_changeInBrightness"];
TRACE_2("changeNVGBrightness",_player,_changeInBrightness);
2015-02-18 04:07:29 +00:00
private _brightness = _player getVariable [QGVAR(NVGBrightness), 0];
2015-02-18 04:07:29 +00:00
_brightness = ((_brightness + _changeInBrightness) min 0) max -6;
2015-02-18 04:07:29 +00:00
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
[format [(localize LSTRING(NVGBrightness)), _brightness]] call EFUNC(common,displayTextStructured);
2015-02-18 04:07:29 +00:00
playSound "ACE_Sound_Click";
// Trigger full ppEffects update next time run in the PFEH:
GVAR(nextEffectsUpdate) = -1;