ACE3/addons/nightvision/functions/fnc_changeNVGBrightness.sqf
jonpas 541f1010a7 Merge branch 'master' into macroSTR
Conflicts:
	addons/attach/functions/fnc_attach.sqf
	addons/captives/functions/fnc_moduleSurrender.sqf
	addons/common/CfgVehicles.hpp
	addons/explosives/CfgModule.hpp
	addons/hearing/CfgVehicles.hpp
	addons/interaction/CfgVehicles.hpp
	addons/map/CfgVehicles.hpp
	addons/microdagr/CfgVehicles.hpp
	addons/mk6mortar/CfgVehicles.hpp
	addons/nametags/CfgVehicles.hpp
	addons/nightvision/functions/fnc_changeNVGBrightness.sqf
	addons/respawn/CfgVehicles.hpp
	addons/switchunits/CfgVehicles.hpp
	addons/vehiclelock/CfgVehicles.hpp
	addons/winddeflection/stringtable.xml
2015-06-02 22:14:32 +02:00

34 lines
888 B
Plaintext

/*
* 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];
_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 0.5) max -0.5;
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (_brightness + 1), 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
[format [(localize LSTRING(NVGBrightness)), (_brightness * 10)]] call EFUNC(common,displayTextStructured);
playSound "ACE_Sound_Click";