2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-03-20 02:32:44 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: commy2, NouberNou and esteldunedain
|
2015-03-20 02:32:44 +00:00
|
|
|
* Removes an action from an object
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-03-20 02:32:44 +00:00
|
|
|
* 0: Object the action is assigned to <OBJECT>
|
|
|
|
* 1: Type of action, 0 for actions, 1 for self-actions <NUMBER>
|
|
|
|
* 2: Full path of the action to remove <ARRAY>
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-03-20 02:32:44 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [cursorTarget,0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromObject;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-04 22:46:57 +00:00
|
|
|
params ["_object", "_typeNum", "_fullPath"];
|
2015-03-20 02:32:44 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _res = _fullPath call FUNC(splitPath);
|
2015-08-04 22:46:57 +00:00
|
|
|
_res params ["_parentPath", "_actionName"];
|
2015-03-20 02:32:44 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
|
|
|
|
private _actionList = _object getVariable [_varName, []];
|
2015-03-20 02:32:44 +00:00
|
|
|
{
|
|
|
|
if (((_x select 0) select 0) isEqualTo _actionName &&
|
|
|
|
{(_x select 1) isEqualTo _parentPath}) exitWith {
|
|
|
|
_actionList deleteAt _forEachIndex;
|
|
|
|
};
|
|
|
|
} forEach _actionList;
|