ACE3/addons/parachute/XEH_postInit.sqf

44 lines
1.3 KiB
Plaintext
Raw Normal View History

/*
* Author: Garth 'L-H' de Wet
* Initialises the parachute system.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* None
*
* Public: No
*/
#include "script_component.hpp"
if (!hasInterface) exitWith {};
["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter), {
2015-03-05 07:32:26 +00:00
// Conditions: canInteract
if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
2015-03-05 07:32:26 +00:00
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
[ACE_player] call FUNC(showAltimeter);
2015-03-05 07:32:26 +00:00
} else {
call FUNC(hideAltimeter);
};
true
}, {false}, [24, [false, false, false]], false] call CBA_fnc_addKeybind;
2015-02-02 21:58:24 +00:00
GVAR(PFH) = false;
["vehicle",{
2015-03-05 07:32:26 +00:00
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
GVAR(PFH) = true;
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler);
2015-03-05 07:32:26 +00:00
};
}] call CBA_fnc_addPlayerEventHandler;
// don't show speed and height when in expert mode
2016-05-24 13:13:11 +00:00
["ace_infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call CBA_fnc_addEventHandler;
2015-07-28 16:36:13 +00:00
["loadout", FUNC(storeParachute)] call CBA_fnc_addPlayerEventHandler;