simplify resupply actions addition
This commit is contained in:
@@ -1,30 +1,28 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params ["_type"]; // string of the object's classname
|
||||
if (!(_type isKindOf "CAManBase")) exitWith {};
|
||||
params [
|
||||
["_types", [], [[]]], // classnames to assign these action to
|
||||
["_useInheritance", false, [false]]
|
||||
];
|
||||
|
||||
if (
|
||||
(localNamespace getVariable [QGVAR(checkReinsertQueueClassesAdded), []])
|
||||
find _type != -1
|
||||
) exitWith {};
|
||||
{ // forEach _types
|
||||
private _classToAddActionsTo = _x;
|
||||
|
||||
private _checkReinsertQueueAction = [
|
||||
QGVAR(checkReinsertQueue),
|
||||
"[PILOT] Check Re-insert Queue",
|
||||
"\A3\ui_f\data\igui\cfg\simpleTasks\types\land_ca.paa",
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
// request notification from the server
|
||||
call FUNC(requestShowQueue);
|
||||
// reset last check time
|
||||
localNamespace setVariable [QGVAR(lastReinsertQueueCheck), diag_tickTime];
|
||||
},
|
||||
{
|
||||
missionNamespace getVariable [QGVAR(setting_enabled), true]
|
||||
} // always allow
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[_type, 1, ["ACE_SelfActions"], _checkReinsertQueueAction, true] call ace_interact_menu_fnc_addActionToClass;
|
||||
private _checkReinsertQueueAction = [
|
||||
QGVAR(checkReinsertQueue),
|
||||
"[PILOT] Check Re-insert Queue",
|
||||
"\A3\ui_f\data\igui\cfg\simpleTasks\types\land_ca.paa",
|
||||
{
|
||||
params ["_target", "_player", "_params"];
|
||||
// request notification from the server
|
||||
call FUNC(requestShowQueue);
|
||||
// reset last check time
|
||||
localNamespace setVariable [QGVAR(lastReinsertQueueCheck), diag_tickTime];
|
||||
},
|
||||
{
|
||||
GVAR(setting_enabled);
|
||||
} // condition
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
[_classToAddActionsTo, 1, ["ACE_SelfActions"], _checkReinsertQueueAction, _useInheritance] call ace_interact_menu_fnc_addActionToClass;
|
||||
|
||||
private _classesActionsAddedTo = (localNamespace getVariable [QGVAR(checkReinsertQueueClassesAdded), []]);
|
||||
_classesActionsAddedTo pushBackUnique _type;
|
||||
localNamespace setVariable [QGVAR(checkReinsertQueueClassesAdded), _classesActionsAddedTo];
|
||||
} forEach _types;
|
||||
Reference in New Issue
Block a user