ACE3/addons/laserpointer/functions/fnc_onDraw.sqf

35 lines
827 B
Plaintext
Raw Normal View History

2015-01-17 22:38:13 +00:00
// by commy2
#include "script_component.hpp"
_brightness = 2 - call EFUNC(common,ambientBrightness);
_isIR = currentVisionMode ACE_player;
if (_isIR == 2) exitWith {};
_isIR = _isIR == 1;
{
_weapon = currentWeapon _x;
_laser = switch (_weapon) do {
case (""): {""};
case (primaryWeapon _x): {
primaryWeaponItems _x select 1;
};
case (secondaryWeapon _x): {
secondaryWeaponItems _x select 1;
};
case (handgunWeapon _x): {
handgunItems _x select 1;
};
default {""};
};
_laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser;
if (_laserID > -1 && {_x isFlashlightOn _weapon}) then {
2015-04-14 11:14:37 +00:00
[_x, 50, _laserID == 1 || _isIR] call FUNC(drawLaserpoint);
2015-01-17 22:38:13 +00:00
};
} forEach GVAR(nearUnits);