2015-01-12 09:48:26 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Opens the UI for explosive detonation selection
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Trigger classname <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-04-01 17:09:19 +00:00
|
|
|
* [player, "ACE_M26_Clacker"] call ACE_Explosives_fnc_addDetonateActions;
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-13 21:21:31 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-15 19:35:33 +00:00
|
|
|
|
|
|
|
params ["_unit", "_detonator"];
|
|
|
|
TRACE_2("params",_unit,_detonator);
|
|
|
|
|
2015-04-29 05:05:02 +00:00
|
|
|
private ["_result", "_item", "_children", "_range", "_required"];
|
2015-04-10 03:46:19 +00:00
|
|
|
|
2015-08-15 19:35:33 +00:00
|
|
|
_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range");
|
2015-01-12 09:48:26 +00:00
|
|
|
|
|
|
|
_result = [_unit] call FUNC(getPlacedExplosives);
|
2015-03-31 21:20:32 +00:00
|
|
|
_children = [];
|
2015-01-12 09:48:26 +00:00
|
|
|
{
|
2015-04-06 20:20:11 +00:00
|
|
|
if (!isNull(_x select 0)) then {
|
2015-04-10 03:56:19 +00:00
|
|
|
_required = getArray (ConfigFile >> "ACE_Triggers" >> (_x select 4) >> "requires");
|
2015-04-06 20:20:11 +00:00
|
|
|
if (_detonator in _required) then {
|
|
|
|
_item = ConfigFile >> "CfgMagazines" >> (_x select 3);
|
2015-03-31 21:20:32 +00:00
|
|
|
|
2015-04-06 20:20:11 +00:00
|
|
|
_children pushBack
|
|
|
|
[
|
|
|
|
[
|
|
|
|
format ["Explosive_%1", _forEachIndex],
|
|
|
|
_x select 2,
|
|
|
|
getText(_item >> "picture"),
|
|
|
|
{(_this select 2) call FUNC(detonateExplosive);},
|
|
|
|
{true},
|
|
|
|
{},
|
|
|
|
[ACE_player,_range,_x]
|
|
|
|
] call EFUNC(interact_menu,createAction),
|
|
|
|
[],
|
|
|
|
ACE_Player
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
2015-08-15 19:35:33 +00:00
|
|
|
} forEach _result;
|
2015-03-31 21:20:32 +00:00
|
|
|
|
|
|
|
_children
|