2015-01-12 09:48:26 +00:00
|
|
|
/*
|
|
|
|
Name: ACE_Explosives_fnc_openTransmitterUI
|
|
|
|
|
|
|
|
Author: Garth de Wet (LH)
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Opens the UI for selecting the transmitter
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
0: OBJECT - Unit
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
Nothing
|
|
|
|
|
|
|
|
Example:
|
|
|
|
[player] call ACE_Explosives_fnc_openTransmitterUI;
|
|
|
|
*/
|
2015-01-13 21:21:31 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-12 09:48:26 +00:00
|
|
|
private ["_items", "_unit", "_count", "_actions", "_config"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_items = (items _unit);
|
|
|
|
|
|
|
|
_actions = [localize "STR_ACE_Explosives_TriggerMenu", localize "STR_ACE_Explosives_SelectTrigger"]
|
2015-01-15 19:13:12 +00:00
|
|
|
call EFUNC(interaction,prepareSelectMenu);
|
2015-01-12 09:48:26 +00:00
|
|
|
_detonators = [_unit] call FUNC(getDetonators);
|
|
|
|
{
|
|
|
|
_config = ConfigFile >> "CfgWeapons" >> _x;
|
|
|
|
_actions = [
|
|
|
|
_actions,
|
|
|
|
getText(_config >> "displayName"),
|
|
|
|
getText(_config >> "picture"),
|
|
|
|
_x
|
2015-01-15 19:13:12 +00:00
|
|
|
] call EFUNC(interaction,addSelectableItem);
|
2015-01-12 09:48:26 +00:00
|
|
|
} count _detonators;
|
|
|
|
|
|
|
|
if (count _detonators == 0) then {
|
2015-01-15 19:13:12 +00:00
|
|
|
call EFUNC(interaction,hideMenu);
|
|
|
|
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
|
2015-01-12 20:39:37 +00:00
|
|
|
[format[localize "STR_ACE_Explosives_NoTriggersAvailable", "player"]] call EFUNC(Common,displayTextStructured);
|
2015-01-12 09:48:26 +00:00
|
|
|
}else{
|
|
|
|
[
|
|
|
|
_actions,
|
|
|
|
{
|
|
|
|
[ACE_player, _this] call FUNC(openDetonateUI);
|
|
|
|
},
|
|
|
|
{
|
2015-01-15 19:13:12 +00:00
|
|
|
call EFUNC(interaction,hideMenu);
|
|
|
|
if !(profileNamespace getVariable [QUOTE(EGVAR(interaction,AutoCloseMenu)), false]) then {
|
|
|
|
"ACE_Explosives" call EFUNC(interaction,openMenuSelf);
|
2015-01-12 09:48:26 +00:00
|
|
|
};
|
|
|
|
}
|
2015-01-15 19:13:12 +00:00
|
|
|
] call EFUNC(interaction,openSelectMenu);
|
2015-01-12 09:48:26 +00:00
|
|
|
};
|