2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-02-02 08:35:17 +00:00
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Opens the UI for explosive trigger selection
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Explosive Magazine <STRING>
|
2015-02-20 01:28:16 +00:00
|
|
|
* 1: Explosive <OBJECT>
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-04-01 17:09:19 +00:00
|
|
|
* [lbData [8866, lbCurSel 8866], _explosive] call ACE_Explosives_fnc_addTriggerActions;
|
2015-02-02 08:35:17 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-08-15 19:35:33 +00:00
|
|
|
|
|
|
|
params ["_magazine", "_explosive"];
|
|
|
|
TRACE_2("params",_magazine,_explosive);
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _isAttached = !isNull (attachedTo _explosive);
|
|
|
|
private _detonators = [ACE_player] call FUNC(getDetonators);
|
|
|
|
private _triggerTypes = [_magazine] call FUNC(triggerType);
|
|
|
|
private _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers";
|
|
|
|
private _children = [];
|
2015-01-11 16:42:31 +00:00
|
|
|
{
|
2017-10-10 14:39:59 +00:00
|
|
|
private _required = getArray (_x >> "requires");
|
|
|
|
private _hasRequiredItems = true;
|
2015-04-06 20:20:11 +00:00
|
|
|
{
|
|
|
|
if !(_x in _detonators) exitWith {
|
|
|
|
_hasRequiredItems = false;
|
|
|
|
};
|
2024-04-04 11:15:26 +00:00
|
|
|
} forEach _required;
|
2015-07-17 04:59:31 +00:00
|
|
|
if (_hasRequiredItems && {(!_isAttached) || {(getNumber (_x >> "isAttachable")) == 1}}) then {
|
2015-04-06 20:20:11 +00:00
|
|
|
_children pushBack
|
|
|
|
[
|
|
|
|
[
|
|
|
|
format ["Trigger_%1", _forEachIndex],
|
|
|
|
if(isText(_magTriggers >> configName _x >> "displayName"))then
|
|
|
|
{getText(_magTriggers >> configName _x >> "displayName")}
|
|
|
|
else{getText(_x >> "displayName")},
|
|
|
|
if(isText(_magTriggers >> configName _x >> "picture"))then
|
|
|
|
{getText(_magTriggers >> configName _x >> "picture")}
|
|
|
|
else{getText(_x >> "picture")},
|
|
|
|
{(_this select 2) call FUNC(selectTrigger);},
|
|
|
|
{true},
|
|
|
|
{},
|
|
|
|
[_explosive, _magazine, configName _x]
|
|
|
|
] call EFUNC(interact_menu,createAction),
|
|
|
|
[],
|
|
|
|
ACE_Player
|
|
|
|
];
|
|
|
|
};
|
2015-08-15 19:35:33 +00:00
|
|
|
} forEach _triggerTypes;
|
2015-03-31 21:20:32 +00:00
|
|
|
|
|
|
|
_children
|