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"
|
|
|
|
if (!hasInterface) exitWith {};
|
|
|
|
|
|
|
|
["ACE3", localize "STR_ACE_Parachute_showAltimeter",
|
|
|
|
{
|
2015-02-03 09:51:16 +00:00
|
|
|
// Conditions: canInteract
|
|
|
|
_exceptions = [QEGVAR(interaction,isNotEscorting)];
|
|
|
|
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
2015-02-02 20:52:08 +00:00
|
|
|
if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false};
|
2015-02-02 21:58:24 +00:00
|
|
|
if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then {
|
|
|
|
[ace_player] call FUNC(showAltimeter);
|
2015-02-02 20:52:08 +00:00
|
|
|
} else {
|
2015-02-02 21:58:24 +00:00
|
|
|
call FUNC(hideAltimeter);
|
2015-02-02 20:52:08 +00:00
|
|
|
};
|
|
|
|
true
|
|
|
|
}, [24, false, false, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind);
|
|
|
|
|
2015-02-02 21:58:24 +00:00
|
|
|
GVAR(PFH) = false;
|
2015-02-03 09:51:16 +00:00
|
|
|
["playerVehicleChanged",{
|
2015-02-02 21:58:24 +00:00
|
|
|
if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then {
|
|
|
|
GVAR(PFH) = true;
|
|
|
|
[FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler);
|
2015-02-02 20:52:08 +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-02-02 21:58:24 +00:00
|
|
|
["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"
|
|
|
|
["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier"
|