/* * Author: commy2 and NouberNou * Add an ACE action to an object or inside a parent action. Note: This function is NOT global. * * Argument: * 0: Object the action should be assigned to or parent action or * 1: Name of the action shown in the menu * 2: Icon * 3: Position (Position or Selection Name) or * 4: Statement * 5: Condition * 6: Distance * * Return value: * The entry array, which can be used to remove the entry, or add children entries . * * Public: No */ #include "script_component.hpp" EXPLODE_7_PVT(_this,_object,_displayName,_icon,_position,_statement,_condition,_distance); private ["_actions","_entry"]; _actions = []; if(IS_OBJECT(_object)) then { _actions = _object getVariable [QUOTE(GVAR(actionData)), []]; if((count _actions) == 0) then { _object setVariable [QUOTE(GVAR(actionData)), _actions] }; } else { if(IS_ARRAY(_object)) then { _actions = _object select 6; }; }; _entry = [ _displayName, _icon, _position, _statement, _condition, _distance, [], GVAR(uidCounter) ]; GVAR(uidCounter) = GVAR(uidCounter) + 1; _actions pushBack _entry; _entry;