ACE3/addons/irlight/XEH_postInit.sqf
BaerMitUmlaut d6faac5881
Add IR Flashlights (#6563)
* Initial IR flashlight tests

* More experiments

* Rewrite using engine IR lights

* Rework ranges, fix bugs, add docs

* Fix uncommented DISABLE_COMPILE_CACHE

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Markdown fixes

Co-authored-by: jonpas <jonpas33@gmail.com>

* Use baseWeapon instead of custom property

* Add baseWeapon to SPIR

---------

Co-authored-by: jonpas <jonpas33@gmail.com>
2023-09-17 09:32:39 +02:00

31 lines
921 B
Plaintext

#include "script_component.hpp"
[] call FUNC(initItemContextMenu);
addUserActionEventHandler ["headlights", "Deactivate", FUNC(onLightToggled)];
["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), {
ACE_player action ["GunLightOn", ACE_player];
ACE_player action ["IRLaserOn", ACE_player];
[] call FUNC(onLightToggled);
true
}, {
ACE_player action ["GunLightOff", ACE_player];
ACE_player action ["IRLaserOff", ACE_player];
[] call FUNC(onLightToggled);
true
}] call CBA_fnc_addKeybind;
["CBA_attachmentSwitched", {
params ["", "", "_item"];
private _substr = _item select [0, 8];
if (
ACE_player getVariable [QGVAR(isTurnedOn), false]
&& {_substr == "ACE_SPIR" || {_substr == "ACE_DBAL"}}
) then {
ACE_player action ["GunLightOn", ACE_player];
ACE_player action ["IRLaserOn", ACE_player];
};
}] call CBA_fnc_addEventHandler;