 sreV                prefix z\vtx\addons\uh60_cas  CfgEventHandlers.hpp             ˆ¬æi   config.bin             ó¬æi»  config.cpp             ˆ¬æi�  config\cfgVehicles.hpp             ˆ¬æi¼  config\coPilotInteraction.hpp             ˆ¬æiÇ  config\pilotInteraction.hpp             ˆ¬æiÚ  functions\fnc_clearCautionsList.sqf             ˆ¬æi€  functions\fnc_perSecond.sqf             ˆ¬æi>  functions\fnc_registerCaution.sqf             ˆ¬æi|   functions\fnc_registerCautionAdvisory.sqf             ˆ¬æi¾  functions\fnc_removeCautionAdvisory.sqf             ˆ¬æi  functions\fnc_setMasterCaution.sqf             ˆ¬æiý  functions\fnc_setup.sqf             ˆ¬æi³  functions\fnc_shutdown.sqf             ˆ¬æiV   functions\fnc_updateAdvisories.sqf             ˆ¬æiq  functions\fnc_updateCautionPanel.sqf             ˆ¬æi:  functions\fnc_updateCautions.sqf             ˆ¬æi‰  functions\fnc_updateCautionsList.sqf             ˆ¬æiV  functions\fnc_updateOverlayList.sqf             ˆ¬æi!  functions\script_component.hpp             ˆ¬æi8   script_component.hpp             ˆ¬æiÒ  XEH_preInit.sqf             ˆ¬æi„   XEH_PREP.hpp             ˆ¬æi  XEH_preStart.sqf             ˆ¬æi<                        class Extended_PreStart_EventHandlers {
    class ADDON {
        init = QUOTE(call COMPILE_FILE(XEH_preStart));
    };
};

class Extended_PreInit_EventHandlers {
    class ADDON {
        init = QUOTE(call COMPILE_FILE(XEH_preInit));
    };
};
 raP       ·    CfgPatches �    Extended_PreStart_EventHandlers a   Extended_PreInit_EventHandlers ×   CfgVehicles L   cfgMods �  ·    vtx_uh60_cas ¥   a   
 name vtx - UH60_CAS units  weapons  requiredVersion ®@requiredAddons  vtx_UH60  author  authors    version 0.7.6.2  versionStr 0.7.6.2 versionAr              a    vtx_uh60_cas y  ×    init call compile preprocessFileLineNumbers '\z\vtx\addons\uh60_cas\XEH_preStart.sqf' ×    vtx_uh60_cas ï  L    init call compile preprocessFileLineNumbers '\z\vtx\addons\uh60_cas\XEH_preInit.sqf' L   Helicopter_Base_F  Helicopter_Base_H ¬   Heli_Transport_01_base_F Ü   vtx_H60_base a  �  Helicopter_Base_F hct_driver hct_copilot Ü  Helicopter_Base_H  hct_driver    hct_copilot :  a  hct_driver interaction modules :  hct_copilot interaction modules a  Heli_Transport_01_base_F  hct_driver     hct_copilot   �  hct_driver  modules Î   interaction Û    modules  Û  interaction  cas õ      cas_panel -   landinglight ü   searchlight t      MasterCaution F  ü    positionType coordinates position áz?33£@…k¾ label Master Caution radius ÍÌÌ= clickSound hct_Switch_Sound  buttonUp _this call vtx_uh60_cas_fnc_clearCautionsList ü    landinglight_elev   t    positionType anim  position b_landinglight_r  label Landing Light radius ÍÌÌ< animation landinglight_elev scrollIncrement ÍÌL=dragRange ÍÌÌ>looping     animLimits     ùÉ? dragStart   dragging   dragStop   buttonUp vtx_uh60_misc_landingLightOn = !vtx_uh60_misc_landingLightOn; _this call vtx_uh60_misc_fnc_toggleLights; t    searchlight ‹      positionType anim  position b_searchlight_r  label Search Light radius ÍÌÌ< animation searchlight_elev  animationH searchlight_turn scrollIncrement ÍÌL=dragRange ÍÌÌ>looping     animLimits     ùÉ?animLimitsH ùÉ¿ùÉ? dragStart   dragging   dragStop   buttonUp vtx_uh60_misc_searchLightOn = !vtx_uh60_misc_searchLightOn; _this call vtx_uh60_misc_fnc_toggleLights;   hct_copilot  modules F   interaction S  �  modules  S  interaction  cas m  �    cas_panel ¥   landinglight t	   searchlight ì
  �    MasterCaution ¾  t	    positionType coordinates position áz¿33£@…k¾ label Master Caution radius ÍÌÌ= clickSound hct_Switch_Sound  buttonUp _this call vtx_uh60_cas_fnc_clearCautionsList t	    landinglight_elev ‘	  ì
    positionType anim  position b_landinglight_l  label Landing Light radius ÍÌÌ< animation landinglight_elev scrollIncrement ÍÌL=dragRange ÍÌÌ>looping     animLimits     ùÉ? dragStart   dragging   dragStop   buttonUp vtx_uh60_misc_landingLightOn = !vtx_uh60_misc_landingLightOn; _this call vtx_uh60_misc_fnc_toggleLights; ì
    searchlight   �    positionType anim  position b_searchlight_l  label Search Light radius ÍÌÌ< animation searchlight_elev  animationH searchlight_turn scrollIncrement ÍÌL=dragRange ÍÌÌ>looping     animLimits     ùÉ?animLimitsH ùÉ¿ùÉ? dragStart   dragging   dragStop   buttonUp vtx_uh60_misc_searchLightOn = !vtx_uh60_misc_searchLightOn; _this call vtx_uh60_misc_fnc_toggleLights; �    author   timepacked 1776725235 ·      #include "script_component.hpp"

