2015-01-17 22:38:13 +00:00
|
|
|
// by commy2
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-06-13 08:41:19 +00:00
|
|
|
private ["_brightness", "_cacheName", "_isIR", "_laser", "_laserID", "_weapon"];
|
2015-01-17 22:38:13 +00:00
|
|
|
|
2015-06-13 08:41:19 +00:00
|
|
|
_isIR = currentVisionMode ACE_player;
|
2015-01-17 22:38:13 +00:00
|
|
|
if (_isIR == 2) exitWith {};
|
|
|
|
|
|
|
|
_isIR = _isIR == 1;
|
|
|
|
|
2015-06-13 08:41:19 +00:00
|
|
|
_brightness = 2 - call EFUNC(common,ambientBrightness);
|
|
|
|
|
2015-01-17 22:38:13 +00:00
|
|
|
{
|
|
|
|
_weapon = currentWeapon _x;
|
|
|
|
|
|
|
|
_laser = switch (_weapon) do {
|
|
|
|
case (primaryWeapon _x): {
|
|
|
|
primaryWeaponItems _x select 1;
|
|
|
|
};
|
|
|
|
case (secondaryWeapon _x): {
|
|
|
|
secondaryWeaponItems _x select 1;
|
|
|
|
};
|
|
|
|
case (handgunWeapon _x): {
|
|
|
|
handgunItems _x select 1;
|
|
|
|
};
|
|
|
|
default {""};
|
|
|
|
};
|
|
|
|
|
2015-04-30 16:51:30 +00:00
|
|
|
if (_laser != "") then {
|
2015-04-30 21:18:45 +00:00
|
|
|
_cacheName = format [QGVAR(laser_%1), _laser];
|
2015-04-30 16:51:30 +00:00
|
|
|
_laserID = missionNamespace getVariable [_cacheName, -1];
|
|
|
|
if (missionNamespace getVariable [_cacheName, -1] == -1) then {
|
|
|
|
_laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer");
|
|
|
|
missionNamespace setVariable [_cacheName, _laserID];
|
|
|
|
};
|
2015-01-17 22:38:13 +00:00
|
|
|
|
2015-04-30 16:51:30 +00:00
|
|
|
if (_laserID > 0 && {_x isFlashlightOn _weapon}) then {
|
2015-06-18 22:16:53 +00:00
|
|
|
[_x, 50, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint);
|
2015-04-30 16:51:30 +00:00
|
|
|
};
|
2015-01-17 22:38:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} forEach GVAR(nearUnits);
|