2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-02 20:33:16 +00:00
|
|
|
/*
|
|
|
|
* Author: Jonpas, PabstMirror
|
|
|
|
* Makes sure there is a ACE_MainActions on the object type
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-08-02 20:33:16 +00:00
|
|
|
* 0: Object classname <STRING>
|
|
|
|
* 1: Type of action, 0 for actions, 1 for self-actions <NUMBER>
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-08-02 20:33:16 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* ["Table", 0] call ace_interact_menu_fnc_addMainAction;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-08-09 18:02:08 +00:00
|
|
|
params ["_objectType", "_typeNum"];
|
2015-08-02 20:33:16 +00:00
|
|
|
|
2016-03-06 05:22:38 +00:00
|
|
|
private _namespace = [GVAR(ActNamespace), GVAR(ActSelfNamespace)] select _typeNum;
|
|
|
|
private _actionTrees = _namespace getVariable _objectType;
|
|
|
|
if (isNil "_actionTrees") then {
|
|
|
|
_actionTrees = [];
|
|
|
|
};
|
|
|
|
|
2016-01-08 04:43:37 +00:00
|
|
|
private _parentNode = [_actionTrees, ["ACE_MainActions"]] call FUNC(findActionNode);
|
2015-08-02 20:33:16 +00:00
|
|
|
|
|
|
|
if (isNil {_parentNode}) then {
|
|
|
|
TRACE_2("No Main Action on object", _objectType, _typeNum);
|
2016-01-08 04:43:37 +00:00
|
|
|
private _mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call FUNC(createAction);
|
2015-08-02 20:33:16 +00:00
|
|
|
[_objectType, _typeNum, [], _mainAction] call EFUNC(interact_menu,addActionToClass);
|
|
|
|
};
|