CBA_fnc_addItemContextMenuOption

Description

Adds context menu option to inventory display.

Parameters

_itemItem classname STRING Can be base class.

Can be item type as reported by BIS_fnc_itemType

[“Equipment”,”Headgear”] -> “#Equipment” and/or “##Headgear”

Wildcard

#All

_slotsRelevant slots <ARRAY, STRING> Values: ALL GROUND CARGO CONTAINER UNIFORM_CONTAINER VEST_CONTAINER BACKPACK_CONTAINER

CLOTHES UNIFORM VEST BACKPACK HEADGEAR GOGGLES

WEAPON RIFLE LAUNCHER PISTOL BINOCULAR

SILENCER RIFLE_SILENCER LAUNCHER_SILENCER PISTOL_SILENCER

BIPOD RIFLE_BIPOD LAUNCHER_BIPOD PISTOL_BIPOD

OPTIC RIFLE_OPTIC LAUNCHER_OPTIC PISTOL_OPTIC

POINTER RIFLE_POINTER LAUNCHER_POINTER PISTOL_POINTER

MAGAZINE RIFLE_MAGAZINE RIFLE_MAGAZINE_GL LAUNCHER_MAGAZINE PISTOL_MAGAZINE

ASSIGNED_ITEM MAP GPS RADIO COMPASS WATCH HMD

_displayName String keys are automatically translated.  <STRING, ARRAY> 0: _displayName - Option display name STRING 1: _tooltip - Option tooltip STRING

_colorOption text color.  Default alpha is 1.  (default: [] = default color) ARRAY
_iconPath to icon.  (default: “” = no icon) STRING

_condition <CODE, ARRAY> 0: _conditionEnable - Menu option is enabled and executed only if this condition reports ‘true’ (default: {true}) <CODE> 1: _conditionShow - Menu option is shown only if this condition reports ‘true’.  (optional, default: {true}) <CODE>

  • Passed arguments: params [“_unit”, “_container”, “_item”, “_slot”, “_params”];
_statementOption statement (default: {}) <CODE> Return true to keep context menu opened.
  • Passed arguments: params [“_unit”, “_container”, “_item”, “_slot”, “_params”];
_consumeRemove the item before executing the statement code.  (default: false) <BOOLEAN>
  • This does NOT work for the following slots: GROUND CARGO
_paramsArguments passed as ‘_this select 4’ to condition and statement (optional, default: []) <ANY>

Returns

Nothing/Undefined.

Examples

["#All", "ALL", ">DEBUG ACTION<", nil, nil, {true}, {
    params ["_unit", "_container", "_item", "_slot", "_params"];
    systemChat str [name _unit, typeOf _container, _item, _slot, _params];
    true
}, false, [0,1,2]] call CBA_fnc_addItemContextMenuOption;

Author

commy2

string used by format
Array to read from [Array]
Close