mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
ec38c8c951
Conflicts: addons/interaction/functions/fnc_addPassengerActions.sqf addons/interaction/functions/fnc_getDoorAnimations.sqf addons/interaction/functions/fnc_moduleInteraction.sqf addons/interaction/functions/fnc_moveDown.sqf addons/interaction/functions/fnc_removeTag.sqf addons/interaction/functions/fnc_showMouseHint.sqf addons/interaction/functions/fnc_updateTooltipPosition.sqf
50 lines
1.5 KiB
Plaintext
50 lines
1.5 KiB
Plaintext
/*
|
|
* Author: Garth de Wet (LH)
|
|
* Opens the select menu UI and sets up the UI
|
|
*
|
|
* Arguments:
|
|
* 0: Items <ARRAY>
|
|
* 0: Text <STRING>
|
|
* 1: Statement to execute <CODE>
|
|
* 2: Condition before execute <CODE>
|
|
* 3: showDisabled <BOOL>
|
|
* 4: Priority <NUMBER>
|
|
* 5: Icon <STRING>
|
|
* 6: Extra variables passed to the code <ARRAY>
|
|
* 1: Select Action <CODE>
|
|
* 2: Cancel Action <CODE>
|
|
*
|
|
* 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);
|
|
};
|