class CfgPatches {
    class ADDON {
        name = COMPONENT_NAME;
        units[] = {};
        weapons[] = {};
        requiredVersion = REQUIRED_VERSION;
        requiredAddons[] = {"vtx_UH60"};
        author = "";
        authors[] = {""};
        VERSION_CONFIG;
    };
};

#include "CfgEventHandlers.hpp"

#include "config\cfgVehicles.hpp"
class CfgVehicles {
    class Helicopter_Base_F;
    class Helicopter_Base_H: Helicopter_Base_F{
        class hct_driver;
        class hct_copilot;
    }; // Helicopter_Base_H
    class Heli_Transport_01_base_F: Helicopter_Base_H {
        class hct_driver: hct_driver {
            class interaction;
            class modules;
        }; // hct_driver
        class hct_copilot: hct_copilot {
            class interaction;
            class modules;
        }; // hct_copilot
    }; // Heli_Transport_01_base_F
    class vtx_H60_base: Heli_Transport_01_base_F {
        class hct_driver: hct_driver {
            class modules: modules {
                //class cas {
                //    startOnEnter = 1;
                //}; // fms
            }; // modules
            class interaction: interaction {
                class cas {
                    #include "pilotInteraction.hpp"
                }; // FMS
            }; // interaction
        }; // hct_driver
        class hct_copilot: hct_copilot {
            class modules: modules {
                //class cas {
                //    startOnEnter = 1;
                //}; // fms
            }; // modules
            class interaction: interaction {
                class cas {
                    #include "coPilotInteraction.hpp"
                }; // FMS
            }; // interaction
        }; // hct_copilot
    }; // vtx_H60_base
}; // CfgVehicles
class cas_panel {
    class MasterCaution {
        positionType="coordinates";
        position[]={-0.58,5.1,-0.23};
        label="Master Caution";
        radius=0.1;
        clickSound="hct_Switch_Sound";
        buttonUp="_this call vtx_uh60_cas_fnc_clearCautionsList";
    };
};

