ACE3/addons/aircraft/XEH_postInitClient.sqf
Dystopian 90647c5495 Replace Helicopter eject configs with universal scripted action (#5384)
* Remove eject config entries

* Add scripted Eject action

* Fix engine stop on driver eject

* Clean up

* Use config instead object for CBA_fnc_getTurret

* Optimize, add commander turret init

* Restore role in var name

* Use single qoutes instead QUOTE macro
2017-09-18 00:24:14 +02:00

30 lines
920 B
Plaintext

#include "script_component.hpp"
if (!hasInterface) exitWith {};
private _cfgAction = configFile >> "CfgActions" >> "Eject";
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 (_cfgAction >> "priority"),
false,
true,
getText (_cfgAction >> "shortcut"),
'[_this, _target] call DFUNC(canShowEject)'
],
getText (_cfgAction >> "text"),
getText (_cfgAction >> "textDefault")
];
["Helicopter", "initPost", LINKFUNC(initEjectAction)] call CBA_fnc_addClassEventHandler;