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"];
|
params ["", "", "_parameters"];
|
||||||
_parameters params ["_unit"];
|
_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];
|
private _actions = [];
|
||||||
_actionTrees = missionNamespace getVariable [_varName, []];
|
|
||||||
|
|
||||||
_actions = [];
|
|
||||||
|
|
||||||
// Mount unit MainActions menu
|
// Mount unit MainActions menu
|
||||||
{
|
{
|
||||||
|
@ -23,12 +23,10 @@ private "_actions";
|
|||||||
_actions = [];
|
_actions = [];
|
||||||
|
|
||||||
{
|
{
|
||||||
private ["_unit", "_icon"];
|
private _unit = _x;
|
||||||
|
|
||||||
_unit = _x;
|
|
||||||
|
|
||||||
if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then {
|
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_driver_ca.paa",
|
||||||
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
|
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
|
||||||
@ -44,14 +42,27 @@ _actions = [];
|
|||||||
format ["%1", _unit],
|
format ["%1", _unit],
|
||||||
[_unit, true] call EFUNC(common,getName),
|
[_unit, true] call EFUNC(common,getName),
|
||||||
_icon,
|
_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},
|
{true},
|
||||||
{_this call FUNC(addPassengerActions)},
|
{
|
||||||
[_unit]
|
if (EGVAR(interact_menu,selectedTarget) isEqualTo _target) then {
|
||||||
] call EFUNC(interact_menu,createAction),
|
_this call FUNC(addPassengerActions)
|
||||||
[],
|
} else {
|
||||||
_unit
|
[] //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
|
||||||
|
];
|
||||||
};
|
};
|
||||||
false
|
false
|
||||||
} count crew _vehicle;
|
} count crew _vehicle;
|
||||||
|
Loading…
Reference in New Issue
Block a user