changed laserpointer to allow 3rd party laser pointers. now there is a new config option for CfgWeapons called ace_laserpointer, number with value 0 no laser, 1 red laser, 2 green laser

This commit is contained in:
Kavinsky 2015-04-30 18:51:30 +02:00
parent 9c02f915ec
commit b9c1936efc
3 changed files with 17 additions and 3 deletions

View File

@ -20,6 +20,8 @@ class CfgWeapons {
ACE_nextModeClass = "acc_pointer_IR";
ACE_modeDescription = "$STR_ACE_Laserpointer_Laser";
ACE_laserpointer = 1;
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_acc_pointer_red";
scope = 1;
@ -79,6 +81,8 @@ class CfgWeapons {
ACE_nextModeClass = "ACE_acc_pointer_green_IR";
ACE_modeDescription = "$STR_ACE_Laserpointer_Laser";
ACE_laserpointer = 2;
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_acc_pointer_green";
scope = 2;

View File

@ -25,10 +25,17 @@ _isIR = _isIR == 1;
default {""};
};
_laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser;
if (_laser != "") then {
_cacheName = format ["ACE_laserpointer_%1", _laser];
_laserID = missionNamespace getVariable [_cacheName, -1];
if (missionNamespace getVariable [_cacheName, -1] == -1) then {
_laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer");
missionNamespace setVariable [_cacheName, _laserID];
};
if (_laserID > -1 && {_x isFlashlightOn _weapon}) then {
[_x, 50, _laserID == 1 || _isIR] call FUNC(drawLaserpoint);
if (_laserID > 0 && {_x isFlashlightOn _weapon}) then {
[_x, 50, _laserID == 2 || _isIR] call FUNC(drawLaserpoint);
};
};
} forEach GVAR(nearUnits);

View File

@ -54,6 +54,9 @@ ace_detonator
ace_barrelTwist
ace_twistDirection
ace_barrelLength
ace_laserpointer
ace_nextmodeclass
ace_modedescription
```