96 lines
2.3 KiB
Plaintext
96 lines
2.3 KiB
Plaintext
#include "..\script_component.hpp"
|
|
|
|
if ( !hasInterface ) exitWith {};
|
|
|
|
[
|
|
QUOTE(MODULE_CATEGORY_NAME),
|
|
"Create Resupply Box",
|
|
{
|
|
params [["_pos", [0,0,0], [[]], 3], ["_target", objNull, [objNull]]];
|
|
// get parent definition
|
|
private _supplyCratesCfg = call EFUNC(resupply,getSupplyCratesCfg);
|
|
// get the subclass names
|
|
private _boxTypesAvailable = _supplyCratesCfg call BIS_fnc_getCfgSubClasses;
|
|
|
|
_boxTypesAvailable sort true;
|
|
_comboOptions = _boxTypesAvailable apply {
|
|
[
|
|
// display name
|
|
[_supplyCratesCfg >> _x >> "displayName", "STRING", "ERROR"] call CBA_fnc_getConfigEntry,
|
|
// tooltip
|
|
[_supplyCratesCfg >> _x >> "tooltip", "STRING", "ERROR"] call CBA_fnc_getConfigEntry,
|
|
// icon
|
|
[_supplyCratesCfg >> _x >> "icon", "STRING", "ERROR"] call CBA_fnc_getConfigEntry
|
|
]
|
|
};
|
|
|
|
[
|
|
"Resupply Box Options",
|
|
[
|
|
// [ "COMBO", "Box Type", [[1,2,3], [["Ammo"],["Weapons"],["Medical"]],0] ]
|
|
["COMBO", "Box Type", [_boxTypesAvailable, _comboOptions, 0]]
|
|
],
|
|
{
|
|
|
|
params ["_dialog", "_args"];
|
|
|
|
_dialog params ["_typeOptionSelected"];
|
|
_args params ["_pos", "_target", "_keysSorted"];
|
|
|
|
|
|
private _box = [_target, _typeOptionSelected, _pos] call EFUNC(resupply,createBox);
|
|
if (isNull _box) exitWith {
|
|
["Resupply Box", "WARNING: Failed to locate or create box!"] call BIS_fnc_curatorHint;
|
|
};
|
|
[
|
|
"Resupply Box",
|
|
format[
|
|
"Created %1",
|
|
getText((call EFUNC(resupply,getSupplyCratesCfg)) >> _typeOptionSelected >> "displayName")
|
|
]
|
|
] call BIS_fnc_curatorHint;
|
|
},
|
|
{},
|
|
[_pos, _target]
|
|
] call zen_dialog_fnc_create;
|
|
}
|
|
] call zen_custom_modules_fnc_register;
|
|
|
|
|
|
[
|
|
QUOTE(MODULE_CATEGORY_NAME),
|
|
"Grounds Cleanup",
|
|
{
|
|
params [["_pos", [0,0,0], [[]], 3], ["_target", objNull, [objNull]]];
|
|
|
|
_pos = [_pos#0, _pos#1, 0];
|
|
|
|
[
|
|
"Cleanup Area",
|
|
[
|
|
[ "SLIDER:RADIUS", "Radius (meters)", [50, 500, 100, 0, _pos, [0.8, 0.2, 0.2, 1.0]], true ]
|
|
],
|
|
{
|
|
|
|
params ["_dialog", "_args"];
|
|
|
|
_dialog params ["_radius"];
|
|
_args params ["_pos", "_target"];
|
|
|
|
_objects = _pos nearObjects ["GroundWeaponHolder", _radius];
|
|
{
|
|
deleteVehicle _x;
|
|
} forEach _objects
|
|
|
|
},
|
|
{},
|
|
[_pos, _target]
|
|
] call zen_dialog_fnc_create;
|
|
|
|
}
|
|
] call zen_custom_modules_fnc_register;
|
|
|
|
|
|
diag_log text "[MILSIM] (client) zeus modules added";
|
|
|
|
nil; |