mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3312 from acemod/passengerInteraction
Only get passenger actions for selected unit
This commit is contained in:
commit
53d870b62a
@ -20,12 +20,10 @@
|
||||
params ["", "", "_parameters"];
|
||||
_parameters params ["_unit"];
|
||||
|
||||
private ["_varName", "_actionTrees", "_actions"];
|
||||
private _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
|
||||
private _actionTrees = missionNamespace getVariable [_varName, []];
|
||||
|
||||
_varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
|
||||
_actionTrees = missionNamespace getVariable [_varName, []];
|
||||
|
||||
_actions = [];
|
||||
private _actions = [];
|
||||
|
||||
// Mount unit MainActions menu
|
||||
{
|
||||
|
@ -23,12 +23,10 @@ private "_actions";
|
||||
_actions = [];
|
||||
|
||||
{
|
||||
private ["_unit", "_icon"];
|
||||
|
||||
_unit = _x;
|
||||
private _unit = _x;
|
||||
|
||||
if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then {
|
||||
_icon = [
|
||||
private _icon = [
|
||||
"",
|
||||
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa",
|
||||
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
|
||||
@ -44,10 +42,23 @@ _actions = [];
|
||||
format ["%1", _unit],
|
||||
[_unit, true] call EFUNC(common,getName),
|
||||
_icon,
|
||||
{},
|
||||
{
|
||||
//statement (Run on hover) - reset the cache so we will insert actions immedietly when hovering over new unit
|
||||
TRACE_2("Cleaning Cache",_target,vehicle _target);
|
||||
[vehicle _target, QEGVAR(interact_menu,ATCache_ACE_SelfActions)] call EFUNC(common,eraseCache);
|
||||
},
|
||||
{true},
|
||||
{_this call FUNC(addPassengerActions)},
|
||||
[_unit]
|
||||
{
|
||||
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)
|
||||
] call EFUNC(interact_menu,createAction),
|
||||
[],
|
||||
_unit
|
||||
|
Loading…
Reference in New Issue
Block a user