ACE3/addons/artillerytables/XEH_postInit.sqf

37 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-03-02 06:26:02 +00:00
#include "script_component.hpp"
["ace_settingsInitialized", {
TRACE_2("ace_settingsInitialized",GVAR(advancedCorrections),GVAR(disableArtilleryComputer));
if (hasInterface) then {
// Add hud overlay for actuall azimuth and elevation:
GVAR(pfID) = -1;
["turret", LINKFUNC(turretChanged), true] call CBA_fnc_addPlayerEventHandler;
// Add ability to dynamically open rangetables:
["ace_interactMenuOpened", LINKFUNC(interactMenuOpened)] call CBA_fnc_addEventHandler;
};
if (GVAR(advancedCorrections)) then {
2019-03-19 21:27:49 +00:00
["LandVehicle", "init", {
params ["_vehicle"];
private _vehicleCfg = configFile >> "CfgVehicles" >> typeOf _vehicle;
// config "ace_artillerytables_applyCorrections" [0 disabled, 1 enabled] falls back to artilleryScanner
private _applyCorrections = if (isNumber (_vehicleCfg >> QGVAR(applyCorrections))) then {
getNumber (_vehicleCfg >> QGVAR(applyCorrections))
} else {
getNumber (_vehicleCfg >> "artilleryScanner")
};
if (_applyCorrections == 1) then {
TRACE_2("adding firedEH",_vehicle,configName _vehicleCfg);
2019-03-02 06:26:02 +00:00
_vehicle addEventHandler ["Fired", {call FUNC(firedEH)}];
2019-03-19 21:27:49 +00:00
};
}, true, [], true] call CBA_fnc_addClassEventHandler;
2019-03-02 06:26:02 +00:00
};
}] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL
#include "dev\showShotInfo.sqf"
2019-03-16 16:56:58 +00:00
#include "dev\checkConfigs.sqf"
2019-03-02 06:26:02 +00:00
#endif