-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
47 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
PREP(getGlowOffset); | ||
PREP(initItemContextMenu); | ||
PREP(onLightToggled); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
#include "script_component.hpp" | ||
|
||
[] call FUNC(initItemContextMenu); | ||
|
||
addUserActionEventHandler ["headlights", "Deactivate", LINKFUNC(onLightToggled)]; | ||
call FUNC(initItemContextMenu); | ||
|
||
["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), { | ||
ACE_player action ["GunLightOn", ACE_player]; | ||
ACE_player action ["IRLaserOn", ACE_player]; | ||
[] call FUNC(onLightToggled); | ||
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 | ||
}, { | ||
ACE_player action ["GunLightOff", ACE_player]; | ||
ACE_player action ["IRLaserOff", ACE_player]; | ||
[] call FUNC(onLightToggled); | ||
true | ||
}] call CBA_fnc_addKeybind; | ||
if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; | ||
|
||
// Save current weapon state to reapply later | ||
private _weaponState = (weaponState ACE_player) select [0, 3]; | ||
|
||
["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; | ||
action ["GunLightOff", ACE_player]; | ||
action ["IRLaserOff", ACE_player]; | ||
|
||
ACE_player selectWeapon _weaponState; | ||
}] call CBA_fnc_addKeybind; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.