From 9c20706c83e637e677ab495387474a7a9a615096 Mon Sep 17 00:00:00 2001 From: Garth L-H de Wet Date: Tue, 3 Feb 2015 11:51:16 +0200 Subject: [PATCH] Added a event handler for player vehicle changing. As well as covered the canInteract in key handler. --- addons/parachute/XEH_postInit.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 4ce50e8631..a15e125edd 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -18,6 +18,9 @@ if (!hasInterface) exitWith {}; ["ACE3", localize "STR_ACE_Parachute_showAltimeter", { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { [ace_player] call FUNC(showAltimeter); @@ -28,13 +31,12 @@ if (!hasInterface) exitWith {}; }, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind); GVAR(PFH) = false; - -[{ +["playerVehicleChanged",{ if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { GVAR(PFH) = true; [FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler); }; -}, 1, []] call CALLSTACK(cba_fnc_addPerFrameHandler); +}] call EFUNC(common,addEventHandler); // don't show speed and height when in expert mode ["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute"