class CfgPatches {
  class BRAF_Optics_Air {
    author = "BRAF Team";
    addonRootClass = "A3_Weapons_F";
    requiredAddons[] = {
        "A3_Data_F",
        "A3_Functions_F",
        "A3_Ui_F",
        "A3_Weapons_F"
    };
    requiredVersion = 0.1;
    units[] = {};
    weapons[] = {};
  };
};

class ScrollBar;
class RscUnitInfo;
class RscControlsGroup;
class RscControlsGroupNoScrollbars;
class CA_HUDRscControlsGroup;
class RscText;
class RangeText: RscText{};
class RscPicture;
class RscOpticsText;
class RscOpticsValue;
class RscIGProgress;

class CfgFunctions {
  class BRAF {
    tag = "BRAF";
    class UI {
      file = "braf\braf_optics_air\braf_fnc";
      class initRSC {};
      class shutdownRSC {};
      class flirControls {};
    };
  };
};

class RscInGameUI {
  class BRAF_RscOptics_Air_FLIR: RscUnitInfo {
    idd = 300;
    controls[] = {"CA_Zeroing","CA_IGUI_elements_group","CA_VehicleToggles"};
    class VScrollbar;
    class HScrollbar;
    onLoad = "[""onLoad"",_this,""RscUnitInfo"",""IGUI""] call (uiNamespace getVariable ""BIS_fnc_initDisplay""); [_this select 0] call BRAF_fnc_initRSC;";
    onUnload = "[""onUnload"",_this,""RscUnitInfo"",""IGUI""] call (uiNamespace getVariable ""BIS_fnc_initDisplay""); [_this select 0] call BRAF_fnc_shutdownRSC;";

    class CA_IGUI_elements_group: RscControlsGroup {
      idc = 170;
      class VScrollbar: VScrollbar { width = 0; };
      class HScrollbar: HScrollbar { height = 0; };

      x = "-4 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH)/2))";
      y = "000 * (0.02500 * SafezoneH) + (SafezoneY)";
      w = "100 * (0.01875 * SafezoneH)";
      h = "080 * (0.02500 * SafezoneH)";

      class controls {
        class ValueDistance: RscText {
          style = 1;
          sizeEx = "0.038*SafezoneH";
          shadow = 0;
          font = "EtelkaMonospacePro";
          idc = 198;
          text = "245678";
          colorText[] = {0,0,0,1};
          colorBackground[] = {0,0,0,0};
          x = "45.5 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
          w = "8 * (0.01875 * SafezoneH)";
          h = "1.2 * (0.025 * SafezoneH)";
        };

        class TextDistance: ValueDistance {
          style = 0;
          idc = 1800;
          text = "Laser dist:";
          x = "42 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class ValueGrid: ValueDistance {
          idc = 171;
          text = "245678";
          x = "10 * (0.01875 * SafezoneH)";
          y = "34 * (0.025 * SafezoneH)";
        };

        class TextGrid: ValueGrid {
          style = 0;
          idc = 1801;
          text = "GPS grid:";
          x = "4.45 * (0.01875 * SafezoneH)";
          y = "34 * (0.025 * SafezoneH)";
        };

        class ValueWeapon: ValueDistance {
          idc = 172;
          text = "245678";
          x = "10 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class TextTarget: ValueGrid {
          style = 0;
          idc = 1802;
          text = "Target grid:";
          x = "4.45 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class TextElev: ValueGrid {
          style = 0;
          idc = 1803;
          text = "Elev:";
          x = "32 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class ValueElev: ValueDistance {
          idc = 175;
          text = "245";
          x = "32 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class TextAz: ValueGrid {
          style = 0;
          idc = 1804;
          text = "Az:";
          x = "24.5 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class ValueAz: ValueDistance {
          idc = 156;
          text = "245";
          x = "23 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
        };

        class TextAlt: ValueGrid {
          style = 0;
          idc = 1805;
          text = "Alt:";
          x = "24.5 * (0.01875 * SafezoneH)";
          y = "34 * (0.025 * SafezoneH)";
        };

        class ValueAlt: ValueDistance {
          idc = 189;
          text = "245678";
          x = "24 * (0.01875 * SafezoneH)";
          y = "34 * (0.025 * SafezoneH)";
        };

        class CA_Time: ValueGrid {
          idc = 190;
          style = 0;
          shadow = 0;
          text = "XX:XX:xx";
          x = "54 * (0.01875 * SafezoneH)";
          y = "35.75 * (0.025 * SafezoneH)";
          w = "6.5 * (0.01875 * SafezoneH)";
        };

        class braf_fov_mode: RscText {
          idc = 154;
          text = "WFOV";
          sizeEx = "0.03*SafezoneH";
          style = 0;
          shadow = 0;
          font = "EtelkaMonospacePro";
          x = "0 * (0.01875 * SafezoneH)";
          y = "3 * (0.025 * SafezoneH)";
          w = "5 * (0.01875 * SafezoneH)";
          h = "1.2 * (0.025 * SafezoneH)";
          colorText[] = {0,0,0,1};
        };

        class CA_VisionMode: RscText {
          idc = 152;
          sizeEx = "0.03*SafezoneH";
          style = 0;
          shadow = 0;
          font = "EtelkaMonospacePro";
          text = "DTV";
          x = "4.5 * (0.01875 * SafezoneH)";
          y = "3 * (0.025 * SafezoneH)";
          w = "5 * (0.01875 * SafezoneH)";
          h = "1.2 * (0.025 * SafezoneH)";
          colorText[] = {0,0,0,1};
        };

        class CA_FlirMode: CA_VisionMode {
          idc = 153;
          text = "BHOT";
          x = "7 * (0.01875 * SafezoneH)";
        };

