2015-03-19 16:00:10 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-03-19 16:00:10 +00:00
|
|
|
* Creates an isolated ACE action
|
|
|
|
* Note: This function is NOT global.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Action name <STRING>
|
|
|
|
* 1: Name of the action shown in the menu <STRING>
|
|
|
|
* 2: Icon <STRING>
|
2015-03-20 02:32:44 +00:00
|
|
|
* 3: Statement <CODE>
|
|
|
|
* 4: Condition <CODE>
|
|
|
|
* 5: Insert children code <CODE> (Optional)
|
|
|
|
* 6: Action parameters <ANY> (Optional)
|
2015-05-01 04:56:39 +00:00
|
|
|
* 7: Position (Position array, Position code or Selection Name) <ARRAY>, <CODE> or <STRING> (Optional)
|
2015-03-20 02:32:44 +00:00
|
|
|
* 8: Distance <NUMBER> (Optional)
|
|
|
|
* 9: Other parameters <ARRAY> (Optional)
|
2015-04-17 02:53:54 +00:00
|
|
|
* 10: Modifier function <CODE> (Optional)
|
2015-03-19 16:00:10 +00:00
|
|
|
*
|
|
|
|
* Return value:
|
2015-03-20 02:32:44 +00:00
|
|
|
* Action <ARRAY>
|
2015-03-19 16:00:10 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-04-15 21:57:15 +00:00
|
|
|
* ["VulcanPinch","Vulcan Pinch","",{_target setDamage 1;},{true},{},[parameters], [0,0,0], 100] call ace_interact_menu_fnc_createAction;
|
2015-03-19 16:00:10 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition);
|
2015-03-19 16:00:10 +00:00
|
|
|
|
2015-04-29 06:26:13 +00:00
|
|
|
// IGNORE_PRIVATE_WARNING(_target);
|
2015-04-17 02:53:54 +00:00
|
|
|
private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"];
|
2015-03-19 16:00:10 +00:00
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
_insertChildren = if (count _this > 5) then {
|
|
|
|
_this select 5
|
|
|
|
} else {
|
|
|
|
{}
|
2015-03-19 16:00:10 +00:00
|
|
|
};
|
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
_customParams = if (count _this > 6) then {
|
|
|
|
_this select 6
|
|
|
|
} else {
|
|
|
|
[]
|
2015-03-19 16:00:10 +00:00
|
|
|
};
|
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
_position = if (count _this > 7) then {
|
2015-05-01 04:56:39 +00:00
|
|
|
if (typeName (_this select 7) == "STRING") then {
|
|
|
|
// If the action is set to a selection, create the suitable code
|
|
|
|
compile format ["_target selectionPosition '%1'", _this select 7];
|
|
|
|
} else {
|
|
|
|
if (typeName (_this select 7) == "ARRAY") then {
|
|
|
|
// If the action is set to a array position, create the suitable code
|
|
|
|
compile format ["%1", _this select 7];
|
|
|
|
} else {
|
|
|
|
_this select 7
|
|
|
|
};
|
|
|
|
}
|
2015-03-20 02:32:44 +00:00
|
|
|
} else {
|
2015-05-01 04:56:39 +00:00
|
|
|
{[0,0,0]}
|
2015-03-19 16:00:10 +00:00
|
|
|
};
|
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
_distance = if (count _this > 8) then {
|
|
|
|
_this select 8
|
|
|
|
} else {
|
|
|
|
2
|
|
|
|
};
|
|
|
|
|
|
|
|
_params = if (count _this > 9) then {
|
|
|
|
_this select 9
|
|
|
|
} else {
|
2015-05-02 05:13:09 +00:00
|
|
|
[false,false,false,false,false]
|
2015-03-20 02:32:44 +00:00
|
|
|
};
|
|
|
|
|
2015-04-17 02:53:54 +00:00
|
|
|
_modifierFunction = if (count _this > 10) then {
|
|
|
|
_this select 10
|
|
|
|
} else {
|
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
2015-03-20 02:32:44 +00:00
|
|
|
[
|
|
|
|
_actionName,
|
|
|
|
_displayName,
|
|
|
|
_icon,
|
|
|
|
_statement,
|
|
|
|
_condition,
|
|
|
|
|
|
|
|
_insertChildren,
|
|
|
|
_customParams,
|
|
|
|
_position,
|
|
|
|
_distance,
|
2015-04-17 02:53:54 +00:00
|
|
|
_params,
|
|
|
|
_modifierFunction
|
2015-03-20 02:32:44 +00:00
|
|
|
]
|