2017-09-17 22:24:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
|
|
|
PREP_RECOMPILE_START;
|
|
|
|
#include "XEH_PREP.hpp"
|
|
|
|
PREP_RECOMPILE_END;
|
|
|
|
|
2019-05-03 17:13:54 +00:00
|
|
|
if (hasInterface) then {
|
2019-05-03 15:47:40 +00:00
|
|
|
["CBA_settingsInitialized", {
|
|
|
|
private _ejectAction = configFile >> "CfgActions" >> "Eject";
|
|
|
|
private _hideEjectAction = missionNamespace getVariable [QEGVAR(vehicles,hideEjectAction), false];
|
|
|
|
|
|
|
|
private _text = getText (_ejectAction >> "text");
|
|
|
|
if (_hideEjectAction) then {
|
|
|
|
_text = format ["<t color='#808080'>%1</t>", _text];
|
|
|
|
};
|
|
|
|
|
|
|
|
GVAR(ejectActionParams) = [
|
|
|
|
[
|
|
|
|
"", // will be set with setUserActionText
|
|
|
|
{
|
|
|
|
params ["_vehicle", "_unit"];
|
|
|
|
private _preserveEngineOn = (_unit == driver _vehicle) && {isEngineOn _vehicle};
|
|
|
|
moveOut _unit;
|
|
|
|
if (_preserveEngineOn) then {
|
|
|
|
// vehicle is local to last driver, no need to care
|
|
|
|
_vehicle engineOn true;
|
|
|
|
};
|
|
|
|
},
|
|
|
|
nil,
|
|
|
|
[getNumber (_ejectAction >> "priority"), -999] select _hideEjectAction,
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
getText (_ejectAction >> "shortcut"),
|
|
|
|
'[_this, _target] call DFUNC(canShowEject)'
|
|
|
|
],
|
|
|
|
_text,
|
|
|
|
getText (_ejectAction >> "textDefault")
|
|
|
|
];
|
|
|
|
|
|
|
|
["Helicopter", "InitPost", LINKFUNC(initEjectAction), nil, nil, true] call CBA_fnc_addClassEventHandler;
|
|
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
};
|
|
|
|
|
2017-09-17 22:24:14 +00:00
|
|
|
ADDON = true;
|