        class CA_Laser: RscText {
          idc = 158;
          style = "0x30 + 0x800";
          sizeEx = "0.038*SafezoneH";
          colorText[] = {0.70599997,0.074500002,0.0196,1};
          shadow = 0;
          font = "EtelkaMonospacePro";
          text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa";
          x = "33 * (0.01875 * SafezoneH)";
          y = "8 * (0.025 * SafezoneH)";
          w = "3.5 * (0.01875 * SafezoneH)";
          h = "1.5 * (0.025 * SafezoneH)";
        };

        class braf_arrow_vert: RscPicture {
          idc = 1901;
          text = "\braf\braf_optics_air\StarSaphire\data\braf_arrow_vert_ca.paa";
          shadow = 0;
          sizeEx = "0.03*SafezoneH";
          x = "-0.5 * (0.01875 * SafezoneH)";
          y = "16.6 * (0.025 * SafezoneH)";
          w = "2.1 * (0.01875 * SafezoneH)";
          h = "2.1 * (0.025 * SafezoneH)";
          color[] = {1,1,1,1};
          colorBackground[] = {0,0,0,0};
        };

        class braf_elev_value: RscText {
          idc = 1902;
          style = 0;
          shadow = 0;
          sizeEx = "0.03*SafezoneH";
          colorText[] = {1,1,1,1};
          colorBackground[] = {0,0,0,0};
          x = "1 * (0.01875 * SafezoneH)";
          y = "16.6 * (0.025 * SafezoneH)";
          w = "4 * (0.01875 * SafezoneH)";
          h = "2.1 * (0.025 * SafezoneH)";
          text = "-120";
        };

        class braf_arrow_horiz: braf_arrow_vert {
          idc = 1903;
          text = "\braf\braf_optics_air\StarSaphire\data\braf_arrow_hor_ca.paa";
          x = "-12 * (0.01875 * SafezoneH)";
          y = "30 * (0.025 * SafezoneH)";
        };

        class braf_dir_value: braf_elev_value {
          idc = 1904;
          style = 2;
          x = "-12.95 * (0.01875 * SafezoneH)";
          y = "20 * (0.025 * SafezoneH)";
          w = "4.0 * (0.01875 * SafezoneH)";
          h = "2.1 * (0.025 * SafezoneH)";
          text = "-180";
        };

        class braf_compass_arrow: RscPicture {
          idc = 1905;
          style = 144;
          shadow = 0;
          text = "\braf\braf_optics_air\StarSaphire\data\braf_arrow_north_ca.paa";
          x = "57.5 * (0.01875 * SafezoneH)";
          y = "25.5 * (0.02500 * SafezoneH)";
          w = "10 * (0.01875 * SafezoneH)";
          h = "10 * (0.02500 * SafezoneH)";
        };

        class braf_compass_n: braf_elev_value {
          idc = -1;
          style = 2;
          sizeEx = "0.03*SafezoneH";
          x = "60 * (0.01875 * SafezoneH)";
          y = "28 * (0.02500 * SafezoneH)";
          w = "05 * (0.01875 * SafezoneH)";
          h = "05 * (0.02500 * SafezoneH)";
          text = "N";
        };

        class BRAF_AirData_Label_HDG: RscText {
          idc = 1906;
          style = 2;
          shadow = 0;
          font = "EtelkaMonospacePro";
          sizeEx = "0.02*SafezoneH";
          colorText[] = {1,1,1,1};
          colorBackground[] = {0,0,0,0};
          text = "HDG:";
          x = "60 * (0.01875 * SafezoneH)";
          y = "4.4 * (0.025 * SafezoneH)";
          w = "4 * (0.01875 * SafezoneH)";
          h = "1.2 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_HDG: BRAF_AirData_Label_HDG {
          idc = 1907;
          style = 1;
          text = "000";
          x = "60 * (0.01875 * SafezoneH)";
          w = "5 * (0.01875 * SafezoneH)";
        };

        class BRAF_AirData_Label_IAS: BRAF_AirData_Label_HDG {
          idc = 1908;
          text = "IAS:";
          y = "5 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_IAS: BRAF_AirData_Value_HDG {
          idc = 1909;
          text = "000";
          y = "5 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Label_GS: BRAF_AirData_Label_HDG {
          idc = 1910;
          text = "GS:";
          y = "5.6 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_GS: BRAF_AirData_Value_HDG {
          idc = 1911;
          text = "000";
          y = "5.6 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Label_RALT: BRAF_AirData_Label_HDG {
          idc = 1912;
          text = "RALT:";
          y = "6.2 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_RALT: BRAF_AirData_Value_HDG {
          idc = 1913;
          text = "0000";
          y = "6.2 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Label_BARO: BRAF_AirData_Label_HDG {
          idc = 1914;
          text = "BARO:";
          y = "6.8 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_BARO: BRAF_AirData_Value_HDG {
          idc = 1915;
          text = "0000";
          y = "6.8 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Label_ROLL: BRAF_AirData_Label_HDG {
          idc = 1916;
          text = "ROLL:";
          y = "7.4 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_ROLL: BRAF_AirData_Value_HDG {
          idc = 1917;
          text = "0";
          y = "7.4 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Label_PTCH: BRAF_AirData_Label_HDG {
          idc = 1918;
          text = "PTCH:";
          y = "8 * (0.025 * SafezoneH)";
        };

        class BRAF_AirData_Value_PTCH: BRAF_AirData_Value_HDG {
          idc = 1919;
          text = "0";
          y = "8 * (0.025 * SafezoneH)";
        };
      };
    };
  };
};
