From a0ecff5def2e4798484257842f8f7f947bd0b03d Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Sat, 25 Apr 2020 21:19:35 +0200 Subject: [PATCH] Inventory - Add context menu options for pointers and optics (#1328) --- addons/accessory/XEH_preInit.sqf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/addons/accessory/XEH_preInit.sqf b/addons/accessory/XEH_preInit.sqf index 0865270e9..68f1c5d1c 100644 --- a/addons/accessory/XEH_preInit.sqf +++ b/addons/accessory/XEH_preInit.sqf @@ -19,3 +19,21 @@ if (!hasInterface) exitWith {}; [ELSTRING(common,WeaponsCategory), "MRT_SwitchItemPrevClass_O", [LSTRING(opticPrev), LSTRING(opticPrev_tooltip)], { [2, "prev"] call FUNC(switchAttachment) // return }, {}, [DIK_SUBTRACT, [true, false, false]]] call CBA_fnc_addKeybind; + +[ + "##AccessoryPointer", "ALL", [LSTRING(railNext), LSTRING(railNext_tooltip)], nil, nil, { + params ["", "", "_item"]; + count (_item call CBA_fnc_switchableAttachments) > 1 // return + }, { + [1, "next"] call FUNC(switchAttachment) // return + } +] call CBA_fnc_addItemContextMenuOption; + +[ + "##AccessorySights", "ALL", [LSTRING(opticNext), LSTRING(opticNext_tooltip)], nil, nil, { + params ["", "", "_item"]; + count (_item call CBA_fnc_switchableAttachments) > 1 // return + }, { + [2, "next"] call FUNC(switchAttachment) // return + } +] call CBA_fnc_addItemContextMenuOption;