/* * Author: Garth de Wet (LH) * Opens the select menu UI and sets up the UI * * Arguments: * 0: Items * 0: Text * 1: Statement to execute * 2: Condition before execute * 3: showDisabled * 4: Priority * 5: Icon * 6: Extra variables passed to the code * 1: Select Action * 2: Cancel Action * * Return value: * None * * Example: * [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu * * Public: No */ #include "script_component.hpp" private["_action", "_count", "_customActions", "_i"]; if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { GVAR(SelectAccept) = _this select 1; GVAR(SelectCancel) = _this select 2; buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept lbSetCurSel [8866, 0]; }else{ PARAMS_1(_customActions); private ["_count", "_action"]; _count = count _customActions; if (_count == 0) exitWith {}; _customActions call FUNC(sortOptionsByPriority); for "_i" from 0 to _count -1 do { _action = _customActions select _i; _action set [1, (_this select 1)]; }; GVAR(Buttons) = _customActions; [(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction); };