mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
b7f48a912f
* 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
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: BaerMitUmlaut
|
|
* Initializes the item context menu for the DBAL.
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* call ace_irlight_fnc_initItemContextMenu
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
{
|
|
_x params ["_variant", "_displayName"];
|
|
|
|
[
|
|
"ACE_DBAL_A3_Red",
|
|
"POINTER",
|
|
_displayName,
|
|
[],
|
|
"",
|
|
{
|
|
params ["", "", "_item", "", "_variant"];
|
|
|
|
private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon");
|
|
_item != _baseClass + _variant
|
|
}, {
|
|
params ["_unit", "", "_item", "_slot", "_variant"];
|
|
|
|
private _weapon = switch (_slot) do {
|
|
case "RIFLE_POINTER": {primaryWeapon _unit};
|
|
case "LAUNCHER_POINTER": {secondaryWeapon _unit};
|
|
case "PISTOL_POINTER": {handgunWeapon _unit};
|
|
default {""};
|
|
};
|
|
|
|
if (_weapon == "") exitWith {};
|
|
|
|
private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon");
|
|
|
|
[_unit, _weapon, _item, _baseClass + _variant] call EFUNC(common,switchAttachmentMode);
|
|
},
|
|
false,
|
|
_variant
|
|
] call CBA_fnc_addItemContextMenuOption;
|
|
} forEach [
|
|
["", LSTRING(Mode_IRDual)],
|
|
["_IP", LSTRING(Mode_IRPointer)],
|
|
["_II", LSTRING(Mode_IRIlluminator)],
|
|
["_VP", LSTRING(Mode_VisiblePointer)]
|
|
];
|