ACE3/addons/artillerytables/XEH_postInit.sqf
PabstMirror c6d7df3770 SQF work
- improve compat with a3 mlrs with remote cam (animationSourcePhase)
- handle non [0] turrets (rhs prp)
- add config entries
- use vectorCos to fix fp error (thanks commy)
2019-03-15 17:37:13 -05:00

37 lines
1.6 KiB
Plaintext

#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 {
[{ // add a frame later to allow other modules to set variables
["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) exitWith {};
TRACE_2("adding firedEH",_vehicle,configName _vehicleCfg);
_vehicle addEventHandler ["Fired", {call FUNC(firedEH)}];
}, true, [], true] call CBA_fnc_addClassEventHandler;
}, []] call CBA_fnc_execNextFrame;
};
}] call CBA_fnc_addEventHandler;
#ifdef DEBUG_MODE_FULL
#include "dev\showShotInfo.sqf"
#endif