diff --git a/TO_MERGE/agm/FireControlSystem/Optics.hpp b/TO_MERGE/agm/FireControlSystem/Optics.hpp deleted file mode 100644 index 0024a9d7ce..0000000000 --- a/TO_MERGE/agm/FireControlSystem/Optics.hpp +++ /dev/null @@ -1,257 +0,0 @@ - -#define MACRO_RANGERFINDER \ - class CA_Distance; \ - class AGM_CA_Distance: CA_Distance { \ - idc = 1713151; \ - text = "----"; \ - }; \ - class AGM_Rangehelper: RscMapControl { \ - onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \ - w = 0; \ - h = 0; \ - }; - -class RscControlsGroup; -class RscMapControl; - -class RscInGameUI { - class RscUnitInfo; - class RscUnitInfo_AH64D_gunner { - onLoad = ""; - controls[] = {"CA_Distance", "AGM_CA_Distance"}; - MACRO_RANGERFINDER - }; - class RscWeaponRangeFinder { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - controls[] = {"CA_Distance", "AGM_CA_Distance"}; - MACRO_RANGERFINDER - }; - //class RscWeaponRangeArtillery - //class RscWeaponRangeArtilleryAuto - - class RscWeaponRangeFinderPAS13 { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - MACRO_RANGERFINDER - }; - class RscOptics_Rangefinder: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_LaserDesignator { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscWeaponRangeFinderMAAWS { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscWeaponRangeFinderAbramsCom { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - controls[] = {"CA_Distance", "AGM_CA_Distance"}; - MACRO_RANGERFINDER - }; - class RscWeaponRangeFinderAbramsGun { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - controls[] = {"CA_Distance", "AGM_CA_Distance"}; - MACRO_RANGERFINDER - }; - class RscWeaponRangeFinderStrykerMGSGun { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - controls[] = {"CA_Distance", "AGM_CA_Distance"}; - MACRO_RANGERFINDER - }; - class RscOptics_crows: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_strider_commander { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - - class RscWeaponRangeZeroing: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "AGM_CA_Distance", "AGM_Rangehelper"}; - MACRO_RANGERFINDER - }; - class RscOptics_sos: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_nightstalker: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_tws: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_punisher { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_tws_sniper: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_SDV_periscope { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_Heli_Attack_02_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_Heli_Attack_01_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_UAV_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_UGV_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_APC_Tracked_01_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_APC_Tracked_03_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_03_commander: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_MBT_01_commander: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_MBT_01_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_MBT_02_commander: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_MBT_02_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; - class RscOptics_MBT_03_gunner: RscUnitInfo { - onLoad = "uiNamespace setVariable ['AGM_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGERFINDER - }; - }; - }; -}; diff --git a/TO_MERGE/agm/FireControlSystem/clientInit.sqf b/TO_MERGE/agm/FireControlSystem/clientInit.sqf deleted file mode 100644 index 291cfeedd5..0000000000 --- a/TO_MERGE/agm/FireControlSystem/clientInit.sqf +++ /dev/null @@ -1,3 +0,0 @@ -AGM_FCSEnabled = true; -AGM_FCSTime = -1; -AGM_FCSPosition = [0,0,0]; diff --git a/TO_MERGE/agm/FireControlSystem/config.cpp b/TO_MERGE/agm/FireControlSystem/config.cpp deleted file mode 100644 index e5e279ef6e..0000000000 --- a/TO_MERGE/agm/FireControlSystem/config.cpp +++ /dev/null @@ -1,899 +0,0 @@ -class CfgPatches { - class AGM_FireControlSystem { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core, AGM_Interaction}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi","BadGuy (simon84)"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; -}; - -// @todo: clean up inheritance and remove old code - -class CfgFunctions { - class AGM_FCS { - class AGM_FCS { - file = "AGM_FireControlSystem\functions"; - class adjustRange; - class canUseFCS; - class canUseRangefinder; - class firedEH; - class getAngle; - class getImpactPoint; - class getRange; - class keyDown; - class keyUp; - class reset; - class vehicleInit; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_FCS { - clientInit = "call compile preprocessFileLineNumbers '\AGM_FireControlSystem\clientInit.sqf'"; - }; -}; - -class Extended_Init_EventHandlers { - class AllVehicles { - class AGM_FCS { - clientInit = "_this call AGM_FCS_fnc_vehicleInit"; - }; - }; -}; - -class AGM_Core_Default_Keys { - class laseTarget { - displayName = "$STR_AGM_FireControlSystem_LaseTarget"; - condition = "call AGM_FCS_fnc_canUseRangefinder || AGM_FCS_fnc_canUseFCS"; - statement = "_range = call AGM_FCS_fnc_getRange; if (call AGM_FCS_fnc_canUseFCS) then {[_vehicle, _range] call AGM_FCS_fnc_keyDown};"; - conditionUp = "AGM_FCSEnabled && AGM_FCS_fnc_canUseFCS"; - statementUp = "_range = call AGM_FCS_fnc_getRange; if (AGM_FCSEnabled && AGM_FCS_fnc_canUseFCS) then {[_vehicle, _range] call AGM_FCS_fnc_keyUp};"; - key = 15; - shift = 0; - control = 0; - alt = 0; - }; - class adjustRangeUp { - displayName = "$STR_AGM_FireControlSystem_AdjustRangeUp"; - condition = "player == gunner _vehicle && {getNumber (configFile >> 'CfgVehicles' >> (typeOf _vehicle) >> 'AGM_FCSEnabled') == 1}"; - statement = "[_vehicle, 50] call AGM_FCS_fnc_adjustRange"; - key = 201; - shift = 0; - control = 0; - alt = 0; - allowHolding = 1; - }; - class adjustRangeDown: adjustRangeUp { - displayName = "$STR_AGM_FireControlSystem_AdjustRangeDown"; - statement = "[_vehicle, -50] call AGM_FCS_fnc_adjustRange"; - key = 209; - }; -}; - -class CfgVehicles { - class All { - class Turrets; - }; - - class AllVehicles: All { - AGM_FCSEnabled = 0; - AGM_FCSMinDistance = 200; - AGM_FCSMaxDistance = 9990; - AGM_FCSDistanceInterval = 5; - class NewTurret { - class Turrets; - }; - class CargoTurret; - }; - - class Land: AllVehicles {}; - - class LandVehicle: Land { - class CommanderOptics; - }; - - class Car: LandVehicle { - class AGM_SelfActions { - class AGM_ResetFCS { - displayName = "$STR_AGM_FireControlSystem_ResetFCS"; - condition = "(count (vehicle _player getVariable ['AGM_FCSMagazines', []]) > 1) and (_player == gunner (vehicle _player))"; - statement = "[vehicle _player] call AGM_FCS_fnc_reset;"; - showDisabled = 0; - priority = -1; - }; - }; - }; - - class Tank: LandVehicle { - AGM_FCSEnabled = 1; // all tracked vehicles get one by default - class AGM_SelfActions { - class AGM_ResetFCS { - displayName = "$STR_AGM_FireControlSystem_ResetFCS"; - enableInside = 1; - condition = "(count (_vehicle getVariable ['AGM_FCSMagazines', []]) > 1) and (_player == gunner _vehicle)"; - statement = "[vehicle _player] call AGM_FCS_fnc_reset;"; - showDisabled = 0; - priority = 1; - icon = ""; - }; - }; - class Turrets { - class MainTurret: NewTurret { - class Turrets { - class CommanderOptics; - }; - }; - }; - }; - - class APC: Tank { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class Air: AllVehicles {}; - - class Helicopter: Air { - class Turrets { - class MainTurret; - }; - }; - - class Plane: Air {}; - - class Ship: AllVehicles { - class Turrets { - class MainTurret; - }; - }; - - class Helicopter_Base_F: Helicopter { - class Turrets: Turrets { - class CopilotTurret; - }; - }; - - class Helicopter_Base_H: Helicopter_Base_F { - class Turrets: Turrets { - class CopilotTurret; - }; - }; - - class Heli_Light_01_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class B_Heli_Light_01_F: Heli_Light_01_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - class CargoTurret_03: CargoTurret_02 {}; - class CargoTurret_04: CargoTurret_01 {}; - };*/ - }; - - class Heli_Light_01_armed_base_F: Heli_Light_01_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Heli_Light_02_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - - class Plane_Base_F: Plane { - class Turrets { - class CopilotTurret; - }; - }; - - class Heli_Attack_01_base_F: Helicopter_Base_F { - AGM_FCSEnabled = 1; - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class Heli_Attack_02_base_F: Helicopter_Base_F { - AGM_FCSEnabled = 1; - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class Heli_Transport_01_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class MainTurret: MainTurret {}; - class RightDoorGun: MainTurret {}; - };*/ - }; - - class Heli_Transport_02_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class I_Heli_light_03_base_F: Helicopter_Base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class I_Heli_light_03_F: I_Heli_light_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class Plane_CAS_01_base_F: Plane_Base_F { - class Turrets; - }; - - class Plane_CAS_02_base_F: Plane_Base_F { - class Turrets; - }; - - class Plane_Fighter_03_base_F: Plane_Base_F { - class Turrets; - }; - - class Tank_F: Tank { - class Turrets { - class MainTurret: NewTurret { - class Turrets { - class CommanderOptics;//: CommanderOptics {}; - }; - }; - }; - }; - - class Car_F: Car { - class Turrets { - class MainTurret; - }; - }; - - class Wheeled_APC_F: Car_F { - class Turrets { - class MainTurret: NewTurret { - class Turrets { - class CommanderOptics;//: CommanderOptics {}; - }; - }; - }; - }; - - class APC_Tracked_01_base_F: Tank_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets; - }; - };*/ - }; - - class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - AGM_FCSEnabled = 0; - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - class CommanderOptics: CommanderOptics {}; - };*/ - }; - - class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - AGM_FCSEnabled = 0; - }; - - class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - magazines[] += {"AGM_120Rnd_35mm_ABM_shells_Tracer_Red"}; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class APC_Tracked_02_base_F: Tank_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ - }; - - class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {}; - - class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - magazines[] += {"AGM_120Rnd_35mm_ABM_shells_Tracer_Green"}; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class APC_Tracked_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class MBT_03_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class MBT_01_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class B_MBT_01_base_F: MBT_01_base_F {}; - - class B_MBT_01_cannon_F: B_MBT_01_base_F {}; - - class MBT_01_arty_base_F: MBT_01_base_F { - AGM_FCSEnabled = 0; - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ - }; - - class MBT_01_mlrs_base_F: MBT_01_base_F { - AGM_FCSEnabled = 0; - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets; - }; - };*/ - }; - - class MBT_02_base_F: Tank_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class MBT_02_arty_base_F: MBT_02_base_F { - AGM_FCSEnabled = 0; - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ - }; - - class Ship_F: Ship {}; - - class Boat_F: Ship_F {}; - - class Boat_Armed_01_base_F: Boat_F { - class Turrets: Turrets { - class FrontTurret; - class RearTurret: FrontTurret {}; - }; - }; - - /*class Boat_Armed_01_minigun_base_F: Boat_Armed_01_base_F { - class Turrets: Turrets { - class FrontTurret: FrontTurret {}; - class RearTurret: RearTurret {}; - }; - };*/ - - class Truck_F: Car_F { - //class Turrets: Turrets {}; - }; - - class MRAP_01_base_F: Car_F {}; - - class MRAP_01_gmg_base_F: MRAP_01_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class B_MRAP_01_F: MRAP_01_base_F { - class Turrets; - }; - - class MRAP_02_base_F: Car_F {}; - - class MRAP_02_hmg_base_F: MRAP_02_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; - - class O_MRAP_02_F: MRAP_02_base_F { - class Turrets; - }; - - class Offroad_01_base_F: Car_F {}; - - class C_Offroad_01_F: Offroad_01_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - class CargoTurret_03: CargoTurret_01 {}; - class CargoTurret_04: CargoTurret_03 {}; - };*/ - }; - - class Offroad_01_repair_base_F: Offroad_01_base_F { - class Turrets; - }; - - class I_G_Offroad_01_F: Offroad_01_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - class CargoTurret_03: CargoTurret_01 {}; - class CargoTurret_04: CargoTurret_03 {}; - };*/ - }; - - class Offroad_01_armed_base_F: Offroad_01_base_F { - /*class Turrets: Turrets { - class M2_Turret: MainTurret {}; - };*/ - }; - - class MRAP_03_base_F: Car_F { - /*class Turrets: Turrets { - class CommanderTurret: MainTurret {}; - };*/ - }; - - class MRAP_03_hmg_base_F: MRAP_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - class CommanderTurret: CommanderTurret {}; - };*/ - }; - - class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - class CommanderTurret: CommanderTurret {}; - };*/ - }; - - class Truck_01_base_F: Truck_F { - class Turrets; - }; - - class B_Truck_01_transport_F: Truck_01_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class Truck_02_base_F: Truck_F { - class Turrets; - }; - - class O_Truck_02_covered_F: Truck_02_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class O_Truck_02_transport_F: Truck_02_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class I_Truck_02_covered_F: Truck_02_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class I_Truck_02_transport_F: Truck_02_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class Truck_03_base_F: Truck_F { - class Turrets; - }; - - class O_Truck_03_transport_F: Truck_03_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class O_Truck_03_covered_F: Truck_03_base_F { - /*class Turrets: Turrets { - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class Hatchback_01_base_F: Car_F { - class Turrets; - }; - - class SUV_01_base_F: Car_F { - class Turrets; - }; - - class B_Truck_01_mover_F: B_Truck_01_transport_F { - class Turrets; - }; - - class Van_01_base_F: Truck_F { - class Turrets; - }; - - class C_Van_01_transport_F: Van_01_base_F { - //class Turrets: Turrets {}; - }; - - class I_G_Van_01_transport_F: Van_01_base_F { - /*class Turrets: Turrets { - class CargoTurret_L1: CargoTurret {}; - class CargoTurret_L2: CargoTurret_L1 {}; - class CargoTurret_L3: CargoTurret_L1 {}; - class CargoTurret_L4: CargoTurret_L1 {}; - class CargoTurret_L5: CargoTurret_L1 {}; - - class CargoTurret_R1: CargoTurret_L1 {}; - class CargoTurret_R2: CargoTurret_L1 {}; - class CargoTurret_R3: CargoTurret_L1 {}; - class CargoTurret_R4: CargoTurret_L1 {}; - class CargoTurret_R5: CargoTurret_L1 {}; - };*/ - }; - - class Kart_01_Base_F: Car_F { - class Turrets; - }; - - class B_Heli_Transport_03_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class MainTurret: MainTurret {}; - class RightDoorGun: MainTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class B_Heli_Transport_03_unarmed_base_F: B_Heli_Transport_03_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class MainTurret: MainTurret {}; - class RightDoorGun: MainTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class Heli_Transport_04_base_F: Helicopter_Base_H { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class LoadmasterTurret: MainTurret {}; - };*/ - }; - - class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class LoadmasterTurret: LoadmasterTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - class CargoTurret_03: CargoTurret_01 {}; - class CargoTurret_04: CargoTurret_01 {}; - class CargoTurret_05: CargoTurret_01 {}; - class CargoTurret_06: CargoTurret_05 {}; - class CargoTurret_07: CargoTurret_05 {}; - class CargoTurret_08: CargoTurret_05 {}; - };*/ - }; - - class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - class LoadmasterTurret: LoadmasterTurret {}; - - class CargoTurret_01: CargoTurret {}; - class CargoTurret_02: CargoTurret_01 {}; - };*/ - }; - - class APC_Wheeled_01_base_F: Wheeled_APC_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - }; - }; - };*/ - }; - - class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {}; - - class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - AGM_FCSEnabled = 1; - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - }; - }; - }; - - class APC_Wheeled_02_base_F: Wheeled_APC_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret { - class Turrets; - }; - - class CommanderOptics: CommanderOptics {}; - };*/ - }; - - class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class APC_Wheeled_03_base_F: Wheeled_APC_F { - AGM_FCSEnabled = 1; - class Turrets: Turrets { - class MainTurret: MainTurret { - discreteDistance[] = {}; - discreteDistanceInitIndex = 0; - /*class Turrets: Turrets { - class CommanderOptics: CommanderOptics {}; - };*/ - }; - }; - }; - - class I_APC_Wheeled_03_base_F: APC_Wheeled_03_base_F {}; - - class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ - }; -}; - -// disable locking, so it doesn't interfere with our system -class CfgWeapons { - class CannonCore; - class cannon_120mm: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; - class autocannon_Base_F: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; - class autocannon_35mm: CannonCore { - canLock = 0; - ballisticsComputer = 0; - magazines[] += {"AGM_120Rnd_35mm_ABM_shells","AGM_120Rnd_35mm_ABM_shells_Tracer_Red","AGM_120Rnd_35mm_ABM_shells_Tracer_Green","AGM_120Rnd_35mm_ABM_shells_Tracer_Yellow"}; - }; - /*class Cannon_30mm_Plane_CAS_02_F: CannonCore { - canLock = 0; - ballisticsComputer = 0; - };*/ - - /*class gatling_20mm: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; - class gatling_25mm: CannonCore { - canLock = 0; - }; - class gatling_30mm: CannonCore { - canLock = 0; - ballisticsComputer = 0; - }; - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - canLock = 0; - ballisticsComputer = 0; - };*/ - - /*class MGunCore; - class M134_minigun: MGunCore { - canLock = 0; - }; - - class MGun: MGunCore {}; - class LMG_RCWS: MGun { - canLock = 0; - ballisticsComputer = 0; - }; - class HMG_127: LMG_RCWS { - ballisticsComputer = 0; - }; - class GMG_F: MGun { - canLock = 0; - ballisticsComputer = 0; - };*/ - - // fix mrco having an invisible rangefinder - class ItemCore; - class optic_MRCO: ItemCore { - weaponInfoType = "RscWeaponZeroing"; - }; -}; - -class CfgMagazines { - class 680Rnd_35mm_AA_shells; - class 680Rnd_35mm_AA_shells_Tracer_Red; - class 680Rnd_35mm_AA_shells_Tracer_Green; - class 680Rnd_35mm_AA_shells_Tracer_Yellow; - - class AGM_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells { - ammo = "AGM_B_35mm_ABM"; - count = 120; - displayName = "35mm ABM Shells"; - displayNameShort = "35mm ABM"; - }; - class AGM_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red { - ammo = "AGM_B_35mm_ABM_Tracer_Red"; - count = 120; - displayName = "35mm ABM Shells"; - displayNameShort = "35mm ABM-T"; - }; - class AGM_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green { - ammo = "AGM_B_35mm_ABM_Tracer_Green"; - count = 120; - displayName = "35mm ABM Shells"; - displayNameShort = "35mm ABM-T"; - }; - class AGM_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow { - ammo = "AGM_B_35mm_ABM_Tracer_Yellow"; - count = 120; - displayName = "35mm ABM Shells"; - displayNameShort = "35mm ABM-T"; - }; -}; - -class CfgAmmo { - class B_35mm_AA; - class B_35mm_AA_Tracer_Red; - class B_35mm_AA_Tracer_Green; - class B_35mm_AA_Tracer_Yellow; - - class AGM_B_35mm_ABM: B_35mm_AA { - AGM_Airburst = 1; - deflecting = 0; - }; - class AGM_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red { - AGM_Airburst = 1; - deflecting = 0; - }; - class AGM_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green { - AGM_Airburst = 1; - deflecting = 0; - }; - class AGM_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow { - AGM_Airburst = 1; - deflecting = 0; - }; - - class AGM_B_35mm_ABM_Helper: B_35mm_AA { - indirectHitRange = 6; - simulation = "shotRocket"; - timeToLive = 0; - }; -}; - -#include diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_canUseFCS.sqf b/TO_MERGE/agm/FireControlSystem/functions/fn_canUseFCS.sqf deleted file mode 100644 index d988c1b791..0000000000 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_canUseFCS.sqf +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Author: commy2 - * - * Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS. - * - * Argument: - * Nothing - * - * Return value: - * Boolean (Bool) - */ - -_player == gunner _vehicle && {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSEnabled") == 1} -&& {cameraView == "GUNNER"} diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_getImpactPoint.sqf b/TO_MERGE/agm/FireControlSystem/functions/fn_getImpactPoint.sqf deleted file mode 100644 index 68c9cb04bb..0000000000 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_getImpactPoint.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Gets the impact point if the given bomb were to be dropped at the - * the current time from the given vehicle. - * - * !!! Experimental !!! - * - * Arguments: - * 0: Vehicle - * 1: Classname of bomb - * - * Return Value: - * Coordinates of hit in ATL - */ - -_vehicle = _this select 0; -_projectile = _this select 1; - -_velocity = velocity (_vehicle); -_position = getPosASL _vehicle; - -_airFriction = getNumber (configFile >> "CfgAmmo" >> _projectile >> "airFriction"); -_simulationStep = getNumber (configFile >> "CfgAmmo" >> _projectile >> "simulationStep"); -_timeToLive = getNumber (configFile >> "CfgAmmo" >> _projectile >> "timeToLive"); - -_time = 0; -while {_time < _timeToLive and (ASLToATL _position) select 2 > 0} do { - _position = _position vectorAdd (_velocity vectorMultiply _simulationStep); - _velMag = vectorMagnitude _velocity; - _velocity = _velocity vectorAdd (_velocity vectorMultiply (_simulationStep * _velMag * _airFriction)); - _velocity set [2, (_velocity select 2) - 9.81 * _simulationStep]; - _time = _time + _simulationStep; -}; - -_position diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_reset.sqf b/TO_MERGE/agm/FireControlSystem/functions/fn_reset.sqf deleted file mode 100644 index 086826b1af..0000000000 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_reset.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Resets the FCS to default. - * - * Arguments: - * 0: Vehicle - * - * Return Value: - * none - */ - -private ["_vehicle"]; - -_vehicle = _this select 0; - -_vehicle setVariable ["AGM_FCSDistance", 0, true]; -_vehicle setVariable ["AGM_FCSMagazines", [], true]; -_vehicle setVariable ["AGM_FCSElevation", 0, true]; -_vehicle setVariable ["AGM_FCSAzimuth", 0, true]; - -[localize "STR_AGM_FireControlSystem_HasBeenReset"] call AGM_Core_fnc_displayTextStructured; diff --git a/addons/fcs/$PBOPREFIX$ b/addons/fcs/$PBOPREFIX$ new file mode 100644 index 0000000000..9e5f231f8f --- /dev/null +++ b/addons/fcs/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\fcs diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp new file mode 100644 index 0000000000..69ef4a3057 --- /dev/null +++ b/addons/fcs/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit) ); + }; +}; + +class Extended_Init_EventHandlers { + class AllVehicles { + class ADDON { + clientInit = QUOTE(_this call FUNC(vehicleInit)); + }; + }; +}; diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp new file mode 100644 index 0000000000..a5af4d175d --- /dev/null +++ b/addons/fcs/CfgOptics.hpp @@ -0,0 +1,254 @@ +#define MACRO_RANGEFINDER \ + class CA_Distance; \ + class ACE_CA_Distance: CA_Distance { \ + idc = 1713151; \ + text = "----"; \ + }; \ + class ACE_Rangehelper: RscMapControl { \ + onDraw = "((ctrlParent (_this select 0)) displayCtrl 1713151) ctrlShow (cameraView == 'GUNNER');"; \ + w = 0; \ + h = 0; \ + }; + +class RscControlsGroup; +class RscMapControl; + +class RscInGameUI { + class RscUnitInfo; + class RscUnitInfo_AH64D_gunner { + onLoad = ""; + controls[] = {"CA_Distance", "ACE_CA_Distance"}; + MACRO_RANGEFINDER + }; + class RscWeaponRangeFinder { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + controls[] = {"CA_Distance", "ACE_CA_Distance"}; + MACRO_RANGEFINDER + }; + + class RscWeaponRangeFinderPAS13 { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + MACRO_RANGEFINDER + }; + class RscOptics_Rangefinder: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_LaserDesignator { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscWeaponRangeFinderMAAWS { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscWeaponRangeFinderAbramsCom { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + controls[] = {"CA_Distance", "ACE_CA_Distance"}; + MACRO_RANGEFINDER + }; + class RscWeaponRangeFinderAbramsGun { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + controls[] = {"CA_Distance", "ACE_CA_Distance"}; + MACRO_RANGEFINDER + }; + class RscWeaponRangeFinderStrykerMGSGun { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + controls[] = {"CA_Distance", "ACE_CA_Distance"}; + MACRO_RANGEFINDER + }; + class RscOptics_crows: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_strider_commander { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + + class RscWeaponRangeZeroing: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance", "ACE_CA_Distance", "ACE_Rangehelper"}; + MACRO_RANGEFINDER + }; + class RscOptics_sos: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_nightstalker: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_tws: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_punisher { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_tws_sniper: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_SDV_periscope { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];"; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_Heli_Attack_02_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_Heli_Attack_01_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_UAV_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_UGV_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_APC_Tracked_01_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_APC_Tracked_03_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_APC_Wheeled_03_commander: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_MBT_01_commander: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_MBT_01_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_MBT_02_commander: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_MBT_02_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; + class RscOptics_MBT_03_gunner: RscUnitInfo { + onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + class CA_IGUI_elements_group: RscControlsGroup { + class controls { + MACRO_RANGEFINDER + }; + }; + }; +}; diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf new file mode 100644 index 0000000000..527e5a9d36 --- /dev/null +++ b/addons/fcs/XEH_clientInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +GVAR(enabled) = True; +GVAR(time) = 0; +GVAR(position) = [0,0,0]; diff --git a/addons/fcs/XEH_preInit.sqf b/addons/fcs/XEH_preInit.sqf new file mode 100644 index 0000000000..ce6f5c99dd --- /dev/null +++ b/addons/fcs/XEH_preInit.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" + +PREP(adjustRange); +PREP(canResetFCS); +PREP(canUseFCS); +PREP(canUseRangefinder); +PREP(firedEH); +PREP(getAngle); +PREP(getRange); +PREP(keyDown); +PREP(keyUp); +PREP(reset); +PREP(vehicleInit); diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp new file mode 100644 index 0000000000..ddd490e674 --- /dev/null +++ b/addons/fcs/config.cpp @@ -0,0 +1,373 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = 0.60; + requiredAddons[] = {ace_common, ace_interaction}; + version = QUOTE(VERSION); + versionStr = QUOTE(VERSION); + versionAr[] = {VERSION_AR}; + author[] = {"KoffeinFlummi","BadGuy (simon84)"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + }; +}; + +#include "CfgEventHandlers.hpp" + +class ACE_Default_Keys { + class laseTarget { + displayName = $STR_ACE_FCS_LaseTarget; + condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); + statement = QUOTE([_vehicle] call FUNC(keyDown)); + conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS)); + statementUp = QUOTE([_vehicle] call FUNC(keyUp)); + key = 15; + shift = 0; + control = 0; + alt = 0; + }; + class adjustRangeUp { + displayName = $STR_ACE_FCS_AdjustRangeUp; + condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); + statement = QUOTE([_vehicle, 50] call FUNC(adjustRange)); + key = 201; + shift = 0; + control = 0; + alt = 0; + allowHolding = 1; + }; + class adjustRangeDown: adjustRangeUp { + displayName = $STR_ACE_FCS_AdjustRangeDown; + statement = QUOTE([_vehicle, -50] call FUNC(adjustRange)); + key = 209; + }; +}; + +class CfgVehicles { + class All { + class Turrets; + }; + + class AllVehicles: All { + GVAR(Enabled) = 0; + GVAR(MinDistance) = 200; + GVAR(MaxDistance) = 9990; + GVAR(DistanceInterval) = 5; + class NewTurret { + class Turrets; + }; + class CargoTurret; + }; + + class Land: AllVehicles {}; + + class LandVehicle: Land { + class CommanderOptics; + }; + + // WHEELED + class Car: LandVehicle { + class ACE_SelfActions { + class ResetFCS { + displayName = $STR_ACE_FCS_ResetFCS; + enableInside = 1; + condition = QUOTE(call FUNC(canResetFCS)); + statement = QUOTE([vehicle _player] call FUNC(reset);); + showDisabled = 0; + priority = 1; + icon = ""; + }; + }; + }; + + class Car_F: Car { + class Turrets { + class MainTurret; + }; + }; + + class Wheeled_APC_F: Car_F { + class Turrets { + class MainTurret: NewTurret { + class Turrets { + class CommanderOptics; + }; + }; + }; + }; + + class APC_Wheeled_01_base_F: Wheeled_APC_F {}; + class B_APC_Wheeled_01_base_F: APC_Wheeled_01_base_F {}; + class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { + GVAR(Enabled) = 1; + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + class APC_Wheeled_03_base_F: Wheeled_APC_F { + GVAR(Enabled) = 1; + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + // TRACKED + class Tank: LandVehicle { + GVAR(Enabled) = 1; // all tracked vehicles get one by default + class ACE_SelfActions { + class ResetFCS { + displayName = $STR_ACE_FCS_ResetFCS; + enableInside = 1; + condition = QUOTE(call FUNC(canResetFCS)); + statement = QUOTE([vehicle _player] call FUNC(reset);); + showDisabled = 0; + priority = 1; + icon = ""; + }; + }; + class Turrets { + class MainTurret: NewTurret { + class Turrets { + class CommanderOptics; + }; + }; + }; + }; + + class Tank_F: Tank { + class Turrets { + class MainTurret: NewTurret { + class Turrets { + class CommanderOptics; + }; + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F {}; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + class MBT_01_arty_base_F: MBT_01_base_F { + GVAR(Enabled) = 0; + }; + class MBT_01_mlrs_base_F: MBT_01_base_F { + GVAR(Enabled) = 0; + }; + + class MBT_02_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + class MBT_02_arty_base_F: MBT_02_base_F { + GVAR(Enabled) = 0; + }; + + class MBT_03_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + class APC_Tracked_01_base_F: Tank_F {}; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F {}; + class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { + GVAR(Enabled) = 0; + }; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + GVAR(Enabled) = 0; + }; + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Red"}; + }; + }; + }; + + class APC_Tracked_02_base_F: Tank_F {}; + class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {}; + class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + magazines[] += {"ACE_120Rnd_35mm_ABM_shells_Tracer_Green"}; + }; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + // HELICOPTERS + class Air: AllVehicles {}; + + class Helicopter: Air { + class ACE_SelfActions { + class ResetFCS { + displayName = $STR_ACE_FCS_ResetFCS; + enableInside = 1; + condition = QUOTE(call FUNC(canResetFCS)); + statement = QUOTE([vehicle _player] call FUNC(reset);); + showDisabled = 0; + priority = 1; + icon = ""; + }; + }; + class Turrets { + class MainTurret; + }; + }; + + class Helicopter_Base_F: Helicopter { + class Turrets: Turrets { + class CopilotTurret; + }; + }; + + class Heli_Attack_01_base_F: Helicopter_Base_F { + GVAR(Enabled) = 1; + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; + + class Heli_Attack_02_base_F: Helicopter_Base_F { + GVAR(Enabled) = 1; + class Turrets: Turrets { + class MainTurret: MainTurret { + discreteDistance[] = {}; + discreteDistanceInitIndex = 0; + }; + }; + }; +}; + +class CfgWeapons { + // disable locking, so it doesn't interfere with our system + class CannonCore; + class cannon_120mm: CannonCore { + canLock = 0; + ballisticsComputer = 0; + }; + class autocannon_Base_F: CannonCore { + canLock = 0; + ballisticsComputer = 0; + }; + class autocannon_35mm: CannonCore { + canLock = 0; + ballisticsComputer = 0; + magazines[] += {"ACE_120Rnd_35mm_ABM_shells","ACE_120Rnd_35mm_ABM_shells_Tracer_Red","ACE_120Rnd_35mm_ABM_shells_Tracer_Green","ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow"}; + }; + + // fix mrco having an invisible rangefinder + class ItemCore; + class optic_MRCO: ItemCore { + weaponInfoType = "RscWeaponZeroing"; + }; +}; + +class CfgMagazines { + class 680Rnd_35mm_AA_shells; + class 680Rnd_35mm_AA_shells_Tracer_Red; + class 680Rnd_35mm_AA_shells_Tracer_Green; + class 680Rnd_35mm_AA_shells_Tracer_Yellow; + + class ACE_120Rnd_35mm_ABM_shells: 680Rnd_35mm_AA_shells { + ammo = "ACE_B_35mm_ABM"; + count = 120; + displayName = "35mm ABM Shells"; + displayNameShort = "35mm ABM"; + }; + class ACE_120Rnd_35mm_ABM_shells_Tracer_Red: 680Rnd_35mm_AA_shells_Tracer_Red { + ammo = "ACE_B_35mm_ABM_Tracer_Red"; + count = 120; + displayName = "35mm ABM Shells"; + displayNameShort = "35mm ABM-T"; + }; + class ACE_120Rnd_35mm_ABM_shells_Tracer_Green: 680Rnd_35mm_AA_shells_Tracer_Green { + ammo = "ACE_B_35mm_ABM_Tracer_Green"; + count = 120; + displayName = "35mm ABM Shells"; + displayNameShort = "35mm ABM-T"; + }; + class ACE_120Rnd_35mm_ABM_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells_Tracer_Yellow { + ammo = "ACE_B_35mm_ABM_Tracer_Yellow"; + count = 120; + displayName = "35mm ABM Shells"; + displayNameShort = "35mm ABM-T"; + }; +}; + +class CfgAmmo { + class B_35mm_AA; + class B_35mm_AA_Tracer_Red; + class B_35mm_AA_Tracer_Green; + class B_35mm_AA_Tracer_Yellow; + + class ACE_B_35mm_ABM: B_35mm_AA { + GVAR(Airburst) = 1; + deflecting = 0; + }; + class ACE_B_35mm_ABM_Tracer_Red: B_35mm_AA_Tracer_Red { + GVAR(Airburst) = 1; + deflecting = 0; + }; + class ACE_B_35mm_ABM_Tracer_Green: B_35mm_AA_Tracer_Green { + GVAR(Airburst) = 1; + deflecting = 0; + }; + class ACE_B_35mm_ABM_Tracer_Yellow: B_35mm_AA_Tracer_Yellow { + GVAR(Airburst) = 1; + deflecting = 0; + }; + + class ACE_B_35mm_ABM_Helper: B_35mm_AA { + indirectHitRange = 6; + simulation = "shotRocket"; + timeToLive = 0; + }; +}; + +#include diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_adjustRange.sqf b/addons/fcs/functions/fnc_adjustRange.sqf similarity index 74% rename from TO_MERGE/agm/FireControlSystem/functions/fn_adjustRange.sqf rename to addons/fcs/functions/fnc_adjustRange.sqf index 485e9585e7..1620c53375 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_adjustRange.sqf +++ b/addons/fcs/functions/fnc_adjustRange.sqf @@ -1,6 +1,6 @@ /* * Author: KoffeinFlummi - * + * * Adjusts the currently zeroed distance. * * Arguments: @@ -11,17 +11,19 @@ * None */ +#include "script_component.hpp" + private ["_vehicle", "_delta", "_min", "_max", "_distance"]; _vehicle = _this select 0; _delta = _this select 1; -_min = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_FCSMinDistance"); -_max = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "AGM_FCSMaxDistance"); -_distance = _vehicle getVariable ["AGM_FCSDistance", _min]; +_min = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(MinDistance)); +_max = getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(MaxDistance)); +_distance = _vehicle getVariable [QGVAR(Distance), _min]; _distance = _distance + _delta; _distance = _distance min _max; _distance = _distance max _min; -[_vehicle, 0, _distance] call AGM_FCS_fnc_keyUp; +[_vehicle, 0, _distance] call FUNC(keyUp); diff --git a/addons/fcs/functions/fnc_canResetFCS.sqf b/addons/fcs/functions/fnc_canResetFCS.sqf new file mode 100644 index 0000000000..0aa281bd85 --- /dev/null +++ b/addons/fcs/functions/fnc_canResetFCS.sqf @@ -0,0 +1,16 @@ +/* + * Author: KoffeinFlummi + * + * Called from config. Can player reset FCS? + * + * Argument: + * Nothing + * + * Return value: + * Boolean (Bool) + */ + +#include "script_component.hpp" + +_player == gunner _vehicle +&& (count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) diff --git a/addons/fcs/functions/fnc_canUseFCS.sqf b/addons/fcs/functions/fnc_canUseFCS.sqf new file mode 100644 index 0000000000..e75efd44cf --- /dev/null +++ b/addons/fcs/functions/fnc_canUseFCS.sqf @@ -0,0 +1,17 @@ +/* + * Author: commy2 + * + * Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS. + * + * Argument: + * Nothing + * + * Return value: + * Boolean (Bool) + */ + +#include "script_component.hpp" + +_player == gunner _vehicle +&& {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(Enabled)) == 1} +&& {cameraView == "GUNNER"} diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_canUseRangefinder.sqf b/addons/fcs/functions/fnc_canUseRangefinder.sqf similarity index 68% rename from TO_MERGE/agm/FireControlSystem/functions/fn_canUseRangefinder.sqf rename to addons/fcs/functions/fnc_canUseRangefinder.sqf index d96211bc5f..f6bb3b2e52 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_canUseRangefinder.sqf +++ b/addons/fcs/functions/fnc_canUseRangefinder.sqf @@ -2,13 +2,15 @@ * Author: commy2 * * Returns true if the laser distance measurement can be read from the engine. - * + * * Argument: * Nothing - * + * * Return value: * Boolean (Bool) */ -!isNull ((uiNamespace getVariable ["AGM_dlgRangefinder", displayNull]) displayCtrl 1713151) +#include "script_component.hpp" + +!isNull ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) && {cameraView == "GUNNER"} diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf similarity index 68% rename from TO_MERGE/agm/FireControlSystem/functions/fn_firedEH.sqf rename to addons/fcs/functions/fnc_firedEH.sqf index bf03327127..235e4531b8 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -10,6 +10,8 @@ * None */ +#include "script_component.hpp" + private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_FCSMagazines", "_FCSElevation", "_offset"]; _unit = _this select 0; @@ -18,10 +20,10 @@ _ammoType = _this select 4; _magazineType = _this select 5; _round = _this select 6; -_FCSMagazines = _unit getVariable "AGM_FCSMagazines"; -_FCSElevation = _unit getVariable "AGM_FCSElevation"; +_FCSMagazines = _unit getVariable QGVAR(Magazines); +_FCSElevation = _unit getVariable QGVAR(Elevation); -if (AGM_player != gunner _unit) exitWith {}; +if (ACE_player != gunner _unit) exitWith {}; if !(_magazineType in _FCSMagazines) exitWith {}; // GET ELEVATION OFFSET OF CURRENT MAGAZINE @@ -32,15 +34,16 @@ _offset = 0; }; } forEach _FCSMagazines; -[_round, (_unit getVariable "AGM_FCSAzimuth"), _offset, 0] call AGM_Core_fnc_changeProjectileDirection; +[_round, (_unit getVariable QGVAR(Azimuth)), _offset, 0] call EFUNC(common,changeProjectileDirection); // Air burst missile -if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "AGM_Airburst") == 1) then { +// may need to get rewritten +if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "ACE_Airburst") == 1) then { _this spawn { _vehicle = _this select 0; _projectile = _this select 6; - _distance = _vehicle getVariable ["AGM_FCSDistance", currentZeroing _vehicle]; + _distance = _vehicle getVariable [QGVAR(Distance), currentZeroing _vehicle]; if (_distance < 50) exitWith {}; if (_distance > 1500) exitWith {}; @@ -50,7 +53,7 @@ if (getNumber (configFile >> "CfgAmmo" >> _ammoType >> "AGM_Airburst") == 1) the _position = getPosATL _projectile; - _subMunition = createVehicle ["AGM_B_35mm_ABM_Helper", _position, [], 0, "FLY"]; + _subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"]; _subMunition setPosATL _position; _subMunition setVelocity [0, 0, -10]; diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf similarity index 91% rename from TO_MERGE/agm/FireControlSystem/functions/fn_getAngle.sqf rename to addons/fcs/functions/fnc_getAngle.sqf index 922ef92d86..b1f743e8cc 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -16,6 +16,7 @@ * offset from the current angle necessary to hit the target */ +#include "script_component.hpp" #define PRECISION 0.1 private ["_distance","_angleTarget","_maxElev","_initSpeed","_airFriction","_timeToLive","_timeToLive","_simulationStep","_angle","_posTargetX","_posTargetY","_posX","_posY","_velocityX","_velocityY","_velocityMagnitude"]; @@ -30,7 +31,7 @@ _simulationStep = _this select 6; if (_simulationStep == 0) exitWith {_angleTarget}; -AGM_FCS_traceBullet = { +FUNC(traceBullet) = { private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude"]; _distance = _this select 0; @@ -67,17 +68,17 @@ AGM_FCS_traceBullet = { _posY - _posTargetY }; -if ((_this + [_maxElev]) call AGM_FCS_traceBullet < 0) exitWith {_maxElev - _angleTarget}; +if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget}; // Newton Method / Secand Method _angle1 = _angleTarget; _angle2 = _maxElev; _it2 = 0; -_f1 = (_this + [_angle1]) call AGM_FCS_traceBullet; +_f1 = (_this + [_angle1]) call FUNC(traceBullet); if ((abs _f1) <= PRECISION) exitWith {0}; while {(abs _f1) > PRECISION} do { - _f2 = (_this + [_angle2]) call AGM_FCS_traceBullet; + _f2 = (_this + [_angle2]) call FUNC(traceBullet); _temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1); _angle1 = _angle2; _angle2 = _temp; diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_getRange.sqf b/addons/fcs/functions/fnc_getRange.sqf similarity index 75% rename from TO_MERGE/agm/FireControlSystem/functions/fn_getRange.sqf rename to addons/fcs/functions/fnc_getRange.sqf index 84814e677d..3618fa446e 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_getRange.sqf +++ b/addons/fcs/functions/fnc_getRange.sqf @@ -1,19 +1,21 @@ /* * Author: commy2 * - * Read laser distance measurement from engine and update compatible info elements. - * + * Read laser distance measurement from engine and update compatible info elements. + * * Argument: * Nothing - * + * * Return value: * Measured distance (Number) */ +#include "script_component.hpp" + private ["_dlgRangefinder", "_range"]; disableSerialization; -_dlgRangefinder = uiNamespace getVariable ["AGM_dlgRangefinder", displayNull]; +_dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]; _range = ctrlText (_dlgRangefinder displayCtrl 151); (_dlgRangefinder displayCtrl 1713151) ctrlSetText _range; diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf similarity index 65% rename from TO_MERGE/agm/FireControlSystem/functions/fn_keyDown.sqf rename to addons/fcs/functions/fnc_keyDown.sqf index fb6a9f4baf..e0c6cd35f9 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -4,27 +4,31 @@ * Starts watching the target for sideways correction. * * Arguments: - * none + * 0: Vehicle * * Return Value: * none */ +#include "script_component.hpp" + private ["_vehicle", "_distance", "_weaponDirection"]; _vehicle = _this select 0; -_distance = _this select 1; +_distance = call FUNC(getRange); -AGM_FCSEnabled = true; -AGM_FCSTime = time; +if !(call FUNC(canUseFCS)) exitWith {}; + +GVAR(Enabled) = true; +GVAR(Time) = time; if (_distance == 0) then { - _distance = [5, 5000, 0] call AGM_Core_fnc_getTargetDistance; // maximum distance: 5000m, 5m precision + _distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision }; _weaponDirection = _vehicle weaponDirection currentWeapon _vehicle; -AGM_FCSPosition = [ +GVAR(Position) = [ (getPos _vehicle select 0) + _distance * (_weaponDirection select 0), (getPos _vehicle select 1) + _distance * (_weaponDirection select 1), (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf similarity index 79% rename from TO_MERGE/agm/FireControlSystem/functions/fn_keyUp.sqf rename to addons/fcs/functions/fnc_keyUp.sqf index a73b23390b..69c11137cf 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -5,25 +5,28 @@ * * Arguments: * 0: The vehicle - * 1: Range Override (Optional) * * Return Value: * none */ +#include "script_component.hpp" + private ["_ammoType", "_viewDiff", "_posArrival", "_airFriction", "_timeToLive", "_maxElev", "_vehicle", "_posTarget", "_distance", "_simulationStep", "_posX", "_velocityMagnitude", "_magazines", "_movingAzimuth", "_FCSElevation", "_velocityX", "_velocityY", "_weaponDirection", "_velocityTarget", "_FCSAzimuth", "_FCSMagazines", "_dirArrival", "_i", "_magazineType", "_angleTarget", "_offset", "_timeToTarget", "_initSpeed"]; _vehicle = _this select 0; -_distance = _this select 1; +_distance = call FUNC(getRange); + +if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; _magazines = magazines _vehicle; if (_distance == 0) then { _distance = [ - getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSDistanceInterval"), - getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSMaxDistance"), - getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "AGM_FCSMinDistance") - ] call AGM_Core_fnc_getTargetDistance; // maximum distance: 5000m, 5m precision + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(DistanceInterval)), + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MaxDistance)), + getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(MinDistance)) + ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision }; _weaponDirection = _vehicle weaponDirection currentWeapon _vehicle; @@ -33,13 +36,13 @@ if (count _this > 2) then { _distance = _this select 2; }; -if (!(isNil "AGM_FCS_backgroundCalculation") and {!(scriptDone AGM_FCS_backgroundCalculation)}) then { - terminate AGM_FCS_backgroundCalculation; +if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then { + terminate GVAR(backgroundCalculation); }; // MOVING TARGETS _movingAzimuth = 0; -if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then { +if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { // calculate speed of target _posTarget = [ (getPos _vehicle select 0) + _distance * (_weaponDirection select 0), @@ -47,9 +50,9 @@ if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then { (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) ]; _velocityTarget = [ - ((_posTarget select 0) - (AGM_FCSPosition select 0)) / (time - AGM_FCSTime), - ((_posTarget select 1) - (AGM_FCSPosition select 1)) / (time - AGM_FCSTime), - ((_posTarget select 2) - (AGM_FCSPosition select 2)) / (time - AGM_FCSTime) + ((_posTarget select 0) - (GVAR(position) select 0)) / (time - GVAR(time)), + ((_posTarget select 1) - (GVAR(position) select 1)) / (time - GVAR(time)), + ((_posTarget select 2) - (GVAR(position) select 2)) / (time - GVAR(time)) ]; // estimate time to target @@ -92,11 +95,11 @@ if (time - AGM_FCSTime > 1 and AGM_FCSTime != -1 and count _this < 3) then { _distance = floor (_posArrival distance (getPos _vehicle)); }; }; -AGM_FCSEnabled = false; -AGM_FCSTime = -1; +GVAR(enabled) = false; +GVAR(time) = -1; // CALCULATE AZIMUTH CORRECTION -_viewDiff = _vehicle getVariable "AGM_FCSViewDiff"; +_viewDiff = _vehicle getVariable QGVAR(ViewDiff); _FCSAzimuth = _movingAzimuth; if (_viewDiff != 0) then { _FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth; @@ -115,19 +118,19 @@ if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMiss _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); - _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call AGM_FCS_fnc_getAngle; + _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle); _FCSMagazines = _FCSMagazines + [_magazineType]; _FCSElevation = _FCSElevation + [_offset]; }; -_vehicle setVariable ["AGM_FCSDistance", _distance, true]; -_vehicle setVariable ["AGM_FCSMagazines", _FCSMagazines, true]; -_vehicle setVariable ["AGM_FCSElevation", _FCSElevation, true]; -_vehicle setVariable ["AGM_FCSAzimuth", _FCSAzimuth, true]; +_vehicle setVariable [QGVAR(Distance), _distance, true]; +_vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true]; +_vehicle setVariable [QGVAR(Elevation), _FCSElevation, true]; +_vehicle setVariable [QGVAR(Azimuth), _FCSAzimuth, true]; // CALCULATE OFFSETS FOR OTHER WEAPONS IN THE BACKGROUND -AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn { +GVAR(backgroundCalculation) = [_vehicle, _magazines, _distance, _angleTarget, _FCSMagazines, _FCSElevation] spawn { _vehicle = _this select 0; _magazines = _this select 1; _distance = _this select 2; @@ -145,7 +148,7 @@ AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget, _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); - _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call AGM_FCS_fnc_getAngle; + _offset = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep] call FUNC(getAngle); _FCSMagazines = _FCSMagazines + [_x]; _FCSElevation = _FCSElevation + [_offset]; @@ -153,8 +156,8 @@ AGM_FCS_backgroundCalculation = [_vehicle, _magazines, _distance, _angleTarget, }; } forEach _magazines; - _vehicle setVariable ["AGM_FCSMagazines", _FCSMagazines, true]; - _vehicle setVariable ["AGM_FCSElevation", _FCSElevation, true]; + _vehicle setVariable [QGVAR(Magazines), _FCSMagazines, true]; + _vehicle setVariable [QGVAR(Elevation), _FCSElevation, true]; }; -[format ["%1: %2", localize "STR_AGM_FireControlSystem_ZeroedTo", _distance]] call AGM_Core_fnc_displayTextStructured; +[format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured); diff --git a/addons/fcs/functions/fnc_reset.sqf b/addons/fcs/functions/fnc_reset.sqf new file mode 100644 index 0000000000..f49c4c9589 --- /dev/null +++ b/addons/fcs/functions/fnc_reset.sqf @@ -0,0 +1,24 @@ +/* + * Author: KoffeinFlummi + * + * Resets the FCS to default. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * none + */ + +#include "script_component.hpp" + +private ["_vehicle"]; + +_vehicle = _this select 0; + +_vehicle setVariable [QGVAR(Distance), 0, true]; +_vehicle setVariable [QGVAR(Magazines), [], true]; +_vehicle setVariable [QGVAR(Elevation), 0, true]; +_vehicle setVariable [QGVAR(Azimuth), 0, true]; + +[localize "STR_ACE_FCS_HasBeenReset"] call EFUNC(common,displayTextStructured); diff --git a/TO_MERGE/agm/FireControlSystem/functions/fn_vehicleInit.sqf b/addons/fcs/functions/fnc_vehicleInit.sqf similarity index 62% rename from TO_MERGE/agm/FireControlSystem/functions/fn_vehicleInit.sqf rename to addons/fcs/functions/fnc_vehicleInit.sqf index ca2b2d5aab..f65ce6dc7d 100644 --- a/TO_MERGE/agm/FireControlSystem/functions/fn_vehicleInit.sqf +++ b/addons/fcs/functions/fnc_vehicleInit.sqf @@ -4,21 +4,23 @@ * Checks if a vehicle is equipped with an FCS and if so, adds the fired event handler * * Arguments: - * 0: Vehicle + * 0: Vehicle * * Return Value: * none */ +#include "script_component.hpp" + private ["_gunBeg", "_gunnerView", "_gunBegPos", "_gunnerViewPos", "_viewDiff"]; -if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "AGM_FCSEnabled") == 1) then { - (_this select 0) addEventHandler ["Fired", {_this call AGM_FCS_fnc_firedEH}]; +if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> QGVAR(Enabled)) == 1) then { + (_this select 0) addEventHandler ["Fired", {_this call FUNC(firedEH)}]; - (_this select 0) setVariable ["AGM_FCSDistance", 0, true]; - (_this select 0) setVariable ["AGM_FCSMagazines", [], true]; - (_this select 0) setVariable ["AGM_FCSElevation", [], true]; - (_this select 0) setVariable ["AGM_FCSAzimuth", 0, true]; + (_this select 0) setVariable [QGVAR(Distance), 0, true]; + (_this select 0) setVariable [QGVAR(Magazines), [], true]; + (_this select 0) setVariable [QGVAR(Elevation), [], true]; + (_this select 0) setVariable [QGVAR(Azimuth), 0, true]; // calculate offset between gunner camera and muzzle position if !((_this select 0) isKindOf "Air") then { @@ -27,8 +29,8 @@ if (getNumber (configFile >> "CfgVehicles" >> (typeOf (_this select 0)) >> "AGM_ _gunBegPos = ((_this select 0) selectionPosition _gunBeg) select 0; _gunnerViewPos = ((_this select 0) selectionPosition _gunnerView) select 0; _viewDiff = _gunBegPos - _gunnerViewPos; - (_this select 0) setVariable ["AGM_FCSViewDiff", _viewDiff, true]; + (_this select 0) setVariable [QGVAR(ViewDiff), _viewDiff, true]; } else { - (_this select 0) setVariable ["AGM_FCSViewDiff", 0, true]; + (_this select 0) setVariable [QGVAR(ViewDiff), 0, true]; }; }; diff --git a/addons/fcs/functions/script_component.hpp b/addons/fcs/functions/script_component.hpp new file mode 100644 index 0000000000..153cad41b2 --- /dev/null +++ b/addons/fcs/functions/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT fcs +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FCS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_FCS + #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/fcs/script_component.hpp b/addons/fcs/script_component.hpp new file mode 100644 index 0000000000..153cad41b2 --- /dev/null +++ b/addons/fcs/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT fcs +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FCS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_FCS + #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" diff --git a/TO_MERGE/agm/FireControlSystem/stringtable.xml b/addons/fcs/stringtable.xml similarity index 89% rename from TO_MERGE/agm/FireControlSystem/stringtable.xml rename to addons/fcs/stringtable.xml index 67b905b0d9..7427b87d52 100644 --- a/TO_MERGE/agm/FireControlSystem/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -1,8 +1,8 @@  - - - + + + Lase Target / Measure Distance Ziel anlasern / Entfernung Messen Télémétrer la cible @@ -17,7 +17,7 @@ --> Подсветить цель / Измерить расстояние - + Zeroed To Haltepunkt Fijado a @@ -29,7 +29,7 @@ Fixado em Azzeramento a - + Adjust FCS Range (Up) Entfernung des FLS erhöhen Zwiększ zasięg FCS @@ -41,7 +41,7 @@ Aumentare la distanza dell'FCS Диапазон СУО (Выше) - + Adjust FCS Range (Down) Entfernung des FLS verringern Zmniejsz zasięg FCS @@ -53,7 +53,7 @@ Ridurre la distanza dell'FCS Диапазон СУО (Ниже) - + Reset FCS FLS zurücksetzen Reiniciar FCS @@ -65,7 +65,7 @@ Azzeramento dell'FCS Обнулить СУО - + FCS has been reset. FLS wurde zurückgesetzt. FCS reiniciado @@ -78,4 +78,4 @@ СУО обнулен - \ No newline at end of file +