2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-19 16:31:45 +00:00
|
|
|
/*
|
2018-09-22 03:54:24 +00:00
|
|
|
* Author: Garth 'L-H' de Wet, CAA-Picard, mharis001
|
|
|
|
* Returns children actions for explosive magazines in the player's inventory.
|
2015-03-19 16:31:45 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2018-09-22 03:54:24 +00:00
|
|
|
* 0: Player <OBJECT>
|
2015-03-19 16:31:45 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* Actions <ARRAY>
|
|
|
|
*
|
|
|
|
* Example:
|
2018-09-22 03:54:24 +00:00
|
|
|
* [_player] call ace_explosives_fnc_addExplosiveActions
|
2015-03-19 16:31:45 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2018-09-22 03:54:24 +00:00
|
|
|
[_this, {
|
|
|
|
params ["_player"];
|
|
|
|
TRACE_1("Creating explosive actions",_player);
|
2015-08-15 19:35:33 +00:00
|
|
|
|
2018-09-22 03:54:24 +00:00
|
|
|
private _cfgMagazines = configFile >> "CfgMagazines";
|
|
|
|
private _magazines = magazines _player;
|
|
|
|
private _totalCount = count _magazines;
|
2015-03-19 16:31:45 +00:00
|
|
|
|
2018-09-22 03:54:24 +00:00
|
|
|
private _actions = [];
|
|
|
|
{
|
|
|
|
private _config = _cfgMagazines >> _x;
|
|
|
|
if (getNumber (_config >> QGVAR(Placeable)) == 1) then {
|
|
|
|
private _name = getText (_config >> "displayNameShort");
|
|
|
|
private _picture = getText (_config >> "picture");
|
|
|
|
if (_name isEqualTo "") then {
|
|
|
|
_name = getText (_config >> "displayName");
|
|
|
|
};
|
2016-09-04 14:44:22 +00:00
|
|
|
|
2018-09-22 03:54:24 +00:00
|
|
|
private _action = [_x, format ["%1 (%2)", _name, _totalCount - count (_magazines - [_x])], _picture, {[{_this call FUNC(setupExplosive)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, _x] call EFUNC(interact_menu,createAction);
|
|
|
|
_actions pushBack [_action, [], _player];
|
|
|
|
};
|
|
|
|
} forEach (_magazines arrayIntersect _magazines);
|
2015-03-19 16:31:45 +00:00
|
|
|
|
2018-09-22 03:54:24 +00:00
|
|
|
_actions
|
|
|
|
}, ACE_player, QGVAR(explosiveActions), 3600, "cba_events_loadoutEvent"] call EFUNC(common,cachedCall);
|