Support additional parameters for addAction API

This commit is contained in:
Nicolás Badano 2015-03-11 00:25:45 -03:00
parent 722f49acc4
commit 7138fadd71

View File

@ -13,6 +13,7 @@
* 6: Statement <CODE> * 6: Statement <CODE>
* 7: Condition <CODE> * 7: Condition <CODE>
* 8: Distance <NUMBER> * 8: Distance <NUMBER>
* 9: Other parameters <ARRAY> (Optional)
* *
* Return value: * Return value:
* The entry full path, which can be used to remove the entry, or add children entries <ARRAY>. * The entry full path, which can be used to remove the entry, or add children entries <ARRAY>.
@ -26,7 +27,7 @@
EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance); EXPLODE_9_PVT(_this,_object,_typeNum,_fullPath,_displayName,_icon,_position,_statement,_condition,_distance);
private ["_varName","_actions"]; private ["_varName","_actions","_params","_entry"];
_varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum;
_actions = _object getVariable [_varName, []]; _actions = _object getVariable [_varName, []];
@ -34,7 +35,11 @@ if((count _actions) == 0) then {
_object setVariable [_varName, _actions]; _object setVariable [_varName, _actions];
}; };
private "_entry"; _params = [false,false,false,false];
if (count _this > 9) then {
_params = _this select 9;
};
_entry = [ _entry = [
[ [
_displayName, _displayName,
@ -43,7 +48,7 @@ _entry = [
_statement, _statement,
_condition, _condition,
_distance, _distance,
[false,false,false], _params,
+ _fullPath + _fullPath
], ],
[] []