/* * Author: commy2, NouberNou and CAA-Picard * Add an ACE action to an object, under a certain config path * Note: This function is NOT global. * * Argument: * 0: Object the action should be assigned to * 1: Type of action, 0 for actions, 1 for self-actions * 2: Full path of the new action * 3: Name of the action shown in the menu * 4: Icon * 5: Position (Position or Selection Name) or * 6: Statement * 7: Condition * 8: Distance * 9: Other parameters (Optional) * * Return value: * The entry full path, which can be used to remove the entry, or add children entries . * * Example: * [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"],"Vulcan Pinch","",[0,0,0],{_target setDamage 1;},{true},100] call ace_interact_menu_fnc_addAction; * * Public: No */ #include "script_component.hpp" EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); private ["_varName","_actions","_params","_entry"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _actions = _object getVariable [_varName, []]; if((count _actions) == 0) then { _object setVariable [_varName, _actions]; }; _params = [false,false,false,false]; if (count _this > 9) then { _params = _this select 9; }; _entry = [ [ _displayName, _icon, _position, _statement, _condition, _distance, _params, + _fullPath ], [] ]; _actions pushBack _entry; _fullPath