2015-01-11 19:32:51 +00:00
|
|
|
/*
|
|
|
|
Author: Garth de Wet (LH)
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Opens the select menu UI and sets up the UI
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
Example:
|
|
|
|
*/
|
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 [8866, lbCurSel 8866])) call GVAR(SelectAccept); )]; // accept
|
2015-01-11 19:32:51 +00:00
|
|
|
lbSetCurSel [8866, 0];
|
|
|
|
}else{
|
|
|
|
_customActions = _this select 0;
|
|
|
|
_count = count _customActions;
|
|
|
|
if (_count == 0) exitWith {};
|
2015-01-11 23:13:47 +00:00
|
|
|
_customActions call FUNC(sortOptionsByPriority);
|
2015-01-11 19:32:51 +00:00
|
|
|
for "_i" from 0 to _count -1 do {
|
|
|
|
_action = _customActions select _i;
|
|
|
|
_action set [1, (_this select 1)];
|
|
|
|
};
|
2015-01-11 23:13:47 +00:00
|
|
|
GVAR(Buttons) = _customActions;
|
2015-01-12 04:20:02 +00:00
|
|
|
[(_this select 2), true, true, false, ACE_player] call FUNC(initialiseInteraction);
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|