ACE3/addons/interaction/functions/fnc_openSelectMenu.sqf

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-01-11 19:32:51 +00:00
/*
Author: Garth de Wet (LH)
2015-01-11 19:32:51 +00:00
Description:
Opens the select menu UI and sets up the UI
2015-01-11 19:32:51 +00:00
Parameters:
0: ARRAY - items
ARRAY
0 = Text
1 = statement to execute
2 = condition before execute
3 = showDisabled
4 = priority
5 = icon
6 = extra variables. Passed to the code.
1: Code - select action
2: Code - Cancel Action
Returns:
Nothing
2015-01-11 19:32:51 +00:00
Example:
2015-01-11 19:32:51 +00:00
*/
2015-01-11 23:13:47 +00:00
#include "script_component.hpp"
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];
2015-01-11 19:32:51 +00:00
}else{
_customActions = _this select 0;
_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);
2015-01-11 19:32:51 +00:00
};