2015-02-02 22:05:03 +00:00
|
|
|
/*
|
|
|
|
* Author: Garth 'L-H' de Wet
|
|
|
|
* Initialises the parachute system.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-02-02 20:52:08 +00:00
|
|
|
#include "script_component.hpp"
|
2015-04-17 11:01:38 +00:00
|
|
|
|
2015-02-02 20:52:08 +00:00
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
2015-05-28 19:59:04 +00:00
|
|
|
["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter),
|
2015-02-02 20:52:08 +00:00
|
|
|
{
|
2015-03-05 07:32:26 +00:00
|
|
|
// Conditions: canInteract
|
2015-04-17 11:01:38 +00:00
|
|
|
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 {
|
2015-05-19 16:17:10 +00:00
|
|
|
[ACE_player] call FUNC(showAltimeter);
|
2015-03-05 07:32:26 +00:00
|
|
|
} else {
|
|
|
|
call FUNC(hideAltimeter);
|
|
|
|
};
|
|
|
|
true
|
|
|
|
},
|
2015-03-05 08:51:24 +00:00
|
|
|
{false},
|
2015-03-10 17:45:08 +00:00
|
|
|
[24, [false, false, false]], false] call cba_fnc_addKeybind;
|
2015-02-02 20:52:08 +00:00
|
|
|
|
2015-02-02 21:58:24 +00:00
|
|
|
GVAR(PFH) = false;
|
2015-02-03 09:51:16 +00:00
|
|
|
["playerVehicleChanged",{
|
2015-03-05 07:32:26 +00:00
|
|
|
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
|
|
|
|
GVAR(PFH) = true;
|
2015-08-04 07:34:31 +00:00
|
|
|
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler);
|
2015-03-05 07:32:26 +00:00
|
|
|
};
|
2015-02-03 09:51:16 +00:00
|
|
|
}] call EFUNC(common,addEventHandler);
|
2015-02-02 20:52:08 +00:00
|
|
|
|
|
|
|
// don't show speed and height when in expert mode
|
2015-05-19 16:17:10 +00:00
|
|
|
["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler);
|
2015-07-28 16:36:13 +00:00
|
|
|
|
2015-05-19 16:17:10 +00:00
|
|
|
//[ACE_Player,([ACE_player] call EFUNC(common,getAllGear))] call FUNC(storeParachute);
|
2015-07-01 00:49:29 +00:00
|
|
|
["playerInventoryChanged", FUNC(storeParachute) ] call EFUNC(common,addEventHandler);
|