2022-05-10 01:28:10 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2022-08-31 04:17:31 +00:00
|
|
|
GVAR(isPlacing) = PLACE_CANCEL;
|
|
|
|
["ace_interactMenuOpened", {GVAR(isPlacing) = PLACE_CANCEL;}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
|
|
private _cfgWeapons = configFile >> "CfgWeapons";
|
|
|
|
private _weapons = (call (uiNamespace getVariable [QGVAR(flagItems), {[]}])) apply {_cfgWeapons >> _x};
|
2022-05-10 01:28:10 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
private _name = configName _x;
|
2022-08-31 04:17:31 +00:00
|
|
|
private _vehicleClass = getText (_x >> QGVAR(vehicle));
|
|
|
|
private _displayName = getText (_x >> "displayName");
|
|
|
|
private _icon = getText (_x >> QGVAR(icon));
|
|
|
|
GVAR(flagCache) set [_name, [_vehicleClass, _displayName, _icon]];
|
2022-05-10 01:28:10 +00:00
|
|
|
|
|
|
|
private _action = [
|
|
|
|
QGVAR(pickup),
|
|
|
|
LLSTRING(ActionPickUp),
|
2022-08-31 04:17:31 +00:00
|
|
|
QPATHTOF(ui\icons\white_pickup_icon.paa),
|
2022-05-10 01:28:10 +00:00
|
|
|
{call FUNC(pickUpFlag)},
|
|
|
|
{[_player, _target, []] call EFUNC(common,canInteractWith)},
|
|
|
|
{},
|
2022-08-31 04:17:31 +00:00
|
|
|
[_name],
|
|
|
|
[0, 0.072, 0.2],
|
|
|
|
2
|
2022-05-10 01:28:10 +00:00
|
|
|
] call EFUNC(interact_menu,createAction);
|
2022-08-31 04:17:31 +00:00
|
|
|
[_vehicleClass, 0, [], _action] call EFUNC(interact_menu,addActionToClass);
|
2022-05-10 01:28:10 +00:00
|
|
|
} forEach _weapons;
|