2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-03-20 03:53:58 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-09-28 12:35:05 +00:00
|
|
|
* Create one action per passenger.
|
2015-03-20 03:53:58 +00:00
|
|
|
*
|
2015-05-09 02:47:15 +00:00
|
|
|
* Arguments:
|
2015-03-20 03:53:58 +00:00
|
|
|
* 0: Vehicle <OBJECT>
|
|
|
|
* 1: Player <OBJECT>
|
2023-11-11 12:03:32 +00:00
|
|
|
* 2: Parameters <ARRAY>
|
2015-03-20 03:53:58 +00:00
|
|
|
*
|
2015-09-28 16:06:25 +00:00
|
|
|
* Return Value:
|
2015-03-20 03:53:58 +00:00
|
|
|
* Children actions <ARRAY>
|
|
|
|
*
|
2015-05-09 02:47:15 +00:00
|
|
|
* Example:
|
2023-11-11 12:03:32 +00:00
|
|
|
* [cursorObject, player, [params]] call ace_interaction_fnc_addPassengersActions
|
2015-05-09 02:47:15 +00:00
|
|
|
*
|
2015-03-20 03:53:58 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-09-28 12:35:05 +00:00
|
|
|
params ["_vehicle", "_player"];
|
2015-03-20 03:53:58 +00:00
|
|
|
|
2023-11-11 12:03:32 +00:00
|
|
|
// If player is not in vehicle and the crew is hostile, do not show any actions
|
|
|
|
if !(_player in _vehicle || {[_player, _vehicle] call FUNC(canInteractWithVehicleCrew)}) exitWith {
|
|
|
|
[] // return
|
|
|
|
};
|
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _actions = [];
|
2023-11-11 12:03:32 +00:00
|
|
|
private _icon = "";
|
2015-03-20 03:53:58 +00:00
|
|
|
|
|
|
|
{
|
2023-11-11 12:03:32 +00:00
|
|
|
_x params ["_unit", "_role"];
|
2015-09-28 12:35:05 +00:00
|
|
|
|
2023-11-11 12:03:32 +00:00
|
|
|
_icon = [
|
|
|
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa",
|
|
|
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
|
|
|
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa",
|
|
|
|
""
|
|
|
|
] select (["driver", "gunner", "commander"] find _role);
|
2015-09-28 12:35:05 +00:00
|
|
|
|
2023-11-11 12:03:32 +00:00
|
|
|
if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then {
|
|
|
|
_icon = QPATHTOEF(captives,UI\handcuff_ca.paa);
|
2015-03-20 03:53:58 +00:00
|
|
|
};
|
2023-11-11 12:03:32 +00:00
|
|
|
|
|
|
|
_actions pushBack [
|
|
|
|
[
|
2024-02-04 17:50:24 +00:00
|
|
|
str _unit,
|
2023-11-11 12:03:32 +00:00
|
|
|
[_unit, true] call EFUNC(common,getName),
|
|
|
|
[_icon, "#FFFFFF"],
|
|
|
|
{
|
|
|
|
// statement (Run on hover) - reset the cache so we will insert actions immediately when hovering over new unit
|
|
|
|
TRACE_2("Cleaning Cache",_target,objectParent _target);
|
|
|
|
[objectParent _target, QEGVAR(interact_menu,ATCache_ACE_SelfActions)] call EFUNC(common,eraseCache);
|
|
|
|
},
|
|
|
|
{true},
|
|
|
|
{
|
|
|
|
if (EGVAR(interact_menu,selectedTarget) isEqualTo _target) then {
|
|
|
|
_this call FUNC(addPassengerActions)
|
|
|
|
} else {
|
|
|
|
[] // not selected, don't waste time on actions
|
|
|
|
};
|
|
|
|
},
|
|
|
|
[_unit],
|
|
|
|
{[0, 0, 0]},
|
|
|
|
2,
|
|
|
|
[false, false, false, true, false], // add run on hover (4th bit true)
|
|
|
|
{if (["ace_medical_gui"] call EFUNC(common,isModLoaded)) then {call EFUNC(medical_gui,modifyActionTriageLevel)}}
|
|
|
|
] call EFUNC(interact_menu,createAction),
|
|
|
|
[],
|
|
|
|
_unit
|
|
|
|
];
|
|
|
|
} forEach ((fullCrew _vehicle) select {_x select 0 != _player && {!unitIsUAV (_x select 0)}});
|
2015-03-20 03:53:58 +00:00
|
|
|
|
2015-05-09 02:47:15 +00:00
|
|
|
_actions
|