class landinglight {
    class landinglight_elev {
        positionType="anim";
        position="b_landinglight_l";
        label="Landing Light";
        radius=0.025;
        animation="landinglight_elev";
        scrollIncrement = 0.05;
        dragRange = 0.4;
        looping = 0;
        animLimits[] = {0, RAD90};
        dragStart="";
        dragging="";
        dragStop="";
        buttonUp="vtx_uh60_misc_landingLightOn = !vtx_uh60_misc_landingLightOn; _this call vtx_uh60_misc_fnc_toggleLights;";
    }; // landinglight_elev
};
class searchlight {
    class searchlight {
        positionType="anim";
        position="b_searchlight_l";
        label="Search Light";
        radius=0.025;
        animation="searchlight_elev";
        animationH="searchlight_turn";
        scrollIncrement = 0.05;
        dragRange = 0.4;
        looping = 0;
        animLimits[] = {0, RAD90};
        animLimitsH[] = {-RAD90, RAD90};
        dragStart="";
        dragging="";
        dragStop="";
        buttonUp="vtx_uh60_misc_searchLightOn = !vtx_uh60_misc_searchLightOn; _this call vtx_uh60_misc_fnc_toggleLights;";
    }; // searchlight
};
class cas_panel {
    class MasterCaution {
        positionType="coordinates";
        position[]={0.58,5.1,-0.23};
        label="Master Caution";
        radius=0.1;
        clickSound="hct_Switch_Sound";
        buttonUp="_this call vtx_uh60_cas_fnc_clearCautionsList";
    };
};
#define RAD90 1.5708
class landinglight {
    class landinglight_elev {
        positionType="anim";
        position="b_landinglight_r";
        label="Landing Light";
        radius=0.025;
        animation="landinglight_elev";
        scrollIncrement = 0.05;
        dragRange = 0.4;
        looping = 0;
        animLimits[] = {0, RAD90};
        dragStart="";
        dragging="";
        dragStop="";
        buttonUp="vtx_uh60_misc_landingLightOn = !vtx_uh60_misc_landingLightOn; _this call vtx_uh60_misc_fnc_toggleLights;";
    }; // landinglight_elev
};
class searchlight {
    class searchlight {
        positionType="anim";
        position="b_searchlight_r";
        label="Search Light";
        radius=0.025;
        animation="searchlight_elev";
        animationH="searchlight_turn";
        scrollIncrement = 0.05;
        dragRange = 0.4;
        looping = 0;
        animLimits[] = {0, RAD90};
        animLimitsH[] = {-RAD90, RAD90};
        dragStart="";
        dragging="";
        dragStop="";
        buttonUp="vtx_uh60_misc_searchLightOn = !vtx_uh60_misc_searchLightOn; _this call vtx_uh60_misc_fnc_toggleLights;";
    }; // searchlight
};
/*
 * vtx_uh60_cas_fnc_clearCautionsList
 *
 * clears clearable master cautions
 *
 * params (array)[(object) vehicle]
 */

params ["_vehicle", ["_autoClearOnly", false]];

private _casList = (_vehicle getVariable ["vtx_cas_list",[]]);

