ACE3/addons/irlight/XEH_postInit.sqf
johnb432 b7f48a912f
IR Light - Fix bad item replacements and switching to primary weapons (#10119)
* Fix bad item replacements and switching to primary weapons

* Update addons/irlight/functions/fnc_initItemContextMenu.sqf

* Update fnc_initItemContextMenu.sqf

* Remove unused funtions

* Various fixes/tweaks

- Added a weapon parameter to `switchAttachmentMode`
- Made `switchPersistentLaser` take pointer switching into account
- Fixed IR light attachments being added to the wrong weapon
2024-08-11 08:08:50 -07:00

28 lines
770 B
Plaintext

#include "script_component.hpp"
call FUNC(initItemContextMenu);
["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), {
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {};
// Save current weapon state to reapply later
private _weaponState = (weaponState ACE_player) select [0, 3];
action ["GunLightOn", ACE_player];
action ["IRLaserOn", ACE_player];
ACE_player selectWeapon _weaponState;
true
}, {
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {};
// Save current weapon state to reapply later
private _weaponState = (weaponState ACE_player) select [0, 3];
action ["GunLightOff", ACE_player];
action ["IRLaserOff", ACE_player];
ACE_player selectWeapon _weaponState;
}] call CBA_fnc_addKeybind;