2015-08-18 21:18:32 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-06-03 18:57:21 +00:00
|
|
|
["ace_unconscious", {_this call FUNC(handleUnconscious)}] call CBA_fnc_addEventHandler;
|
2016-11-02 17:44:39 +00:00
|
|
|
["weapon", FUNC(handlePlayerWeaponChanged)] call CBA_fnc_addPlayerEventHandler;
|
2016-02-19 16:24:32 +00:00
|
|
|
|
|
|
|
if (isServer) then {
|
|
|
|
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleDisconnect)}];
|
|
|
|
};
|
2016-03-05 16:41:47 +00:00
|
|
|
|
|
|
|
[QGVAR(resetLocal), {
|
|
|
|
_this call FUNC(resetLocal);
|
2016-05-22 15:29:05 +00:00
|
|
|
}] call CBA_fnc_addEventHandler;
|
2016-07-03 20:17:00 +00:00
|
|
|
|
2016-12-14 18:48:00 +00:00
|
|
|
// workaround for static fuel stations
|
|
|
|
if (hasInterface) then {
|
|
|
|
{
|
|
|
|
if (
|
|
|
|
configName _x isKindOf "Building" &&
|
|
|
|
{isClass (_x >> "ACE_Actions" >> "ACE_MainActions" >> QGVAR(Refuel))} &&
|
|
|
|
{getNumber (_x >> "scope") == 2}
|
|
|
|
) then {
|
|
|
|
TRACE_1("Compiling menu",configName _x);
|
|
|
|
[configName _x] call EFUNC(interact_menu,compileMenu);
|
|
|
|
};
|
|
|
|
} count ('true' configClasses (configFile >> "CfgVehicles"));
|
|
|
|
};
|
|
|
|
|
2016-07-03 20:17:00 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG_MODE_FULL
|
|
|
|
diag_log text format ["[ACE-refuel] Showing CfgVehicles with vanilla transportFuel"];
|
|
|
|
private _fuelTrucks = configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'transportFuel')) > 0}", true];
|
|
|
|
{
|
|
|
|
if ((configName _x) isKindOf "Car") then {
|
|
|
|
diag_log text format ["Car [%1] needs config [fuel: %2]", configName _x, getNumber (_x >> 'transportFuel')];
|
|
|
|
} else {
|
|
|
|
diag_log text format ["Non-car? [%1] needs config [fuel: %2]", configName _x, getNumber (_x >> 'transportFuel')];
|
|
|
|
};
|
|
|
|
} forEach _fuelTrucks;
|
|
|
|
#endif
|
2017-07-10 19:41:37 +00:00
|
|
|
|
|
|
|
#ifdef DRAW_HOOKS_POS
|
|
|
|
addMissionEventHandler ["Draw3D", {
|
|
|
|
private _target = cursorObject;
|
|
|
|
private _cfgPos = getArray (configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hooks));
|
|
|
|
private _dynPos = _target getVariable [QGVAR(dev_hooks), []];
|
|
|
|
{
|
|
|
|
drawIcon3D ["\a3\ui_f\data\gui\cfg\hints\icon_text\group_1_ca.paa", [1,1,1,1], _target modelToWorldVisual _x, 1, 1, 0, format ["Hook %1", _forEachIndex]];
|
|
|
|
} forEach ([_dynPos, _cfgPos] select (_dynPos isEqualTo []));
|
|
|
|
}];
|
|
|
|
#endif
|