2015-03-27 05:02:54 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth de Wet (LH), PabstMirror
|
|
|
|
* Show the ammo counts for a static weapon.
|
|
|
|
* Called from "insertChildren" on interact_menu
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2015-03-27 05:02:54 +00:00
|
|
|
* 0: Target <OBJECT>
|
|
|
|
* 1: Player <OBJECT>
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2015-03-27 05:02:54 +00:00
|
|
|
* ChildActiosn<ARRAY>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, player] call ace_attach_fnc_getChildrenAttachActions
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-04 22:47:31 +00:00
|
|
|
params ["_target","_player"];
|
2015-08-06 18:17:59 +00:00
|
|
|
TRACE_2("params",_target,_player);
|
2015-03-27 05:02:54 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _listed = [];
|
|
|
|
private _actions = [];
|
2015-03-27 05:02:54 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
if !(_x in _listed) then {
|
|
|
|
_listed pushBack _x;
|
2017-10-10 14:39:59 +00:00
|
|
|
private _item = ConfigFile >> "CfgMagazines" >> _x;
|
2015-04-10 02:36:28 +00:00
|
|
|
if (getText (_item >> "ACE_Attachable") != "") then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _displayName = getText(_item >> "displayName");
|
|
|
|
private _picture = getText(_item >> "picture");
|
|
|
|
private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
2015-03-27 05:02:54 +00:00
|
|
|
_actions pushBack [_action, [], _target];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach (magazines _player);
|
|
|
|
|
|
|
|
{
|
|
|
|
if !(_x in _listed) then {
|
|
|
|
_listed pushBack _x;
|
2017-10-10 14:39:59 +00:00
|
|
|
private _item = ConfigFile >> "CfgWeapons" >> _x;
|
2015-04-10 02:36:28 +00:00
|
|
|
if (getText (_item >> "ACE_Attachable") != "") then {
|
2017-10-10 14:39:59 +00:00
|
|
|
private _displayName = getText(_item >> "displayName");
|
|
|
|
private _picture = getText(_item >> "picture");
|
|
|
|
private _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call CBA_fnc_execNextFrame}, {true}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
2015-03-27 05:02:54 +00:00
|
|
|
_actions pushBack [_action, [], _target];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach (items _player);
|
|
|
|
|
|
|
|
_actions
|