ACE3/addons/interaction/functions/fnc_addSelectableItem.sqf
2015-09-28 15:37:18 +02:00

34 lines
742 B
Plaintext

/*
* Author: Garth de Wet (LH)
* Adds an item to the select menu.
*
* Arguments:
* 0: List container <ARRAY/NUMBER>
* 1: Display name <STRING>
* 2: Picture <STRING>
* 3: Data <STRING/CODE>
*
* Return Value:
* Container <ARRAY, NUMBER>
*
* Example:
* [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem
*
* Public: No
*/
#include "script_component.hpp"
params ["_container", "_displayName", "_picture", "_data"];
if (toLower _picture in ["", "picturething"]) then {
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
};
private "_index";
_index = lbAdd [_container, _displayName];
lbSetData [_container, _index, str _data];
lbSetPicture [_container, _index, _picture];
_container