private ["_condition"];
{ // forEach _casList;
    _condition = _x # 1;
    _wantToClear = (_x # 2 && _autoClearOnly || !_autoClearOnly);
    if (!(call _condition) && _wantToClear) then {
        [_vehicle, _x # 0] call vtx_uh60_cas_fnc_removeCautionAdvisory;
    };
} forEach _casList;
if(!_autoClearOnly) then {
    [_vehicle, false] call vtx_uh60_cas_fnc_setMasterCaution;
};
/*
 * vtx_uh60_Cas_fnc_perSecond
 *
 * handles occasional updates of the caution system
 *
 * params (array)[(object) vehicle]
 */
params ["_vehicle"];

[_vehicle] call vtx_uh60_cas_fnc_updateCautionPanel;
[_vehicle] call vtx_uh60_cas_fnc_updateCautions;
[_vehicle] call vtx_uh60_cas_fnc_updateAdvisories;
params ["_vehicle"];

[_vehicle] call vtx_uh60_cas_fnc_updateCautionPanel;
_vehicle animate ["CautionMasterCaution",1];
/*
 * vtx_uh60_cas_fnc_registerCautionAdvisory
 *
 * registers a caution/advisory in the cas system
 * this gets run on all clients when a caution happens, to synchronize the cautions list
 *
 * params (array)[(object) vehicle,(string) text, (code) clear condition]
 */

params ["_vehicle", "_text", "_clearCondition", ["_caution", false], ["_autoClear", false]];

private _casList = (_vehicle getVariable ["vtx_cas_list",[]]);
private _exists = false;
{ // forEach _casList
    if (_text == _x # 0) exitWith {
        _exists = true;
    };
} forEach _casList;

if (_exists) exitWith {};

// if you are the pilot, make the event run for the crew
if (local _vehicle) then {
    //_this remoteExecCall ["vtx_uh60_cas_fnc_registerCautionAdvisory", ((crew _vehicle) - [player])];
};

if (isNil "vtx_uh60_cas_cautionsUnacked") then {vtx_uh60_cas_cautionsUnacked = 0};
if (isNil "vtx_uh60_cas_cautionsLog") then {vtx_uh60_cas_cautionsLog = []};
vtx_uh60_cas_cautionsLog = vtx_uh60_cas_cautionsLog + [_text];
[_vehicle,true] call vtx_uh60_cas_fnc_updateOverlayList;

_casList pushBack [_text, _clearCondition, _autoClear];
_vehicle setVariable ["vtx_cas_list", _casList];

if (_vehicle == vehicle player) then {
    [_vehicle] call vtx_uh60_cas_fnc_updateCautionsList;
};
_vehicle setVariable ["vtx_cas_queue", (_vehicle getVariable ["vtx_cas_queue",0]) + 1];

if (_caution) then {
    _vehicle animate ["CautionMasterCaution",1];
};
/*
 * vtx_uh60_cas_fnc_removeCautionAdvisory
 *
 * removes a caution/advisory in the cas system
 *
 * params (array)[(object) vehicle,(string) text]
 */

params ["_vehicle", ["_text",""]];

private _casList = (_vehicle getVariable ["vtx_cas_list",[]]);
{ // forEach _casList
    if (_text == _x # 0) exitWith {
        _casList deleteat _forEachIndex;
    };
} forEach _casList;

private _logIndex = vtx_uh60_cas_cautionsLog find _text;
if (_logIndex > -1) then {
    vtx_uh60_cas_cautionsLog deleteAt _logIndex;
    vtx_uh60_cas_cautionsUnacked = (vtx_uh60_cas_cautionsUnacked - 1) max 0;
};

_vehicle setVariable ["vtx_cas_list", _casList];
[_vehicle] call vtx_uh60_cas_fnc_updateCautionsList;
[_vehicle,false] call vtx_uh60_cas_fnc_updateOverlayList;
#include "script_component.hpp"
/*
 * vtx_uh60_cas_fnc_setMasterCaution
 *
 */

params ["_vehicle", ["_on", true], ["_reset", false]];

// if we're enabling it then do this
if (_on) exitWith {
	_vehicle animate ["CautionMasterCaution",1];
};

// otherwise we're clearing it

_vehicle animate ["CautionMasterCaution",0];
vtx_uh60_cas_cautionsUnacked = 0;
[_vehicle,false] call vtx_uh60_cas_fnc_updateOverlayList;
if (_reset) exitWith {
	vtx_uh60_cas_cautionsLog = [];
	for "_i" from USERMFDV_L00 to USERMFDV_R25 do {
    _vehicle setUserMFDValue [_i, 0];
	};
};
for "_i" from USERMFDV_L00 to USERMFDV_R25 do {
  private _value = getUserMFDValue _vehicle select _i;
  if (_value == 2) then {
    _vehicle setUserMFDValue [_i, 1];
	};
};
#include "script_component.hpp"
/*
 * vtx_uh60_Cas_fnc_setup
 *
 * starts up the caution and advisory system module
 *
 * params (array)[(object) vehicle]
 */

params ["_vehicle"];
if (!vtx_uh60m_enabled_cas) exitWith {false};
#define SET_GLOBAL_DEFAULT(VAR,DEFAULT) _vehicle setVariable [VAR, _vehicle getVariable [VAR, DEFAULT], true];
#define SET_DEFAULT(VAR,DEFAULT) _vehicle setVariable [VAR, _vehicle getVariable [VAR, DEFAULT]];
SET_GLOBAL_DEFAULT("vtx_cas_list",[])
SET_DEFAULT("vtx_cas_queue", 0)

vtx_uh60_cas_hitEH = _vehicle addEventHandler ["hit", vtx_uh60_cas_fnc_updateCautions];
vtx_uh60_cas_cautionsLog = [];
vtx_uh60_cas_cautionsUnacked = 0;
vtx_uh60_cas_firstAdvisory = 0;

[_vehicle] call vtx_uh60_cas_fnc_updateCautionsList;
SET_DEFAULT("vtx_cas_rotorIgnored", false);

for [{ _i = USERMFDV_CAS }, { _i < USERMFDV_HELLFIRE_BOX }, { _i = _i + 1 }] do {
  _vehicle setUserMFDValue [_i, 0];
};

true
params ["_vehicle"];

_vehicle removeEventHandler ["hit", vtx_uh60_cas_fnc_hitEH];
/*
 * vtx_uh60_cas_fnc_updateAdvisories
 *
 * handles occasional updates of the caution system
 *
 * params (array)[(object) vehicle]
 */

params ["_vehicle"];

#define ADVISORY(MESSAGE,CONDITION) \
    if(CONDITION) then { \
        [_vehicle, MESSAGE, {CONDITION}, false, true] call vtx_uh60_cas_fnc_registerCautionAdvisory; \
    };

ADVISORY("WOW",(isTouchingGround (_this # 0)))

ADVISORY("BOOST PUMP 1 ON",((_this # 0) animationPhase "Switch_fuelboostpump1" == 0))
ADVISORY("BOOST PUMP 2 ON",((_this # 0) animationPhase "Switch_fuelboostpump2" == 0))

if ((_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] < 30 && (_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] > 0) then {
    [_vehicle, "FLARE LOW", {((_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] < 30 && (_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] > 0)}, false, true] call vtx_uh60_cas_fnc_registerCautionAdvisory;
};
if ((_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] == 0) then {
    [_vehicle, "FLARE OUT", {((_this # 0) magazineTurretAmmo ["60Rnd_CMFlareMagazine",[-1]] == 0)}, false, true] call vtx_uh60_cas_fnc_registerCautionAdvisory;
};

ADVISORY("LANDING LIGHT ON",(vtx_uh60_misc_landingLightOn))

ADVISORY("LRD LASE DES",(!(isNull (laserTarget _vehicle))))

[_vehicle, true] call vtx_uh60_cas_fnc_clearCautionsList;
/*
 * vtx_uh60_cas_fnc_updateCautionPanel
 *
 * Updates the caution list, called from various eventhandlers.
 *
 * params (array)[(object) vehicle]
 */

params ["_vehicle"];

if (!(local _vehicle) || _vehicle != vehicle player) exitWith {};

(_vehicle getVariable ["vtx_uh60_sfmplus_engPctNP", [0,0]]) params ["_np1", "_np2"];

private _eng1Powered = parseNumber (_np1 < 0.6);
private _eng2Powered = parseNumber (_np2 < 0.6);

_vehicle animate ["CautionEng1Out", _eng1Powered];
_vehicle animate ["CautionEng2Out", _eng2Powered];

private _battPower = ((_vehicle getVariable ["vtx_uh60_acft_battBusState", "OFF"]) == "ON");
private _battPowerSoundMod = if (_battPower) then { 1 } else { 0 };
private _WOWSoundMod = if (isTouchingGround _vehicle) then { 0 } else { 1 };

setCustomSoundController [_vehicle, "CustomSoundController7", _battPowerSoundMod * _WOWSoundMod * (_eng1Powered + _eng2Powered)];

private _realRotorRPM = (_vehicle animationPhase "rotorCollectiveBlade1") * 1.025 / 10;
private _rpmWarn = parseNumber (_realRotorRPM < 0.9);
_vehicle animate ["CautionLowRpm", _rpmWarn];
setCustomSoundController [_vehicle, "CustomSoundController6", _battPowerSoundMod * _WOWSoundMod* _rpmWarn];

if (_eng1Powered + _eng2Powered + _rpmWarn == 0) then {
  _vehicle animate ["CautionMasterCaution", 0];
};
#include "script_component.hpp"
/*
 * vtx_uh60_cas_fnc_updateCautions
 *
 * updates the cautions list on the EICAS
 * called from events, not continual
 *
 * params (array)[(object) vehicle]
 */

/*
16 gen 1
17 hyd 1
18
19 chip 1
20 chip main
21 chip xmsn
22 hull
23 batt
24 start 1
25 gen 2
26 hyd 2
27 egi
28 chip 2
29 tr servo
30 tr quad fail
31 apu fail
32 stab fail
33 start 2
34 stby inst
35 stab fail
36 cmws fail
37
38
39
*/

private _pylonLabels = [
    "","","","","","","","","","","","","","","","", // first 15
    "","","","","","","","","","","","","","","","", // first 15
    "","","","","","","","","","","","","","","","", // first 15
    "","","","","","","","","","","","","","","","", // first 15
    "","","","",""
    ,"GEN 1 FAIL"
    ,"HYD PUMP 1 FAIL"
    ,""
    ,"CHIP ENG 1"
    ,"CHIP MAIN MDL SUMP"
    ,"MAIN XMSN PRES"
    ,"HULL INTEGRITY CRIT"
    ,"LEFT STN HANG"
    ,"ENG 1 STARTER ON"
    ,"GEN 2 FAIL"
    ,"HYD PUMP 2"
    ,"EGI FAIL"
    ,"CHIP ENG 2"
    ,"T/R SERVO 1 FAIL"
    ,"T/R QUAD FAIL"
    ,"APU FAIL"
    ,"RIGHT STN HANG"
    ,"ENG 2 STARTER ON"
    ,"STBY INST NOT ARMD"
    ,"STAB FAIL"
    ,"CMWS FAIL"
    ,"FLIR FAIL"
    ,"MFD BUS ERR"
    ,""
];

params ["_vehicle"];
if (!local _vehicle || missionNamespace getVariable ["vtx_uh60_mfd_eicas_testing", false]) exitWith {};

_setPylonFn = {
    params ["_index", "_enable"];
    private _return = [_vehicle, _index, if (_enable) then [{1}, {0}], true] call vtx_uh60_mfd_fnc_setPylonValue;
    _vehicle setUserMFDValue [_index, parseNumber _enable];
    if (_return == 2) then {
        vtx_uh60_cas_cautionsUnacked = vtx_uh60_cas_cautionsUnacked + 1;
        vtx_uh60_cas_firstAdvisory = vtx_uh60_cas_firstAdvisory + 1;
        vtx_uh60_cas_cautionsLog = [_pylonLabels # _index] + vtx_uh60_cas_cautionsLog;
    };
    if (_return == 0) then {
        private _string = _pylonLabels # _index;
        vtx_uh60_cas_cautionsLog deleteAt (vtx_uh60_cas_cautionsLog find _string);
        vtx_uh60_cas_firstAdvisory = vtx_uh60_cas_firstAdvisory - 1;
        vtx_uh60_cas_cautionsUnacked = vtx_uh60_cas_cautionsUnacked min (count vtx_uh60_cas_cautionsLog);
    };
    if (_return > -1) then {
        [_vehicle,(_return > 0)] call vtx_uh60_cas_fnc_updateOverlayList;
    };
};

// GEN 1 GEN 2 HYD 1 HYD 2
(_vehicle getVariable ["vtx_uh60_sfmplus_engPctNP", [0,0]]) params ["_np1", "_np2"];
private _np = (_np1 max _np2);
[USERMFDV_L00, _np < 0.9] call _setPylonFn;
[USERMFDV_R00, _np < 0.9] call _setPylonFn;
[USERMFDV_L01, _np < 0.3] call _setPylonFn;
[USERMFDV_R01, _np < 0.3] call _setPylonFn;


// CHIP ENG 1
private _chipeng1 = (_vehicle getHitPointDamage "hitengine1") > 0.2;
[USERMFDV_L10, _chipeng1] call _setPylonFn;
// CHIP ENG 2
private _chipeng2 = (_vehicle getHitPointDamage "hitengine2") > 0.2;
[USERMFDV_R10, _chipeng2] call _setPylonFn;


// TAIL ROTOR
private _trot =
    (_vehicle getHitPointDamage "hitvrotor") +
    (_vehicle getHitPointDamage "TailGearBox") +
    (_vehicle getHitPointDamage "TailIntermediateGearBox");

[USERMFDV_L12, _trot > 0.2] call _setPylonFn;
[USERMFDV_R11, _trot > 0.5] call _setPylonFn;
[USERMFDV_R12, (_vehicle getHitPointDamage "hitvrotor") > 0.8] call _setPylonFn;

if (_trot > 2) then {
    [_vehicle, "BACKUP PUMP ON", {}, false, false] call vtx_uh60_cas_fnc_registerCautionAdvisory;
    [_vehicle, "T/R SERVO 2 ON", {}, false, false] call vtx_uh60_cas_fnc_registerCautionAdvisory;
} else {
    [_vehicle, "BACKUP PUMP ON"] call vtx_uh60_cas_fnc_removeCautionAdvisory;
    [_vehicle, "T/R SERVO 2 ON"] call vtx_uh60_cas_fnc_removeCautionAdvisory;
};

// HULL
[USERMFDV_L13, (damage _vehicle) > 0.5] call _setPylonFn;

// STARTER 1 STARTER 2
(_vehicle getVariable ["vtx_uh60_sfmplus_engState", ["OFF", "OFF"]]) params ["_eng1", "_eng2"];
[USERMFDV_L15, _eng1 == "STARTING"] call _setPylonFn;
[USERMFDV_R15, _eng2 == "STARTING"] call _setPylonFn;

// STBY INST
private _stbyInst = (_vehicle animationPhase "switch_stbyinst") > 0;
[USERMFDV_R20, _stbyInst] call _setPylonFn;

// main rotor
private _mrot =
    // (_vehicle getHitPointDamage "hithrotor") +
    (_vehicle getHitPointDamage "MainRotorGearBox") +
    (_vehicle getHitPointDamage "MainRotorHub");
[USERMFDV_L11, _mrot > 0.5] call _setPylonFn;

// flir
[USERMFDV_R23, (_vehicle getHitPointDamage "FlirHit") > 0.5] call _setPylonFn;

// cmws
[USERMFDV_R22, (_vehicle getHitPointDamage "hitRWR") > 0.5] call _setPylonFn;

// mfd
private _mfd =
    (_vehicle getHitPointDamage "mfd1") +
    (_vehicle getHitPointDamage "mfd2") +
    (_vehicle getHitPointDamage "mfd3") +
    (_vehicle getHitPointDamage "mfd4");

[USERMFDV_R24, (_mfd) > 0.2] call _setPylonFn;


[USERMFDV_L14, (_vehicle getHitPointDamage "WingStoreL") > 0.3] call _setPylonFn;
[USERMFDV_R14, (_vehicle getHitPointDamage "WingStoreR") > 0.7] call _setPylonFn;
/*
 * vtx_uh60_cas_fnc_updateCautionsList
 *
 * Updates the cautions list to the proper userTexts
 * This gets run from registerCautionAdvisory, removeCautionAdvisory and setup
 *
 * params (array)[(object) vehicle]
 */

params ["_vehicle"];

private _casList = (_vehicle getVariable ["vtx_cas_list",[]]);

for "_i" from 0 to 6 do {
    if (_i >= count _casList) then {
        [_vehicle, 6 - _i, ""] call vtx_uh60_mfd_fnc_setUserText;
    } else {
         [_vehicle, 6 - _i, _casList # (((count _casList) - 1) - _i) # 0] call vtx_uh60_mfd_fnc_setUserText;
        
    };
};
#include "script_component.hpp"
/*
 * vtx_uh60_cas_fnc_updateOverlayList
 */
params ["_vehicle", ["_canOpen", false], ["_hide", false]];
if (_hide) exitWith {
  _vehicle setUserMFDValue [USERMFDV_CAS, 0];
};
if (count vtx_uh60_cas_cautionsLog == 0) exitWith {
  _vehicle setUserMFDValue [USERMFDV_CAS, 0];
};
for "_i" from 14 to 19 do {
	_vehicle setUserMFDText [_i, ""];
};
{
	if (_forEachIndex > 5) exitWith {};
	_vehicle setUserMFDText [14 + _forEachIndex, _x];
} forEach vtx_uh60_cas_cautionsLog;
if (_canOpen || (getUserMFDValue _vehicle select USERMFDV_CAS) isNotEqualTo 0) then {
  _vehicle setUserMFDValue [USERMFDV_CAS, 1 + vtx_uh60_cas_cautionsUnacked];
};
_vehicle setUserMFDValue [USERMFDV_ADVISORIES, missionNamespace getVariable ["vtx_uh60_cas_firstAdvisory", 0]];
#include "\z\vtx\addons\uh60_cas\script_component.hpp"
#define COMPONENT uh60_cas
#define COMPONENT_BEAUTIFIED UH60_CAS
#include "\z\vtx\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define CBA_DEBUG_SYNCHRONOUS
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_UH60_CAS
    #define DEBUG_MODE_FULL
#endif

#ifdef DEBUG_SETTINGS_UH60_CAS
    #define DEBUG_SETTINGS DEBUG_SETTINGS_UH60_CAS
#endif

#include "\z\vtx\addons\main\script_macros.hpp"
#include "script_component.hpp"

ADDON = false;

vtx_uh60_cas_cautionsUnacked = 0;

#include "XEH_PREP.hpp"

ADDON = true;
PREP(updateCautionsList);
PREP(clearCautionsList);
PREP(perSecond);
PREP(registerCautionAdvisory);
PREP(removeCautionAdvisory);
PREP(setup);
PREP(updateAdvisories);
PREP(updateCautionPanel);
PREP(updateCautions);
PREP(setMasterCaution);
PREP(updateOverlayList);
#include "script_component.hpp"

#include "XEH_PREP.hpp"
 &Ô¿�gfm1Ùs×óÌH¾