33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
// adds a scroll wheel action to all arsenal boxes to spawn different supply crate types
|
|
|
|
private _arsenalBoxClassName = "Land_PaperBox_open_full_F";
|
|
|
|
// get all instances of the arsenal item
|
|
private _arsenalBoxes = (allMissionObjects _arsenalBoxClassName) select {
|
|
// only select the ones that already have user actions attached
|
|
count (actionIDs _x) > 0;
|
|
};
|
|
|
|
private _supplyCratesCfg = call FUNC(getSupplyCratesCfg);
|
|
private _supplyCrateTypesCfgs = _supplyCratesCfg call BIS_fnc_returnChildren;
|
|
|
|
{
|
|
// add scroll wheel action to spawn different supply box types
|
|
private _arsenalBox = _x;
|
|
{
|
|
private _cfg = _x;
|
|
private _supplyCrateDisplayName = (_cfg >> "displayName") call BIS_fnc_getCfgData;
|
|
|
|
_arsenalBox addAction [format ["<t color='#ffffff'>Spawn %1</t>", _supplyCrateDisplayName], {
|
|
params ["_target", "_caller", "_actionId", "_arguments"];
|
|
_arguments params ["_supplyCrateCfg"];
|
|
[
|
|
objNull,
|
|
configName _supplyCrateCfg,
|
|
getPos _target
|
|
] call FUNC(createBox);
|
|
}, [_cfg], 0, false, true, "", ""];
|
|
} forEach _supplyCrateTypesCfgs;
|
|
} forEach _arsenalBoxes; |