diff --git a/README.md b/README.md index dd464966f2..3ec6fe0683 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ If you installed ACE3, but have trouble understanding how it all works, or where #### Contributing If you want to help put with the ongoing development, you can do so by looking for possible bugs or by contributing new features. To contribute something to ACE, simply fork this repository and submit your pull requests for review by other collaborators. In the process, please add yourself to the author array of any .pbo you will be editing and the AUTHORS.txt file; including a valid email address. -To report a bug, propose a feature, or suggest a change to the existing one — please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues). +To report a bug, propose a feature, or suggest a change to the existing one — please, use our [Issue Tracker](https://github.com/acemod/ACE3/issues). See [this link](http://ace3mod.com/wiki/user/how-to-report-an-issue.html) for details. #### Testing & Building If you want to help us test the latest development changes, feel free to download our master branch, using either git — if familiar with the process — or directly, by following [this link](https://github.com/acemod/ACE3/archive/master.zip). diff --git a/addons/aircraft/CfgAmmo.hpp b/addons/aircraft/CfgAmmo.hpp index 41462354d8..8aa5d3173e 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -2,7 +2,7 @@ class CfgAmmo { class BulletBase; class B_20mm : BulletBase { - hit = 80; + hit = 80; indirectHit = 12; indirectHitRange = 2; //2; caliber = 1.4; @@ -13,7 +13,7 @@ class CfgAmmo { tracerEndTime = 3.5; CraterEffects = "ExploAmmoCrater"; - explosionEffects = "ExploAmmoExplosion"; + explosionEffects = "ExploAmmoExplosion"; model = "\A3\Weapons_f\Data\bullettracer\tracer_red"; }; class ACE_20mm_HE : B_20mm {}; @@ -23,7 +23,7 @@ class CfgAmmo { indirectHitRange = 0.3; //2; explosive = 0; CraterEffects = ""; - explosionEffects = ""; + explosionEffects = ""; }; // adjust minigun caliber and deflection to other ammo diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 7276b3e402..22f2da3833 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -907,7 +907,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { thermalMode[] = {0,1}; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; class Medium: Wide @@ -918,7 +918,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.093; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; class Narrow: Wide @@ -929,7 +929,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.029; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; @@ -941,7 +941,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { maxFov = 0.01; gunnerOpticsColor[] = {0,0,0,1}; directionStabilized = 1; - horizontallyStabilized = 1; + horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index b60ff03fdc..c421f5df70 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -230,12 +230,12 @@ class ATragMX_Display { w=0.03; h=0.03; colorBackground[]={0,0,0,0.0}; - action=QUOTE((GVAR(currentGun) + (count GVAR(gunList)) - 1) % (count GVAR(gunList)) call FUNC(change_gun)); + action=QUOTE(-1 call FUNC(cycle_gun_list)); }; class BOTTOM: TOP { idc=-1; y=0.265*safezoneH+safezoneY+0.955; - action=QUOTE((GVAR(currentGun) + (count GVAR(gunList)) + 1) % (count GVAR(gunList)) call FUNC(change_gun)); + action=QUOTE(+1 call FUNC(cycle_gun_list)); }; class LEFT: ATragMX_RscButton { idc=-1; @@ -316,6 +316,7 @@ class ATragMX_Display { colorBackground[]={0.15,0.21,0.23,0.3}; colorFocused[]={0.15,0.21,0.23,0.2}; text="Gun"; + action=QUOTE(call FUNC(toggle_gun_ammo_data)); }; class TEXT_BORE_HEIGHT: TEXT_GUN_PROFILE { idc=10; @@ -323,12 +324,12 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.285; text="BH"; }; - class TEXT_BORE_HEIGHT_INPUT: ATragMX_RscEdit { + class TEXT_BORE_HEIGHT_OUTPUT: TEXT_BORE_HEIGHT { idc=100; + style=ST_RIGHT; w=0.058; x=0.550*safezoneW+safezoneX+0.145; y=0.265*safezoneH+safezoneY+0.285; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); }; class TEXT_BULLET_MASS: TEXT_BORE_HEIGHT { idc=11; @@ -336,7 +337,7 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.320; text="BW"; }; - class TEXT_BULLET_MASS_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_BULLET_MASS_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=110; y=0.265*safezoneH+safezoneY+0.320; }; @@ -345,7 +346,7 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.355; text="C1"; }; - class TEXT_AIR_FRICTION_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_AIR_FRICTION_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=120; y=0.265*safezoneH+safezoneY+0.355; }; @@ -359,7 +360,7 @@ class ATragMX_Display { colorFocused[]={0.15,0.21,0.23,0.2}; text="MV"; }; - class TEXT_MUZZLE_VELOCITY_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_MUZZLE_VELOCITY_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=130; y=0.265*safezoneH+safezoneY+0.390; }; @@ -368,35 +369,35 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.425; text="ZR"; }; - class TEXT_ZERO_RANGE_INPUT: TEXT_BORE_HEIGHT_INPUT { + class TEXT_ZERO_RANGE_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=140; y=0.265*safezoneH+safezoneY+0.425; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(update_zero_range)}); }; class TEXT_ATMOSPHERE: TEXT_GUN { idc=4001; x=0.550*safezoneW+safezoneX+0.205; text="Atmsphr"; + action=QUOTE(0 call FUNC(toggle_atmo_env_data)); }; class TEXT_TEMPERATURE: TEXT_BULLET_MASS { idc=20; x=0.550*safezoneW+safezoneX+0.20; text="Tmp"; }; - class TEXT_TEMPERATURE_INPUT: ATragMX_RscEdit { + class TEXT_TEMPERATURE_OUTPUT: TEXT_TEMPERATURE { idc=200; + style=ST_RIGHT; w=0.050; x=0.550*safezoneW+safezoneX+0.245; y=0.265*safezoneH+safezoneY+0.320; text=""; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); }; class TEXT_BAROMETRIC_PRESSURE: TEXT_AIR_FRICTION { idc=21; x=0.550*safezoneW+safezoneX+0.20; text="BP"; }; - class TEXT_BAROMETRIC_PRESSURE_INPUT: TEXT_TEMPERATURE_INPUT { + class TEXT_BAROMETRIC_PRESSURE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=210; y=0.265*safezoneH+safezoneY+0.355; }; @@ -406,10 +407,19 @@ class ATragMX_Display { y=0.265*safezoneH+safezoneY+0.390; text="RH"; }; - class TEXT_RELATIVE_HUMIDITY_INPUT: TEXT_TEMPERATURE_INPUT { + class TEXT_RELATIVE_HUMIDITY_OUTPUT: TEXT_TEMPERATURE_OUTPUT { idc=220; y=0.265*safezoneH+safezoneY+0.390; }; + class TEXT_ALTITUDE: TEXT_BORE_HEIGHT { + idc=23; + x=0.550*safezoneW+safezoneX+0.20; + text="Alt"; + }; + class TEXT_ALTITUDE_OUTPUT: TEXT_TEMPERATURE_OUTPUT { + idc=230; + y=0.265*safezoneH+safezoneY+0.285; + }; class TEXT_TARGET_A: ATragMX_RscButton { idc=500; w=0.0231; @@ -445,18 +455,18 @@ class ATragMX_Display { idc=4002; x=0.550*safezoneW+safezoneX+0.3; text="Target"; + action=QUOTE(0 call FUNC(toggle_target_data)); }; class TEXT_WIND_SPEED: TEXT_BORE_HEIGHT { idc=30; x=0.550*safezoneW+safezoneX+0.3; text="WS"; }; - class TEXT_WIND_SPEED_INPUT: ATragMX_RscEdit { + class TEXT_WIND_SPEED_OUTPUT: TEXT_BORE_HEIGHT_OUTPUT { idc=300; w=0.058; x=0.550*safezoneW+safezoneX+0.335; y=0.265*safezoneH+safezoneY+0.285; - onKeyUp=QUOTE(if (_this select 1 == 28) then {call FUNC(calculate_target_solution)}); text="0"; }; class TEXT_WIND_DIRECTION: TEXT_BULLET_MASS { @@ -464,7 +474,7 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.3; text="WD"; }; - class TEXT_WIND_DIRECTION_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_WIND_DIRECTION_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=310; y=0.265*safezoneH+safezoneY+0.32; }; @@ -473,7 +483,7 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.3; text="IA"; }; - class TEXT_INCLINATION_ANGLE_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_INCLINATION_ANGLE_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=320; y=0.265*safezoneH+safezoneY+0.355; }; @@ -481,9 +491,9 @@ class ATragMX_Display { idc=33; x=0.550*safezoneW+safezoneX+0.3; text="TS"; - action=QUOTE(call FUNC(toggle_target_speed_assist)); + action=QUOTE(0 call FUNC(toggle_target_speed_assist)); }; - class TEXT_TARGET_SPEED_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_TARGET_SPEED_OUTPUT: TEXT_WIND_SPEED_OUTPUT { idc=330; y=0.265*safezoneH+safezoneY+0.39; }; @@ -493,7 +503,7 @@ class ATragMX_Display { text="TR"; action=QUOTE(0 call FUNC(toggle_target_range_assist)); }; - class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_INPUT { + class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_OUTPUT { idc=340; y=0.265*safezoneH+safezoneY+0.425; }; @@ -563,6 +573,7 @@ class ATragMX_Display { x=0.550*safezoneW+safezoneX+0.11; y=0.265*safezoneH+safezoneY+0.57; text="Lead"; + action=QUOTE(GVAR(showWind2) = !GVAR(showWind2); call FUNC(update_result); call FUNC(update_target)); }; class TEXT_LEAD_OUTPUT: TEXT_ELEVATION_OUTPUT_ABSOLUTE { idc=420; @@ -814,13 +825,13 @@ class ATragMX_Display { w=0.07; x=0.550*safezoneW+safezoneX+0.32; text="cm"; - action=QUOTE(GVAR(rangeAssistTargetSizeUnit)=(GVAR(rangeAssistTargetSizeUnit)+1) % (count GVAR(GVAR(rangeAssistTargetSizeUnit)s)); ctrlSetText [7014, GVAR(GVAR(rangeAssistTargetSizeUnit)s) select GVAR(rangeAssistTargetSizeUnit)]); + action=QUOTE(call FUNC(cycle_target_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT { idc=7015; y=0.265*safezoneH+safezoneY+0.45; text="MIL"; - action=QUOTE(GVAR(rangeAssistImageSizeUnit)=(GVAR(rangeAssistImageSizeUnit)+1) % (count GVAR(rangeAssistImageSizeUnits)); ctrlSetText [7015, GVAR(rangeAssistImageSizeUnits) select GVAR(rangeAssistImageSizeUnit)]); + action=QUOTE(call FUNC(cycle_image_size_units)); }; class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=7016; @@ -861,22 +872,22 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE { idc=8000; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Target Range"; }; class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE { idc=8001; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Num Ticks"; }; class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE { idc=8002; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Time (secs)"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE { idc=8003; - x=0.550*safezoneW+safezoneX+0.12; + x=0.550*safezoneW+safezoneX+0.13; text="Est Speed"; }; class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT { @@ -907,7 +918,7 @@ class ATragMX_Display { class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_UNIT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8009; text="MIL"; - action=QUOTE(GVAR(speedAssistNumTicksUnit)=(GVAR(speedAssistNumTicksUnit)+1) % (count GVAR(speedAssistNumTicksUnits)); ctrlSetText [8009, GVAR(speedAssistNumTicksUnits) select GVAR(speedAssistNumTicksUnit)]; call FUNC(calculate_target_speed_assist)); + action=QUOTE(call FUNC(cycle_num_ticks_units)); }; class TEXT_TARGET_SPEED_ASSIST_TIMER_START: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT { idc=8010; @@ -1046,5 +1057,298 @@ class ATragMX_Display { text="Cancel"; action=QUOTE(false call FUNC(show_add_new_gun); true call FUNC(show_gun_list)); }; + + class TEXT_GUN_AMMO_DATA_BORE_HEIGHT: TEXT_BORE_HEIGHT { + idc=12000; + w=0.22; + y=0.265*safezoneH+safezoneY+0.28; + text="Bore (cm)"; + }; + class TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT: ATragMX_RscEdit { + idc=120000; + w=0.06; + x=0.550*safezoneW+safezoneX+0.335; + y=0.265*safezoneH+safezoneY+0.28; + }; + class TEXT_GUN_AMMO_DATA_BULLET_MASS: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12001; + y=0.265*safezoneH+safezoneY+0.320; + text="Bullet Weight (grams)"; + }; + class TEXT_GUN_AMMO_DATA_BULLET_MASS_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120010; + y=0.265*safezoneH+safezoneY+0.320; + }; + class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12002; + y=0.265*safezoneH+safezoneY+0.360; + text="Bullet Diam (cm)"; + }; + class TEXT_GUN_AMMO_DATA_BULLET_DIAMETER_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120020; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_GUN_AMMO_DATA_AIR_FRICTION: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12003; + y=0.265*safezoneH+safezoneY+0.400; + text="C1 Coefficient"; + }; + class TEXT_GUN_AMMO_DATA_AIR_FRICTION_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120030; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_GUN_AMMO_DATA_RIFLE_TWIST: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12004; + y=0.265*safezoneH+safezoneY+0.440; + text="Rifle Twist (cm/trn)"; + }; + class TEXT_GUN_AMMO_DATA_RIFLE_TWIST_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120040; + y=0.265*safezoneH+safezoneY+0.440; + }; + class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12005; + y=0.265*safezoneH+safezoneY+0.480; + text="Muzzle Velocity (m/s)"; + }; + class TEXT_GUN_AMMO_DATA_MUZZLE_VELOCITY_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_GUN_AMMO_DATA_ZERO_RANGE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=12006; + y=0.265*safezoneH+safezoneY+0.520; + text="Zero Range (meters)"; + }; + class TEXT_GUN_AMMO_DATA_ZERO_RANGE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=120060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_GUN_AMMO_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=12008; + action=QUOTE(1 call FUNC(toggle_gun_ammo_data)); + }; + class TEXT_GUN_AMMO_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=12009; + action=QUOTE(0 call FUNC(toggle_gun_ammo_data)); + }; + class TEXT_GUN_AMMO_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=12010; + }; + class TEXT_GUN_AMMO_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=12011; + }; + + class TEXT_ATMO_ENV_DATA_DEFAULT: TEXT_LEAD { + idc=13000; + w=0.08; + x=0.550*safezoneW+safezoneX+0.15; + y=0.265*safezoneH+safezoneY+0.320; + text="Default"; + action=QUOTE(call FUNC(restore_atmo_default)); + }; + class TEXT_ATMO_ENV_DATA_AT: TEXT_TARGET_A { + idc=13001; + w=0.04; + x=0.550*safezoneW+safezoneX+0.24; + y=0.265*safezoneH+safezoneY+0.320; + text="AT"; + action=QUOTE(GVAR(atmosphereModeTBH) = false; call FUNC(update_atmo_selection)); + }; + class TEXT_ATMO_ENV_DATA_TBH: TEXT_ATMO_ENV_DATA_AT { + idc=13002; + x=0.550*safezoneW+safezoneX+0.28; + text="TBH"; + action=QUOTE(GVAR(atmosphereModeTBH) = true; call FUNC(update_atmo_selection)); + }; + class TEXT_ATMO_ENV_DATA_ALTITUDE: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=13003; + x=0.550*safezoneW+safezoneX+0.115; + y=0.265*safezoneH+safezoneY+0.400; + text="Altitude (ft)"; + }; + class TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT: TEXT_GUN_AMMO_DATA_BORE_HEIGHT_INPUT { + idc=130030; + x=0.550*safezoneW+safezoneX+0.330; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_ATMO_ENV_DATA_TEMPERATURE: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13004; + y=0.265*safezoneH+safezoneY+0.440; + text="temperature (F)"; + }; + class TEXT_ATMO_ENV_DATA_TEMPERATURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130040; + y=0.265*safezoneH+safezoneY+0.440; + }; + class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13005; + y=0.265*safezoneH+safezoneY+0.480; + text="Barom Pres (in.merc.)"; + }; + class TEXT_ATMO_ENV_DATA_BAROMETRIC_PRESSURE_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY: TEXT_ATMO_ENV_DATA_ALTITUDE { + idc=13006; + y=0.265*safezoneH+safezoneY+0.520; + text="Relative Humidity (%)"; + }; + class TEXT_ATMO_ENV_DATA_RELATIVE_HUMIDITY_INPUT: TEXT_ATMO_ENV_DATA_ALTITUDE_INPUT { + idc=130060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_ATMO_ENV_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=13007; + action=QUOTE(1 call FUNC(toggle_atmo_env_data)); + }; + class TEXT_ATMO_ENV_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=13008; + action=QUOTE(0 call FUNC(toggle_atmo_env_data)); + }; + class TEXT_ATMO_ENV_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=13009; + }; + class TEXT_ATMO_ENV_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=13010; + }; + class TEXT_ATMO_ENV_DATA_CALC_METHOD: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=13011; + x=0.550*safezoneW+safezoneX+0.24; + y=0.265*safezoneH+safezoneY+0.29; + text="Calc Method"; + }; + + class TEXT_TARGET_DATA_LATITUDE: TEXT_BORE_HEIGHT { + idc=14000; + w=0.22; + y=0.265*safezoneH+safezoneY+0.28; + text="Latitude"; + }; + class TEXT_TARGET_DATA_LATITUDE_INPUT: ATragMX_RscEdit { + idc=140000; + w=0.06; + x=0.550*safezoneW+safezoneX+0.335; + y=0.265*safezoneH+safezoneY+0.28; + }; + class TEXT_TARGET_DATA_DIR_OF_FIRE: TEXT_TARGET_DATA_LATITUDE { + idc=14001; + y=0.265*safezoneH+safezoneY+0.320; + text="Dir of Fire (deg from N)"; + }; + class TEXT_TARGET_DATA_DIR_OF_FIRE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140010; + y=0.265*safezoneH+safezoneY+0.320; + }; + class TEXT_TARGET_DATA_WIND_SPEED: TEXT_TARGET_DATA_LATITUDE { + idc=14002; + w=1.2; + y=0.265*safezoneH+safezoneY+0.360; + text="Wind Speed (m/s)"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_1: TEXT_TARGET_DATA_LATITUDE { + idc=141020; + colorText[]={0,0,0,0.6}; + w=0.05; + h=0.03; + sizeEx=0.025; + x=0.550*safezoneW+safezoneX+0.270; + y=0.265*safezoneH+safezoneY+0.357; + text="1"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_INPUT_1: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140020; + w=0.045; + x=0.550*safezoneW+safezoneX+0.290; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_TARGET_DATA_WIND_SPEED_2: TEXT_TARGET_DATA_WIND_SPEED_1 { + idc=141021; + x=0.550*safezoneW+safezoneX+0.330; + text="2"; + }; + class TEXT_TARGET_DATA_WIND_SPEED_INPUT_2: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140021; + w=0.045; + x=0.550*safezoneW+safezoneX+0.350; + y=0.265*safezoneH+safezoneY+0.360; + }; + class TEXT_TARGET_DATA_WIND_DIRECTION: TEXT_TARGET_DATA_LATITUDE { + idc=14003; + y=0.265*safezoneH+safezoneY+0.400; + text="Wind Direction (clock)"; + }; + class TEXT_TARGET_DATA_WIND_DIRECTION_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140030; + y=0.265*safezoneH+safezoneY+0.400; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE: TEXT_TARGET_DATA_LATITUDE { + idc=14004; + w=1.2; + y=0.265*safezoneH+safezoneY+0.440; + text="Inclination Angle"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE: TEXT_TARGET_DATA_LATITUDE { + idc=141041; + colorText[]={0,0,0,0.6}; + w=0.05; + h=0.03; + sizeEx=0.025; + x=0.550*safezoneW+safezoneX+0.270; + y=0.265*safezoneH+safezoneY+0.437; + text="c"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_COSINE: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140041; + w=0.045; + x=0.550*safezoneW+safezoneX+0.290; + y=0.265*safezoneH+safezoneY+0.440; + onKeyUp=QUOTE(if (_this select 1 == 28) then {0 call FUNC(update_inclination_angle)}); + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_DEGREE: TEXT_TARGET_DATA_INCLINATION_ANGLE_COSINE { + idc=141040; + x=0.550*safezoneW+safezoneX+0.330; + text="d"; + }; + class TEXT_TARGET_DATA_INCLINATION_ANGLE_INPUT_DEGREE: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140040; + w=0.045; + x=0.550*safezoneW+safezoneX+0.350; + y=0.265*safezoneH+safezoneY+0.440; + onKeyUp=QUOTE(if (_this select 1 == 28) then {1 call FUNC(update_inclination_angle)}); + }; + class TEXT_TARGET_DATA_TARGET_SPEED: TEXT_TARGET_DATA_LATITUDE { + idc=14005; + y=0.265*safezoneH+safezoneY+0.480; + text="Target Speed (m/s)"; + }; + class TEXT_TARGET_DATA_TARGET_SPEED_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140050; + y=0.265*safezoneH+safezoneY+0.480; + }; + class TEXT_TARGET_DATA_TARGET_RANGE: TEXT_TARGET_DATA_LATITUDE { + idc=14006; + y=0.265*safezoneH+safezoneY+0.520; + text="Target Range (meters)"; + }; + class TEXT_TARGET_DATA_TARGET_RANGE_INPUT: TEXT_TARGET_DATA_LATITUDE_INPUT { + idc=140060; + y=0.265*safezoneH+safezoneY+0.520; + }; + class TEXT_TARGET_DATA_DONE: TEXT_TARGET_SPEED_ASSIST_DONE { + idc=14008; + action=QUOTE(1 call FUNC(toggle_target_data)); + }; + class TEXT_TARGET_DATA_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL { + idc=14009; + action=QUOTE(0 call FUNC(toggle_target_data)); + }; + class TEXT_TARGET_DATA_PREV: TEXT_TARGET_SPEED_ASSIST_PREV { + idc=14010; + }; + class TEXT_TARGET_DATA_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT { + idc=14011; + }; }; }; \ No newline at end of file diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 9d769d84a3..e5f7dd42d3 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -2,46 +2,48 @@ #include "initKeybinds.sqf" -if (count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { +if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == ATRAGMX_PROFILE_NAMESPACE_VERSION && count (profileNamespace getVariable ["ACE_ATragMX_gunList", []]) > 0) then { GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; } else { - // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Elevation Scope Step, Windage Scope Step, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Ammo Class Name, Magazine Class Name, BC, Drag Model, Atmosphere Model - GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0659, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.28, "B_127x108_Ball" , "5Rnd_127x108_Mag" , 0.630, 1, "ASM" ], + // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Elevation Scope Step, Windage Scope Step, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model + GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0659, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ], - ["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.60, "B_127x99_Ball" , "5Rnd_mas_127x99_Stanag" , 1.050, 1, "ASM" ], - ["12.7x99mm" , 853, 100, 0.0623, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 41.92, "B_127x99_Ball" , "5Rnd_mas_127x99_Stanag" , 0.670, 1, "ASM" ], + ["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], + ["12.7x99mm" , 853, 100, 0.0623, -0.0008600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ], - ["12.7x54mm" , 300, 100, 0.3394, -0.0014000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.60, "B_127x54_Ball" , "10Rnd_127x54_Mag" , 1.050, 1, "ASM" ], + ["12.7x54mm" , 300, 100, 0.3394, -0.0014000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ], - [".408 Chey Tac" , 910, 100, 0.0569, -0.0004800, 3.81, 0, 0.338, 0.338, 120, 0, 0, 27.15, "B_408_Ball" , "7Rnd_408_Mag" , 0.970, 1, "ASM" ], + [".408 Chey Tac" , 910, 100, 0.0569, -0.0004800, 3.81, 0, 0.338, 0.338, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ], - ["9.3×64mm" , 870, 100, 0.0619, -0.0007500, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.90, "B_93x64_Ball" , "10Rnd_93x64_DMR_05_Mag" , 0.368, 1, "ASM" ], + ["9.3×64mm" , 870, 100, 0.0619, -0.0007500, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ], - [".338LM 250gr" , 880, 100, 0.0598, -0.0006060, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.20, "B_338_Ball" , "10Rnd_338_Mag" , 0.322, 7, "ICAO"], - [".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 0.338, 0.338, 120, 0, 0, 19.44, "ACE_338_Ball" , "ACE_10Rnd_338_300gr_HPBT_Mag" , 0.381, 7, "ICAO"], - [".338LM API526" , 880, 100, 0.0601, -0.0006730, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.39, "ACE_338_Ball_API526" , "ACE_10Rnd_338_API526_Mag" , 0.290, 7, "ICAO"], + [".338LM 250gr" , 880, 100, 0.0598, -0.0006060, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], + [".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 0.338, 0.338, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], + [".338LM API526" , 880, 100, 0.0601, -0.0006730, 3.81, 0, 0.338, 0.338, 120, 0, 0, 16.39, 8.58, 25.40, 0.290, 7, "ICAO"], - [".300WM Mk248 Mod 0", 900, 100, 0.0584, -0.0008300, 3.81, 0, 0.338, 0.338, 120, 0, 0, 13.31, "ACE_762x67_Ball_Mk248_Mod_0" , "ACE_20Rnd_762x67_Mk248_Mod_0_Mag" , 0.268, 7, "ICAO"], - [".300WM Mk248 Mod 1", 867, 100, 0.0611, -0.0008150, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.26, "ACE_762x67_Ball_Mk248_Mod_1" , "ACE_20Rnd_762x67_Mk248_Mod_1_Mag" , 0.310, 7, "ICAO"], - [".300WM Berger OTM" , 853, 100, 0.0622, -0.0007600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.90, "ACE_762x67_Ball_Berger_Hybrid_OTM", "ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag", 0.368, 7, "ICAO"], + [".300WM Mk248 Mod 0", 900, 100, 0.0584, -0.0008300, 3.81, 0, 0.338, 0.338, 120, 0, 0, 13.31, 7.80, 25.40, 0.268, 7, "ICAO"], + [".300WM Mk248 Mod 1", 867, 100, 0.0611, -0.0008150, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"], + [".300WM Berger OTM" , 853, 100, 0.0622, -0.0007600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"], - ["7.62x54mmR" , 800, 100, 0.0692, -0.0010230, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.849, "B_762x54_Ball" , "10Rnd_762x54_Mag" , 0.400, 1, "ICAO"], + ["7.62x54mmR" , 800, 100, 0.0692, -0.0010230, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"], - ["7.62x51mm M80" , 810, 100, 0.0679, -0.0010350, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.525, "B_762x51_Ball" , "20Rnd_762x51_Mag" , 0.200, 7, "ICAO"], - ["7.62x51mm M118LR" , 820, 100, 0.0662, -0.0008525, 3.81, 0, 0.338, 0.338, 120, 0, 0, 11.34, "ACE_762x51_Ball_M118LR" , "ACE_20Rnd_762x51_M118LR_Mag" , 0.243, 7, "ICAO"], - ["7.62x51mm Mk319" , 820, 100, 0.0670, -0.0010300, 3.81, 0, 0.338, 0.338, 120, 0, 0, 8.424, "ACE_762x51_Ball_Mk319_Mod_0" , "ACE_20Rnd_762x51_Mk319_Mod_0_Mag" , 0.377, 1, "ICAO"], - ["7.62x51mm Subsonic", 320, 100, 0.3060, -0.0004910, 3.81, 0, 0.338, 0.338, 120, 0, 0, 12.96, "ACE_762x51_Ball_Subsonic" , "ACE_20Rnd_762x51_Mag_SD" , 0.235, 7, "ICAO"], + ["7.62x51mm M80" , 810, 100, 0.0679, -0.0010350, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.525, 7.82, 25.40, 0.200, 7, "ICAO"], + ["7.62x51mm M118LR" , 820, 100, 0.0662, -0.0008525, 3.81, 0, 0.338, 0.338, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], + ["7.62x51mm Mk319" , 820, 100, 0.0670, -0.0010300, 3.81, 0, 0.338, 0.338, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"], + ["7.62x51mm Subsonic", 320, 100, 0.3060, -0.0004910, 3.81, 0, 0.338, 0.338, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"], - ["6.5x39mm" , 800, 100, 0.0683, -0.0007850, 3.81, 0, 0.338, 0.338, 120, 0, 0, 7.970, "B_65x39_Caseless" , "30Rnd_65x39_caseless_mag" , 0.263, 7, "ICAO"], - ["6.5x47mm Lapua" , 800, 100, 0.0682, -0.0007710, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.007, "ACE_65x47_Ball_Scenar" , "ACE_30Rnd_65x47_Scenar_mag" , 0.290, 7, "ICAO"], + ["6.5x39mm" , 800, 100, 0.0683, -0.0007850, 3.81, 0, 0.338, 0.338, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"], + ["6.5x47mm Lapua" , 800, 100, 0.0682, -0.0007710, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"], - ["5.56x45mm M855" , 870, 100, 0.0626, -0.0012650, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.018, "B_556x45_Ball" , "30Rnd_556x45_Stanag" , 0.151, 7, "ASM" ], - ["5.56x45mm Mk262" , 820, 100, 0.0671, -0.0011250, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.990, "ACE_556x45_Ball_Mk262" , "ACE_30Rnd_556x45_Stanag_Mk262_mag" , 0.361, 1, "ASM" ], - ["5.56x45mm Mk318" , 880, 100, 0.0616, -0.0011200, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.018, "ACE_556x45_Ball_Mk318" , "ACE_30Rnd_556x45_Stanag_Mk318_mag" , 0.307, 1, "ASM" ]]; + ["5.56x45mm M855" , 870, 100, 0.0626, -0.0012650, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ], + ["5.56x45mm Mk262" , 820, 100, 0.0671, -0.0011250, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ], + ["5.56x45mm Mk318" , 880, 100, 0.0616, -0.0011200, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ]]; + [] call FUNC(clear_user_data); profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; }; [] call FUNC(init); +[] call FUNC(restore_user_data); ["RangerfinderData", {_this call FUNC(sord)}] call EFUNC(common,addEventHandler); diff --git a/addons/atragmx/XEH_preInit.sqf b/addons/atragmx/XEH_preInit.sqf index 0224fc3e9c..b85e325494 100644 --- a/addons/atragmx/XEH_preInit.sqf +++ b/addons/atragmx/XEH_preInit.sqf @@ -12,36 +12,55 @@ PREP(calculate_target_speed_assist); PREP(can_show); PREP(change_gun); PREP(change_target_slot); +PREP(clear_user_data); PREP(create_dialog); +PREP(cycle_gun_list); +PREP(cycle_image_size_units); +PREP(cycle_num_ticks_units); PREP(cycle_range_card_columns); PREP(cycle_scope_unit); +PREP(cycle_target_size_units); PREP(delete_gun); PREP(init); PREP(parse_input); PREP(reset_relative_click_memory); +PREP(restore_atmo_default); +PREP(restore_user_data); PREP(save_gun); PREP(show_add_new_gun); +PREP(show_atmo_env_data); +PREP(show_gun_ammo_data); PREP(show_gun_list); PREP(show_main_page); PREP(show_range_card); PREP(show_range_card_setup); +PREP(show_target_data); PREP(show_target_range_assist); PREP(show_target_speed_assist); PREP(show_target_speed_assist_timer); PREP(sord); +PREP(store_user_data); PREP(target_speed_assist_timer); +PREP(toggle_atmo_env_data); +PREP(toggle_gun_ammo_data); PREP(toggle_gun_list); PREP(toggle_range_card); PREP(toggle_range_card_setup); +PREP(toggle_target_data); PREP(toggle_target_range_assist); PREP(toggle_target_speed_assist); PREP(update_atmosphere); +PREP(update_atmo_env_data); +PREP(update_atmo_selection); PREP(update_gun); +PREP(update_gun_ammo_data); +PREP(update_inclination_angle); PREP(update_range_card); PREP(update_relative_click_memory); PREP(update_result); PREP(update_scope_unit); PREP(update_target); +PREP(update_target_data); PREP(update_target_selection); PREP(update_unit_selection); PREP(update_zero_range); diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index aecd6496af..c11cf90550 100644 --- a/addons/atragmx/functions/fnc_calculate_range_card.sqf +++ b/addons/atragmx/functions/fnc_calculate_range_card.sqf @@ -20,43 +20,61 @@ private ["_scopeBaseAngle"]; _scopeBaseAngle = (GVAR(workingMemory) select 3); -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; +private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; _bulletMass = GVAR(workingMemory) select 12; +_bulletDiameter = GVAR(workingMemory) select 13; _boreHeight = GVAR(workingMemory) select 5; _airFriction = GVAR(workingMemory) select 4; +_barrelTwist = GVAR(workingMemory) select 14; _muzzleVelocity = GVAR(workingMemory) select 1; _bc = GVAR(workingMemory) select 15; _dragModel = GVAR(workingMemory) select 16; _atmosphereModel = GVAR(workingMemory) select 17; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_twistDirection = 0; +if (_barrelTwist > 0) then { + _twistDirection = 1; +} else { + if (_barrelTwist < 0) then { + _twistDirection = -1; + }; +}; +_barrelTwist = abs(_barrelTwist); + +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); _temperature = GVAR(temperature); _barometricPressure = GVAR(barometricPressure); _relativeHumidity = GVAR(relativeHumidity); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; +if (!GVAR(atmosphereModeTBH)) then { + _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _relativeHumidity = 50; }; -private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_windSpeed = (GVAR(windSpeed) select GVAR(currentTarget)); +private ["_bulletLength", "_stabilityFactor"]; +_bulletLength = 1.8; +_stabilityFactor = 1.5; +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { + if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + }; +}; + +private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_latitude = GVAR(latitude) select GVAR(currentTarget); +_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +_windSpeed1 = (GVAR(windSpeed1) select GVAR(currentTarget)); +_windSpeed2 = (GVAR(windSpeed2) select GVAR(currentTarget)); _windDirection = (GVAR(windDirection) select GVAR(currentTarget)); _inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); _targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); _targetRange = GVAR(rangeCardEndRange); -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; -if (GVAR(currentUnit) == 1) then -{ - _windSpeed = _windSpeed / 2.23693629; - _targetSpeed = _targetSpeed / 2.23693629; -}; GVAR(rangeCardData) = []; private ["_result"]; _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true] call FUNC(calculate_solution); + [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true, _stabilityFactor, _twistDirection, _latitude] call FUNC(calculate_solution); diff --git a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf b/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf index 17370c82b2..76c54f63a9 100644 --- a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf +++ b/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf @@ -35,6 +35,6 @@ _barometricPressure = 1013.25; _relativeHumidity = 0; private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false] call FUNC(calculate_solution); +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false, 1.5, 0, 0] call FUNC(calculate_solution); _scopeBaseAngle + (_result select 0) / 60 diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 4e7f5981c1..242e2e9c48 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -12,7 +12,7 @@ * 6: barometric pressure * 7: relative humidity * 8: simulation steps - * 9: wind speed + * 9: wind speed * 10: wind direction * 11: inclination angle * 12: target speed @@ -21,14 +21,20 @@ * 15: drag model * 16: atmosphere model * 17: Store range card data? + * 18: Stability factor + * 19: Twist Direction + * 20: Latitude * * Return Value: - * 0: Elevation - * 1: Windage - * 2: Lead - * 3: Time of fligth - * 4: Remaining velocity - * 4: Remaining kinetic energy + * 0: Elevation (MOA) + * 1: Windage (MOA) + * 2: Lead (MOA) + * 3: Time of fligth (SECONDS) + * 4: Remaining velocity (m/s) + * 5: Remaining kinetic energy (ft·lb) + * 6: Vertical coriolis drift (MOA) + * 7: Horizontal coriolis drift (MOA) + * 8: Spin drift (MOA) * * Example: * call ace_atragmx_calculate_target_range_assist @@ -37,7 +43,7 @@ */ #include "script_component.hpp" -private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData"]; +private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude"]; _scopeBaseAngle = _this select 0; _bulletMass = _this select 1; _boreHeight = _this select 2; @@ -47,7 +53,8 @@ _temperature = _this select 5; _barometricPressure = _this select 6; _relativeHumidity = _this select 7; _simSteps = _this select 8; -_windSpeed = _this select 9; +_windSpeed1 = (_this select 9) select 0; +_windSpeed2 = (_this select 9) select 1; _windDirection = _this select 10; _inclinationAngle = _this select 11; _targetSpeed = _this select 12; @@ -56,6 +63,9 @@ _bc = _this select 14; _dragModel = _this select 15; _atmosphereModel = _this select 16; _storeRangeCardData = _this select 17; +_stabilityFactor = _this select 18; +_twistDirection = _this select 19; +_latitude = _this select 20; private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"]; _bulletPos = [0, 0, 0]; @@ -65,31 +75,45 @@ _bulletSpeed = 0; _gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; _deltaT = 1 / _simSteps; -private ["_elevation", "_windage", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy"]; +private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"]; _elevation = 0; -_windage = 0; +_windage1 = 0; +_windage2 = 0; _lead = 0; _TOF = 0; _trueVelocity = [0, 0, 0]; _trueSpeed = 0; +_verticalCoriolis = 0; +_verticalDeflection = 0; +_horizontalCoriolis = 0; +_horizontalDeflection = 0; +_spinDrift = 0; +_spinDeflection = 0; private ["_n", "_range", "_rangeFactor"]; _n = 0; _range = 0; _rangeFactor = 1; if (_storeRangeCardData) then { - if (GVAR(currentUnit) != 2) then { + if (GVAR(currentUnit) == 1) then { _rangeFactor = 1.0936133; }; GVAR(rangeCardData) = []; }; -private ["_wind"]; -_wind = [cos(270 - _windDirection * 30) * _windSpeed, sin(270 - _windDirection * 30) * _windSpeed, 0]; +private ["_wind1", "_wind2", "_windDrift"]; +_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; +_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; +_windDrift = 0; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); }; +private ["_speedTotal", "_stepsTotal", "_speedAverage"]; +_speedTotal = 0; +_stepsTotal = 0; +_speedAverage = 0; + _TOF = 0; _bulletPos set [0, 0]; @@ -102,8 +126,12 @@ _bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { _bulletSpeed = vectorMagnitude _bulletVelocity; + + _speedTotal = _speedTotal + _bulletSpeed; + _stepsTotal = _stepsTotal + 1; + _speedAverage = (_speedTotal / _stepsTotal); - _trueVelocity = _bulletVelocity vectorDiff _wind; + _trueVelocity = _bulletVelocity vectorDiff _wind1; _trueSpeed = vectorMagnitude _trueVelocity; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { @@ -132,15 +160,34 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { if ((_bulletPos select 1) * _rangeFactor >= _range && _range <= GVAR(rangeCardEndRange)) then { if ((_bulletPos select 1) > 0) then { _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windDrift = (_wind2 select 0) * (_TOF - (_range / _rangeFactor) / _muzzleVelocity); + _windage2 = - atan(_windDrift / (_bulletPos select 1)); }; if (_range != 0) then { _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); }; _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; - - GVAR(rangeCardData) set [_n, [_range, _elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy]]; + + if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false])) then { + if ((_bulletPos select 1) > 0) then { + _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _horizontalCoriolis; + _windage2 = _windage2 + _horizontalCoriolis; + }; + }; + if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { + if ((_bulletPos select 1) > 0) then { + _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; + _spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _spinDrift; + _windage2 = _windage2 + _spinDrift; + }; + }; + + GVAR(rangeCardData) set [_n, [_range, _elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy]]; _n = _n + 1; }; }; @@ -148,7 +195,9 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do { if ((_bulletPos select 1) > 0) then { _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); - _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); + _windage2 = - atan(_windDrift / (_bulletPos select 1)); }; if (_targetRange != 0) then { @@ -158,4 +207,21 @@ if (_targetRange != 0) then { _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); _kineticEnergy = _kineticEnergy * 0.737562149; -[_elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy] +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false])) then { + if ((_bulletPos select 1) > 0) then { + _horizontalDeflection = 0.0000729 * ((_bulletPos select 1) ^ 2) * sin(_latitude) / _speedAverage; + _horizontalCoriolis = - atan(_horizontalDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _horizontalCoriolis; + _windage2 = _windage2 + _horizontalCoriolis; + }; +}; +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { + if ((_bulletPos select 1) > 0) then { + _spinDeflection = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; + _spinDrift = - atan(_spinDeflection / (_bulletPos select 1)); + _windage1 = _windage1 + _spinDrift; + _windage2 = _windage2 + _spinDrift; + }; +}; + +[_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60] diff --git a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf index 6280f19339..91eb9ae20c 100644 --- a/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_range_assist.sqf @@ -46,7 +46,7 @@ switch (GVAR(rangeAssistImageSizeUnit)) do { }; }; _estRange = parseNumber(ctrlText 7013); -if (GVAR(currentUnit) != 2) then { +if (GVAR(currentUnit) == 1) then { _estRange = _estRange / 1.0936133; }; diff --git a/addons/atragmx/functions/fnc_calculate_target_solution.sqf b/addons/atragmx/functions/fnc_calculate_target_solution.sqf index 3f4c92c191..c8a3683498 100644 --- a/addons/atragmx/functions/fnc_calculate_target_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_solution.sqf @@ -20,47 +20,63 @@ private ["_scopeBaseAngle"]; _scopeBaseAngle = (GVAR(workingMemory) select 3); -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; +private ["_bulletMass", "_bulletDiameter", "_boreHeight", "_airFriction", "_barrelTwist", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel", "_twistDirection"]; _bulletMass = GVAR(workingMemory) select 12; +_bulletDiameter = GVAR(workingMemory) select 13; _boreHeight = GVAR(workingMemory) select 5; _airFriction = GVAR(workingMemory) select 4; +_barrelTwist = GVAR(workingMemory) select 14; _muzzleVelocity = GVAR(workingMemory) select 1; _bc = GVAR(workingMemory) select 15; _dragModel = GVAR(workingMemory) select 16; _atmosphereModel = GVAR(workingMemory) select 17; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_twistDirection = 0; +if (_barrelTwist > 0) then { + _twistDirection = 1; +} else { + if (_barrelTwist < 0) then { + _twistDirection = -1; + }; +}; +_barrelTwist = abs(_barrelTwist); + +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); _temperature = GVAR(temperature); _barometricPressure = GVAR(barometricPressure); _relativeHumidity = GVAR(relativeHumidity); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; +if (!GVAR(atmosphereModeTBH)) then { + _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _relativeHumidity = 50; }; -private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; -_windSpeed = (GVAR(windSpeed) select GVAR(currentTarget)); -_windDirection = (GVAR(windDirection) select GVAR(currentTarget)); -_inclinationAngle = (GVAR(inclinationAngle) select GVAR(currentTarget)); -_targetSpeed = (GVAR(targetSpeed) select GVAR(currentTarget)); -_targetRange = (GVAR(targetRange) select GVAR(currentTarget)); -if (GVAR(currentUnit) != 2) then -{ - _targetRange = _targetRange / 1.0936133; -}; -if (GVAR(currentUnit) == 1) then -{ - _windSpeed = _windSpeed / 2.23693629; - _targetSpeed = _targetSpeed / 2.23693629; +private ["_bulletLength", "_stabilityFactor"]; +_bulletLength = 1.8; +_stabilityFactor = 1.5; +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false])) then { + if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + }; }; +private ["_latitude", "_directionOfFire", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_latitude = GVAR(latitude) select GVAR(currentTarget); +_directionOfFire = GVAR(directionOfFire) select GVAR(currentTarget); +_windSpeed1 = GVAR(windSpeed1) select GVAR(currentTarget); +_windSpeed2 = GVAR(windSpeed2) select GVAR(currentTarget); +_windDirection = GVAR(windDirection) select GVAR(currentTarget); +_inclinationAngle = GVAR(inclinationAngle) select GVAR(currentTarget); +_targetSpeed = GVAR(targetSpeed) select GVAR(currentTarget); +_targetRange = GVAR(targetRange) select GVAR(currentTarget); + private ["_result"]; _result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, - _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution); + [_windSpeed1, _windSpeed2], _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false, _stabilityFactor, _twistDirection, _latitude] call FUNC(calculate_solution); GVAR(elevationOutput) set [GVAR(currentTarget), _result select 0]; -GVAR(windageOutput) set [GVAR(currentTarget), _result select 1]; +GVAR(windage1Output) set [GVAR(currentTarget), (_result select 1) select 0]; +GVAR(windage2Output) set [GVAR(currentTarget), (_result select 1) select 1]; GVAR(leadOutput) set [GVAR(currentTarget), _result select 2]; GVAR(tofOutput) set [GVAR(currentTarget), _result select 3]; GVAR(velocityOutput) set [GVAR(currentTarget), _result select 4]; diff --git a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf index 7ee7e9ff78..d055af5a71 100644 --- a/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_speed_assist.sqf @@ -22,34 +22,27 @@ _numTicks = parseNumber(ctrlText 8005); _timeSecs = parseNumber(ctrlText 8006); _estSpeed = 0; -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { _targetRange = _targetRange / 1.0936133; }; -switch (GVAR(rangeAssistImageSizeUnit)) do -{ - case 0: - { +switch (GVAR(rangeAssistImageSizeUnit)) do { + case 0: { _numTicks = _numTicks / 6400 * 360; }; - case 1: - { + case 1: { _numTicks = _numTicks / 60; }; - case 2: - { + case 2: { _numTicks = _numTicks / 60 / 1.047; }; }; -if (_timeSecs > 0) then -{ +if (_timeSecs > 0) then { _estSpeed = tan(_numTicks) * _targetRange / _timeSecs; }; -if (GVAR(currentUnit) == 1) then -{ +if (GVAR(currentUnit) != 2) then { _estSpeed = _estSpeed * 2.23693629; }; diff --git a/addons/atragmx/functions/fnc_change_gun.sqf b/addons/atragmx/functions/fnc_change_gun.sqf index 520e4e85be..c753f644a4 100644 --- a/addons/atragmx/functions/fnc_change_gun.sqf +++ b/addons/atragmx/functions/fnc_change_gun.sqf @@ -4,6 +4,7 @@ * * Arguments: * gunID + * update solution * * Return Value: * Nothing @@ -15,24 +16,31 @@ */ #include "script_component.hpp" -if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {}; +private ["_gunID", "_updateSolution"]; +_gunID = _this select 0; +_updateSolution = _this select 1; -GVAR(workingMemory) = +(GVAR(gunList) select _this); -GVAR(currentGun) = _this; +if (_gunID < 0 || _gunID > (count GVAR(gunList)) - 1) exitWith {}; + +GVAR(workingMemory) = +(GVAR(gunList) select _gunID); +GVAR(currentGun) = _gunID; lbSetCurSel [6000, GVAR(currentGun)]; -if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then -{ +if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then { GVAR(currentScopeUnit) = GVAR(workingMemory) select 6; }; [] call FUNC(update_gun); +[] call FUNC(update_gun_ammo_data); GVAR(elevationOutput) set [GVAR(currentTarget), 0]; -GVAR(windageOutput) set [GVAR(currentTarget), 0]; +GVAR(windage1Output) set [GVAR(currentTarget), 0]; +GVAR(windage2Output) set [GVAR(currentTarget), 0]; GVAR(leadOutput) set [GVAR(currentTarget), 0]; GVAR(tofOutput) set [GVAR(currentTarget), 0]; GVAR(velocityOutput) set [GVAR(currentTarget), 0]; -[] call FUNC(calculate_target_solution); +if (_updateSolution) then { + [] call FUNC(calculate_target_solution); +}; diff --git a/addons/atragmx/functions/fnc_change_target_slot.sqf b/addons/atragmx/functions/fnc_change_target_slot.sqf index 6e6951c6bf..ed8c622b8d 100644 --- a/addons/atragmx/functions/fnc_change_target_slot.sqf +++ b/addons/atragmx/functions/fnc_change_target_slot.sqf @@ -23,4 +23,4 @@ call FUNC(parse_input); GVAR(currentTarget) = _target; call FUNC(update_target_selection); -call FUNC(calculate_target_solution); +[] call FUNC(calculate_target_solution); diff --git a/addons/atragmx/functions/fnc_clear_user_data.sqf b/addons/atragmx/functions/fnc_clear_user_data.sqf new file mode 100644 index 0000000000..10f31741f2 --- /dev/null +++ b/addons/atragmx/functions/fnc_clear_user_data.sqf @@ -0,0 +1,39 @@ +/* + * Author: Ruthberg + * Removes all user data from the profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_clear_user_data + * + * Public: No + */ +#include "script_component.hpp" + +profileNamespace setVariable ["ACE_ATragMX_gunList", nil]; + +profileNamespace setVariable ["ACE_ATragMX_currentUnit", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentGun", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentTarget", nil]; +profileNamespace setVariable ["ACE_ATragMX_currentScopeUnit", nil]; + +profileNamespace setVariable ["ACE_ATragMX_atmosphereModeTBH", nil]; +profileNamespace setVariable ["ACE_ATragMX_altitude", nil]; +profileNamespace setVariable ["ACE_ATragMX_temperature", nil]; +profileNamespace setVariable ["ACE_ATragMX_barometricPressure", nil]; +profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", nil]; + +profileNamespace setVariable ["ACE_ATragMX_showWind2", nil]; +profileNamespace setVariable ["latitude", nil]; +profileNamespace setVariable ["directionOfFire", nil]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed1", nil]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed2", nil]; +profileNamespace setVariable ["ACE_ATragMX_windDirection", nil]; +profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", nil]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeed", nil]; +profileNamespace setVariable ["ACE_ATragMX_targetRange", nil]; diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index 8dc0f3e34f..5be6e4ecb4 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -26,13 +26,16 @@ call FUNC(update_target_selection); GVAR(showMainPage) call FUNC(show_main_page); GVAR(showAddNewGun) call FUNC(show_add_new_gun); +GVAR(showAtmoEnvData) call FUNC(show_atmo_env_data); +GVAR(showGunAmmoData) call FUNC(show_gun_ammo_data); GVAR(showGunList) call FUNC(show_gun_list); GVAR(showRangeCard) call FUNC(show_range_card); if (GVAR(showRangeCard)) then { - ctrlSetFocus (_dsp displayCtrl 5001); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001); [] call FUNC(update_range_card); }; GVAR(showRangeCardSetup) call FUNC(show_range_card_setup); +GVAR(showTargetData) call FUNC(show_target_data); GVAR(showTargetRangeAssist) call FUNC(show_target_range_assist); GVAR(showTargetSpeedAssist) call FUNC(show_target_speed_assist); GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer); diff --git a/addons/atragmx/functions/fnc_cycle_gun_list.sqf b/addons/atragmx/functions/fnc_cycle_gun_list.sqf new file mode 100644 index 0000000000..3d4bef70c1 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_gun_list.sqf @@ -0,0 +1,18 @@ +/* + * Author: Ruthberg + * Cycles through the gun list + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_scope_unit + * + * Public: No + */ +#include "script_component.hpp" + +[(GVAR(currentGun) + (count GVAR(gunList)) + _this) % (count GVAR(gunList)), true] call FUNC(change_gun); diff --git a/addons/atragmx/functions/fnc_cycle_image_size_units.sqf b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf new file mode 100644 index 0000000000..d78b13731c --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_image_size_units.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Cycles through the image size units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_image_size_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(rangeAssistImageSizeUnit) = (GVAR(rangeAssistImageSizeUnit) + 1) % (count GVAR(rangeAssistImageSizeUnits)); +ctrlSetText [7015, GVAR(rangeAssistImageSizeUnits) select GVAR(rangeAssistImageSizeUnit)]; diff --git a/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf new file mode 100644 index 0000000000..6afc105f62 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_num_ticks_units.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * Cycles through the num ticks units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_num_ticks_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(speedAssistNumTicksUnit) = (GVAR(speedAssistNumTicksUnit) + 1) % (count GVAR(speedAssistNumTicksUnits)); +ctrlSetText [8009, GVAR(speedAssistNumTicksUnits) select GVAR(speedAssistNumTicksUnit)]; +call FUNC(calculate_target_speed_assist); diff --git a/addons/atragmx/functions/fnc_cycle_target_size_units.sqf b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf new file mode 100644 index 0000000000..e055c8282c --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_target_size_units.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Cycles through the target size units + * + * Arguments: + * step + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_cycle_target_size_units + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(rangeAssistTargetSizeUnit) = (GVAR(rangeAssistTargetSizeUnit) + 1) % (count GVAR(rangeAssistTargetSizeUnits)); +ctrlSetText [7014, GVAR(rangeAssistTargetSizeUnits) select GVAR(rangeAssistTargetSizeUnit)]; diff --git a/addons/atragmx/functions/fnc_delete_gun.sqf b/addons/atragmx/functions/fnc_delete_gun.sqf index d16e1f84a0..be230da59a 100644 --- a/addons/atragmx/functions/fnc_delete_gun.sqf +++ b/addons/atragmx/functions/fnc_delete_gun.sqf @@ -20,10 +20,8 @@ _index = lbCurSel 6000; if (_index == -1) exitWith {}; -for "_i" from 0 to (count GVAR(currentGun)) - 1 do { - if ((GVAR(currentGun) select _i) > _index) then { - GVAR(currentGun) set [_i, (GVAR(currentGun) select _i) - 1]; - }; +if (GVAR(currentGun) > _index) then { + GVAR(currentGun) = GVAR(currentGun) - 1; }; GVAR(gunList) set [_index, 0]; diff --git a/addons/atragmx/functions/fnc_init.sqf b/addons/atragmx/functions/fnc_init.sqf index 8fda3570fa..881f65a6b0 100644 --- a/addons/atragmx/functions/fnc_init.sqf +++ b/addons/atragmx/functions/fnc_init.sqf @@ -9,7 +9,7 @@ * Nothing * * Example: - * call ace_atragmx_init + * call ace_atragmx_fnc_init * * Public: No */ @@ -26,7 +26,7 @@ GVAR(rangeCardLastColumns) = ["Lead", "RemV", "RemE", "TmFlt"]; GVAR(rangeCardCurrentColumn) = 3; GVAR(rangeCardData) = []; -GVAR(GVAR(rangeAssistTargetSizeUnit)s) = ["in", "ft", "cm", "m"]; +GVAR(rangeAssistTargetSizeUnits) = ["in", "ft", "cm", "m"]; GVAR(rangeAssistTargetSizeUnit) = 2; GVAR(rangeAssistImageSizeUnits) = ["MIL", "TMOA", "IOA"]; GVAR(rangeAssistImageSizeUnit) = 0; @@ -41,28 +41,37 @@ GVAR(currentGun) = 0; GVAR(currentTarget) = 0; GVAR(currentScopeUnit) = 0; +GVAR(atmosphereModeTBH) = true; +GVAR(altitude) = 0; GVAR(temperature) = 15; GVAR(barometricPressure) = 1013.25; GVAR(relativeHumidity) = 0.5; -GVAR(windSpeed) = [0, 0, 0, 0]; +GVAR(latitude) = [38, 38, 38, 38]; +GVAR(directionOfFire) = [0, 0, 0, 0]; +GVAR(windSpeed1) = [0, 0, 0, 0]; +GVAR(windSpeed2) = [0, 0, 0, 0]; GVAR(windDirection) = [12, 12, 12, 12]; GVAR(inclinationAngle) = [0, 0, 0, 0]; GVAR(targetSpeed) = [0, 0, 0, 0]; GVAR(targetRange) = [0, 0, 0, 0]; +GVAR(showWind2) = false; GVAR(elevationOutput) = [0, 0, 0, 0]; -GVAR(windageOutput) = [0, 0, 0, 0]; +GVAR(windage1Output) = [0, 0, 0, 0]; +GVAR(windage2Output) = [0, 0, 0, 0]; GVAR(leadOutput) = [0, 0, 0, 0]; GVAR(tofOutput) = [0, 0, 0, 0]; GVAR(velocityOutput) = [0, 0, 0, 0]; GVAR(showMainPage) = true; GVAR(showAddNewGun) = false; +GVAR(showAtmoEnvData) = false; +GVAR(showGunAmmoData) = false; GVAR(showGunList) = false; GVAR(showRangeCard) = false; GVAR(showRangeCardSetup) = false; +GVAR(showTargetData) = false; GVAR(showTargetRangeAssist) = false; GVAR(showTargetSpeedAssist) = false; GVAR(showTargetSpeedAssistTimer) = false; - diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 7d364cbdfc..aa77fc8111 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -15,64 +15,95 @@ */ #include "script_component.hpp" -GVAR(temperature) = parseNumber(ctrlText 200); -GVAR(barometricPressure) = 0 max parseNumber(ctrlText 210); -GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 220) min 100) / 100; - -GVAR(windSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 300)) min 50]; -GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 310)) min 12]; -GVAR(inclinationAngle) set [GVAR(currentTarget), -60 max parseNumber(ctrlText 320) min 60]; -GVAR(targetSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 330)) min 50]; -GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 340)) min 4000]; - -private ["_boreHeight", "_bulletMass", "_airFriction", "_muzzleVelocity"]; -_boreHeight = parseNumber(ctrlText 100); -_bulletMass = parseNumber(ctrlText 110); -if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { - _airFriction = 0.1 max parseNumber(ctrlText 120) min 2; -} else { - _airFriction = parseNumber(ctrlText 120) / -1000; +GVAR(altitude) = -1000 max parseNumber(ctrlText 130030) min 20000; +GVAR(temperature) = -50 max parseNumber(ctrlText 130040) min 160; +GVAR(barometricPressure) = 0 max parseNumber(ctrlText 130050) min 1350; +GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 130060) min 100) / 100; +if (GVAR(currentUnit) == 1) then { + GVAR(altitude) = GVAR(altitude) * 0.3048; + GVAR(temperature) = (GVAR(temperature) - 32) / 1.8; + GVAR(barometricPressure) = GVAR(barometricPressure) * 33.86389; }; -_muzzleVelocity = parseNumber(ctrlText 130); -if (GVAR(currentUnit) == 1) then -{ + +private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; +GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90]; +GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359]; +GVAR(windSpeed1) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140020)) min 50]; +GVAR(windSpeed2) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140021)) min 50]; +GVAR(windDirection) set [GVAR(currentTarget), 1 max Round(parseNumber(ctrlText 140030)) min 12]; +_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +_inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; +if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)) then { + GVAR(inclinationAngle) set [GVAR(currentTarget), _inclinationAngleDegree]; +} else { + if (_inclinationAngleCosine != Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100) then { + GVAR(inclinationAngle) set [GVAR(currentTarget), acos(_inclinationAngleCosine)]; + }; +}; +GVAR(targetSpeed) set [GVAR(currentTarget), -50 max abs(parseNumber(ctrlText 140050)) min 50]; +GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140060)) min 4000]; +if (GVAR(currentUnit) != 2) then { + GVAR(windSpeed1) set [GVAR(currentTarget), (GVAR(windSpeed1) select GVAR(currentTarget)) * 0.44704]; + GVAR(windSpeed2) set [GVAR(currentTarget), (GVAR(windSpeed2) select GVAR(currentTarget)) * 0.44704]; + GVAR(targetSpeed) set [GVAR(currentTarget), (GVAR(targetSpeed) select GVAR(currentTarget)) * 0.44704]; +}; +if (GVAR(currentUnit) == 1) then { + GVAR(targetRange) set [GVAR(currentTarget), (GVAR(targetRange) select GVAR(currentTarget)) * 0.9144]; +}; + +private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"]; +_boreHeight = parseNumber(ctrlText 120000); +_bulletMass = parseNumber(ctrlText 120010); +_bulletDiameter = parseNumber(ctrlText 120020); +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { + _airFriction = 0.1 max parseNumber(ctrlText 120030) min 2; +} else { + _airFriction = parseNumber(ctrlText 120030) / -1000; +}; +_rifleTwist = parseNumber(ctrlText 120040); +_muzzleVelocity = parseNumber(ctrlText 120050); +_zeroRange = parseNumber (ctrlText 120060); +if (GVAR(currentUnit) != 2) then { _boreHeight = _boreHeight * 2.54; _bulletMass = _bulletMass * 0.06479891; + _bulletDiameter = _bulletDiameter * 10 * 2.54; + _rifleTwist = _rifleTwist * 2.54; _muzzleVelocity = _muzzleVelocity / 3.2808399; }; +if (GVAR(currentUnit) == 1) then { + _zeroRange = _zeroRange / 1.0936133; +}; _boreHeight = 0.1 max _boreHeight min 10; _bulletMass = 1 max _bulletMass min 100; +_bulletDiameter = 1 max _bulletDiameter min 25; _muzzleVelocity = 100 max _muzzleVelocity min 1400; - +_zeroRange = 0 max _zeroRange min 1000; GVAR(workingMemory) set [5, _boreHeight]; GVAR(workingMemory) set [12, _bulletMass]; +GVAR(workingMemory) set [13, _bulletDiameter]; +GVAR(workingMemory) set [14, _rifleTwist]; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { GVAR(workingMemory) set [15, _airFriction]; } else { GVAR(workingMemory) set [4, _airFriction]; }; GVAR(workingMemory) set [1, _muzzleVelocity]; +GVAR(workingMemory) set [2, _zeroRange]; private ["_elevationCur", "_windageCur", "_elevationScopeStep", "_windageScopeStep"]; _elevationCur = parseNumber(ctrlText 402); _windageCur = parseNumber(ctrlText 412); -switch (GVAR(currentScopeUnit)) do -{ - case 0: - { +switch (GVAR(currentScopeUnit)) do { + case 0: { _elevationCur = _elevationCur * 3.38; _windageCur = _windageCur * 3.38; }; - - case 2: - { + case 2: { _elevationCur = _elevationCur / 1.047; _windageCur = _windageCur / 1.047; }; - - case 3: - { + case 3: { _elevationScopeStep = (GVAR(workingMemory) select 7); _windageScopeStep = (GVAR(workingMemory) select 8); @@ -85,5 +116,10 @@ GVAR(workingMemory) set [10, _elevationCur]; GVAR(workingMemory) set [11, _windageCur]; [] call FUNC(update_gun); +[] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); +[] call FUNC(update_atmo_env_data); [] call FUNC(update_target); +[] call FUNC(update_target_data); + +[] call FUNC(store_user_data); diff --git a/addons/atragmx/functions/fnc_restore_atmo_default.sqf b/addons/atragmx/functions/fnc_restore_atmo_default.sqf new file mode 100644 index 0000000000..08b7c56d86 --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_atmo_default.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Restores the atmospheric data defaults + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_restore_atmo_default + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(atmosphereModeTBH) = true; +GVAR(altitude) = 0; +GVAR(temperature) = 15; +GVAR(barometricPressure) = 1013.25; +GVAR(relativeHumidity) = 0.5; + +[] call FUNC(update_atmo_selection); +[] call FUNC(update_atmosphere); diff --git a/addons/atragmx/functions/fnc_restore_user_data.sqf b/addons/atragmx/functions/fnc_restore_user_data.sqf new file mode 100644 index 0000000000..6fddc4bed5 --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_user_data.sqf @@ -0,0 +1,37 @@ +/* + * Author: Ruthberg + * Reads user data from profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_restore_user_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(currentUnit) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentUnit", 2]) min 2; +[profileNamespace getVariable ["ACE_ATragMX_currentGun", 0], false] call FUNC(change_gun); +GVAR(currentTarget) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentTarget", 0]) min 3; +GVAR(currentScopeUnit) = 0 max (profileNamespace getVariable ["ACE_ATragMX_currentScopeUnit", 0]) min 3; + +GVAR(atmosphereModeTBH) = profileNamespace getVariable ["ACE_ATragMX_atmosphereModeTBH", true]; +GVAR(altitude) = -1000 max (profileNamespace getVariable ["ACE_ATragMX_altitude", 0]) min 20000; +GVAR(temperature) = -50 max (profileNamespace getVariable ["ACE_ATragMX_temperature", 15]) min 160; +GVAR(barometricPressure) = 340 max (profileNamespace getVariable ["ACE_ATragMX_barometricPressure", 1013.25]) min 1350; +GVAR(relativeHumidity) = 0 max (profileNamespace getVariable ["ACE_ATragMX_relativeHumidity", 0.5]) min 1; + +GVAR(showWind2) = profileNamespace getVariable ["ACE_ATragMX_showWind2", false]; +GVAR(latitude) = profileNamespace getVariable ["ACE_ATragMX_latitude", [38, 38, 38, 38]]; +GVAR(directionOfFire) = profileNamespace getVariable ["ACE_ATragMX_directionOfFire", [0, 0, 0, 0]]; +GVAR(windSpeed1) = profileNamespace getVariable ["ACE_ATragMX_windSpeed1", [0, 0, 0, 0]]; +GVAR(windSpeed2) = profileNamespace getVariable ["ACE_ATragMX_windSpeed2", [0, 0, 0, 0]]; +GVAR(windDirection) = profileNamespace getVariable ["ACE_ATragMX_windDirection", [12, 12, 12, 12]]; +GVAR(inclinationAngle) = profileNamespace getVariable ["ACE_ATragMX_inclinationAngle", [0, 0, 0, 0]]; +GVAR(targetSpeed) = profileNamespace getVariable ["ACE_ATragMX_targetSpeed", [0, 0, 0, 0]]; +GVAR(targetRange) = profileNamespace getVariable ["ACE_ATragMX_targetRange", [0, 0, 0, 0]]; diff --git a/addons/atragmx/functions/fnc_show_atmo_env_data.sqf b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf new file mode 100644 index 0000000000..56f75f7844 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_atmo_env_data.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * Shows/Hides the atmosphere and environmental data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showAtmoEnvData) = _this; + +{ctrlShow [_x, _this]} forEach [13000, 13001, 13002, 13003, 130030, 13004, 130040, 13005, 130050, 13006, 130060, 13007, 13008, 13009, 13010, 13011]; + +if (_this) then { + [] call FUNC(update_atmo_selection); + [] call FUNC(update_atmo_env_data); +}; diff --git a/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf new file mode 100644 index 0000000000..06ab20b3b7 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_gun_ammo_data.sqf @@ -0,0 +1,24 @@ +/* + * Author: Ruthberg + * Shows/Hides the gun ammo data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showGunAmmoData) = _this; + +{ctrlShow [_x, _this]} forEach [12000, 120000, 12001, 120010, 12002, 120020, 12003, 120030, 12004, 120040, 12005, 120050, 12006, 120060, 12007, 12008, 12009, 12010, 12011]; + +if (_this) then { + [] call FUNC(update_gun_ammo_data); +}; diff --git a/addons/atragmx/functions/fnc_show_gun_list.sqf b/addons/atragmx/functions/fnc_show_gun_list.sqf index e51aaba13b..5e1cdfa453 100644 --- a/addons/atragmx/functions/fnc_show_gun_list.sqf +++ b/addons/atragmx/functions/fnc_show_gun_list.sqf @@ -20,7 +20,7 @@ GVAR(showGunList) = _this; {ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007]; if (_this) then { - ctrlSetFocus (_dsp displayCtrl 6002); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 6002); lbSetCurSel [6000, GVAR(currentGun)]; }; diff --git a/addons/atragmx/functions/fnc_show_main_page.sqf b/addons/atragmx/functions/fnc_show_main_page.sqf index 941c7559c8..607527a18e 100644 --- a/addons/atragmx/functions/fnc_show_main_page.sqf +++ b/addons/atragmx/functions/fnc_show_main_page.sqf @@ -17,5 +17,13 @@ GVAR(showMainPage) = _this; -{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420, +{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 23, 230, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420, 500, 501, 502, 503, 600, 601, 602, 603, 1000, 2000, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; + +if (_this) then { + if (GVAR(atmosphereModeTBH)) then { + {ctrlShow [_x, false]} forEach [23, 230]; + } else { + {ctrlShow [_x, false]} forEach [21, 210, 22, 220]; + }; +}; diff --git a/addons/atragmx/functions/fnc_show_range_card_setup.sqf b/addons/atragmx/functions/fnc_show_range_card_setup.sqf index e9afe41cc5..3d44c14b53 100644 --- a/addons/atragmx/functions/fnc_show_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_show_range_card_setup.sqf @@ -20,7 +20,7 @@ GVAR(showRangeCardSetup) = _this; {ctrlShow [_x, _this]} forEach [10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009]; if (_this) then { - ctrlSetFocus (_dsp displayCtrl 10006); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 10006); ctrlSetText [10003, Str(Round(GVAR(rangeCardStartRange)))]; ctrlSetText [10004, Str(Round(GVAR(rangeCardEndRange)))]; diff --git a/addons/atragmx/functions/fnc_show_target_data.sqf b/addons/atragmx/functions/fnc_show_target_data.sqf new file mode 100644 index 0000000000..4e696ae331 --- /dev/null +++ b/addons/atragmx/functions/fnc_show_target_data.sqf @@ -0,0 +1,24 @@ +/* + * Author: Ruthberg + * Shows/Hides the target data controls + * + * Arguments: + * visible - + * + * Return Value: + * Nothing + * + * Example: + * false call ace_atragmx_fnc_show_target_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(showTargetData) = _this; + +{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 14006, 140060, 14007, 14008, 14009, 14010, 14011]; + +if (_this) then { + [] call FUNC(update_target_data); +}; diff --git a/addons/atragmx/functions/fnc_show_target_range_assist.sqf b/addons/atragmx/functions/fnc_show_target_range_assist.sqf index e3ca0a2626..4f46932a0b 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -20,16 +20,14 @@ GVAR(showTargetRangeAssist) = _this; {ctrlShow [_x, _this]} forEach [7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020]; if (_this) then { - ctrlSetFocus (_dsp displayCtrl 7018); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 7018); ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; - if (GVAR(currentUnit) != 2) then - { + if (GVAR(currentUnit) == 1) then { ctrlSetText [7016, "Yards"]; - } else - { + } else { ctrlSetText [7016, "Meters"]; }; }; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf index 90425e26db..2e66b5ea7b 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -20,23 +20,19 @@ GVAR(showTargetSpeedAssist) = _this; {ctrlShow [_x, _this]} forEach [8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015]; if (_this) then { - ctrlSetFocus (_dsp displayCtrl 8012); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 8012); ctrlSetText [8004, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; - if (GVAR(currentUnit) != 2) then - { + if (GVAR(currentUnit) == 1) then { ctrlSetText [8008, "Yards"]; - } else - { + } else { ctrlSetText [8008, "Meters"]; }; - if (GVAR(currentUnit) != 1) then - { + if (GVAR(currentUnit) == 2) then { ctrlSetText [8011, "m/s"]; - } else - { + } else { ctrlSetText [8011, "mph"]; }; }; diff --git a/addons/atragmx/functions/fnc_store_user_data.sqf b/addons/atragmx/functions/fnc_store_user_data.sqf new file mode 100644 index 0000000000..66207444d2 --- /dev/null +++ b/addons/atragmx/functions/fnc_store_user_data.sqf @@ -0,0 +1,39 @@ +/* + * Author: Ruthberg + * Saves user data into profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_store_user_data + * + * Public: No + */ +#include "script_component.hpp" + +profileNamespace setVariable ["ACE_ATragMX_profileNamespaceVersion", ATRAGMX_PROFILE_NAMESPACE_VERSION]; + +profileNamespace setVariable ["ACE_ATragMX_currentUnit", GVAR(currentUnit)]; +profileNamespace setVariable ["ACE_ATragMX_currentGun", GVAR(currentGun)]; +profileNamespace setVariable ["ACE_ATragMX_currentTarget", GVAR(currentTarget)]; +profileNamespace setVariable ["ACE_ATragMX_currentScopeUnit", GVAR(currentScopeUnit)]; + +profileNamespace setVariable ["ACE_ATragMX_atmosphereModeTBH", GVAR(atmosphereModeTBH)]; +profileNamespace setVariable ["ACE_ATragMX_altitude", GVAR(altitude)]; +profileNamespace setVariable ["ACE_ATragMX_temperature", GVAR(temperature)]; +profileNamespace setVariable ["ACE_ATragMX_barometricPressure", GVAR(barometricPressure)]; +profileNamespace setVariable ["ACE_ATragMX_relativeHumidity", GVAR(relativeHumidity)]; + +profileNamespace setVariable ["ACE_ATragMX_showWind2", GVAR(showWind2)]; +profileNamespace setVariable ["latitude", GVAR(latitude)]; +profileNamespace setVariable ["directionOfFire", GVAR(directionOfFire)]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed1", GVAR(windSpeed1)]; +profileNamespace setVariable ["ACE_ATragMX_windSpeed2", GVAR(windSpeed2)]; +profileNamespace setVariable ["ACE_ATragMX_windDirection", GVAR(windDirection)]; +profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", GVAR(inclinationAngle)]; +profileNamespace setVariable ["ACE_ATragMX_targetSpeed", GVAR(targetSpeed)]; +profileNamespace setVariable ["ACE_ATragMX_targetRange", GVAR(targetRange)]; diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index d8414ba692..6e47461cf3 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -20,7 +20,7 @@ if !(ctrlVisible 9000) then { false call FUNC(show_target_speed_assist); true call FUNC(show_target_speed_assist_timer); - ctrlSetFocus (_dsp displayCtrl 9002); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 9002); [{ private ["_args", "_startTime"]; diff --git a/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf new file mode 100644 index 0000000000..ce761c2216 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_atmo_env_data.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Toggles the atmospheric data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 13000) then { + false call FUNC(show_atmo_env_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_atmo_env_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf new file mode 100644 index 0000000000..0fd4b913b8 --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_gun_ammo_data.sqf @@ -0,0 +1,29 @@ +/* + * Author: Ruthberg + * Toggles the gun ammo data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 12000) then { + false call FUNC(show_gun_ammo_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(update_zero_range); + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_gun_ammo_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_gun_list.sqf b/addons/atragmx/functions/fnc_toggle_gun_list.sqf index cd4acb1f76..714e6e848d 100644 --- a/addons/atragmx/functions/fnc_toggle_gun_list.sqf +++ b/addons/atragmx/functions/fnc_toggle_gun_list.sqf @@ -3,28 +3,26 @@ * Toggles the gun list screen on/off * * Arguments: - * Nothing + * change gun? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_gun_list + * false call ace_atragmx_fnc_toggle_gun_list * * Public: No */ #include "script_component.hpp" -if (ctrlVisible 6000) then -{ +if (ctrlVisible 6000) then { false call FUNC(show_gun_list); true call FUNC(show_main_page); if (_this) then { - (lbCurSel 6000) call FUNC(change_gun); + [lbCurSel 6000, true] call FUNC(change_gun); }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_gun_list); }; diff --git a/addons/atragmx/functions/fnc_toggle_range_card.sqf b/addons/atragmx/functions/fnc_toggle_range_card.sqf index 6a75ea5445..059bc7e40b 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card.sqf @@ -15,16 +15,14 @@ */ #include "script_component.hpp" -if (ctrlVisible 5006) then -{ +if (ctrlVisible 5006) then { false call FUNC(show_range_card); true call FUNC(show_main_page); -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_range_card); - ctrlSetFocus (_dsp displayCtrl 5001); + ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 5001); [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); diff --git a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf index 71da18349b..738a154d17 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card_setup.sqf @@ -3,25 +3,23 @@ * Toggles the range card setup screen on/off * * Arguments: - * Apply new range card settings + * Apply new range card settings * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_range_card_setup + * 1 call ace_atragmx_fnc_toggle_range_card_setup * * Public: No */ #include "script_component.hpp" -if (ctrlVisible 10000) then -{ +if (ctrlVisible 10000) then { false call FUNC(show_range_card_setup); true call FUNC(show_range_card); - if (_this == 1) then - { + if (_this == 1) then { GVAR(rangeCardStartRange) = 0 max Round(parseNumber(ctrlText 10003)) min 3000; GVAR(rangeCardEndRange) = 0 max Round(parseNumber(ctrlText 10004)) min 3000; GVAR(rangeCardIncrement) = 1 max Round(parseNumber(ctrlText 10005)) min 3000; @@ -29,8 +27,7 @@ if (ctrlVisible 10000) then [] call FUNC(calculate_range_card); [] call FUNC(update_range_card); }; -} else -{ +} else { false call FUNC(show_range_card); true call FUNC(show_range_card_setup); }; diff --git a/addons/atragmx/functions/fnc_toggle_target_data.sqf b/addons/atragmx/functions/fnc_toggle_target_data.sqf new file mode 100644 index 0000000000..90fefbf37e --- /dev/null +++ b/addons/atragmx/functions/fnc_toggle_target_data.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Toggles the target data screen on/off + * + * Arguments: + * Apply new data? + * + * Return Value: + * Nothing + * + * Example: + * 1 call ace_atragmx_fnc_toggle_target_data + * + * Public: No + */ +#include "script_component.hpp" + +if (ctrlVisible 14000) then { + false call FUNC(show_target_data); + true call FUNC(show_main_page); + + if (_this == 1) then { + call FUNC(calculate_target_solution); + }; +} else { + true call FUNC(show_target_data); + false call FUNC(show_main_page); +}; diff --git a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf index 04e9307ded..d13ef4fb2e 100644 --- a/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_range_assist.sqf @@ -3,30 +3,30 @@ * Toggles the target range assist screen on/off * * Arguments: - * Nothing + * update range? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_target_range_assist + * 1 call ace_atragmx_fnc_toggle_target_range_assist * * Public: No */ #include "script_component.hpp" -if (ctrlVisible 7000) then -{ +if (ctrlVisible 7000) then { false call FUNC(show_target_range_assist); true call FUNC(show_main_page); - if (_this == 1) then - { + if (_this == 1) then { ctrlSetText [320, Str(parseNumber(ctrlText 7012))]; + ctrlSetText [140040, Str(parseNumber(ctrlText 7012))]; ctrlSetText [340, Str(parseNumber(ctrlText 7013))]; + ctrlSetText [140060, Str(parseNumber(ctrlText 7013))]; + [] call FUNC(calculate_target_solution); }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_target_range_assist); }; diff --git a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf index 66ffaa5d07..5b88a6cfce 100644 --- a/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_toggle_target_speed_assist.sqf @@ -3,30 +3,33 @@ * Toggles the target speed assist screen on/off * * Arguments: - * Nothing + * update speed? * * Return Value: * Nothing * * Example: - * call ace_atragmx_fnc_toggle_target_speed_assist + * 1 call ace_atragmx_fnc_toggle_target_speed_assist * * Public: No */ #include "script_component.hpp" -if (ctrlVisible 8000) then -{ +if (ctrlVisible 8000) then { false call FUNC(show_target_speed_assist); true call FUNC(show_main_page); - if (_this == 1) then - { + if (_this == 1) then { [] call FUNC(calculate_target_speed_assist); - ctrlSetText [330, Str(parseNumber(ctrlText 8007))]; + private ["_targetSpeed"]; + _targetSpeed = parseNumber(ctrlText 8007); + if (_targetSpeed != 0) then { + ctrlSetText [330, Str(_targetSpeed)]; + ctrlSetText [140050, Str(_targetSpeed)]; + [] call FUNC(calculate_target_solution); + }; }; -} else -{ +} else { false call FUNC(show_main_page); true call FUNC(show_target_speed_assist); }; diff --git a/addons/atragmx/functions/fnc_update_atmo_env_data.sqf b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf new file mode 100644 index 0000000000..8dcbc89280 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_atmo_env_data.sqf @@ -0,0 +1,45 @@ +/* + * Author: Ruthberg + * Updates the atmospheric data fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_atmo_env_data + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13007); + +if (GVAR(currentUnit) != 1) then { + ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)]; +} else { + ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) != 1) then { + ctrlSetText [130050, Str(Round(GVAR(barometricPressure)))]; +} else { + ctrlSetText [130050, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; +}; +ctrlSetText [130060, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +if (GVAR(currentUnit) != 1) then { + ctrlSetText [130030, Str(Round(GVAR(altitude)))]; +} else { + ctrlSetText [130030, Str(Round(GVAR(altitude) * 3.2808399))]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [13003, "Altitude (m)"]; + ctrlSetText [13004, "temperature (C)"]; + ctrlSetText [13005, "Barom Pres (milibars)"]; +} else { + ctrlSetText [13003, "Altitude (ft)"]; + ctrlSetText [13004, "temperature (F)"]; + ctrlSetText [13005, "Barom Pres (in.merc.)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_atmo_selection.sqf b/addons/atragmx/functions/fnc_update_atmo_selection.sqf new file mode 100644 index 0000000000..18036178b4 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_atmo_selection.sqf @@ -0,0 +1,31 @@ +/* + * Author: Ruthberg + * Updates the atmospheric data input method + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_atmo_selection + * + * Public: No + */ +#include "script_component.hpp" + +((uiNamespace getVariable "ATragMX_Display") displayCtrl 13001) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 13002) ctrlEnable true; + +if (GVAR(atmosphereModeTBH)) then { + ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13002) ctrlEnable false; + {ctrlShow [_x, false]} forEach [13003, 130030]; + {ctrlShow [_x, true]} forEach [13005, 130050, 13006, 130060]; +} else { + ((uiNamespace getVariable "ATragMX_Display") displayCtrl 13001) ctrlEnable false; + {ctrlShow [_x, false]} forEach [13005, 130050, 13006, 130060]; + {ctrlShow [_x, true]} forEach [13003, 130030]; +}; + +[] call FUNC(update_atmo_env_data); diff --git a/addons/atragmx/functions/fnc_update_atmosphere.sqf b/addons/atragmx/functions/fnc_update_atmosphere.sqf index 68a60f72e9..fa555f50e7 100644 --- a/addons/atragmx/functions/fnc_update_atmosphere.sqf +++ b/addons/atragmx/functions/fnc_update_atmosphere.sqf @@ -15,10 +15,19 @@ */ #include "script_component.hpp" -ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; -if (GVAR(currentUnit) == 1) then { - ctrlSetText [210, Str(Round(GVAR(barometricPressure) * 100) / 100)]; +if (GVAR(currentUnit) != 1) then { + ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; } else { + ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) != 1) then { ctrlSetText [210, Str(Round(GVAR(barometricPressure)))]; +} else { + ctrlSetText [210, Str(Round(GVAR(barometricPressure) / 33.8638866667 * 100) / 100)]; }; ctrlSetText [220, Str(Round(GVAR(relativeHumidity) * 100 * 10) / 10)]; +if (GVAR(currentUnit) != 1) then { + ctrlSetText [230, Str(Round(GVAR(altitude)))]; +} else { + ctrlSetText [230, Str(Round(GVAR(altitude) * 3.2808399))]; +}; diff --git a/addons/atragmx/functions/fnc_update_gun.sqf b/addons/atragmx/functions/fnc_update_gun.sqf index 1e12439878..f3d173ba11 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -16,37 +16,29 @@ #include "script_component.hpp" ctrlSetText [1000, GVAR(workingMemory) select 0]; -if (GVAR(currentUnit) == 1) then -{ - ctrlSetText [ 100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; -} else -{ - ctrlSetText [ 100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; +} else { + ctrlSetText [100, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; }; -if (GVAR(currentUnit) == 1) then -{ - ctrlSetText [ 110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; -} else -{ - ctrlSetText [ 110, Str(Round(GVAR(workingMemory) select 12))]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [110, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; +} else { + ctrlSetText [110, Str(Round(GVAR(workingMemory) select 12))]; }; if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { - ctrlSetText [ 120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; + ctrlSetText [120, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; } else { - ctrlSetText [ 120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; + ctrlSetText [120, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; }; -if (GVAR(currentUnit) == 1) then -{ +if (GVAR(currentUnit) != 2) then { ctrlSetText [130, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; -} else -{ +} else { ctrlSetText [130, Str(Round(GVAR(workingMemory) select 1))]; }; -if (GVAR(currentUnit) == 2) then -{ +if (GVAR(currentUnit) != 1) then { ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; -} else -{ +} else { ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; }; diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf new file mode 100644 index 0000000000..3627197185 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -0,0 +1,74 @@ +/* + * Author: Ruthberg + * Updates the gun ammo data fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_gun_ammo_data + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 12008); + +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) / 2.54 * 100) / 100)]; +} else { + ctrlSetText [120000, Str(Round((GVAR(workingMemory) select 5) * 100) / 100)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120010, Str(Round((GVAR(workingMemory) select 12) * 15.4323584))]; +} else { + ctrlSetText [120010, Str(Round(GVAR(workingMemory) select 12))]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; +} else { + ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) * 1000) / 1000)]; +}; +if ((missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) && (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false])) then { + ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; +} else { + ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 4) * -1000 * 1000) / 1000)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) / 2.54 * 10) / 10)]; +} else { + ctrlSetText [120040, Str(Round((GVAR(workingMemory) select 14) * 100) / 100)]; +}; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [120050, Str(Round((GVAR(workingMemory) select 1) * 3.2808399))]; +} else { + ctrlSetText [120050, Str(Round(GVAR(workingMemory) select 1))]; +}; +if (GVAR(currentUnit) == 2) then { + ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))]; +} else { + ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [12000, "Bore (cm)"]; + ctrlSetText [12001, "Bullet Weight (grams)"]; + ctrlSetText [12002, "Bullet Diam (cm)"]; + ctrlSetText [12004, "Rifle Twist (cm/trn)"]; + ctrlSetText [12005, "Muzzle Velocity (m/s)"]; +} else { + ctrlSetText [12000, "Bore (inches)"]; + ctrlSetText [12001, "Bullet Weight (grains)"]; + ctrlSetText [12002, "Bullet Diam (inches)"]; + ctrlSetText [12004, "Rifle Twist (inches/trn)"]; + ctrlSetText [12005, "Muzzle Velocity (feet/sec)"]; +}; + +if (GVAR(currentUnit) == 1) then { + ctrlSetText [12006, "Zero Range (yards)"]; +} else { + ctrlSetText [12006, "Zero Range (meters)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_inclination_angle.sqf b/addons/atragmx/functions/fnc_update_inclination_angle.sqf new file mode 100644 index 0000000000..ea5599bf2d --- /dev/null +++ b/addons/atragmx/functions/fnc_update_inclination_angle.sqf @@ -0,0 +1,26 @@ +/* + * Author: Ruthberg + * Updates the inclination angle input fields + * + * Arguments: + * Reference input field ID + * + * Return Value: + * Nothing + * + * Example: + * 0 call ace_atragmx_fnc_update_inclination_angle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_inclinationAngleCosine", "_inclinationAngleDegree"]; +_inclinationAngleCosine = 0.5 max parseNumber(ctrlText 140041) min 1; +_inclinationAngleDegree = -60 max parseNumber(ctrlText 140040) min 60; + +if (_this == 0) then { + ctrlSetText [140040, Str(round(acos(_inclinationAngleCosine)))]; +} else { + ctrlSetText [140041, Str(round(cos(_inclinationAngleDegree) * 100) / 100)]; +}; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index 358a74ce5d..0c49b6f794 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -15,16 +15,18 @@ */ #include "script_component.hpp" -private ["_range", "_elevation", "_windage", "_elevationScopeStep", "_windageScopeStep", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; +private ["_range", "_elevation", "_windage1", "_windage2", "_elevationScopeStep", "_windageScopeStep", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; _lastColumnOutput = ""; -ctrlSetText [5006, (GVAR(rangeCardLastColumns) select GVAR(rangeCardCurrentColumn))]; +if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then { + ctrlSetText [5006, "Wind2"]; +} else { + ctrlSetText [5006, (GVAR(rangeCardLastColumns) select GVAR(rangeCardCurrentColumn))]; +}; -if (GVAR(currentUnit) != 2) then -{ +if (GVAR(currentUnit) == 1) then { ctrlSetText [5003, "Yards"]; -} else -{ +} else { ctrlSetText [5003, "Meters"]; }; @@ -33,69 +35,61 @@ lnbClear 5007; { _range = _x select 0; _elevation = _x select 1; - _windage = _x select 2; + _windage1 = (_x select 2) select 0; + _windage2 = (_x select 2) select 1; _lead = _x select 3; _TOF = _x select 4; _velocity = _x select 5; _kineticEnergy = _x select 6; - switch (GVAR(currentScopeUnit)) do - { - case 0: - { + switch (GVAR(currentScopeUnit)) do { + case 0: { _elevation = _elevation / 3.38; - _windage = _windage / 3.38; + _windage1 = _windage1 / 3.38; + _windage2 = _windage2 / 3.38; }; - - case 2: - { + case 2: { _elevation = _elevation * 1.047; - _windage = _windage * 1.047; + _windage1 = _windage1 * 1.047; + _windage2 = _windage2 * 1.047; }; - - case 3: - { + case 3: { _elevationScopeStep = (GVAR(workingMemory) select 7); _windageScopeStep = (GVAR(workingMemory) select 8); _elevation = Round(_elevation / _elevationScopeStep); - _windage = Round(_windage / _windageScopeStep); + _windage1 = Round(_windage1 / _windageScopeStep); + _windage2 = Round(_windage2 / _windageScopeStep); }; }; _elevationOutput = Str(Round(_elevation * 100) / 100); - _windageOutput = Str(Round(_windage * 100) / 100); + _windageOutput = Str(Round(_windage1 * 100) / 100); _rangeOutput = Str(_range); - if (_velocity < 340.29) then - { + if (_velocity < 340.29) then { _rangeOutput = _rangeOutput + "*"; }; - if (GVAR(currentUnit) == 1) then - { + if (GVAR(currentUnit) == 1) then { _velocity = _velocity * 3.2808399; }; - switch (GVAR(rangeCardCurrentColumn)) do - { - case 0: - { - _lastColumnOutput = Str(Round(_lead * 100) / 100); + switch (GVAR(rangeCardCurrentColumn)) do { + case 0: { + if (GVAR(showWind2)) then { + _lastColumnOutput = Str(Round(_windage2 * 100) / 100); + } else { + _lastColumnOutput = Str(Round(_lead * 100) / 100); + }; }; - - case 1: - { + case 1: { _lastColumnOutput = Str(Round(_velocity)); }; - - case 2: - { + case 2: { _lastColumnOutput = Str(Round(_kineticEnergy)); }; - - case 3: - { + case 3: { _lastColumnOutput = Str(Round(_TOF * 100) / 100); } }; diff --git a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf index 1d5add83db..1dc534ce4b 100644 --- a/addons/atragmx/functions/fnc_update_relative_click_memory.sqf +++ b/addons/atragmx/functions/fnc_update_relative_click_memory.sqf @@ -16,6 +16,6 @@ #include "script_component.hpp" GVAR(workingMemory) set [10, (GVAR(elevationOutput) select GVAR(currentTarget))]; -GVAR(workingMemory) set [11, (GVAR(windageOutput) select GVAR(currentTarget))]; +GVAR(workingMemory) set [11, (GVAR(windage1Output) select GVAR(currentTarget))]; [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_update_result.sqf b/addons/atragmx/functions/fnc_update_result.sqf index addd1034b2..a86170fd45 100644 --- a/addons/atragmx/functions/fnc_update_result.sqf +++ b/addons/atragmx/functions/fnc_update_result.sqf @@ -15,9 +15,11 @@ */ #include "script_component.hpp" -private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"]; -_elevationAbs = (GVAR(elevationOutput) select GVAR(currentTarget)); -_windageAbs = (GVAR(windageOutput) select GVAR(currentTarget)); +private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_wind2", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"]; +_elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget); +_windageAbs = GVAR(windage1Output) select GVAR(currentTarget); + +_wind2 = GVAR(windage2Output) select GVAR(currentTarget); _elevationCur = GVAR(workingMemory) select 10; _windageCur = GVAR(workingMemory) select 11; @@ -25,42 +27,42 @@ _windageCur = GVAR(workingMemory) select 11; _elevationRel = _elevationAbs - _elevationCur; _windageRel = _windageAbs - _windageCur; -_lead = (GVAR(leadOutput) select GVAR(currentTarget)); +_lead = GVAR(leadOutput) select GVAR(currentTarget); -switch (GVAR(currentScopeUnit)) do -{ - case 0: - { +switch (GVAR(currentScopeUnit)) do { + case 0: { _elevationAbs = _elevationAbs / 3.38; _windageAbs = _windageAbs / 3.38; + _wind2 = _wind2 / 3.38; + _elevationRel = _elevationRel / 3.38; _windageRel = _windageRel / 3.38; _elevationCur = _elevationCur / 3.38; _windageCur = _windageCur / 3.38; }; - - case 2: - { + case 2: { _elevationAbs = _elevationAbs * 1.047; _windageAbs = _windageAbs * 1.047; + _wind2 = _wind2 / 1.047; + _elevationRel = _elevationRel * 1.047; _windageRel = _windageRel * 1.047; _elevationCur = _elevationCur * 1.047; _windageCur = _windageCur * 1.047; }; - - case 3: - { + case 3: { _elevationScopeStep = (GVAR(workingMemory) select 7); _windageScopeStep = (GVAR(workingMemory) select 8); _elevationAbs = Round(_elevationAbs / _elevationScopeStep); _windageAbs = Round(_windageAbs / _windageScopeStep); + _wind2 = Round(_wind2 / _windageScopeStep); + _elevationRel = Round(_elevationRel / _elevationScopeStep); _windageRel = Round(_windageRel / _windageScopeStep); @@ -69,6 +71,12 @@ switch (GVAR(currentScopeUnit)) do }; }; +if (GVAR(showWind2)) then { + ctrlSetText [42, "Wind2"]; +} else { + ctrlSetText [42, "Lead"]; +}; + ctrlSetText [400, Str(Round(_elevationAbs * 100) / 100)]; ctrlSetText [401, Str(Round(_elevationRel * 100) / 100)]; ctrlSetText [402, Str(Round(_elevationCur * 100) / 100)]; @@ -77,4 +85,8 @@ ctrlSetText [410, Str(Round(_windageAbs * 100) / 100)]; ctrlSetText [411, Str(Round(_windageRel * 100) / 100)]; ctrlSetText [412, Str(Round(_windageCur * 100) / 100)]; -ctrlSetText [420, Str(Round(_lead * 100) / 100)]; +if (GVAR(showWind2)) then { + ctrlSetText [420, Str(Round(_wind2 * 100) / 100)]; +} else { + ctrlSetText [420, Str(Round(_lead * 100) / 100)]; +}; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index 18d7a72cd2..dab62e099d 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -15,23 +15,28 @@ */ #include "script_component.hpp" -if (!isNil QGVAR(windSpeed)) then -{ - ctrlSetText [300, Str(Round((GVAR(windSpeed) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(showWind2)) then { + if (GVAR(currentUnit) != 2) then { + ctrlSetText [300, format["%1/%2", Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629), Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629)]]; + } else { + ctrlSetText [300, format["%1/%2", Round(GVAR(windSpeed1) select GVAR(currentTarget)), Round(GVAR(windSpeed2) select GVAR(currentTarget))]]; + }; +} else { + if (GVAR(currentUnit) != 2) then { + ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + } else { + ctrlSetText [300, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + }; }; -if (!isNil QGVAR(windDirection)) then -{ - ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; -}; -if (!isNil QGVAR(inclinationAngle)) then -{ - ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; -}; -if (!isNil QGVAR(targetSpeed)) then -{ +ctrlSetText [310, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [320, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { ctrlSetText [330, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; }; -if (!isNil QGVAR(targetRange)) then -{ +if (GVAR(currentUnit) == 1) then { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; +} else { ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; }; diff --git a/addons/atragmx/functions/fnc_update_target_data.sqf b/addons/atragmx/functions/fnc_update_target_data.sqf new file mode 100644 index 0000000000..733118d583 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -0,0 +1,53 @@ +/* + * Author: Ruthberg + * Updates all target column input fields + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_atragmx_fnc_update_target + * + * Public: No + */ +#include "script_component.hpp" + +ctrlSetText [140000, Str(Round((GVAR(latitude) select GVAR(currentTarget)) * 100) / 100)]; +ctrlSetText [140010, Str(Round((GVAR(directionOfFire) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; + ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { + ctrlSetText [140020, Str(Round((GVAR(windSpeed1) select GVAR(currentTarget)) * 100) / 100)]; + ctrlSetText [140021, Str(Round((GVAR(windSpeed2) select GVAR(currentTarget)) * 100) / 100)]; +}; +ctrlSetText [140030, Str(Round((GVAR(windDirection) select GVAR(currentTarget))))]; +ctrlSetText [140040, Str(Round((GVAR(inclinationAngle) select GVAR(currentTarget))))]; +ctrlSetText [140041, Str(Round(cos(GVAR(inclinationAngle) select GVAR(currentTarget)) * 100) / 100)]; +if (GVAR(currentUnit) != 2) then { + ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 2.23693629 * 100) / 100)]; +} else { + ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)]; +}; +if (GVAR(currentUnit) == 1) then { + ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; +} else { + ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; +}; + +if (GVAR(currentUnit) == 2) then { + ctrlSetText [14002, "Wind Speed (m/s)"]; + ctrlSetText [14005, "Target Speed (m/s)"]; +} else { + ctrlSetText [14002, "Wind Speed (mph)"]; + ctrlSetText [14005, "Target Speed (mph)"]; +}; + +if (GVAR(currentUnit) == 1) then { + ctrlSetText [14006, "Target Range (yards)"]; +} else { + ctrlSetText [14006, "Target Range (meters)"]; +}; diff --git a/addons/atragmx/functions/fnc_update_target_selection.sqf b/addons/atragmx/functions/fnc_update_target_selection.sqf index 476c22d658..d63f84a90c 100644 --- a/addons/atragmx/functions/fnc_update_target_selection.sqf +++ b/addons/atragmx/functions/fnc_update_target_selection.sqf @@ -15,13 +15,13 @@ */ #include "script_component.hpp" -(_dsp displayCtrl 500) ctrlEnable true; -(_dsp displayCtrl 501) ctrlEnable true; -(_dsp displayCtrl 502) ctrlEnable true; -(_dsp displayCtrl 503) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 500) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 501) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 502) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 503) ctrlEnable true; -(_dsp displayCtrl 500 + GVAR(currentTarget)) ctrlEnable false; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 500 + GVAR(currentTarget)) ctrlEnable false; -ctrlSetFocus (_dsp displayCtrl 3000); +ctrlSetFocus ((uiNamespace getVariable "ATragMX_Display") displayCtrl 3000); [] call FUNC(update_unit_selection); diff --git a/addons/atragmx/functions/fnc_update_unit_selection.sqf b/addons/atragmx/functions/fnc_update_unit_selection.sqf index f6a51c5cfc..77d96bfdd6 100644 --- a/addons/atragmx/functions/fnc_update_unit_selection.sqf +++ b/addons/atragmx/functions/fnc_update_unit_selection.sqf @@ -15,13 +15,17 @@ */ #include "script_component.hpp" -(_dsp displayCtrl 600) ctrlEnable true; -(_dsp displayCtrl 601) ctrlEnable true; -(_dsp displayCtrl 602) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 600) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 601) ctrlEnable true; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 602) ctrlEnable true; -(_dsp displayCtrl 600 + GVAR(currentUnit)) ctrlEnable false; +((uiNamespace getVariable "ATragMX_Display") displayCtrl 600 + GVAR(currentUnit)) ctrlEnable false; [] call FUNC(update_gun); +[] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); +[] call FUNC(update_atmo_env_data); [] call FUNC(update_target); +[] call FUNC(update_target_data); + [] call FUNC(update_result); diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index e7f0c2c301..a5cab3755e 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -28,9 +28,8 @@ _dragModel = GVAR(workingMemory) select 16; _atmosphereModel = GVAR(workingMemory) select 17; private ["_zeroRange"]; -_zeroRange = Round(parseNumber(ctrlText 140)); -if (GVAR(currentUnit) != 2) then -{ +_zeroRange = Round(parseNumber(ctrlText 120060)); +if (GVAR(currentUnit) == 1) then { _zeroRange = _zeroRange / 1.0936133; }; if (_zeroRange < 10) exitWith { @@ -38,18 +37,14 @@ if (_zeroRange < 10) exitWith { GVAR(workingMemory) set [3, 0]; }; -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +private ["_altitude", "_temperature", "_barometricPressure", "_relativeHumidity"]; +_altitude = GVAR(altitude); _temperature = GVAR(temperature); _barometricPressure = GVAR(barometricPressure); _relativeHumidity = GVAR(relativeHumidity); -if (GVAR(currentUnit) == 1) then -{ - _temperature = (_temperature - 32) / 1.8; - _barometricPressure = _barometricPressure * 33.8638866667; -}; private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false] call FUNC(calculate_solution); +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0] call FUNC(calculate_solution); GVAR(workingMemory) set [2, _zeroRange]; GVAR(workingMemory) set [3, _scopeBaseAngle + (_result select 0) / 60]; diff --git a/addons/atragmx/script_component.hpp b/addons/atragmx/script_component.hpp index 014524c6dd..5290ba6a1f 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -11,4 +11,4 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define _dsp (uiNamespace getVariable "ATragMX_Display") +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.0 diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 3bb54eee16..45b1c0a336 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -62,6 +62,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; [{ + private "_startingPosition"; PARAMS_2(_args,_pfID); EXPLODE_7_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_tempObject,_onAtachText,_actionID); diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index d0930dc069..18071092d5 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -19,7 +19,7 @@ PARAMS_3(_attachToVehicle,_player,_args); -private ["_itemName", "_attachLimit", "_attachedObjects"]; +private ["_itemName", "_attachLimit", "_attachedObjects","_playerPos"]; _itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 99ac646013..a56936301d 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -18,7 +18,7 @@ PARAMS_2(_attachToVehicle,_unit); -private ["_attachedObjects", "_attachedItems"]; +private ["_attachedObjects", "_attachedItems", "_itemDisplayName"]; _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []]; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index 3594e10bd6..fb432146be 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -17,6 +17,7 @@ */ #include "script_component.hpp" +private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"]; PARAMS_2(_target,_player); _listed = []; diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 1894d68f23..3f5cf53994 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -13,11 +13,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; -_backpack = _this select 2; +PARAMS_3(_unit,_target,_backpack); // do cam shake if the target is the player if ([_target] call EFUNC(common,isPlayer)) then { diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index cf59b59f40..eb8e3a25c7 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -480,7 +480,7 @@ Caliber: .338 Norma Magnum Tracer IR-DIM<br />Rounds: 130<br />Used in: SPMG Kaliber: .338 Norma Magnum Leuchtspur IR-DIM<br />Schuss: 130<br />Verwendet für: SPMG Kaliber: .338 Norma Magnum Smugacz IR-DIM<br />Pociski: 130<br />Używany w: SPMG - Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartouches: 130<br />Utilisé dans: SPMG + Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartouches: 130<br />Utilisé dans: SPMG Calibre: .338 Norma Magnum trazadora IR-DIM<br />Balas: 130<br />Se usa en: SPMG @@ -805,31 +805,37 @@ 7.62mm 10Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 10rd (Mk319 Mod 0) 7.62mm 10Cps (Mk319 Mod 0) + Cargador de 10 balas de 7.62mm (Mk319 Mod 0) 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 + 7.62mm Mk319 Caliber: 7.62x51 mm NATO (Mk319 Mod 0)<br />Rounds: 10 Kaliber: 7,62x51 mm NATO (Mk319 Mod 0)<br />Pociski: 10 Calibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Cartouches: 10 + Calibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Balas: 10 7.62mm 20Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 20rd (Mk319 Mod 0) 7.62mm 20Cps (Mk319 Mod 0) + Cargador de 20 balas de 7.62mm (Mk319 Mod 0) 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 + 7.62mm Mk319 Caliber: 7.62x51 mm NATO (Mk319 Mod 0)<br />Rounds: 20 Kaliber: 7,62x51 mm NATO (Mk319 Mod 0)<br />Pociski: 20 Calibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Cartouches: 20 + Calibre: 7.62x51 mm NATO (Mk319 Mod 0)<br />Balas: 20 7.62mm 20Rnd Mag (Mk248 Mod 0) @@ -889,67 +895,91 @@ 6.5x47mm 30Rnd Mag (HPBT Scenar) 6.5x47mm 30Cps (HPBT Scenar) Cargador de 30 balas de 6.5x47mm (HPBT Scenar) + Magazynek 6,5x47 mm 30rd (HPBT Scenar) 6.5mm Scenar 6.5mm Scenar 6.5mm Scenar + 6,5mm Scenar Caliber: 6.5x47mm (HPBT Scenar)<br />Rounds: 30 Calibre: 6.5x47mm (HPBT Scenar)<br />Cartouches: 30 Calibre: 6.5x47mm (HPBT Scenar)<br />Balas: 30 + Kaliber: 6,5x47 mm (HPBT Scenar)<br />Pociski: 30 .338 10Rnd Mag (300gr Sierra MatchKing HPBT) .338 10 Cps (300gr Sierra MatchKing HPBT) Cargador de 10 balas de 8.6x70mm (300gr Sierra MatchKing HPBT) + Magazynek .338 10rd (300gr Sierra MatchKing HPBT) .338 (HPBT) .338 (HPBT) .338 (HPBT) + .338 (HPBT) Caliber: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Rounds: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Cartouches: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Balas: 10 + Kaliber: 8,6x70 mm (300gr Sierra MatchKing HPBT)<br />Pociski: 10 .338 10Rnd Mag (API526) .338 10Cps (API526) + Cargador de 10 balas de .338 (API526) + Magazynek .338 10rd (API526) .338 AP .338 AP + .338 AP + .338 AP Caliber: 8.6x70mm (API526)<br />Rounds: 10 Calibre: 8.6x70mm (API526)<br />Cartouches: 10 + Calibre: 8.6x70mm (API526)<br />Balas: 10 + Kaliber: 8,6x70 mm (API526)<br />Pociski: 10 12.7x99mm 5Rnd Mag 12.7x99mm 5Cps + Cargador de 5 balas de 12.7x99mm + Magazynek 12,7x99 mm 5rd 12.7mm 12.7mm + 12.7mm + 12,7mm Caliber: 12.7x99mm<br />Rounds: 5 Calibre: 12.7x99mm<br />Cartouches: 5 + Calibre: 12.7x99mm<br />Balas: 5 + Kaliber: 12,7x99 mm<br />Pociski: 5 12.7x99mm 5Rnd Mag (AMAX) 12.7x99mm 5Rnd Mag (AMAX) + Cargador de 5 balas de 12.7x99mm (AMAX) + Magazynek 12,7x99 mm 5rd (AMAX) 12.7mm 12.7mm + 12.7mm + 12,7mm Caliber: 12.7x99mm (AMAX)<br />Rounds: 5 Calibre: 12.7x99mm (AMAX)<br />Cartouches: 5 + Calibre: 12.7x99mm (AMAX)<br />Balas: 5 + Kaliber: 12,7x99 mm (AMAX)<br />Pociski: 5 - + \ No newline at end of file diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 651edbcf86..f91f24025e 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -7,6 +7,7 @@ if (isServer) then { addMissionEventHandler ["HandleDisconnect", { PARAMS_1(_disconnectedPlayer); + private "_escortedUnit"; _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 9fd65a130d..97ecd98a0a 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -18,6 +18,7 @@ #include "script_component.hpp" PARAMS_3(_unit,_target,_vehicle); +private "_objects"; if (isNull _target) then { _objects = attachedObjects _unit; diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 0506b0cc17..bf0e04cd6a 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -18,6 +18,7 @@ #include "script_component.hpp" PARAMS_3(_logic,_units,_activated); +private ["_bisMouseOver", "_mouseOverObject"]; if (!_activated) exitWith {}; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 5f134ab03b..bd141988bb 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -50,6 +50,7 @@ if (_state) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) + private "_animChangedEHID"; _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { @@ -66,6 +67,7 @@ if (_state) then { [_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus); //remove AnimChanged EH + private "_animChangedEHID"; _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index d774e7f6e0..22de70921d 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -48,6 +48,7 @@ if (_state) then { if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then { //Adds an animation changed eh //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) + private "_animChangedEHID"; _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { @@ -63,6 +64,7 @@ if (_state) then { [_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus); //remove AnimChanged EH + private "_animChangedEHID"; _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 5683eaf0d3..f609aabd93 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -95,7 +95,7 @@ Algema Plástica Fascietta Gyorskötöző - Пластиковые наручники + Кабельная стяжка Cable ties that allow you to restrain prisoners. @@ -107,7 +107,7 @@ A algema plástica permite que você contenha prisioneiros. Fascietta che ti consente di arrestare i prigionieri. Gyorskötöző, emberek foglyulejtéséhez használható. - Пластиковые наручники позволяют связывать пленников. + Кабельные стяжки позволяют связывать пленников. Inventory of frisked person diff --git a/addons/common/CfgMagazines.hpp b/addons/common/CfgMagazines.hpp index 815ab6db9f..465ea57f78 100644 --- a/addons/common/CfgMagazines.hpp +++ b/addons/common/CfgMagazines.hpp @@ -2,6 +2,7 @@ class CfgMagazines { class CA_Magazine; class ACE_FakeMagazine: CA_Magazine { + scopeCurator = 1; descriptionShort = ""; displayName = ""; displayNameShort = ""; diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index c2d1532f40..cf8c06798e 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -14,6 +14,8 @@ class CfgWeapons { class ACE_FakePrimaryWeapon: Rifle_Base_F { scope = 2; + scopeCurator = 1; + displayName = ""; model = "\A3\Weapons_f\empty"; picture = ""; diff --git a/addons/common/ProgressScreen.hpp b/addons/common/ProgressScreen.hpp index df07e5ca2f..ab624669cf 100644 --- a/addons/common/ProgressScreen.hpp +++ b/addons/common/ProgressScreen.hpp @@ -1,7 +1,7 @@ class GVAR(ProgressBar_Dialog) { idd = -1; movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 2)];); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBG)),(_this select 0) displayCtrl 1)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBar)),(_this select 0) displayCtrl 2)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ctrlProgressBarTitle)),(_this select 0) displayCtrl 3)];); objects[] = {}; class controlsBackground { @@ -23,26 +23,31 @@ class GVAR(ProgressBar_Dialog) { w = "safezoneW"; h = "safezoneH"; }; - class Progress: ACE_gui_RscProgress { + class TitleBackground: ACE_gui_staticBase { idc = 1; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "37.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorFrame[] = {0,0,0,0.0}; - colorBar[] = {0.27,0.5,0.31,0.8}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - }; - class Title_Bar : ACE_gui_staticBase { - idc = 2; - style = 0x22; - colorBackground[] = {0, 0, 0, 0}; + style = ST_CENTER; + sizeEx = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0, 0, 0, 0.5}; colorText[] = {1, 1, 1, 1}; x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; + class Progress: ACE_gui_RscProgress { + idc = 2; + x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorFrame[] = {1,1,1,0.5}; + colorBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; + texture = "#(argb,8,8,3)color(1,1,1,0.7)"; + }; + class TitleText: TitleBackground { + idc = 3; + colorBackground[] = {0, 0, 0, 0}; + }; }; }; diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 03c56398c4..f7d927556c 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -38,12 +38,14 @@ createDialog QGVAR(ProgressBar_Dialog); //Adjust position based on user setting: _ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBarTitle)); _ctrlPos set [1, ((0 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; -(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; -(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; -_ctrlPos = ctrlPosition (uiNamespace getVariable QGVAR(ctrlProgressBar)); -_ctrlPos set [1, ((0.1 + 29 * GVAR(SettingProgressBarLocation)) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))]; + +(uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable QGVAR(ctrlProgressBG)) ctrlCommit 0; (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos; (uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0; +(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos; +(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0; + _perFrameFunction = { diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 4d81ef3535..347320edec 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -75,6 +75,18 @@ if (isNil _name) then { getNumber (_optionEntry >> "force") > 0, _value ]; + + //Strings in the values array won't be localized from the config, so just do that now: + private "_values"; + _values = _settingData select 5; + { + _text = _x; + if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then { + _text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $ + _values set [_forEachIndex, _text]; + }; + } forEach _values; + GVAR(settings) pushBack _settingData; diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index 7b88350c6a..afb5817d81 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -40,12 +40,13 @@ if (true) then { { _ppos = worldToScreen (_object modelToWorld _x); - _pposX = _ppos select 0; - _pposY = _ppos select 1; - if (_pposX < _minX) then {_minX = _pposX}; - if (_pposX > _maxX) then {_maxX = _pposX}; - if (_pposY < _minY) then {_minY = _pposY}; - if (_pposY > _maxY) then {_maxY = _pposY}; + if (count _ppos >= 2) then { + EXPLODE_2_PVT(_ppos,_pposX,_pposY); + if (_pposX < _minX) then {_minX = _pposX}; + if (_pposX > _maxX) then {_maxX = _pposX}; + if (_pposY < _minY) then {_minY = _pposY}; + if (_pposY > _maxY) then {_maxY = _pposY}; + }; //else - what to do if it is offscreen? } forEach _boundsCorners; }; diff --git a/addons/disarming/functions/fnc_canBeDisarmed.sqf b/addons/disarming/functions/fnc_canBeDisarmed.sqf index 04171a900d..25ec884919 100644 --- a/addons/disarming/functions/fnc_canBeDisarmed.sqf +++ b/addons/disarming/functions/fnc_canBeDisarmed.sqf @@ -17,6 +17,8 @@ PARAMS_1(_target); +private ["_animationStateCfgMoves", "_putDownAnim"]; + //Check animationState for putDown anim //This ensures the unit doesn't have to actualy do any animation to drop something //This should always be true for the 3 possible status effects that allow disarming diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 24ab96a2cf..2cb3e89b5d 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -20,6 +20,9 @@ #define TIME_MAX_WAIT 5 +private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"]; + + PARAMS_3(_caller,_target,_listOfItemsToRemove); DEFAULT_PARAM(3,_doNotDropAmmo,false); //By default units drop all weapon mags when dropping a weapon @@ -154,6 +157,8 @@ if (_holderIsEmpty) then { //Start the PFEH to do the actions (which could take >1 frame) [{ + private ["_needToRemoveWeapon", "_needToRemoveMagazines", "_needToRemoveBackpack", "_needToRemoveVest", "_needToRemoveUniform", "_error", "_magsToPickup", "_index", "_magazinesInHolder"]; + PARAMS_2(_args,_pfID); EXPLODE_8_PVT(_args,_caller,_target,_listOfItemsToRemove,_holder,_holderIsEmpty,_maxWaitTime,_doNotDropAmmo,_startingMagazines); diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index c91f717e2a..316ec2b656 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -20,6 +20,8 @@ PARAMS_3(_caller,_target,_listOfObjectsToRemove); +private "_itemsToAdd"; + _itemsToAdd = []; { if (_x == (uniform _target)) then { diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index d07f40c972..a319c006ee 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -17,6 +17,8 @@ PARAMS_1(_target); +private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; + _allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target)); if ((backpack _target) != "") then { diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 6da123b831..832f32ced5 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -28,6 +28,7 @@ ] PARAMS_2(_caller,_target); +private "_display"; //Sanity Checks if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; @@ -59,6 +60,7 @@ GVAR(disarmTarget) = _target; //Setup PFEH [{ + private ["_groundContainer", "_targetContainer", "_playerName", "_rankPicture", "_rankIndex", "_targetUniqueItems", "_holderUniqueItems"]; disableSerialization; EXPLODE_2_PVT(_this,_args,_pfID); EXPLODE_3_PVT(_args,_player,_target,_display); @@ -71,6 +73,7 @@ GVAR(disarmTarget) = _target; GVAR(disarmTarget) = objNull; if (!isNull _display) then {closeDialog 0;}; //close dialog if still open } else { + _groundContainer = _display displayCtrl 632; _targetContainer = _display displayCtrl 633; _playerName = _display displayCtrl 111; diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index e040233b82..5c809de4a2 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -19,7 +19,7 @@ disableSerialization; PARAMS_2(_listBoxCtrl,_itemsCountArray); -private "_classname"; +private ["_classname", "_count", "_displayName", "_picture"]; { _displayName = ""; diff --git a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf index 779a5e39ba..e1753f390a 100644 --- a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf +++ b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf @@ -20,7 +20,7 @@ */ #include "script_component.hpp" -private ["_problem", "_beginingArray"]; +private ["_problem", "_beginingArray", "_index"]; PARAMS_4(_startA,_endA,_startB,_endB); diff --git a/addons/disposable/CfgEventHandlers.hpp b/addons/disposable/CfgEventHandlers.hpp index 02d0cb625f..e4e4abffd8 100644 --- a/addons/disposable/CfgEventHandlers.hpp +++ b/addons/disposable/CfgEventHandlers.hpp @@ -1,44 +1,28 @@ class Extended_PreInit_EventHandlers { class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; class Extended_PostInit_EventHandlers { class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); }; }; class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - firedBIS = QUOTE( _this call FUNC(replaceATWeapon) ); + firedBIS = QUOTE(_this call FUNC(replaceATWeapon)); }; }; }; // handle preloaded missile -class Extended_Init_EventHandlers { +class Extended_InitPost_EventHandlers { class CAManBase { class ADDON { - init = QUOTE( _this call FUNC(takeLoadedATWeapon) ); - }; - }; -}; - -class Extended_Take_EventHandlers { - class CAManBase { - class ADDON { - take = QUOTE( _this call FUNC(takeLoadedATWeapon); [_this select 0] call FUNC(updateInventoryDisplay); ); - }; - }; -}; - -class Extended_Put_EventHandlers { - class CAManBase { - class ADDON { - put = QUOTE( [_this select 0] call FUNC(updateInventoryDisplay); ); + init = QUOTE([ARR_2(_this select 0, secondaryWeapon (_this select 0))] call FUNC(takeLoadedATWeapon)); }; }; }; diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp index 8fbae08dfd..6265c06f50 100644 --- a/addons/disposable/CfgMagazines.hpp +++ b/addons/disposable/CfgMagazines.hpp @@ -3,6 +3,7 @@ class CfgMagazines { class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine author = "$STR_ACE_Common_ACETeam"; scope = 1; + scopeArsenal = 1; displayName = "$STR_ACE_Disposable_PreloadedMissileDummy"; picture = PATHTOEF(common,UI\blank_CO.paa); weaponPoolAvailable = 0; diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf new file mode 100644 index 0000000000..bc51974bc6 --- /dev/null +++ b/addons/disposable/XEH_postInit.sqf @@ -0,0 +1,10 @@ +// by commy2 +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["inventoryDisplayLoaded", {[ACE_player, _this select 0] call FUNC(updateInventoryDisplay)}] call EFUNC(common,addEventHandler); +["playerInventoryChanged", { + [_this select 0, _this select 1 select 11] call FUNC(takeLoadedATWeapon); + [_this select 0] call FUNC(updateInventoryDisplay); +}] call EFUNC(common,addEventHandler); diff --git a/addons/disposable/XEH_postInitClient.sqf b/addons/disposable/XEH_postInitClient.sqf deleted file mode 100644 index 1fe598137f..0000000000 --- a/addons/disposable/XEH_postInitClient.sqf +++ /dev/null @@ -1,11 +0,0 @@ -// by commy2 - -// The Arma InventoryOpened EH fires actually before the inventory dialog is opened (findDisplay 602 => displayNull). - -#include "script_component.hpp" - -["inventoryDisplayLoaded",{ - _player = ACE_player; - [_player] call FUNC(takeLoadedATWeapon); - [_player, (_this select 0)] call FUNC(updateInventoryDisplay); -}] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/disposable/stringtable.xml b/addons/disposable/stringtable.xml index 214b3f228a..7f57998157 100644 --- a/addons/disposable/stringtable.xml +++ b/addons/disposable/stringtable.xml @@ -31,7 +31,7 @@ Wstępnie załadowana atrapa pocisku Preloaded Missile Dummy Előtöltött műrakéta - Заряженная ракетная пустышка + Предзаряженная ракетная болванка Missile stupido precaricato diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 01c00511cf..29a4859651 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_interval", "_player", "_newVel", "_accel", "_currentGForce", "_average", "_sum", "_classCoef", "_suitCoef", "_gBlackOut", "_gRedOut", "_g", "_gBO", "_coef", "_strength"]; + EXPLODE_2_PVT(_this,_params,_pfhId); _interval = time - GVAR(lastUpdateTime); diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index ee62dfdd66..4fcf4fc055 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -56,6 +56,7 @@ FUNC(CheckGlasses) = { }; player addEventHandler ["Explosion", { + private "_effects"; if (alive ace_player) then { call FUNC(ApplyDirtEffect); if (GETBROKEN) exitWith {}; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index 182ffac910..068f7639d2 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false}; -private "_dirtImage"; +private ["_dirtImage", "_applied", "_effects"]; _effects = GETGLASSES(ace_player); _effects set [DIRT, true]; SETGLASSES(ace_player,_effects); diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf index b70b962940..7fcb05a511 100644 --- a/addons/goggles/functions/fnc_clearGlasses.sqf +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -private "_broken"; +private ["_broken", "_effects"]; + _broken = GETBROKEN; _effects = GLASSESDEFAULT; _effects set [BROKEN, _broken]; diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf index 5519bf397c..6e16085b2c 100644 --- a/addons/goggles/functions/fnc_getExplosionIndex.sqf +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -9,7 +9,7 @@ * The rating [0-3] * * Example: - * _rating = 0.05 call ace_goggles_fnc_getExplosionIndex; + * 0.05 call ace_goggles_fnc_getExplosionIndex; * * Public: No */ diff --git a/addons/goggles/functions/fnc_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf index 9206965995..253a82f0a3 100644 --- a/addons/goggles/functions/fnc_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -14,8 +14,10 @@ * Public: Yes */ #include "script_component.hpp" -private ["_currentGlasses", "_result", "_unit"]; -_unit = _this select 0; + +PARAMS_1(_unit); + +private ["_currentGlasses", "_result", "_position", "_visible"]; _currentGlasses = goggles _unit; _result = false; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index c84ee33b33..75e61dab56 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount"]; +private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; PARAMS_1(_grenade); diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index a83c81e660..377793ca7b 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -19,7 +19,8 @@ PARAMS_1(_projectile); if (alive _projectile) then { playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - + + private "_affected"; _affected = _projectile nearEntities ["CAManBase", 50]; ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); }; diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 72776b68c6..7e9472e72a 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -private ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_silencer", "_audibleFireCoef", "_loudness", "_strength"]; +private ["_unit", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_silencer", "_audibleFireCoef", "_loudness", "_strength", "_audibleFire", "_audibleFireTime", "_audibleFireTimeCoef"]; _unit = _this select 0; _firer = _this select 1; diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index d7b43e0092..a560a712a6 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index dd51f30e19..a0ca6af457 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -18,6 +18,8 @@ #define STRENGHTODEAFNESS 3 #define MAXDEAFNESS 1.1 +private ["_recoverRate", "_volume"]; + // Exit if combat deafness is disabled if !(GVAR(enableCombatDeafness)) exitWith {}; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index f57bc2545a..3fa947ead9 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -19,7 +19,7 @@ Los tapones para los oídos permiten al usuario operar armamento ruidoso sin sufrir pérdida de audición. Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu. Ochranné špunty umožňují uživateli, aby neutrpěl zranění jeho sluchu v blízkosti hlasitých zbraní. - Беруши позволяют избежать потери слуха при близкой громкой стрельбе. + Беруши позволяют носителю находиться возле громкого вооружения без потери слуха. Bouchons Anti-Bruits pour la prévention des traumatismes sonores aigus. Erősebb hanghatásoktól védő füldugó, megakadályozza a nagy hanggal járó fegyverzettől való halláskárosodást. Protetor para ouvidos permitem que o usuário esteja próximo a ruídos sem danificar sua audição. diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 582fe750a8..6abcebf47e 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -22,6 +22,13 @@ private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_ _target = _object; _player = ACE_player; +// Check if the function should be modified first +if !((_origActionData select 10) isEqualTo {}) then { + // It should, so make a copy and pass it to the modifierFunction + _origActionData = +_origActionData; + [_target, ACE_player, _origActionData select 6, _origActionData] call (_origActionData select 10); +}; + // Return nothing if the action itself is not active if !([_target, ACE_player, _origActionData select 6] call (_origActionData select 4)) exitWith { [] diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index baf8e1c272..7983c493e1 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -27,7 +27,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; @@ -56,6 +56,7 @@ _recurseFnc = { _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -76,7 +77,8 @@ _recurseFnc = { [], _selection, _distance, - [_showDisabled,_enableInside,_canCollapse,_runOnHover] + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction ], _children ]; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 968b143701..0258b3dc8a 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -27,7 +27,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_selection", "_condition", "_showDisabled", - "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren"]; + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; @@ -46,6 +46,7 @@ _recurseFnc = { _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; @@ -66,7 +67,8 @@ _recurseFnc = { [], [0,0,0], 10, //distace - [_showDisabled,_enableInside,_canCollapse,_runOnHover] + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction ], _children ]; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 0b0030a1b4..fb3f05b7b5 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -14,6 +14,7 @@ * 7: Position (Position or Selection Name) or (Optional) * 8: Distance (Optional) * 9: Other parameters (Optional) + * 10: Modifier function (Optional) * * Return value: * Action @@ -27,7 +28,7 @@ EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); -private ["_insertChildren","_customParams","_position","_distance","_params"]; +private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"]; _insertChildren = if (count _this > 5) then { _this select 5 @@ -59,6 +60,12 @@ _params = if (count _this > 9) then { [false,false,false,false] }; +_modifierFunction = if (count _this > 10) then { + _this select 10 +} else { + {} +}; + [ _actionName, _displayName, @@ -70,5 +77,6 @@ _params = if (count _this > 9) then { _customParams, _position, _distance, - _params + _params, + _modifierFunction ] diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 1268f8b886..622dacc624 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -21,7 +21,7 @@ class ACE_Settings { isClientSettable = 1; displayName = "$STR_ACE_Inventory_SettingName"; description = "$STR_ACE_Inventory_SettingDescription"; - values[] = {"Normal (Default Size)", "Medium", "Bigger"}; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; }; }; diff --git a/addons/javelin/CfgVehicles.hpp b/addons/javelin/CfgVehicles.hpp new file mode 100644 index 0000000000..5ea7e3327c --- /dev/null +++ b/addons/javelin/CfgVehicles.hpp @@ -0,0 +1,32 @@ +class CfgVehicles { + class LandVehicle; + class StaticWeapon : LandVehicle { + class Turrets; + }; + + class StaticMGWeapon : StaticWeapon { + class Turrets : Turrets { + class MainTurret; + }; + }; + + + class AT_01_base_F: StaticMGWeapon { + class Turrets : Turrets { + class MainTurret : MainTurret { + weapons[] = { "missiles_titan_static_at" }; + magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; + + turretInfoType = "ACE_RscOptics_javelin"; + gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); + opticsZoomMin = 0.08333; + opticsZoomMax = 0.04167; + opticsZoomInit = 0.08333; + opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1"}; + opticsFlare = 0; + discretefov[] = {0.08333,0.04167}; + discreteInitIndex = 0; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index 1f62ee1bd7..1392cd1a56 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -1,18 +1,38 @@ class CfgWeapons { class Launcher; + class MissileLauncher; + class Launcher_Base_F : Launcher { class WeaponSlotsInfo; - }; + }; + + // @TODO: AA by default, motherfuckers + class missiles_titan : MissileLauncher { + + }; - class launch_Titan_base : Launcher_Base_F { + class missiles_titan_at : missiles_titan { weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); - canLock = 1; + canLock = 0; + magazines[] = {"1Rnd_GAT_missiles"}; + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; + class missiles_titan_static_at : missiles_titan_at { }; + + // @TODO: AA by default, motherfuckers + class launch_Titan_base : Launcher_Base_F {}; + + class launch_Titan_short_base : launch_Titan_base { + weaponInfoType = "ACE_RscOptics_javelin"; + modelOptics = PATHTOF(data\reticle_titan.p3d); + + canLock = 0; lockingTargetSound[] = {"",0,1}; - lockedTargetSound[] = {"",0,1}; - + lockedTargetSound[] = {"",0,1}; }; }; \ No newline at end of file diff --git a/addons/javelin/RscInGameUI.hpp b/addons/javelin/RscInGameUI.hpp index d845c1d00b..ea1e12626c 100644 --- a/addons/javelin/RscInGameUI.hpp +++ b/addons/javelin/RscInGameUI.hpp @@ -255,9 +255,9 @@ class RscInGameUI { idc = 6999; x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; enabled = 0; class Controls { diff --git a/addons/javelin/config.cpp b/addons/javelin/config.cpp index 9d7c14e448..cb76da0010 100644 --- a/addons/javelin/config.cpp +++ b/addons/javelin/config.cpp @@ -13,4 +13,5 @@ class CfgPatches { #include "CfgEventhandlers.hpp" #include "RscInGameUI.hpp" #include "CfgSounds.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/javelin/functions/fnc_onFired.sqf b/addons/javelin/functions/fnc_onFired.sqf index 04a023c9d8..8c6590f5df 100644 --- a/addons/javelin/functions/fnc_onFired.sqf +++ b/addons/javelin/functions/fnc_onFired.sqf @@ -6,7 +6,10 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); // Bail on not missile if( _shooter != ACE_player) exitWith { false }; -if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_base"] call EFUNC(common,inheritsFrom)) ) exitWith { }; +if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom)) + && + { ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) } +) exitWith { }; _pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil]; if(!isNil "_pfh_handle") then { diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 13669b9d2e..adbd2fde1c 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -30,13 +30,18 @@ _soundTime = _args select 4; _randomLockInterval = _args select 5; _fireDisabledEH = _args select 6; -if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_base"] call EFUNC(common,inheritsFrom)) ) exitWith { +if( ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "launch_Titan_short_base"] call EFUNC(common,inheritsFrom)) + && + { ! ([ (configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)) ), "missiles_titan_at"] call EFUNC(common,inheritsFrom)) } + ) exitWith { __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); + if(!isNil "_fireDisabledEH") then { + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); + }; [(_this select 1)] call cba_fnc_removePerFrameHandler; uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil]; @@ -55,13 +60,21 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && // bail on not loaded -if (ACE_player ammo (currentWeapon ACE_player) == 0) exitWith { }; - +if( (vehicle ACE_player) != ACE_player) then { + if( (vehicle player) magazineTurretAmmo ["1Rnd_GAT_missiles", [0]] < 1) exitWith { + TRACE_1("No turret ammo, exit", ""); + }; +} else { + if (ACE_player ammo (currentWeapon ACE_player) < 1 ) exitWith { + TRACE_1("No ammo, exit", ""); + }; +}; + _range = parseNumber (ctrlText __JavelinIGUIRangefinder); TRACE_1("Viewing range", _range); if (_range > 50 && {_range < 2500}) then { _pos = positionCameraToWorld [0,0,_range]; - _targetArray = _pos nearEntities ["AllVehicles", _range/25]; + _targetArray = _pos nearEntities ["AllVehicles", _range/100]; TRACE_1("Searching at range", _targetArray); if (count (_targetArray) > 0) then { _newTarget = _targetArray select 0; @@ -144,6 +157,8 @@ if (isNull _newTarget) then { // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { + _fov = [] call CBA_fnc_getFoV; + TRACE_1("FOV", _fov); if (_newTarget distance ACE_player < 2500 && {(call CBA_fnc_getFoV) select 1 > 9} && { (currentVisionMode ACE_player == 2)} diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index b5c6664657..6fda0fed10 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -18,6 +18,8 @@ PARAMS_2(_caller,_target); +private ["_onFinish", "_onFailure"]; + if (!(_this call FUNC(canRefuelUAV))) exitWith {}; _onFinish = { diff --git a/addons/logistics_uavbattery/stringtable.xml b/addons/logistics_uavbattery/stringtable.xml index b60353e29c..23588586cf 100644 --- a/addons/logistics_uavbattery/stringtable.xml +++ b/addons/logistics_uavbattery/stringtable.xml @@ -11,7 +11,7 @@ Dron je nabitý O VANT está cheio Il drone è pieno - БПЛА заполнен + БПЛА полностью заряжен You need a UAV Battery @@ -59,7 +59,7 @@ Používané k dobíjení UAV Usada para reabastecer VANT Usata per ricaricare la Batteria dell'UAV - Используется для зарядки БПЛА + Используется для зарядки переносных БПЛА Recharging ... diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp index 79c3aaa959..3daad1425a 100644 --- a/addons/logistics_wirecutter/CfgEventHandlers.hpp +++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/logistics_wirecutter/CfgSounds.hpp b/addons/logistics_wirecutter/CfgSounds.hpp deleted file mode 100644 index 9958190ec1..0000000000 --- a/addons/logistics_wirecutter/CfgSounds.hpp +++ /dev/null @@ -1,12 +0,0 @@ -class CfgSounds { - class ACE_Wirecutter_sound { - name = "ACE_wirecutter_sound"; - sound[] = {QUOTE(PATHTOF(sound\wire_cut.ogg)), "db-0", 1}; - titles[] = {}; - }; - class ACE_Wirecutter_sound_long { - name = "ACE_wirecutter_sound_long"; - sound[] = {QUOTE(PATHTOF(sound\wire_cut_long.ogg)), "db-0", 1}; - titles[] = {}; - }; -}; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp new file mode 100644 index 0000000000..a31d9c0d99 --- /dev/null +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -0,0 +1,8 @@ +class CfgVehicles { + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_wirecutter,4); + }; + }; +}; diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 76b1003f34..648bc3a3f8 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -1,16 +1,16 @@ class CfgWeapons { - class InventoryItem_Base_F; - class ACE_ItemCore; + class InventoryItem_Base_F; + class ACE_ItemCore; - class ACE_wirecutter: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_logistics_wirecutter_wirecutterName"; - descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 100; + class ACE_wirecutter: ACE_ItemCore { + author = "$STR_ACE_Common_ACETeam"; + displayName = "$STR_ACE_logistics_wirecutter_wirecutterName"; + descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 100; + }; }; - }; }; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp index 6e1db15061..d83cff4035 100644 --- a/addons/logistics_wirecutter/config.cpp +++ b/addons/logistics_wirecutter/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {}; + weapons[] = {"ACE_wirecutter"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author[] = {"gpgpgpgp", "PabstMirror"}; @@ -13,5 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgSounds.hpp" #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index ee4c512cd2..0cab7ab461 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -16,19 +16,26 @@ */ #include "script_component.hpp" -private ["_timeToCut"]; +#define SOUND_CLIP_TIME_SPACEING 1.5 +private ["_timeToCut", "_progressCheck"]; PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; -_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10}; +_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); -if (_timeToCut > 5) then { - playSound "ACE_wirecutter_sound_long"; -} else { - playSound "ACE_wirecutter_sound"; +_progressCheck = { + PARAMS_2(_args,_passedTime); + EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime); + if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then { + // playSound "ACE_wirecutter_sound"; + playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10]; + _args set [1, _passedTime]; + }; + + ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))}) }; -[_timeToCut, [_fenceObject], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence"] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize "STR_ACE_logistics_wirecutter_CuttingFence", _progressCheck] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf index c9e59b41a0..15bfbdb8ef 100644 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf @@ -20,9 +20,9 @@ PARAMS_1(_unit); _nearestFence = objNull; { - if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { - _nearestFence = _x; - }; + if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { + _nearestFence = _x; + }; } forEach nearestObjects [_unit, [], 15]; _nearestFence diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 6dace9c42d..efb8f292c9 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -25,7 +25,7 @@ if (_interactionType != 0) exitWith {}; if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; [{ - private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"]; + private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; PARAMS_2(_args,_pfID); EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); @@ -35,7 +35,7 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; } else { // Prevent Rare Error when ending mission with interact key down: if (isNull ace_player) exitWith {}; - + //If player moved >5 meters from last pos, then rescan if (((getPosASL ace_player) distance _setPosition) > 5) then { diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index aee9a22ef9..1ab97a67af 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -17,11 +17,9 @@ #include "script_component.hpp" //find is case sensitive, so keep everything lowercase -#define FENCE_A3_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"] -#define FENCE_A3_P3DS ["mil_wiredfence_f.p3d"] +#define FENCE_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f"] -#define FENCE_AIA_TYPENAMES [] -#define FENCE_AIA_P3DS ["wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"] +#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"] private ["_typeOf", "_returnValue"]; PARAMS_1(_object); @@ -30,14 +28,15 @@ _typeOf = toLower (typeOf _object); _returnValue = false; if (_typeOf != "") then { - _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); + //If the fence has configEntry we can check it directly + _returnValue = _typeOf in FENCE_TYPENAMES; } else { _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" { - if ((_typeOf find _x) != -1) then { + if ((_typeOf find _x) != -1) exitWith { _returnValue = true; }; - } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); + } forEach FENCE_P3DS; }; _returnValue diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index 7a2b81371c..fbd07cf31a 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -28,7 +28,7 @@ _unitMagCounts = []; _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there - if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _magazineClassname}}) then { + if ((_xCount < _xFullMagazineCount) && {_xCount > 0} && {(!_xLoaded) || {_player canAdd _xClassname}}) then { _index = _unitMagazines find _xClassname; if (_index == -1) then { _unitMagazines pushBack _xClassname; diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index fb37a0dd4e..4ef69044da 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded"]; +private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index cecfd348d2..c156c9527d 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -14,9 +14,7 @@ if !(hasInterface) exitWith {}; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index 030daeaa36..edbe484f04 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"]; + // Delete last set of markers (always) { deleteMarkerLocal _x; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index fbc847c313..a5168bd8a1 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -15,7 +15,7 @@ EXPLODE_1_PVT(_this,_unit); -private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight"]; +private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight", "_flareTint", "_lightTint", "_l"]; // Blend two colors _fnc_blendColor = { diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf index fdc620b417..345fc68583 100644 --- a/addons/map/functions/fnc_determineZoom.sqf +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; +private ["_grids", "_fourSize", "_sixSize", "_continue", "_size", "_i"]; _grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; _fourSize = -1; _sixSize = -1; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index a22bbbb385..4bcdb69269 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -10,8 +10,7 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf index 26fb005e9f..8129a75b15 100644 --- a/addons/maptools/XEH_postInitClient.sqf +++ b/addons/maptools/XEH_postInitClient.sqf @@ -24,6 +24,7 @@ GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; // The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { _fnc_installMapEvents = { + private "_d"; _d = _this; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; diff --git a/addons/maptools/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf index 83e983d0e3..157891a262 100644 --- a/addons/maptools/functions/fnc_addLineMarker.sqf +++ b/addons/maptools/functions/fnc_addLineMarker.sqf @@ -15,10 +15,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_marker", "_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _marker = createMarkerLocal [_name, _startPos]; _name setMarkerShapeLocal "RECTANGLE"; diff --git a/addons/maptools/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf index 700e089a88..4723a4f5e1 100644 --- a/addons/maptools/functions/fnc_calculateMapScale.sqf +++ b/addons/maptools/functions/fnc_calculateMapScale.sqf @@ -12,6 +12,8 @@ */ #include "script_component.hpp" +private ["_screenOffset", "_pos"]; + _pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; _screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; diff --git a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf index e3de77316a..44f6ed6203 100644 --- a/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf +++ b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf @@ -15,6 +15,7 @@ PARAMS_1(_lineMarkers); { + private "_marker"; _marker = _x; //Add marker if we don't already have it if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { diff --git a/addons/maptools/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf index d2b3a060b8..d1f9e199c9 100644 --- a/addons/maptools/functions/fnc_handleKeyDown.sqf +++ b/addons/maptools/functions/fnc_handleKeyDown.sqf @@ -15,13 +15,10 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +PARAMS_5(_display,_code,_shiftKey,_ctrlKey,_altKey); + +private ["_handled", "_relPos", "_diffVector", "_magDiffVector", "_lambdaLong", "_lambdaTrasAbs"]; -_display = _this select 0; -_code = _this select 1; -_shiftKey = _this select 2; -_ctrlKey = _this select 3; -_altKey = _this select 4; _handled = false; #define DIK_ESCAPE 0x01 diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 8db6b8b0f1..16cabe9719 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -13,10 +13,9 @@ #include "script_component.hpp" -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; +private ["_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos", "_altKey", "_gui", "_marker"]; -_dir = _this select 0; -_params = _this select 1; +PARAMS_2(_dir,_params); _control = _params select 0; _button = _params select 1; _screenPos = [_params select 2, _params select 3]; diff --git a/addons/maptools/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf index 4111c8fad4..2148c5a162 100644 --- a/addons/maptools/functions/fnc_handleMouseMove.sqf +++ b/addons/maptools/functions/fnc_handleMouseMove.sqf @@ -51,6 +51,7 @@ if (GVAR(mapTool_isDragging)) exitWith { // Rotation if (GVAR(mapTool_isRotating)) exitWith { + private "_angle"; // Get new angle _angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); diff --git a/addons/maptools/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf index 4dd66e2b9a..eeaf8f346a 100644 --- a/addons/maptools/functions/fnc_isInsideMapTool.sqf +++ b/addons/maptools/functions/fnc_isInsideMapTool.sqf @@ -16,6 +16,7 @@ #define DIST_TOP_TO_CENTER_PERC 0.65 #define DIST_LEFT_TO_CENTER_PERC 0.30 +private ["_textureWidth", "_relPos", "_dirVector", "_lambdaLong", "_lambdaTrasAbs", "_pos"]; if (GVAR(mapTool_Shown) == 0) exitWith {false}; _textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); diff --git a/addons/maptools/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf index c4e2436b3b..7d29d9e169 100644 --- a/addons/maptools/functions/fnc_openMapGps.sqf +++ b/addons/maptools/functions/fnc_openMapGps.sqf @@ -12,7 +12,10 @@ */ #include "script_component.hpp" -_shouldOpenGps = _this select 0; +PARAMS_1(_shouldOpenGps); + +private ["_isOpen"]; + _isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])); if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then { diff --git a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf index ddc177f182..092f0720c2 100644 --- a/addons/maptools/functions/fnc_openMapGpsUpdate.sqf +++ b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf @@ -3,6 +3,8 @@ #include "script_component.hpp" +private ["_mapGpsDisplay", "_ctrl"]; + if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler diff --git a/addons/maptools/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf index 45c39611db..be82970524 100644 --- a/addons/maptools/functions/fnc_removeLineMarker.sqf +++ b/addons/maptools/functions/fnc_removeLineMarker.sqf @@ -11,7 +11,7 @@ #include "script_component.hpp" -_name = _this select 0; +PARAMS_1(_name); deleteMarkerLocal _name; { diff --git a/addons/maptools/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf index cf80c1ac26..a745bfa123 100644 --- a/addons/maptools/functions/fnc_updateLineMarker.sqf +++ b/addons/maptools/functions/fnc_updateLineMarker.sqf @@ -13,10 +13,11 @@ */ #include "script_component.hpp" -_name = _this select 0; -_startPos = _this select 1; -_difPos = (_this select 2) vectorDiff _startPos ; -_color = _this select 3; +PARAMS_4(_name,_startPos,_endPos,_color); + +private ["_difPos", "_mag"]; + +_difPos = _endPos vectorDiff _startPos; _name setMarkerShapeLocal "RECTANGLE"; _name setMarkerAlphaLocal 1; diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index 3a7b919b8b..fa6db8872a 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -18,6 +18,8 @@ PARAMS_1(_theMap); +private ["_rotatingTexture", "_textureWidth", "_scale", "_xPos", "_yPos"]; + if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; _rotatingTexture = ""; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index fd97aeda0c..b2b9ed5c00 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -12,6 +12,8 @@ PREP(sendMarkersJIP); PREP(setMarkerJIP); PREP(setMarkerNetwork); +private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"]; + // init marker types if (isNil QGVAR(MarkersCache)) then { _config = configfile >> "CfgMarkers"; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 6ac13f9e80..6c5160c031 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -19,6 +19,8 @@ #define BORDER 0.005 [{ + private ["_display", "_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_posX", "_posY", "_posW", "_posH", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"]; + disableserialization; PARAMS_1(_display); diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 309bb2a888..ae6c87c1c6 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -248,7 +248,7 @@ if (USE_WOUND_EVENT_SYNC) then { }; [ - {(((_this select 0) getvariable [QGVAR(bloodVolume), 0]) < 65)}, + {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, {(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)}, {(((_this select 0) call FUNC(getBloodLoss)) > 0.25)}, {((_this select 0) getvariable [QGVAR(inReviveState), false])}, diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index 82c385f0e1..cbe146d701 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -33,10 +33,10 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { [_this select 1] call CBA_fnc_removePerFrameHandler; if (!local _unit) then { if (GVAR(level) >= 2) then { - _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 0], true]; - _unit setvariable [QGVAR(bloodPressure), _unit getvariable [QGVAR(bloodPressure), [0, 0]], true]; + _unit setvariable [QGVAR(heartRate), _unit getvariable [QGVAR(heartRate), 80], true]; + _unit setvariable [QGVAR(bloodPressure), _unit getvariable [QGVAR(bloodPressure), [80, 120]], true]; }; - _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 0], true]; + _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 100], true]; }; } else { [_unit] call FUNC(handleUnitVitals); diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 81c9ffea40..2b175d7ca2 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -27,7 +27,7 @@ if (_syncValues) then { _unit setvariable [QGVAR(lastMomentValuesSynced), time]; }; -_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 0]) + ([_unit] call FUNC(getBloodVolumeChange)); +_bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 100]) + ([_unit] call FUNC(getBloodVolumeChange)); _bloodVolume = _bloodVolume max 0; _unit setvariable [QGVAR(bloodVolume), _bloodVolume, _syncValues]; @@ -100,7 +100,7 @@ if (GVAR(level) >= 2) then { }; // Set the vitals - _heartRate = (_unit getvariable [QGVAR(heartRate), 0]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); + _heartRate = (_unit getvariable [QGVAR(heartRate), 80]) + (([_unit] call FUNC(getHeartRateChange)) * _interval); _unit setvariable [QGVAR(heartRate), _heartRate, _syncValues]; _bloodPressure = [_unit] call FUNC(getBloodPressure); diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index cebf968898..b4483defc2 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -33,7 +33,7 @@ _timeInCardiacArrest = 120 + round(random(600)); _startTime = _args select 1; _timeInCardiacArrest = _args select 2; - _heartRate = _unit getvariable [QGVAR(heartRate), 0]; + _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (_heartRate > 0 || !alive _unit) exitwith { [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 9f651e90b7..a8a8017160 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,4 +1,5 @@  + @@ -64,7 +65,7 @@ Salzlösungtransfusion Transfundir salino Transfúze fyziologický roztoku - Przetocz solankę + Przetocz sól fizjologiczną Transfuser de la Saline Перелить физраствор Infúzió (sós víz) @@ -216,7 +217,7 @@ Sallösungtransfusion ... Transfusión de salino ... Probíha transfúze fyziologický roztoku ... - Przetaczanie solanki ... + Przetaczanie soli fizjologicznej ... Transfusion de saline ... Переливание физраствора ... Infúzió sós vizzel ... @@ -436,7 +437,7 @@ Kochsaltzlösung IV (1000ml) Dar Salino IV (1000ml) Дать физраствор для в/в вливания (1000 мл) - Podaj solankę IV (1000ml) + Podaj sól fizjologiczną IV (1000ml) Administrer de la Solution Saline en IV (1000ml) Podaz fyz. roztok (1000ml) Sós víz adása intravénásan (1000ml) @@ -447,7 +448,7 @@ Kochsaltzlösung IV (500ml) Dar Salino IV (500ml) Дать физраствор для в/в вливания (500 мл) - Podaj solankę IV (500ml) + Podaj sól fizjologiczną IV (500ml) Administrer de la Solution Saline en IV (500ml) Podaz fyz. roztok (500ml) Sós víz adása intravénásan (500ml) @@ -458,7 +459,7 @@ Kochsaltzlösung IV (250ml) Dar Salino IV (250ml) Дать физраствор для в/в вливания (250 мл) - Podaj solankę IV (250ml) + Podaj sól fizjologiczną IV (250ml) Administrer de la Solution Saline en IV (250ml) Podaz fyz. roztok (250ml) Sós víz adása intravénásan (250ml) @@ -930,7 +931,7 @@ Физраствор для в/в вливания (1000 мл) Solución Salina IV (1000ml) Solution Saline 0.9% IV (1000ml) - Solanka 0,9% IV (1000ml) + Sól fizjologiczna IV (1000ml) Kochsalzlösung (1000ml) 0,9%-os sósvíz-infúzió (1000ml) Soluzione salina IV (1000ml) @@ -940,7 +941,7 @@ Пакет физраствора для возмещения объема потерянной крови Solución salina intravenosa, para restaurar el volumen sanguíneo Solution Saline 0.9% IV, pour rétablir temporairement la tension artérielle - Solanka 0,9%, podawana dożylnie (IV), używana w celu uzupełnienia krwi u pacjenta + Sól fizjologiczna, podawana dożylnie (IV), używana w celu uzupełnienia krwi u pacjenta 0,9%-os sósvíz-infúzió, a páciens vérmennyiségének helyreállítására Soluzione salina, usata per ripristinare sangue nei pazienti. @@ -958,7 +959,7 @@ Физраствор для в/в вливания (500 мл) Salino IV (500ml) Solution Saline 0.9% IV (500ml) - Solanka 0,9% IV (500ml) + Sól fizjologiczna IV (500ml) Kochsalzlösung (500ml) 0,9%-os sósvíz-infúzió (500ml) Soluzione salina IV (500ml) @@ -968,7 +969,7 @@ Физраствор для в/в вливания (250 мл) Salino IV (250ml) Solution Saline 0.9% IV (250ml) - Solanka 0,9% IV (250ml) + Sól fizjologiczna IV (250ml) Kochsalzlösung (250ml) 0,9%-os sósvíz-infúzió (250ml) Soluzione salina IV (250ml) @@ -1128,6 +1129,7 @@ La Presión Arterial es %2/%3 A vérnyomás %2/%3 Hai riscontrato una pressione di %2/%3 + Wyczuwasz ciśnienie krwi o wartości %2/%3 You find a low blood pressure @@ -1611,4 +1613,4 @@ Aberración cromática - + \ No newline at end of file diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index c917eb0a8d..99c94b4512 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -54,6 +54,8 @@ GVAR(rangeFinderPositionASL) = []; GVAR(mapAltitude) = getNumber (configFile >> "CfgWorlds" >> worldName >> "elevationOffset"); +private ["_worldMapLong", "_worldMapLat", "_zone", "_band", "_squareID"]; + //Calculate the map's MGRS: _worldMapLong = getNumber (configFile >> "CfgWorlds" >> worldName >> "longitude"); _worldMapLat = getNumber (configFile >> "CfgWorlds" >> worldName >> "latitude"); diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index 6912810f58..c383d0a95e 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -19,6 +19,8 @@ PARAMS_2(_waypointName,_waypointPosASL); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; _waypoints pushBack [_waypointName, _waypointPosASL]; ace_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf index 3d1e8ec852..62ca5a222a 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -18,6 +18,8 @@ PARAMS_1(_wpIndex); +private "_waypoints"; + _waypoints = ace_player getVariable [QGVAR(waypoints), []]; if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");}; diff --git a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf index f36d5f2548..21a164ff2e 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -20,6 +20,8 @@ PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +private ["_worldPos"]; + //Only handle LMB if (_mouseButton != 0) exitWith {}; diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 3acf3e889c..bff20a4b67 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -17,7 +17,8 @@ PARAMS_1(_theMap); -_theMap = _this select 0; +private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; + _mapSize = (ctrlPosition _theMap) select 3; _waypoints = [] call FUNC(deviceGetWaypoints); diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 1f4982d87f..64a5cab991 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -1,7 +1,7 @@ /* * Author: PabstMirror * Saves the current mode and sets a new mode - * Used to backup display when switching display modes + * Used to backup display when switching display modes * * Arguments: * 0: New Mode @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize", "_centerPos"]; +private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"]; PARAMS_1(_newMode); @@ -36,16 +36,16 @@ if (GVAR(currentApplicationPage) == 2) then { _centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; - + //Hit button again, toggle map modes: if (_newMode == 2) then { - if (GVAR(mapShowTexture)) then { - GVAR(mapShowTexture) = false; - } else { + if (GVAR(mapShowTexture)) then { + GVAR(mapShowTexture) = false; + } else { if (GVAR(MapDataAvailable) == MAP_DETAIL_SAT) then { GVAR(mapShowTexture) = true; }; - }; + }; }; }; diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index d7d550fc32..f98c7f438c 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -95,7 +95,7 @@ Enter Grid Cords: Introducir coordenadas de cuadrícula: - Введите координаты: + Введите сеточные координаты: Wprowadź współrzędne: Entrer coordonnées Koordinaten eingeben: @@ -183,7 +183,7 @@ Connect To Conectar a - Соединиться с + Подключиться к Verbinde zu Připojit k Podłącz do diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 3b74c87065..680a410506 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -8,29 +8,29 @@ class CfgAmmo { class M_PG_AT : MissileBase { model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; + proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; irLock = 0; - laserLock = 0; - airLock = 0; - weaponLockSystem = "2 + 16"; + laserLock = 0; + airLock = 0; + weaponLockSystem = "2 + 16"; - maxSpeed = 720; - maxControlRange = 5000; - maneuvrability = 8; - timeToLive = 60; - simulationStep = 0.01; - airFriction = 0.1; - sideAirFriction = 0.16; - initTime = 0.002; - thrustTime = 1.07; - thrust = 530; - fuseDistance = 2; + maxSpeed = 720; + maxControlRange = 5000; + maneuvrability = 8; + timeToLive = 60; + simulationStep = 0.01; + airFriction = 0.1; + sideAirFriction = 0.16; + initTime = 0.002; + thrustTime = 1.07; + thrust = 530; + fuseDistance = 2; - effectsMissileInit = "MissileDAR1"; - effectsMissile = "missile2"; - whistleDist = 4; - muzzleEffect = ""; + effectsMissileInit = "MissileDAR1"; + effectsMissile = "missile2"; + whistleDist = 4; + muzzleEffect = ""; // Turn off arma crosshair-guidance manualControl = 0; @@ -46,9 +46,6 @@ class CfgAmmo { minDeflection = 0.00025; // Minium flap deflection for guidance maxDeflection = 0.001; // Maximum flap deflection for guidance incDeflection = 0.0005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -73,17 +70,17 @@ class CfgAmmo { class ACE_Hydra70_DAGR : M_PG_AT { displayName = "$STR_ACE_Hydra70_DAGR"; - displayNameShort = "$STR_ACE_Hydra70_DAGR_Short"; + displayNameShort = "$STR_ACE_Hydra70_DAGR_Short"; description = "$STR_ACE_Hydra70_DAGR"; - descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc"; + descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc"; }; class ACE_Hellfire_AGM114K : ACE_Hydra70_DAGR { displayName = "$STR_ACE_Hellfire_AGM114K"; - displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short"; + displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short"; - description = "$STR_ACE_Hellfire_AGM114K_desc"; + description = "$STR_ACE_Hellfire_AGM114K_desc"; descriptionShort = "$STR_ACE_Hellfire_AGM114K_desc"; // @TODO: placeholder model to at least make it look different @@ -92,21 +89,22 @@ class CfgAmmo { hit = 1400; indirectHit = 71; - indirectHitRange = 4.5; - effectsMissile = "missile2"; + indirectHitRange = 4.5; + effectsMissile = "missile2"; }; // Titan class M_Titan_AT : MissileBase { irLock = 0; - laserLock = 0; - airLock = 0; + laserLock = 0; + airLock = 0; // Turn off arma crosshair-guidance manualControl = 0; - hit = 1400; - + hit = 1400; // default: 800 + indirectHit = 20; + indirectHitRange = 2; // ACE uses these values //trackOversteer = 1; //trackLead = 0; @@ -118,9 +116,6 @@ class CfgAmmo { minDeflection = 0.00005; // Minium flap deflection for guidance maxDeflection = 0.025; // Maximum flap deflection for guidance incDeflection = 0.00005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; canVanillaLock = 0; diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp index 7707717c9e..301795b8d7 100644 --- a/addons/missileguidance/CfgVehicles.hpp +++ b/addons/missileguidance/CfgVehicles.hpp @@ -17,7 +17,7 @@ class CfgVehicles { class MainTurret; }; }; - + class ACE_Comanche_Test : B_Heli_Attack_01_F { displayName = "ACE_Comanche_Test"; author = "ACE Team"; @@ -30,4 +30,5 @@ class CfgVehicles { }; }; }; + }; diff --git a/addons/missileguidance/Example_ACE_MissileGuidance.hpp b/addons/missileguidance/Example_ACE_MissileGuidance.hpp deleted file mode 100644 index 400a3a9a41..0000000000 --- a/addons/missileguidance/Example_ACE_MissileGuidance.hpp +++ /dev/null @@ -1,65 +0,0 @@ -THIS IS A WIP FUNCTIONALITY, DUE TO CHANGE - - - class M_PG_AT : MissileBase { - model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; - - irLock = 0; - laserLock = 0; - airLock = 0; - weaponLockSystem = "2 + 16"; - - maxSpeed = 720; - maxControlRange = 5000; - maneuvrability = 8; - timeToLive = 60; - simulationStep = 0.01; - airFriction = 0.1; - sideAirFriction = 0.16; - initTime = 0.002; - thrustTime = 1.07; - thrust = 530; - fuseDistance = 2; - - effectsMissileInit = "MissileDAR1"; - effectsMissile = "missile2"; - whistleDist = 4; - muzzleEffect = ""; - - // Turn off arma crosshair-guidance - manualControl = 0; - - // ACE uses these values - trackOversteer = 1; - trackLead = 0; - - // Begin ACE guidance Configs - class ACE_MissileGuidance { - enabled = 1; - - minDeflection = 0.005; // Minium flap deflection for guidance - maxDeflection = 0.025; // Maximum flap deflection for guidance - incDeflection = 0.005; // The incrmeent in which deflection adjusts. - //minDeflection = 0.005; - //maxDeflection = 0.5; - //incDeflection = 0.005; - - // Guidance type for munitions - defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; - - defaultSeekerLockMode = "LOAL"; - seekerLockModes[] = { "LOAL", "LOBL" }; - - seekerAngle = 90; // Angle in front of the missile which can be searched - seekerAccuracy = 1; // seeker accuracy multiplier - - seekerMinRange = 1; - seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - - // Attack profile type selection - defaultAttackProfile = "LIN"; - attackProfiles[] = { "LIN", "DIR", "MID", "HI", "TOP", "PYM" }; - }; - }; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index ecb469527a..1e13c57ccc 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -53,7 +53,7 @@ switch( (_state select 0) ) do { }; case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.002]; + _returnTargetPos = _seekerTargetPos; }; }; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index c5933e6df9..e9064da404 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -70,7 +70,7 @@ switch( (_state select 0) ) do { case STAGE_TERMINAL: { TRACE_1("STAGE_TERMINAL",""); //_returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.02]; - _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget * 0.002]; + _returnTargetPos = _seekerTargetPos; }; }; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index f7fd56c164..2487e3b28f 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -92,6 +92,10 @@ if(accTime > 0) then { drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,1,1], ASLtoATL _projectilePos, 0.75, 0.75, 0, str _vectorTo, 1, 0.025, "TahomaB"]; drawLine3D [ASLtoATL _projectilePos, ASLtoATL _profileAdjustedTargetPos, [1,0,0,1]]; +_ps = "#particlesource" createVehicleLocal (ASLtoATL _projectilePos); +_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil]; +_PS setDropInterval 3.0; + hintSilent format["d: %1", _distanceToTarget]; #endif diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 74d3b0fc71..45e378c975 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -17,6 +17,7 @@ TRACE_1("", _launchParams); _foundTargetPos = [0,0,0]; if(!isNil "_target") then { _foundTargetPos = getPosASL _target; + //_foundTargetPos = (_target modelToWorldVisual (getCenterOfMass _target)); }; // @TODO: This is seeker LOS and angle checks for LOAL only; LOBL does not need visual diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index c9cb4c4c6b..ab3a449aa6 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -13,6 +13,9 @@ Fejlett rakétairányító Расширенный ракетой + + Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. + Hydra-70 DAGR Missile diff --git a/addons/movement/functions/fnc_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf index 27753d8a12..671ab0b808 100644 --- a/addons/movement/functions/fnc_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -9,15 +9,15 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_canClimb + * [player] call ace_movement_fnc_canClimb * * Public: No */ #include "script_component.hpp" -private ["_unit", "_pos", "_dir"]; +private ["_pos", "_dir"]; -_unit = _this select 0; +PARAMS_1(_unit); _pos = getPosASL _unit; _dir = getDir _unit; @@ -25,15 +25,36 @@ _dir = [sin _dir, cos _dir, 0]; private ["_checkPos0beg", "_checkPos0end", "_checkPos1beg", "_checkPos1end"]; -_checkPos0beg = _pos vectorAdd [0, 0, 1.0]; +_checkPos0beg = _pos vectorAdd [0, 0, 0.9]; _checkPos0end = _checkPos0beg vectorAdd (_dir vectorMultiply 1.3); -_checkPos1beg = _pos vectorAdd [0, 0, 1.5]; -_checkPos1end = _checkPos1beg vectorAdd _dir; +_checkPos1beg = _pos vectorAdd [0, 0, 1.75]; +_checkPos1end = _checkPos1beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos2beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 2.0]; +_checkPos2end = _checkPos2beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos3beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 2.0]; +_checkPos3end = _checkPos3beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos4beg = _pos vectorAdd [0.3 * (_dir select 1), 0.3 * -(_dir select 0), 1.5]; +_checkPos4end = _checkPos4beg vectorAdd (_dir vectorMultiply 1.3); + +_checkPos5beg = _pos vectorAdd [-0.2 * (_dir select 1), -0.2 * -(_dir select 0), 1.5]; +_checkPos5end = _checkPos5beg vectorAdd (_dir vectorMultiply 1.3); /* -drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [1,0,0,1]]; +drawLine3D [ASLToATL _checkPos0beg, ASLToATL _checkPos0end, [0,1,0,1]]; drawLine3D [ASLToATL _checkPos1beg, ASLToATL _checkPos1end, [1,0,0,1]]; - */ +drawLine3D [ASLToATL _checkPos2beg, ASLToATL _checkPos2end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos3beg, ASLToATL _checkPos3end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos4beg, ASLToATL _checkPos4end, [1,0.5,0.5,1]]; +drawLine3D [ASLToATL _checkPos5beg, ASLToATL _checkPos5end, [1,0.5,0.5,1]]; +*/ -lineIntersects [_checkPos0beg, _checkPos0end] && {!(lineIntersects [_checkPos1beg, _checkPos1end])} + lineIntersects [_checkPos0beg, _checkPos0end] +&& {!(lineIntersects [_checkPos1beg, _checkPos1end])} +&& {!(lineIntersects [_checkPos2beg, _checkPos2end])} +&& {!(lineIntersects [_checkPos3beg, _checkPos3end])} +&& {!(lineIntersects [_checkPos4beg, _checkPos4end])} +&& {!(lineIntersects [_checkPos5beg, _checkPos5end])} diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index aff27ffe9d..f88884195e 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -24,6 +24,15 @@ if !([_unit] call FUNC(canClimb)) exitWith { }; if !(_unit getVariable [QGVAR(isClimbInit), false]) then { + _unit addEventHandler ["AnimChanged", { + if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then { + // abort climb animation + if !(_this call FUNC(canClimb)) then { + [_this select 0, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); + }; + }; + }]; + _unit addEventHandler ["AnimDone", { if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; }]; @@ -32,5 +41,5 @@ if !(_unit getVariable [QGVAR(isClimbInit), false]) then { }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); -[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); +[_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); [_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 955be1a215..6941173fde 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -9,7 +9,7 @@ * The return value * * Example: - * _bool = [player] call ace_movement_fnc_getWeight + * [player] call ace_movement_fnc_getWeight * * Public: No */ diff --git a/addons/movement/stringtable.xml b/addons/movement/stringtable.xml index eb91496de8..efed949036 100644 --- a/addons/movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -11,7 +11,7 @@ Mostra peso in libbre Mostrar peso em libras Súly megjelenítése fontban. - Показать вес в фунтах + Показывать вес в фунтах Weight: @@ -32,7 +32,7 @@ Wspinaczka Trepar Vylézt - Подняться + Взобраться Mászás Arrampicati @@ -43,7 +43,7 @@ Nie możesz wspiąć się tutaj No se puede trepar aquí Zde není možné vylézt - Не можете подняться здесь + Здесь невозможно взобраться Itt nem tudsz mászni Non puoi arrampicarti qui diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index f0a9bb89d4..6a7db7d5ac 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -27,7 +27,7 @@ "\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \ ] -private ["_height", "_position", "_color", "_name", "_rank", "_size"]; +private ["_height", "_position", "_color", "_name", "_rank", "_size", "_icon"]; PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType); diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index d8ffda756c..c6087541a8 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -41,20 +41,21 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { diag_log text format ["[ACE_nametags] - ACRE Detected"]; DFUNC(isSpeaking) = { PARAMS_1(_unit); - ([_unit] call acre_api_fnc_isSpeaking) || ([ACE_player] call acre_api_fnc_isBroadcasting) + (([_unit] call acre_api_fnc_isSpeaking) || ([ACE_player] call acre_api_fnc_isBroadcasting)) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then { diag_log text format ["[ACE_nametags] - TFR Detected"]; DFUNC(isSpeaking) = { PARAMS_1(_unit); - (_unit getVariable ["tf_isSpeaking", false]) + (_unit getVariable ["tf_isSpeaking", false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { //No Radio Mod - Start a PFEH to watch the internal VON icon //Note: class RscDisplayVoiceChat {idd = 55} - only present when talking [{ + private ["_oldSetting", "_newSetting"]; _oldSetting = ACE_player getVariable [QGVAR(isSpeakingInGame), false]; _newSetting = (!(isNull findDisplay 55)); if (!(_oldSetting isEqualTo _newSetting)) then { @@ -64,7 +65,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { DFUNC(isSpeaking) = { PARAMS_1(_unit); - (_unit getVariable [QGVAR(isSpeakingInGame), false]) + (_unit getVariable [QGVAR(isSpeakingInGame), false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; }; }; diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index 6050b99c67..1bbd4d8efb 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -14,9 +14,7 @@ if !(isServer) exitWith {}; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index d35cef0d67..9efc70aeb9 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -1,9 +1,9 @@ #include "script_component.hpp" -_player = ACE_player; +private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"]; //don't show nametags in spectator -if (!alive _player) exitWith {}; +if (!alive ACE_player) exitWith {}; _onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then { 2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0 @@ -24,14 +24,14 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then { if ((!(_target isKindOf "CAManBase")) && {!(_target in allUnitsUAV)}) then { _target = effectiveCommander _target; if ((!isNull _target) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; - [_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); }; }; }; @@ -41,11 +41,11 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { _target = cursorTarget; if ((!isNull _target) && {_target isKindOf "CAManBase"} && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - _distance = _player distance _target; + _distance = ACE_player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); _alpha = _alpha min _onKeyPressAlphaMax; _icon = ICON_NONE; @@ -55,7 +55,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { _icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target} && {GVAR(showSoundWaves) > 0}) then {ICON_NAME_SPEAK} else {_defaultIcon}; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; }; @@ -84,12 +84,12 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho }; if ((_icon != ICON_NONE) && - {(side (group _target)) == (side (group _player))} && - {_target != _player} && + {(side (group _target)) == (side (group ACE_player))} && + {_target != ACE_player} && {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle _player, _target]) exitWith {}; // Check if there is line of sight + if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight _relPos = (visiblePositionASL _target) vectorDiff _pos; _distance = vectorMagnitude _relPos; _projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy)); @@ -102,7 +102,7 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho _alpha = _alpha min _onKeyPressAlphaMax; }; - [_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); + [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; } forEach _targets; }; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 32eb35781b..4f6e2cfb93 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -10,6 +10,7 @@ Pokaż imiona Nevek mutatása Показать имена + Mostra i nomi Show player names @@ -30,7 +31,7 @@ Zeige Spielernamen nur an, wenn die Maus auf sie gerrichtet ist (benötigt Spielernamen) Noms uniquement sous le curseur (si noms affichés) Zobrazit jméno hráče jenom na kurzor (vyžaduje jména hráčů) - Mostra i nomi solo se puntati (richiede i nomi dei giocatori abilitati) + Mostra i nomi solo se puntati (richiede mostra nomi abilitato) Mostrar nome de jogador somente no cursor (requer nome de jogadores) Játékosok nevének mutatása csak a kurzoron (a nevek mutatása szükséges) Показать имена игроков только под курсором (требует имен игроков) @@ -44,6 +45,7 @@ Pokaż imiona graczy tylko po przytrzymaniu klawisza (wymagana opcja Pokaż imiona graczy) Játékosnevek mutatása csak gombnyomásra (a nevek mutatása szükséges) Показать имена игроков только по нажатию клавиши (требует имен игроков) + Mostra i nomi solo se si preme il tasto (richiede mostra nomi abilitato) Show player ranks (requires player names) @@ -52,7 +54,7 @@ Mostrar rango de los jugadores (requiere Mostrar nombres de jugadores) Grade des joueurs (si noms affichés) Zobrazit hodnosti hráčů (vyžaduje jména hráčů) - Mostra i gradi (richiede i nomi dei giocatori abilitati) + Mostra i gradi (richiede mostra nomi abilitato) Mostrar patente de jogadores (requer nome de jogadores) Játékosok rendfokozatának mutatása (a nevek mutatása szükséges) Показать звания игроков (требует имен игроков) @@ -66,6 +68,7 @@ Zobrazit info o posádce vozidla Показать экипаж Jármű-legénység adatainak mutatása + Mostra le informazioni sull'equipaggio del veicolo Show name tags for AI units @@ -76,6 +79,7 @@ Wyświetl imiona jednostek AI Afficher les noms des IA Névcímkék mutatása MI-egységeknél + Mostra le tag nomi per le unità AI Show SoundWaves (requires player names) @@ -86,6 +90,7 @@ Pokaż fale dźwiękowe (wymagana opcja Pokaż imiona graczy) Afficher "qui parle" (si noms affichés) "Hanghullámok" mutatása (a nevek mutatása szükséges) + Mostra barra movimento audio (richiede mostra nomi abilitato) Default Nametag Color (Non Group Members) @@ -96,6 +101,7 @@ Couleur d'affichage par défaut (si dans aucun groupe) Standardní barva jmenovek (pro nečleny jednotky) Alap névcímke-szín (csoporton kívüli személyek) + Colore nametag di default (membri non del gruppo) diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 376059ce1b..db5d395096 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -42,7 +42,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, 1] call FUNC(changeNVGBrightness); @@ -56,7 +56,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if ((currentVisionMode _player != 1)) exitWith {false}; + if ((currentVisionMode ACE_player != 1)) exitWith {false}; // Statement [ACE_player, -1] call FUNC(changeNVGBrightness); diff --git a/addons/nightvision/functions/fnc_updatePPEffects.sqf b/addons/nightvision/functions/fnc_updatePPEffects.sqf index a90186fe10..9906a440fc 100644 --- a/addons/nightvision/functions/fnc_updatePPEffects.sqf +++ b/addons/nightvision/functions/fnc_updatePPEffects.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"]; +private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config", "_hmd", "_cameraView", "_turret"]; _currentVehicle = vehicle ACE_player; @@ -41,7 +41,7 @@ _fnc_isUsingHMD = { !("NVG" in getArray (_config >> "ViewOptics" >> "visionMode")); }; - private ["_result", "_turretConfig", "_turretConfigOpticsIn"]; + private ["_result", "_turretConfig", "_turretConfigOpticsIn", "_index"]; _result = true; _turretConfig = [_config, _turret] call EFUNC(common,getTurretConfigPath); _turretConfigOpticsIn = _turretConfig >> "OpticsIn"; diff --git a/addons/noradio/XEH_post_initClient.sqf b/addons/noradio/XEH_post_initClient.sqf index 4f35a1ced9..ecd80a6436 100644 --- a/addons/noradio/XEH_post_initClient.sqf +++ b/addons/noradio/XEH_post_initClient.sqf @@ -2,15 +2,13 @@ #include "script_component.hpp" /* -_setupPlayer = { +[{ if (!isNull ACE_player) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; [ACE_player, "isPlayer"] call EFUNC(common,muteUnit); }; -}; - -[_setupPlayer, 0, []] call CBA_fnc_addPerFrameHandler; +}, 0, []] call CBA_fnc_addPerFrameHandler; */ if (!hasInterface) exitWith {}; diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 7749db0bc4..6d61ff98a2 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -5,20 +5,20 @@ class CfgWeapons { class Default; class Binocular: Default { - forceOptics = 0; // Allow using compass with Binocular - opticsZoomMin = 0.056889; // 5.25x power - opticsZoomMax = 0.056889; // 9 px/mil - modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 horizontal field of view - visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes - // Fix AI using Binocs on short range - #18737 + forceOptics = 0; // Allow using compass with Binocular + opticsZoomMin = 0.056889; // 5.25x power + opticsZoomMax = 0.056889; // 9 px/mil + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 horizontal field of view + visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes + // Fix AI using Binocs on short range - #18737 // minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats) minRange = 500; //500 = seem almost never use it..? - minRangeProbab = 0.001; + minRangeProbab = 0.001; midRange = 1000; midRangeProbab = 0.01; maxRange = 5000; maxRangeProbab = 0.01; - }; + }; // zooming reticle scopes class optic_DMS: ItemCore { diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 675e415e47..69249b36c4 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -26,4 +26,14 @@ class CfgAddons { #include "gui\settingsMenu.hpp" #include "gui\pauseMenu.hpp" -#include "CFgVehicles.hpp" +#include "CfgVehicles.hpp" + +class ACE_Settings { + class GVAR(optionMenuDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = "$STR_ACE_optionsMenu_uiScaing"; + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; +}; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 3ac2455a64..f98c3548e8 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" +private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"]; + _compiledConfig = " "; { @@ -52,6 +54,10 @@ class %1 { typeName = %3; force = 1; };", _name, _value, format['"%1"', _typeName]]; + + //clipboard seems to be getting cuttoff, so do a backup dump to rpt: + diag_log text _compiledConfigEntry; + _compiledConfig = _compiledConfig + _compiledConfigEntry; }; } forEach EGVAR(common,settings); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index ca4a00891a..b8eb630f85 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -16,28 +16,28 @@ #include "script_component.hpp" -private ["_settingIndex", "_inputText"]; +private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; _settingIndex = lbCurSel 200; //Index of left list _inputText = ctrlText 414; //Index of right drop down switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { - try { - _setting = (GVAR(serverSideValues) select _settingIndex); - _settingName = _setting select 0; + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { + try { + _setting = (GVAR(serverSideValues) select _settingIndex); + _settingName = _setting select 0; - _convertedValue = switch (toUpper (_setting select 1)) do { + _convertedValue = switch (toUpper (_setting select 1)) do { case "STRING": {format ['"%1"', _inputText]}; case "ARRAY": {format [call compile "[%1]", _inputText]}; case "SCALAR": {parseNumber _inputText;}; - default {throw "Error"}; + default {throw "Error"}; + }; + [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); + } catch { }; - [MENU_TAB_SERVER_VALUES, _settingName, _convertedValue] call FUNC(updateSetting); - } catch { }; + [false] call FUNC(serverSettingsMenuUpdateList); }; - [false] call FUNC(serverSettingsMenuUpdateList); - }; }; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 7894d2ff1a..f5501d0860 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" +private ["_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_setting", "_menu", "_settingsMenu"]; + if (GVAR(serverConfigGeneration) == 0 || isMultiplayer) exitwith {closeDialog 145246;}; // Filter only user setable setting @@ -54,7 +56,6 @@ GVAR(serverSideValues) = []; //Delay a frame [{ [MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); -private "_menu"; disableSerialization; _menu = uiNamespace getvariable "ACE_serverSettingsMenu"; (_menu displayCtrl 1003) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 3a4c6ec561..050abcf295 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -16,9 +16,12 @@ #include "script_component.hpp" +private ["_setting", "_menu"]; + // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; + { // If the setting is user setable and not forced if ((_x select 2) && !(_x select 6)) then { @@ -40,7 +43,6 @@ GVAR(clientSideColors) = []; //Delay a frame [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); -private "_menu"; disableSerialization; _menu = uiNamespace getvariable "ACE_settingsMenu"; (_menu displayCtrl 1002) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 2dcf9f7fe7..52984b78f3 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; +private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index ad5d647c16..dad3012e1b 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 0138b9e87d..513b187d7d 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 93d35b284c..04e7ee5aaa 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -1,438 +1,452 @@ class ACE_settingsMenu { - idd = 145246; - movingEnable = false; - onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); - onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); + idd = 145246; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX (((safezoneW / safezoneH) min 1.2)) - #define SIZEY (SIZEX / 1.2) - #define UNITX (SIZEX / 40) - #define UNITY (SIZEY / 25) - #define OFFSETX (safezoneX + (safezoneW - SIZEX)/2) - #define OFFSETY (safezoneY + (safezoneH - (SIZEX / 1.2))/2) +#define SIZEX (((safezoneW / safezoneH) min 1.2)) +#define SIZEY (SIZEX / 1.2) +#define X_ORIGINAL(num) (num * (SIZEX / 40) + (safezoneX + (safezoneW - SIZEX)/2)) +#define Y_ORIGINAL(num) (num * (SIZEY / 25) + (safezoneY + (safezoneH - (SIZEX / 1.2))/2)) +#define W_ORIGINAL(num) (num * (SIZEX / 40)) +#define H_ORIGINAL(num) (num * (SIZEY / 25)) - class controlsBackground { - class HeaderBackground: ACE_gui_backgroundBase { - idc = -1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - text = ""; - }; - class CenterBackground: HeaderBackground { - y = 2.1 * UNITY + OFFSETY; - h = 2.5 * UNITY; - text = ""; - colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; - }; - class LeftBackground: CenterBackground { - y = 4.8 * UNITY + OFFSETY; - h = 17.4 * UNITY; - w = 25 * UNITX; - }; - class RightBackground: LeftBackground { - x = 26.1 * UNITX + OFFSETX; - w = 12.9 * UNITX; - }; - class RightBackgroundHeader: RightBackground { - h = 1.4 * UNITY; - colorBackground[] = {0,0,0,1}; - }; - }; +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) +#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) - class controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; +#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), X_ORIGINAL(num), X_MAKEITBIGGA(num))]) +#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), Y_ORIGINAL(num), Y_MAKEITBIGGA(num))]) +#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), W_ORIGINAL(num), W_MAKEITBIGGA(num))]) +#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(optionMenuDisplaySize)), 0)]), H_ORIGINAL(num), H_MAKEITBIGGA(num))]) + + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase { + idc = -1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + class CenterBackground: HeaderBackground { + y = Y_PART(2.1); + h = H_PART(2.5); + text = ""; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class LeftBackground: CenterBackground { + y = Y_PART(4.8); + h = H_PART(17.4); + w = W_PART(25); + }; + class RightBackground: LeftBackground { + x = X_PART(26.1); + w = W_PART(12.9); + }; + class RightBackgroundHeader: RightBackground { + h = H_PART(1.4); + colorBackground[] = {0,0,0,1}; + }; }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = 2 * UNITX + OFFSETX; - y = 3.4 * UNITY + OFFSETY; - w = 30 * UNITX; - h = 1 * UNITY; - text = ""; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = X_PART(2); + y = Y_PART(3.4); + w = W_PART(30); + h = H_PART(1); + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = X_PART(1); + y = Y_PART(2.1); + w = W_PART(9.5); + h = H_PART(1); + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); + SizeEx = H_PART(1); + Size = H_PART(1); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = X_PART(10.5); + action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = ""; + x = X_PART(20); + action = ""; + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = ""; + x = X_PART(29.5); + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = X_PART(2); + y = Y_PART(5.5); + w = W_PART(23); + h = H_PART(15); + SizeEx = H_ORIGINAL(0.8); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = X_PART(27.1); + y = Y_PART(5.1); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(1); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = X_PART(27.1); + y = Y_PART(6.2); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(0.65); + }; + class Label2: labelKey { + idc = 301; + y = Y_PART(7.3); + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = H_PART(1); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = X_PART(31.1); + y = Y_PART(7.3); + w = W_PART(7); + h = H_PART(1); + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = H_PART(0.9); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = Y_PART(8.2); + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = Y_PART(9.1); + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = Y_PART(10); + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = X_PART(27.1); + y = Y_PART(11); + w = W_PART(11); + h = H_PART(11); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class actionClose: ACE_gui_buttonBase { + idc = 10; + text = "$STR_DISP_CLOSE"; + x = X_PART(1); + y = Y_PART(22.3); + w = W_PART(7.5); + h = H_PART(1); + style = ST_LEFT; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = "closedialog 0;"; + SizeEx = H_PART(1); + Size = H_PART(1); + }; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = X_PART(9.5); + action = QUOTE([] call FUNC(resetSettings)); + }; + class action_exportServerConfig: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_OpenExport"; + x = X_PART(18); + action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + }; }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; - x = 1 * UNITX + OFFSETX; - y = 2.1 * UNITY + OFFSETY; - w = 9.5 * UNITX; - h = 1 * UNITY; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; - x = 10.5 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = ""; - x = 20 * UNITX + OFFSETX; - action = ""; - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = 29.5 * UNITX + OFFSETX; - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = 2 * UNITX + OFFSETX; - y = 5.5 * UNITY + OFFSETY; - w = 23 * UNITX; - h = 15 * UNITY; - SizeEx = (UNITY * 0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = 27.1 * UNITX + OFFSETX; - y = 5.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY *1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = 27.1 * UNITX + OFFSETX; - y = 6.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY * 0.65); - }; - class Label2: labelKey { - idc = 301; - y = 7.3 * UNITY + OFFSETY; - text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = 31.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 7 * UNITX; - h = 1 * UNITY; - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = 8.2 * UNITY + OFFSETY; - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = 9.1 * UNITY + OFFSETY; - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = 10 * UNITY + OFFSETY; - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = 27.1 * UNITX + OFFSETX; - y = 11 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 11 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class actionClose: ACE_gui_buttonBase { - idc = 10; - text = "$STR_DISP_CLOSE"; - x = 1 * UNITX + OFFSETX; - y = 22.3 * UNITY + OFFSETY; - w = 7.5 * UNITX; - h = 1 * UNITY; - style = ST_LEFT; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = "closedialog 0;"; - }; - class action_reset: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 26.1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(resetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1102; - text = "$STR_ACE_OptionsMenu_OpenExport"; - x = 1 * (SIZEX / 40) + OFFSETX; - action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); - }; - }; }; class ACE_serverSettingsMenu: ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', _this select 0)]; [] call FUNC(onServerSettingsMenuOpen);); onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_serverSettingsMenu', nil)];); - class controls: controls { - class HeaderName { - idc = 1; - type = CT_STATIC; - x = 1 * UNITX + OFFSETX; - y = 1 * UNITY + OFFSETY; - w = 38 * UNITX; - h = 1 * UNITY; - style = ST_LEFT + ST_SHADOW; - font = "PuristaMedium"; - SizeEx = (UNITY * 1); - colorText[] = {0.95, 0.95, 0.95, 0.75}; - colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + class controls: controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = X_PART(1); + y = Y_PART(1); + w = W_PART(38); + h = H_PART(1); + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = H_PART(1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = X_PART(2); + y = Y_PART(3.4); + w = W_PART(30); + h = H_PART(1); + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = X_PART(1); + y = Y_PART(2.1); + w = W_PART(9.5); + h = H_PART(1); + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,1}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = X_PART(10.5); + action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = "$STR_ACE_OptionsMenu_TabValues"; + x = X_PART(20); + action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = ""; + x = X_PART(29.5); + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = X_PART(2); + y = Y_PART(5.5); + w = W_PART(23); + h = H_PART(15); + SizeEx = H_ORIGINAL(0.8); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = X_PART(27.1); + y = Y_PART(5.1); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(1); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = X_PART(27.1); + y = Y_PART(6.2); + w = W_PART(11); + h = H_PART(1); + text = ""; + SizeEx = H_PART(0.65); + }; + class Label2: labelKey { + idc = 301; + y = Y_PART(7.3); + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = H_PART(1); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = X_PART(31.1); + y = Y_PART(7.3); + w = W_PART(7); + h = H_PART(1); + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = H_PART(0.9); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = Y_PART(8.2); + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = Y_PART(9.1); + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = Y_PART(10); + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class inputField1: ACE_gui_editBase { + idc = 414; + x = X_PART(27.1); + y = Y_PART(7.3); + w = W_PART(11); + h = H_PART(0.75); + }; + class inputFieldTypeLabel: ACE_gui_staticBase { + idc = 415; + x = X_PART(27.1); + y = Y_PART(8.2); + w = W_PART(11); + h = H_PART(0.75); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class saveInputButton: selectionAction_1 { + idc = 416; + text = "$STR_ACE_OptionsMenu_SaveInput"; + x = X_PART(27.1); + y = Y_PART(9.1); + w = W_PART(11); + h = H_PART(1); + action = QUOTE([] call FUNC(onServerSaveInputField);); + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = X_PART(27.1); + y = Y_PART(11); + w = W_PART(11); + h = H_PART(11); + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = H_PART(0.8); + }; + class actionClose; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = X_PART(26.1); + action = QUOTE([] call FUNC(serverResetSettings)); + }; + class action_exportServerConfig: actionClose { + idc = 1101; + text = "$STR_ACE_OptionsMenu_Export"; + x = X_PART(1); + action = QUOTE([] call FUNC(exportSettings)); + }; + class action_toggleIncludeClientSettings: actionClose { + idc = 1102; + text = "$STR_ACE_OptionsMenu_inClientSettings"; + x = X_PART(9); + action = QUOTE([] call FUNC(toggleIncludeClientSettings)); + }; }; - class labelSubHeader: ACE_gui_staticBase { - idc = 13; - x = 2 * UNITX + OFFSETX; - y = 3.4 * UNITY + OFFSETY; - w = 30 * UNITX; - h = 1 * UNITY; - text = ""; - }; - class selectionAction_1: ACE_gui_buttonBase { - idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; - x = 1 * UNITX + OFFSETX; - y = 2.1 * UNITY + OFFSETY; - w = 9.5 * UNITX; - h = 1 * UNITY; - animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; - animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)"; - animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; - animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; - animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 1}; - color2[] = {0,0,0, 1}; - colorBackgroundFocused[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,1}; - colorFocused[] = {0,0,0,1}; - periodFocus = 1; - periodOver = 1; - action = QUOTE([MENU_TAB_SERVER_OPTIONS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_2: selectionAction_1 { - idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; - x = 10.5 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_3: selectionAction_1 { - idc = 1002; - text = "$STR_ACE_OptionsMenu_TabValues"; - x = 20 * UNITX + OFFSETX; - action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); - }; - class selectionAction_4: selectionAction_1 { - idc = 1003; - text = ""; - x = 29.5 * UNITX + OFFSETX; - action = ""; - }; - class listBoxSettingsList: ACE_gui_listNBox { - idc = 200; - x = 2 * UNITX + OFFSETX; - y = 5.5 * UNITY + OFFSETY; - w = 23 * UNITX; - h = 15 * UNITY; - SizeEx = (UNITY * 0.8); - colorBackground[] = {0, 0, 0, 0.9}; - colorSelectBackground[] = {0, 0, 0, 0.9}; - columns[] = {0.0, 0.6}; - onLBSelChanged = QUOTE(_this call FUNC(serverSettingsMenuUpdateKeyView)); - }; - class labelTitle: ACE_gui_staticBase { - idc = 250; - x = 27.1 * UNITX + OFFSETX; - y = 5.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY *1); - }; - class labelKey: ACE_gui_staticBase { //Variable Name - idc = 300; - x = 27.1 * UNITX + OFFSETX; - y = 6.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - text = ""; - SizeEx = (UNITY * 0.65); - }; - class Label2: labelKey { - idc = 301; - y = 7.3 * UNITY + OFFSETY; - text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 1); - }; - class comboBox1: ACE_gui_comboBoxBase { - idc = 400; - x = 31.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 7 * UNITX; - h = 1 * UNITY; - onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.9); - }; - class sliderBar1: RscXSliderH { - idc = 410; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); - color[] = {1,0,0,0.4}; - colorActive[] = {1,0,0,1}; - }; - class sliderBar2: sliderBar1 { - idc = 411; - y = 8.2 * UNITY + OFFSETY; - color[] = {0,1,0,0.4}; - colorActive[] = {0,1,0,1}; - }; - class sliderBar3: sliderBar1 { - idc = 412; - y = 9.1 * UNITY + OFFSETY; - color[] = {0,0,1,0.4}; - colorActive[] = {0,0,1,1}; - }; - class sliderBar4: sliderBar1 { - idc = 413; - y = 10 * UNITY + OFFSETY; - color[] = {1,1,1,0.4}; - colorActive[] = {1,1,1,1}; - }; - class inputField1: ACE_gui_editBase { - idc = 414; - x = 27.1 * UNITX + OFFSETX; - y = 7.3 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - }; - class inputFieldTypeLabel: ACE_gui_staticBase { - idc = 415; - x = 27.1 * UNITX + OFFSETX; - y = 8.2 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 0.75 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class saveInputButton: selectionAction_1 { - idc = 416; - text = "$STR_ACE_OptionsMenu_SaveInput"; - x = 27.1 * UNITX + OFFSETX; - y = 9.1 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 1 * UNITY; - action = QUOTE([] call FUNC(onServerSaveInputField);); - }; - class labelDesc: ACE_gui_staticBase { - idc = 251; - x = 27.1 * UNITX + OFFSETX; - y = 11 * UNITY + OFFSETY; - w = 11 * UNITX; - h = 11 * UNITY; - text = ""; - style = ST_LEFT + ST_MULTI; - lineSpacing = 1; - SizeEx = (UNITY * 0.8); - }; - class actionClose; - class action_reset: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 26.1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(serverResetSettings)); - }; - class action_exportServerConfig: actionClose { - idc = 1101; - text = "$STR_ACE_OptionsMenu_Export"; - x = 1 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(exportSettings)); - }; - class action_toggleIncludeClientSettings: actionClose { - idc = 1102; - text = "$STR_ACE_OptionsMenu_inClientSettings"; - x = 9 * (SIZEX / 40) + OFFSETX; - action = QUOTE([] call FUNC(toggleIncludeClientSettings)); - }; - }; }; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index c4ac2b1593..2bc66b8b52 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -22,6 +22,7 @@ Napraw animację Corriger animation Animációk kijavítása + Fixa l'animazione Reset All @@ -32,6 +33,7 @@ Resetuj wszystko Défaut Minden visszaállítása + Resetta tutto Colors @@ -42,6 +44,7 @@ Barvy Kolory Színek + Colori Options @@ -64,6 +67,7 @@ Valeurs Werte Értékek + Valori Yes @@ -98,6 +102,7 @@ Ustawienie: Paramètres Opció: + Parametri: Export @@ -108,6 +113,7 @@ Eksport Exporter Exportálás + Esporta Open Export Menu @@ -118,6 +124,7 @@ Otwórz menu eksportowania Ouvrir le menu d'exportation Exportálási menü megnyitása + Apri menù esportazione String input. @@ -127,6 +134,7 @@ Wpisywanie tekstu. Entrée String bevitel. + Stringa di unput. Array. Seperate elements by using ,. @@ -137,6 +145,7 @@ Tableau. Séparation par ,. Tabulka. Odděl elementy použitím ,. Array. Válasszad el az elemeket vesszővel. + Array. Separa gli elementi usando ,. Number @@ -147,6 +156,7 @@ Cyfra Nombre Szám + Numero Uknown input type @@ -157,6 +167,7 @@ Nieznany rodzaj danych Type d'entrée inconnue Ismeretlen beviteli típus + Input inserito sconosciuto Save input @@ -167,6 +178,7 @@ Zapisz dane Sauvegarder Bevitel elmentése + Salva input Include Client Settings @@ -177,6 +189,7 @@ Zawrzyj ustawienia klienta Inclure paramètres client Kliens-beállítások melléklése + Includi i parametri del client Exclude Client Settings @@ -187,6 +200,7 @@ Wyklucz ustawienia klienta Exclure paramètres client Kliens-beállítások elhagyása + Escludi i parametri del client Settings exported to clipboard @@ -197,6 +211,10 @@ Ustawienia wyeksportowano do schowka Paramètres exportés dans le presse papier Beállítások exportálva a vágólapba + Parametri esportati alla clipboard + + + Option Menu UI Scaling - + \ No newline at end of file diff --git a/addons/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index 6c15068815..0b811f9792 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -18,6 +18,8 @@ EXPLODE_2_PVT(_this,_player,_weapon); +private ["_action"]; + // Play animation and report temperature _action = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_checkTemperatureAction"); diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 6112bea178..3012e480e3 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -16,7 +16,7 @@ EXPLODE_2_PVT(_this,_player,_weapon); // Calculate cool down of weapon since last shot -private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"]; +private ["_string", "_overheat", "_temperature", "_time", "_barrelMass", "_a"]; _string = format [QGVAR(%1), _weapon]; _overheat = _player getVariable [_string, [0, 0]]; _temperature = _overheat select 0; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 2468265f8f..05e5bbba9c 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -17,7 +17,8 @@ */ #include "\z\ace\addons\overheating\script_component.hpp" -private ["_unit", "_weapon", "_ammo", "_projectile"]; +private ["_unit", "_weapon", "_ammo", "_projectile", "_velocity", "_variableName", "_overheat", "_temperature", "_time", "_bulletMass", "_energyIncrement", "_barrelMass", "_scaledTemperature", "_intensity", "_position", "_direction", "_dispersion", "_count", "_slowdownFactor", "_jamChance", "_surface"]; + _unit = _this select 0; _weapon = _this select 1; _ammo = _this select 4; @@ -25,8 +26,6 @@ _projectile = _this select 6; _velocity = velocity _projectile; -private ["_variableName", "_overheat", "_temperature", "_time", "_energyIncrement", "_barrelMass", "_scaledTemperature"]; - // each weapon has it's own variable. Can't store the temperature in the weapon since they are not objects unfortunately. _variableName = format [QGVAR(%1), _weapon]; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index ead4b33943..19e6d413a2 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -14,12 +14,13 @@ * Public: No */ #include "script_component.hpp" + if (!hasInterface) exitWith {}; ["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { [ace_player] call FUNC(showAltimeter); @@ -40,5 +41,4 @@ GVAR(PFH) = false; }] call EFUNC(common,addEventHandler); // don't show speed and height when in expert mode -["Parachute", {if (!cadetMode) then {_dlg = _this select 0; {(_dlg displayCtrl _x) ctrlShow false} forEach [121, 122, 1004, 1005, 1006, 1014];};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Parachute" -["Soldier", {if (!cadetMode) then {_dlg = _this select 0; {_ctrl = (_dlg displayCtrl _x); _ctrl ctrlSetPosition [0,0,0,0]; _ctrl ctrlCommit 0;} forEach [380, 382]};}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" +["infoDisplayChanged", {_this call FUNC(handleInfoDisplayChanged)}] call EFUNC(common,addEventHandler); diff --git a/addons/parachute/XEH_preInit.sqf b/addons/parachute/XEH_preInit.sqf index 91c24606c6..f446d955b8 100644 --- a/addons/parachute/XEH_preInit.sqf +++ b/addons/parachute/XEH_preInit.sqf @@ -18,6 +18,7 @@ ADDON = false; PREP(doLanding); +PREP(handleInfoDisplayChanged); PREP(hideAltimeter); PREP(onEachFrame); PREP(showAltimeter); diff --git a/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf new file mode 100644 index 0000000000..9b076256dd --- /dev/null +++ b/addons/parachute/functions/fnc_handleInfoDisplayChanged.sqf @@ -0,0 +1,41 @@ +/* + * Author: commy2 + * Hides the height and velocity display while freefalling or parachuting on higher difficulties. + * + * Arguments: + * Stuff from infoDisplayChanged eventhandler. + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private ["_dialog", "_type"]; + +_dialog = _this select 0; +_type = _this select 1; + +// don't do anything in noob mode +if (cadetMode) exitWith {}; + +switch (_type) do { + case ("Parachute"): { + { + (_dialog displayCtrl _x) ctrlShow false; + } forEach [121, 122, 1004, 1005, 1006, 1014]; + }; + + case ("Soldier"): { + { + private "_control"; + _control = (_dialog displayCtrl _x); + + // these reset ctrlShow every frame by the engine. Set height/width to 0 as work around. + _control ctrlSetPosition [0,0,0,0]; + _control ctrlCommit 0; + } forEach [380, 382]; + }; +}; +nil // switch might return true if no case was found. Just to make sure the return value matches diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index a8200fb2ca..45816cc883 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -14,19 +14,24 @@ * Public: Yes */ #include "script_component.hpp" + private ["_unit"]; + _unit = _this select 0; -(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN",0,true]; + +(["ACE_Altimeter"] call BIS_fnc_rscLayer) cutRsc ["ACE_Altimeter", "PLAIN", 0, true]; if (isNull (uiNamespace getVariable ["ACE_Altimeter", displayNull])) exitWith {}; GVAR(AltimeterActive) = true; + [{ - if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);}; + if (!GVAR(AltimeterActive)) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler)}; disableSerialization; EXPLODE_4_PVT(_this select 0,_display,_unit,_oldHeight,_prevTime); - if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler);call FUNC(hideAltimeter);}; + if !("ACE_Altimeter" in assignedItems _unit) exitWith {[_this select 1] call CALLSTACK(cba_fnc_removePerFrameEventHandler); call FUNC(hideAltimeter)}; + + private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime", "_timeDiff"]; - private ["_height", "_hour", "_minute", "_descentRate","_HeightText", "_DecendRate", "_TimeText", "_curTime"]; _HeightText = _display displayCtrl 1100; _DecendRate = _display displayCtrl 1000; _TimeText = _display displayCtrl 1001; @@ -35,7 +40,8 @@ GVAR(AltimeterActive) = true; _height = (getPosASL _unit) select 2; _curTime = time; - _descentRate = floor ((_oldHeight - _height) / (_curTime - _prevTime)); + _timeDiff = _curTime - _prevTime; + _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; _TimeText ctrlSetText (format ["%1:%2",[_hour, 2] call EFUNC(common,numberToDigitsString),[_minute, 2] call EFUNC(common,numberToDigitsString)]); _HeightText ctrlSetText (format ["%1", floor(_height)]); diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index 52ccaefe77..a1de714331 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -11,6 +11,7 @@ Altímetro Magasságmérő Высотомер + Altimetro Altimeter Watch @@ -21,6 +22,7 @@ Reloj altímetro Magasságmérős karóra Часы с высотомером + Controlla l'altimetro Used to show height, descent rate and the time. @@ -31,6 +33,7 @@ Utilizado para mostrar altura, tasa de descenso y hora. Mutatja a magasságot, a zuhanási sebességet, és az időt. Используется для определения высоты, скорости снижения и времени. + Usato per mostrare l'altitudine, la velocità di discesa e l'ora. Non-Steerable Parachute @@ -41,6 +44,7 @@ Neříditelný padák Irányíthatatlan ejtőernyő Неуправляемый парашют + Paracadute non manovrabile - \ No newline at end of file + diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 63c302bf07..4075e7a151 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -13,6 +13,8 @@ EXPLODE_2_PVT(_this,_player,_target); +private ["_magazineType", "_magazineCfg"]; + // Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { if (currentMagazine _target != "") exitWith {true}; diff --git a/addons/reload/functions/fnc_displayAmmo.sqf b/addons/reload/functions/fnc_displayAmmo.sqf index 77578caa68..06f3a39da3 100644 --- a/addons/reload/functions/fnc_displayAmmo.sqf +++ b/addons/reload/functions/fnc_displayAmmo.sqf @@ -14,7 +14,7 @@ EXPLODE_1_PVT(_this,_target); -private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture"]; +private ["_weapon","_muzzle","_magazine","_showNumber","_ammo","_maxRounds","_count","_text","_color","_picture", "_a", "_string"]; _weapon = currentWeapon _target; _muzzle = currentMuzzle _target; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 412fcabb97..8b9145c237 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -15,7 +15,7 @@ EXPLODE_2_PVT(_this,_player,_target); if (vehicle _target != _target) exitWith {false}; -private ["_magazineCfg","_magazineType"]; +private ["_magazineCfg","_magazineType", "_condition", "_onFailure", "_onFinish"]; _magazineType = currentMagazine _target; _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; @@ -54,7 +54,7 @@ _onFinish = { _onFailure = { EXPLODE_3_PVT((_this select 0),_player,_target,_magazine); - [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + [_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); // Add back the magazine with the former ammo count _player addMagazine _magazine; diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 7c401fec05..51956670b7 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -10,6 +10,7 @@ Sprawdź stan amunicji przy przeładowaniu broni Vérification des munitions au rechargement Lőszer ellenőrzése a fegyver újratöltésekor + Controlla le munizioni ricaricando Check the ammo in your new magazine on magazine reload. @@ -20,6 +21,7 @@ Pokaż stan amunicji w nowym magazynku przy przeładowaniu broni Vérification du nombre de munition au rechargement A lőszer ellenőrzése az új tárad behelyezésekor újratöltés közben. + Controlla le munizioni rimanenti nel caricatore in fase di cambio caricatore. Check Ammo @@ -54,6 +56,7 @@ Podłącz taśmę Gurt anhängen Töltényheveder összekötése + Attacca la tracolla Linking belt... @@ -64,6 +67,7 @@ Podłączanie taśmy... Gurt anhängen ... Töltényheveder összekötése folyamatban... + Attacco la tracolla... diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index 36772f9dfd..fc802a025c 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -14,12 +14,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_magazine"]; - -_unit = _this select 0; -_target = _this select 1; -_weapon = _this select 2; -_magazine = _this select 3; +PARAMS_4(_unit,_target,_weapon,_magazine); _target selectWeapon _weapon; diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index ff5637eaf6..7716050334 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -11,6 +11,7 @@ Załaduj wyrzutnię Charger lanceur Kilövö betöltése + Carica lanciamissili Loading launcher ... @@ -21,6 +22,7 @@ Nabíjím odpalovač ... Ładowanie wyrzutni ... Kilövő betöltés alatt ... + Carico il lanciamissili ... Launcher loaded @@ -31,6 +33,7 @@ Odpalovač nabit Wyrzutnia załadowana Kilövő betöltve + Lanciamissili caricato Load %1 @@ -41,6 +44,7 @@ Nabít %1 Załadowano %1 %1 betöltése + Caricato %1 diff --git a/addons/respawn/functions/fnc_handleInitPostServer.sqf b/addons/respawn/functions/fnc_handleInitPostServer.sqf index f8a0479717..914334cc25 100644 --- a/addons/respawn/functions/fnc_handleInitPostServer.sqf +++ b/addons/respawn/functions/fnc_handleInitPostServer.sqf @@ -2,13 +2,11 @@ // execute on server only! #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); private ["_group0", "_rallypoint"]; -_group0 = group _unit; // _group is a reserved veriable and shouldn't be used +_group0 = group _unit; // _group-is a reserved veriable and shouldn't be used _rallypoint = [ objNull, diff --git a/addons/respawn/functions/fnc_initRallypoint.sqf b/addons/respawn/functions/fnc_initRallypoint.sqf index 44671b7c45..2ef158a419 100644 --- a/addons/respawn/functions/fnc_initRallypoint.sqf +++ b/addons/respawn/functions/fnc_initRallypoint.sqf @@ -16,11 +16,7 @@ #include "script_component.hpp" -private ["_rallypoint", "_respawnMarker", "_side"]; - -_rallypoint = _this select 0; -_respawnMarker = _this select 1; -_side = _this select 2; +PARAMS_3(_rallypoint,_respawnMarker,_side); private "_name"; _name = typeOf _rallypoint; @@ -29,12 +25,11 @@ _name = typeOf _rallypoint; if (hasInterface) then { // fix init having wrong position, vars etc. [_rallypoint, _respawnMarker, _side, _name] spawn { - _rallypoint = _this select 0; - _respawnMarker = _this select 1; - _side = _this select 2; - _name = _this select 3; - - _marker = format ["ACE_Marker_%1", _name]; + PARAMS_4(_rallypoint,_respawnMarker,_side,_name); + + private ["_marker", "_type"]; + + _marker = format ["ACE_Marker_%1", _name]; // exit if it already exist if (_marker in allMapMarkers) exitWith {}; diff --git a/addons/respawn/functions/fnc_module.sqf b/addons/respawn/functions/fnc_module.sqf index 6d03c1eda3..4f22bdfcd4 100644 --- a/addons/respawn/functions/fnc_module.sqf +++ b/addons/respawn/functions/fnc_module.sqf @@ -18,10 +18,9 @@ #include "script_component.hpp" -if !(isServer) exitWith {}; +PARAMS_3(_logic,_units,_activated); -_logic = _this select 0; -_activated = _this select 2; +if !(isServer) exitWith {}; if !(_activated) exitWith {}; @@ -32,9 +31,10 @@ GVAR(Module) = true; if (isServer) then { if (GVAR(RemoveDeadBodiesDisconnected)) then { + private "_fnc_deleteDisconnected"; _fnc_deleteDisconnected = { _this spawn { - _unit = _this select 0; + PARAMS_1(_unit); sleep 4; diff --git a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf index 35857b43e4..7641db806d 100644 --- a/addons/respawn/functions/fnc_moduleFriendlyFire.sqf +++ b/addons/respawn/functions/fnc_moduleFriendlyFire.sqf @@ -19,17 +19,13 @@ #include "script_component.hpp" _this spawn { - _logic = _this select 0; - _units = _this select 1; - _activated = _this select 2; + PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; if (isServer) then { - _varName = QGVAR(showFriendlyFireMessage); - - missionNamespace setVariable [_varName, true]; - publicVariable _varName; + missionNamespace setVariable [QGVAR(showFriendlyFireMessage), true]; + publicVariable QGVAR(showFriendlyFireMessage); }; diag_log text "[ACE]: Friendly Fire Messages Module Initialized."; diff --git a/addons/respawn/functions/fnc_moduleRallypoint.sqf b/addons/respawn/functions/fnc_moduleRallypoint.sqf index 1646fa72da..15c415027d 100644 --- a/addons/respawn/functions/fnc_moduleRallypoint.sqf +++ b/addons/respawn/functions/fnc_moduleRallypoint.sqf @@ -16,11 +16,9 @@ VOID */ - #include "script_component.hpp" - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index 62d2742ef9..2453c68344 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -18,9 +18,10 @@ #include "script_component.hpp" _this spawn { - _unit = _this select 0; - _side = _this select 1; - + PARAMS_2(_unit,_side); + + private ["_rallypoint", "_position"]; + // rallypoint names are defined in CfgVehicles.hpp _rallypoint = [ diff --git a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf index 492cd990a4..7bd0a6707f 100644 --- a/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf +++ b/addons/respawn/functions/fnc_removeDisconnectedPlayer.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_forceRemove", "_body"]; +private ["_forceRemove", "_body", "_uid"]; _forceRemove = _this select 0; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 5a00e3425c..85863bb6c2 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -17,11 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular"]; +PARAMS_2(_unit,_allGear); +private ["_unit", "_allGear", "_headgear", "_goggles", "_uniform", "_uniformitems", "_vest", "_vestitems", "_backpack", "_backpackitems", "_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", "_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", "_assigneditems", "_binocular", "_backpa", "_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine"]; -_unit = _this select 0; -_allGear = _this select 1; // remove all starting gear of a player removeAllWeapons _unit; diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index 82a1d68e05..dc3cc16b92 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -1,31 +1,29 @@ /* - Name: ACE_Respawn_fnc_teleportToRallypoint - - Author(s): - commy2 - - Description: - teleports a unit to a rallypoint - - Parameters: - 0: OBJECT - unit - 1: OBJECT - side - 2: BOOLEAN - teleport to base - - Returns: - VOID -*/ - + * Author: commy2 + * teleports a unit to a rallypoint + * + * Arguments: + * 0: unit + * 1: side? + * 2: teleport to base + * + * Return Value: + * Nothing + * + * Example: + * [,,] call ACE_Respawn_fnc_teleportToRallypoint; + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_side", "_rallypoint", "_toBase"]; +PARAMS_3(_unit,_side,_rallypoint); -_unit = _this select 0; -_side = _this select 1; -_rallypoint = _this select 2; +private ["_toBase"]; // rallypoint names are defined in CfgVehicles.hpp +//IGNORE_PRIVATE_WARNING("_Base") _toBase = _rallypoint find "_Base" != -1; _rallypoint = missionNamespace getVariable [_rallypoint, objNull], diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index af003b4c28..5874b095ae 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -1,15 +1,17 @@  + Deploy in 5 seconds ... Déploiement dans 5 secondes ... Wird in 5 Sekunden errichtet ... - Desplegando en 5 segundos ... + Despliegue en 5 segundos ... Возрождение через 5 секунд ... Rozmieszczenie za 5 sekund ... Respawn za 5 sekund... Kihelyezés 5 másodperc múlva ... + Dispiegamento in 5 secondi ... Rallypoint deployed @@ -20,6 +22,7 @@ Punkt zbiórki rozmieszczony Rallypoint umístěn Gyülekezőpont elhelyezve + Rallypoint dispiegato Teleported to Base @@ -30,6 +33,7 @@ Przeteleportowano do bazy Odteleportován na základnu Bázisra teleportálva + Teleportato alla base Teleported to Rallypoint @@ -40,30 +44,49 @@ Przeteleportowano do punktu zbiórki Odteleportován na rallypoint Gyülekezőpontra teleportálva + Teleportato al rallypoint Rallypoint West (Base) Sammelpunkt West (Basis) + Punto de reunión Oeste (Base) + Точка сбора Синих (База) + Punkt zbiórki Zachodu (Baza) Rallypoint East (Base) Sammelpunkt Ost (Basis) + Punto de reunión Este (Base) + Точка сбора Красных (База) + Punkt zbiórki Wschodu (Baza) Rallypoint Independent (Base) Sammelpunkt Widerstand (Basis) + Punto de reunión Independiente (Base) + Точка сбора Независимых (База + Punkt zbiórki Ruchu oporu (Baza) Rallypoint West Sammelpunkt West + Punto de reunión Oeste + Точка сбора Синих + Punkt zbiórki Zachodu Rallypoint East Sammelpunkt Ost + Punto de reunión Este + Точка сбора Красных + Punkt zbiórki Wschodu Rallypoint Independent Sammelpunkt Widerstand + Punto de reunión Independiente + Точка сбора Независимых + Punkt zbiórki Ruchu oporu - + \ No newline at end of file diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index aa13029547..be6b79d82a 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -3,6 +3,7 @@ if (!hasInterface) exitWith {}; +// IGNORE_PRIVATE_WARNING(_player) //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" diff --git a/addons/safemode/stringtable.xml b/addons/safemode/stringtable.xml index 40691bd7da..521651999a 100644 --- a/addons/safemode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -10,6 +10,7 @@ Biztonságos mód Предохранитель Sécurité + Sicura inserita Take off Safety @@ -20,6 +21,7 @@ Biztonsági kapcsoló eltolása Снять с предохранителя Enlever sécurité + Togli la sicura Put on Safety @@ -30,6 +32,7 @@ Biztonsági kapcsoló helyretolása Поставить на предохранитель Sécurité mise + Inserisci la sicura Took off Safety @@ -40,6 +43,7 @@ Biztonságos mód megszüntetve Снят с предохранителя Sécurité enlevée + Togli la sicura diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 76c62a4688..a59095d127 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -14,11 +14,11 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_3(_unit,_turretAndDirection,_majorStep); -private ["_unit", "_turretAndDirection", "_majorStep", "_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero"]; +if (vehicle _unit != _unit) exitWith {false}; -EXPLODE_3_PVT(_this,_unit,_turretAndDirection,_majorStep); +private ["_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 4dbab48f49..12e911b537 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -12,10 +12,11 @@ */ #include "script_component.hpp" -if !(vehicle _unit == _unit) exitWith {false}; +PARAMS_1(_unit); -private ["_unit", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; -_unit = _this select 0; +if (vehicle _unit != _unit) exitWith {false}; + +private ["_weaponIndex", "_adjustment", "_zeroing", "_elevation", "_windage", "_zero"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 6bb72558b1..4950fe9ece 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -private ["_unit", "_elevation", "_windage", "_zero", "_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw"]; - EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero); +private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"]; + _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); _adjustment = _unit getVariable QGVAR(Adjustment); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index c9663ea711..619d82cf6e 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -12,13 +12,14 @@ */ #include "script_component.hpp" +PARAMS_1(_unit); + +private ["_weaponIndex", "_adjustment", "_elevation"]; + if (cameraView == "GUNNER") exitWith {false}; if !(vehicle _unit == _unit) exitWith {false}; if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; -private ["_unit", "_adjustment", "_elevation"]; -_unit = _this select 0; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 4a06a779b5..dd5abdef55 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -6,54 +6,63 @@ Zerowanie powoli w górę Малая корректировка ВВЕРХ Ajuste menor arriba + Regola leggermente alzata in alto Minor adjustment down Zerowanie powoli w dół Малая корректировка ВНИЗ Ajuste menor abajo + Regola leggermente alzata in basso Minor adjustment right Zerowanie powoli w prawo Малая корректировка ВПРАВО Ajuste menor derecha + Regola leggermente il tiro a destra Minor adjustment left Zerowanie powoli w lewo Малая корректировка ВЛЕВО Ajuste menor izquierda + Regola leggermete il tiro a sinistra Major adjustment up Zerowanie w górę Большая корректировка ВВЕРХ Ajuste mayor arriba + Regola l'alzata in alto Major adjustment down Zerowanie w dół Большая корректировка ВНИЗ Ajuste mayor abajo + Regola l'alzata in basso Major adjustment right Zerowanie w prawo Большая корректировка ВПРАВО Ajuste mayor derecha + Regola il tiro a destra Major adjustment left Zerowanie w lewo Большая корректировка ВЛЕВО Ajuste mayor izquierda + Regola il tiro a sinistra Set zero adjustment Zresetuj wyzerowanie Сбросить корректировку Establecer ajuste a cero + Resetta i valori del tiro diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 62a7c42a22..7204e73d36 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -17,12 +17,10 @@ #include "script_component.hpp" -private ["_unit", "_sides"]; -_unit = _this select 0; -_sides = _this select 1; +PARAMS_2(_unit,_sides); ["theMapClick", "onMapSingleClick", { - + // IGNORE_PRIVATE_WARNING(_pos,_shift,_alt) if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then { [_this, _pos, _shift, _alt] call FUNC(handleMapClick); }; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index 3033071984..bfe36f13ea 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_unit, _sides] call FUNC(handleMapClick) + * [unit, _sides] call FUNC(handleMapClick) * * Public: No */ diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index 9c71f8cefc..c2857f1091 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_player, _sides] call FUNC(initPlayer) + * [player, [west]] call FUNC(initPlayer) * * Public: No */ @@ -19,8 +19,7 @@ private ["_playerUnit", "_sides"]; -_playerUnit = _this select 0; -_sides = _this select 1; +PARAMS_2(_playerUnit,_sides); if (vehicle _playerUnit == _playerUnit) then { diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf index b79c54054f..987c4e3528 100644 --- a/addons/switchunits/functions/fnc_nearestPlayers.sqf +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -10,14 +10,15 @@ * Player units > * * Example: - * [_pos, 100] call FUNC(nearestPlayers) + * [[300,300,0], 100] call FUNC(nearestPlayers) * * Public: Yes */ - #include "script_component.hpp" -private ["_position", "_radius", "_nearestPlayers"]; +private ["_nearestPlayers"]; + +PARAMS_2(_position,_radius); _position = _this select 0; _radius = _this select 1; @@ -25,9 +26,9 @@ _radius = _this select 1; _nearestPlayers = []; { - if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { - _nearestPlayers pushBack _x; - }; + if ([_x] call EFUNC(common,isPlayer) && {alive _x}) then { + _nearestPlayers pushBack _x; + }; } forEach (nearestObjects [_position, ["Man"], _radius]); - _nearestPlayers +_nearestPlayers diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index d54713bbe4..69be77dd8b 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -10,26 +10,20 @@ * None * * Example: - * [_origPlayer, _respPlayer] call FUNC(switchBack) + * [_originalPlayerUnit, _currentUnit] call FUNC(switchBack) * * Public: Yes */ #include "script_component.hpp" -private ["_origPlayerUnit"]; +PARAMS_1(_originalPlayerUnit); -_origPlayerUnit = _this select 0; -[_origPlayerUnit] joinSilent GVAR(OriginalGroup); +[_originalPlayerUnit] joinSilent GVAR(OriginalGroup); DFUNC(pfhSwitchBack) = { - - private ["_args", "_originalPlayerUnit", "_currentUnit"]; - - _args = _this select 0; - - _originalPlayerUnit = _args select 0; - _currentUnit = _args select 1; + PARAMS_2(_args,_pfID); + EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit); if (local _originalPlayerUnit) exitWith { selectPlayer _originalPlayerUnit; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index abd053ffae..b1879b0999 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -18,9 +18,9 @@ #include "script_component.hpp" -private ["_unit", "_allNearestPlayers", "_oldUnit", "_leave"]; +private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"]; -_unit = _this select 1; +PARAMS_1(_unit); // don't switch to original player units if (!([_unit] call FUNC(isValidAi))) exitWith {}; diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index c95da37337..58b0b46d6d 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -10,6 +10,7 @@ Cambiado de unidad Unité changée Egység átváltva + Cambia unità This unit is too close to the enemy. @@ -20,6 +21,7 @@ Esta unidad está demasiado cerca del enemigo. Cette unité est trop proche des ennemis Ez az egység túl közel van az ellenséghez. + Questa unità è troppo vicina al nemico. diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index feed42e3ab..ede20e3196 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -37,6 +37,7 @@ if (!isServer) exitWith {}; }; { + private "_unit"; _unit = _x; if (_unit isKindOf "CAManBase") then { { diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 55fee28cc6..65c3068dce 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -21,6 +21,7 @@ PARAMS_2(_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; +private "_handeled"; _handeled = false; if (GVAR(LockVehicleInventory) && //if setting not enabled diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index a327352f9b..e62f9fdc5f 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -10,6 +10,7 @@ Odemknout vozidlo Jármű nyitása Открыть машину + Apri il veicolo Lock Vehicle @@ -20,6 +21,7 @@ Zamknout vozidlo Jármű zárása Закрыть машину + Chiudi il veicolo Lockpick Vehicle @@ -30,6 +32,7 @@ Vypáčit vozidlo Jármű feltörése Взломать замок + Scassina veicolo Picking Lock.... @@ -40,6 +43,7 @@ Páčim vozidlo... Zár feltörése... Взламываем замок... + Scassino il veicolo.... A custom key that will open a specific vehicle. @@ -50,6 +54,7 @@ Vlastní klíč, který otevře konkrétní vozidlo. Egy egyedi kulcs, ami egy meghatározott járművet nyit ki. Ключ от конкретной машины. + Una chiave personalizzata che apre determinati veicoli. A Master Key will open any lock, no matter what! @@ -60,6 +65,7 @@ Hlavní klíč otevře libovolný zámek, bez vyjímek! Egy főkulcs, ami minden zárat kinyit, helyzettől függetlenül! Универсальный ключ, открывающий любой замок. + Una chiave principale che apre qualsiasi serratura! A lockpick set that can pick the locks of most vehicles. @@ -70,6 +76,7 @@ Sada paklíčů, která dokáže odemknout zámky u většiny vozidel. Egy tolvajkulcs-készlet, mely a legtöbb jármű zárjait fel tudja törni. Набор отмычек, которым можно взломать почти любую машину. + Un grimardello per forzare la maggior parte dei veicoli A key that should open most WEST vehicles. @@ -79,7 +86,8 @@ Klucz, który powinien otworzyć większość pojazdów ZACHODU. Klíč který by měl otevřít většinou Západních vozidel. Egy kulcs, ami a NYUGAT egységeinek legtöbb járművét ki tudja nyitni. - Ключ для открытия большинства машин Запада. + Ключ для открытия большинства машин Красных. + Una chiave che apre la maggior parte dei veicoli WEST A key that should open most EAST vehicle. @@ -89,7 +97,8 @@ Klucz, który powinien otworzyć większość pojazdów WSCHODU. Egy kulcs, ami a KELET egységeinek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít vetšinu Východních vozidel. - Ключ для открытия большинства машин Востока. + Ключ для открытия большинства машин Синих. + Una chaive che apr ela maggior parte dei veicoli EAST A key that should open most INDEP vehicle. @@ -100,6 +109,7 @@ Egy kulcs, ami a FÜGGETLEN egységek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít většinu Nezávislých vozidel. Ключ для открытия большинства машин Независимых. + Una chaive che apr ela maggior parte dei veicoli INDEP A key that should open most CIV vehicle. @@ -110,6 +120,7 @@ Klíč který by měl otevřít většinu Civilních vozidel. Egy kulcs, ami a CIVIL járművek többségét ki tudja nyitni. Ключ для открытия большинства машин Гражданских. + Una chaive che apr ela maggior parte dei veicoli CIV diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 2332336e0a..053d96d470 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -35,7 +35,7 @@ _maxSpeed = speed _vehicle max 10; _speed = speed _vehicle; if (_speed > _maxSpeed) then { - _vehicle setVelocity ((velocity _vehicle) vectorMultiply (_maxSpeed / _speed)); + _vehicle setVelocity ((velocity _vehicle) vectorMultiply ((_maxSpeed / _speed) - 0.00001)); // fix 1.42-hotfix PhysX libraries applying force in previous direction when turning }; } , 0, [_driver, _vehicle, _maxSpeed]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 790dfe7a99..4c5216c2f6 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -26,6 +26,7 @@ GVAR(CurrentGrenadeMuzzleOther) = ""; // Collect frag and other muzzles separately with uiNamespace do { + private ["_magazines", "_magazine", "_ammo", "_explosive"]; if (isNil QGVAR(FragMuzzles)) then { GVAR(FragMuzzles) = []; GVAR(NonFragMuzzles) = []; diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f73f2444c4..f45ed0ea57 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -12,18 +12,13 @@ */ #include "script_component.hpp" -private ["_unit", "_muzzle"]; +PARAMS_2(_unit,_muzzle); -_unit = _this select 0; -_muzzle = _this select 1; - -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _numberOfMagazines = 0; _magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines"); diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 1922ffdbb9..d7a68e7f50 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -21,10 +21,10 @@ _numberofMagazines = _this select 1; private ["_color", "_name", "_text", "_picture"]; -_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0); +_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); -_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText); +_text = [format["%1 x%2", _name, _numberofMagazines], _color] call EFUNC(common,stringToColoredText); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); [_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 31999ad0b9..a75a11c202 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -11,41 +11,41 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; if (_nextMuzzle in GVAR(FragMuzzles)) then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = true; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = true; } else { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - GVAR(CurrentGrenadeMuzzleIsFrag) = false; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = false; }; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 408cf0e608..0dee3e5c57 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_text", "_nextMuzzle"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleFrag) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = true; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index c732010a2b..4ab65e5bf3 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -11,34 +11,34 @@ */ #include "script_component.hpp" -private ["_unit", "_nextMuzzle"]; +private ["_nextMuzzle", "_text"]; -_unit = _this select 0; +PARAMS_1(_unit); _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); - reverse _magazines; + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); + reverse _magazines; - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; - // There is a muzzle with magazines --> cycle to it - [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); - [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); } else { - // There is a no muzzle with magazines --> select nothing - GVAR(CurrentGrenadeMuzzleOther) = ""; - if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); - [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); - }; + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleOther) = ""; + if (GVAR(DisplayText)) then { + _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + }; }; GVAR(CurrentGrenadeMuzzleIsFrag) = false; diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index ced1fa87b3..81d1a59ed1 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -17,19 +17,15 @@ private ["_unit", "_muzzle"]; _unit = _this select 0; _muzzle = _this select 1; -private ["_uniformMags", "_vestMags", "_backPackMags"]; +private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; -_backPackMags = getMagazineCargo backpackContainer _unit; - -private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"]; +_backpackMags = getMagazineCargo backpackContainer _unit; _uniformMagsToRemove = []; _vestMagsToRemove = []; -_backPackMagsToRemove = []; - -private ["_firstMagazine", "_throwMuzzleNames"]; +_backpackMagsToRemove = []; _firstMagazine = ""; _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); @@ -99,7 +95,7 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit removeItem (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; // Readd magazines { @@ -118,4 +114,4 @@ _throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles" for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { _unit addItemToBackpack (_x select 0); }; -} forEach _backPackMagsToRemove; +} forEach _backpackMagsToRemove; diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml index d534ecd29b..08bb510f6c 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -10,6 +10,7 @@ Wyświetl tekst przy rzucie granatem Afficher texte lors d'un lancé de grenade Szöveg mutatása gránát eldobásakor + Mostra indicazioni nel lancio granate Display a hint or text on grenade throw. @@ -20,6 +21,7 @@ Wyświetla powiadomienie lub tekst przy rzucie granatem. Afficher texte/info au lancé de grenade Jelez egy súgót vagy szöveget a gránát eldobásakor. + Mostra un suggerimento quando si lanciano granate Select Pistol @@ -55,7 +57,7 @@ Sélectionner Lanceur Rakétavető Kiválasztása Selecionar Lançador - Seleziona il Lanciatore + Seleziona il Lanciamissili Select Grenade Launcher @@ -162,6 +164,7 @@ Gránát: %1 Граната %1 Grenade %1 + Granata %1 Ready Grenade @@ -172,6 +175,7 @@ Gránát előkészítése Подготовить гранату Grenade prête + Granata pronta Select Frag Grenade @@ -194,7 +198,7 @@ Nem-robbanó Gránát Kiválasztása Zvolit Ne-Výbušný Granát Selecionar Granada - Seleziona Altre Granate + Seleziona granate non a frammentazione Выбрать гранату @@ -218,6 +222,7 @@ Žádné granáty Nincs több gránát Гранат не осталось + Granate esaurite No frags left @@ -229,7 +234,7 @@ Už nejsou granáty Não há granadas de fragmentação restantes Nessuna granata a frammentazione rimanente - Осколочныких гранат нет + Осколочных гранат нет No misc. grenades left @@ -264,6 +269,7 @@ Wystrzel granat dymny Füstvető eltüzelése Запустить дымовую завесу + Lancia fumogeno - + \ No newline at end of file diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 75e1277fee..9276e710da 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -39,6 +39,7 @@ _fnc_updateWind = { // Update Rain _fnc_updateRain = { + private ["_oldStrength","_rainStrength","_transitionTime","_periodPosition","_periodPercent"]; if(GVAR(enableRain)) then { if(!isNil "ACE_RAIN_PARAMS" && {!isNil QGVAR(rain_period_start_time)}) then { _oldStrength = ACE_RAIN_PARAMS select 0; @@ -56,6 +57,7 @@ _fnc_updateRain = { // Update Temperature _fnc_updateTemperature = { + private ["_time","_month","_hourlyCoef","_avgTemperature","_pS1","_pS2"]; _time = daytime; _month = date select 1; diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 61d556a27c..d84cddd106 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -1,6 +1,5 @@ /* * Author: Ruthberg - * * Displays a wind info (colored arrow) in the top left corner of the screen * * Argument: @@ -29,13 +28,13 @@ GVAR(WindInfo) = true; [{ private ["_windSpeed", "_windDir", "_playerDir", "_windIndex", "_windColor", "_newWindSpeed", "_windSource", "_height"]; - + if !(GVAR(WindInfo) && !(underwater ACE_player) && vehicle ACE_player == ACE_player) exitWith { GVAR(WindInfo) = false; 0 cutText ["", "PLAIN"]; [_this select 1] call cba_fnc_removePerFrameHandler; }; - + _windIndex = 12; _windColor = [1, 1, 1, 1]; @@ -46,7 +45,7 @@ GVAR(WindInfo) = true; } else { vectorMagnitude ACE_wind; }; - + if (_windSpeed > 0.2) then { _playerDir = getDir ACE_player; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index 86a05fb225..fecf9f34f7 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -1,6 +1,5 @@ /* * Author: Ruthberg, esteldunedain - * * Get the weather data for the current map * * Argument: diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index e25d53309d..b0fbf5e8fa 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -1,4 +1,15 @@ +/* + * Author: ACE2 Team + * Calculate current wind locally from the data broadcasted by the server + * + * Argument: + * None + * + * Return value: + * Wind + */ #include "script_component.hpp" +private ["_dir","_dirInc","_dirRange","_period","_periodPercent","_periodPosition","_return","_spd","_spdInc","_spdRange"]; _return = [0,0,0]; if(!isNil "ACE_WIND_PARAMS") then { diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf index 7646475e81..e29836fc18 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -1,4 +1,15 @@ +/* + * Author: ACE2 Team, esteldunedain + * Calculate the wind and rain evolution on the server. Broadcast the current and next values to the clients + * + * Argument: + * None + * + * Return value: + * None + */ #include "script_component.hpp" +private ["_gustCount","_gustDir","_gustSpeed","_gustTime","_gusts","_i","_lastRain","_maxInterval","_rainOverCast","_startDir","_startSpeed","_time","_timeTillGust","_transitionTime"]; // Rain simulation if(GVAR(rain_period_count) > GVAR(rain_next_period)) then { diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 060d9b6f51..2278bf350d 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -7,6 +7,7 @@ Показать информацию о погоде Afficher information du vent Mostrar información del viento + Mostra informazioni sul vento diff --git a/addons/winddeflection/ACE_Settings.hpp b/addons/winddeflection/ACE_Settings.hpp index 89235fe5af..f84bdeace3 100644 --- a/addons/winddeflection/ACE_Settings.hpp +++ b/addons/winddeflection/ACE_Settings.hpp @@ -1,4 +1,10 @@ class ACE_Settings { + class GVAR(enabled) { + displayName = "Wind Deflection"; + description = "Enables wind deflection"; + typeName = "BOOL"; + value = 1; + }; class GVAR(simulationInterval) { displayName = "Simulation Interval"; description = "Defines the interval between every calculation step"; diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index f9362a2711..09dc1b69be 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -11,6 +11,12 @@ class CfgVehicles { isTriggerActivated = 0; author = "$STR_ACE_Common_ACETeam"; class Arguments { + class enabled { + displayName = "Wind Deflection"; + description = "Enables wind deflection"; + typeName = "BOOL"; + defaultValue = 1; + }; class simulationInterval { displayName = "Simulation Interval"; description = "Defines the interval between every calculation step"; diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index 5ee22ecf4f..241fbcf839 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -28,6 +28,7 @@ _unit = _this select 0; _bullet = _this select 6; if (!hasInterface) exitWith {false}; +if (!(GVAR(enabled))) exitWith {false}; if (!(_bullet isKindOf "BulletBase")) exitWith {false}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 897a3c556b..8e2e00d96e 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -11,6 +11,7 @@ Vent Windinformationen Szélinformáció + Informazioni sul vento Direction: %1 @@ -21,6 +22,7 @@ Direction %1 Windrichtung: %1 Irány: %1 + Direzione: %1 Speed: %1 m/s @@ -31,6 +33,7 @@ Vitesse %1 m/s Geschwindigkeit: %1m/s Sebesség: %1 m/s + Velocità: %1 m/s Weather Information @@ -41,6 +44,7 @@ Météo Wetterinformationen Időjárás-Információ + Meteo Humidity: %1% @@ -51,6 +55,7 @@ Humidité: %1% Luftfeuchtigkeit: %1 Páratartalom: %1% + Umidità: %1% diff --git a/extensions/breakLine/ace_breakLine.cpp b/extensions/breakLine/ace_breakLine.cpp index 74a32cc66d..fb5775b861 100644 --- a/extensions/breakLine/ace_breakLine.cpp +++ b/extensions/breakLine/ace_breakLine.cpp @@ -19,13 +19,13 @@ #define MAXCHARACTERS 14 -static char version[] = "1.0"; +static char VERSION[] = "1.0"; extern "C" { __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); }; -std::vector splitString(std::string input) { +std::vector splitString(const std::string & input) { std::istringstream ss(input); std::string token; @@ -38,10 +38,10 @@ std::vector splitString(std::string input) { } std::string addLineBreaks(const std::vector &words) { - std::stringstream sstream; int numChar = 0; int i = 0; + while (i < words.size()) { if (numChar == 0) { sstream << words[i]; @@ -58,6 +58,7 @@ std::string addLineBreaks(const std::vector &words) { } } } + return sstream.str(); } @@ -66,12 +67,10 @@ std::string addLineBreaks(const std::vector &words) { #pragma warning( disable : 4996 ) void __stdcall RVExtension(char *output, int outputSize, const char *function) { - //strncpy(output, function, outputSize); - if (!strcmp(function, "version")) { - strncpy(output, version, outputSize); + strncpy(output, VERSION, outputSize); } else { - strcpy(output, addLineBreaks(splitString(function)).c_str()); + strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize); output[outputSize - 1] = '\0'; } } diff --git a/tools/make.py b/tools/make.py index bd27f893f5..29cf3f1956 100644 --- a/tools/make.py +++ b/tools/make.py @@ -200,7 +200,10 @@ def find_depbo_tools(regKey): reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) try: - k = winreg.OpenKey(reg, r"Software\Mikero\pboProject") + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\pboProject") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\pboProject") try: pboproject_path = winreg.QueryValueEx(k, "exe")[0] winreg.CloseKey(k) @@ -208,7 +211,10 @@ def find_depbo_tools(regKey): except: print_error("ERROR: Could not find pboProject.") - k = winreg.OpenKey(reg, r"Software\Mikero\rapify") + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\rapify") try: rapify_path = winreg.QueryValueEx(k, "exe")[0] winreg.CloseKey(k) @@ -216,7 +222,10 @@ def find_depbo_tools(regKey): except: print_error("Could not find rapify.") - k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo") + try: + k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\MakePbo") + except FileNotFoundError: + k = winreg.OpenKey(reg, r"Software\Mikero\MakePbo") try: makepbo_path = winreg.QueryValueEx(k, "exe")[0] winreg.CloseKey(k) diff --git a/tools/make64.py b/tools/make64.py deleted file mode 100644 index b6635f884e..0000000000 --- a/tools/make64.py +++ /dev/null @@ -1,837 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 : - -# make.py -# An Arma 3 addon build system - -############################################################################### - -# The MIT License (MIT) - -# Copyright (c) 2013-2014 Ryan Schultz - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -############################################################################### - -__version__ = "0.3dev" - -import sys - -if sys.version_info[0] == 2: - print("Python 3 is required.") - sys.exit(1) - -import os -import os.path -import shutil -import platform -import glob -import subprocess -import hashlib -import configparser -import json -import traceback -import time -import re - -if sys.platform == "win32": - import winreg - -############################################################################### -# http://akiscode.com/articles/sha-1directoryhash.shtml -# Copyright (c) 2009 Stephen Akiki -# MIT License (Means you can do whatever you want with this) -# See http://www.opensource.org/licenses/mit-license.php -# Error Codes: -# -1 -> Directory does not exist -# -2 -> General error (see stack traceback) -def get_directory_hash(directory): - directory_hash = hashlib.sha1() - if not os.path.exists (directory): - return -1 - - try: - for root, dirs, files in os.walk(directory): - for names in files: - path = os.path.join(root, names) - try: - f = open(path, 'rb') - except: - # You can't open the file for some reason - f.close() - continue - - while 1: - # Read file in as little chunks - buf = f.read(4096) - if not buf: break - new = hashlib.sha1(buf) - directory_hash.update(new.digest()) - f.close() - - except: - # Print the stack traceback - traceback.print_exc() - return -2 - - return directory_hash.hexdigest() - -# Copyright (c) André Burgaud -# http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ -if sys.platform == "win32": - from ctypes import windll, Structure, c_short, c_ushort, byref - - SHORT = c_short - WORD = c_ushort - - class COORD(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("X", SHORT), - ("Y", SHORT)] - - class SMALL_RECT(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("Left", SHORT), - ("Top", SHORT), - ("Right", SHORT), - ("Bottom", SHORT)] - - class CONSOLE_SCREEN_BUFFER_INFO(Structure): - """struct in wincon.h.""" - _fields_ = [ - ("dwSize", COORD), - ("dwCursorPosition", COORD), - ("wAttributes", WORD), - ("srWindow", SMALL_RECT), - ("dwMaximumWindowSize", COORD)] - - # winbase.h - STD_INPUT_HANDLE = -10 - STD_OUTPUT_HANDLE = -11 - STD_ERROR_HANDLE = -12 - - # wincon.h - FOREGROUND_BLACK = 0x0000 - FOREGROUND_BLUE = 0x0001 - FOREGROUND_GREEN = 0x0002 - FOREGROUND_CYAN = 0x0003 - FOREGROUND_RED = 0x0004 - FOREGROUND_MAGENTA = 0x0005 - FOREGROUND_YELLOW = 0x0006 - FOREGROUND_GREY = 0x0007 - FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified. - - BACKGROUND_BLACK = 0x0000 - BACKGROUND_BLUE = 0x0010 - BACKGROUND_GREEN = 0x0020 - BACKGROUND_CYAN = 0x0030 - BACKGROUND_RED = 0x0040 - BACKGROUND_MAGENTA = 0x0050 - BACKGROUND_YELLOW = 0x0060 - BACKGROUND_GREY = 0x0070 - BACKGROUND_INTENSITY = 0x0080 # background color is intensified. - - stdout_handle = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE) - SetConsoleTextAttribute = windll.kernel32.SetConsoleTextAttribute - GetConsoleScreenBufferInfo = windll.kernel32.GetConsoleScreenBufferInfo - - def get_text_attr(): - """Returns the character attributes (colors) of the console screen - buffer.""" - csbi = CONSOLE_SCREEN_BUFFER_INFO() - GetConsoleScreenBufferInfo(stdout_handle, byref(csbi)) - return csbi.wAttributes - - def set_text_attr(color): - """Sets the character attributes (colors) of the console screen - buffer. Color is a combination of foreground and background color, - foreground and background intensity.""" - SetConsoleTextAttribute(stdout_handle, color) -############################################################################### - -def find_bi_tools(work_drive): - """Find BI tools.""" - - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - - addonbuilder_path = os.path.join(arma3tools_path, "AddonBuilder", "AddonBuilder.exe") - dssignfile_path = os.path.join(arma3tools_path, "DSSignFile", "DSSignFile.exe") - dscreatekey_path = os.path.join(arma3tools_path, "DSSignFile", "DSCreateKey.exe") - cfgconvert_path = os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe") - - if os.path.isfile(addonbuilder_path) and os.path.isfile(dssignfile_path) and os.path.isfile(dscreatekey_path) and os.path.isfile(cfgconvert_path): - return [addonbuilder_path, dssignfile_path, dscreatekey_path, cfgconvert_path] - else: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - -def find_depbo_tools(regKey): - """Use registry entries to find DePBO-based tools.""" - stop = False - - if regKey == "HKCU": - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - stop = True - else: - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - - try: - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\pboProject") - try: - pboproject_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found pboproject.") - except: - print_error("ERROR: Could not find pboProject.") - - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\rapify") - try: - rapify_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found rapify.") - except: - print_error("Could not find rapify.") - - k = winreg.OpenKey(reg, r"Software\Wow6432Node\Mikero\MakePbo") - try: - makepbo_path = winreg.QueryValueEx(k, "exe")[0] - winreg.CloseKey(k) - print("Found makepbo.") - except: - print_error("Could not find makepbo.") - except: - if stop == True: - raise Exception("BadDePBO", "DePBO tools not installed correctly") - return -1 - - - #Strip any quotations from the path due to a MikeRo tool bug which leaves a trailing space in some of its registry paths. - return [pboproject_path.strip('"'),rapify_path.strip('"'),makepbo_path.strip('"')] - -def color(color): - """Set the color. Works on Win32 and normal terminals.""" - if sys.platform == "win32": - if color == "green": - set_text_attr(FOREGROUND_GREEN | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "red": - set_text_attr(FOREGROUND_RED | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "blue": - set_text_attr(FOREGROUND_BLUE | get_text_attr() & 0x0070 | FOREGROUND_INTENSITY) - elif color == "reset": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - elif color == "grey": - set_text_attr(FOREGROUND_GREY | get_text_attr() & 0x0070) - else : - if color == "green": - sys.stdout.write('\033[92m') - elif color == "red": - sys.stdout.write('\033[91m') - elif color == "blue": - sys.stdout.write('\033[94m') - elif color == "reset": - sys.stdout.write('\033[0m') - -def print_error(msg): - color("red") - print ("ERROR: " + msg) - color("reset") - -def print_green(msg): - color("green") - print(msg) - color("reset") - -def print_blue(msg): - color("blue") - print(msg) - color("reset") - -def print_yellow(msg): - color("yellow") - print(msg) - color("reset") - -############################################################################### - -def main(argv): - """Build an Arma addon suite in a directory from rules in a make.cfg file.""" - print_blue(("\nmake.py for Arma, v" + __version__)) - - if sys.platform != "win32": - print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") - sys.exit(1) - - reg = winreg.ConnectRegistry(None, winreg.HKEY_CURRENT_USER) - try: - k = winreg.OpenKey(reg, r"Software\bohemia interactive\arma 3 tools") - arma3tools_path = winreg.QueryValueEx(k, "path")[0] - winreg.CloseKey(k) - except: - raise Exception("BadTools","Arma 3 Tools are not installed correctly or the P: drive needs to be created.") - - # Default behaviors - test = False # Copy to Arma 3 directory? - arg_modules = False # Only build modules on command line? - make_release = False # Make zip file from the release? - release_version = 0 # Version of release - use_pboproject = True # Default to pboProject build tool - make_target = "DEFAULT" # Which section in make.cfg to use for the build - new_key = False # Make a new key and use it to sign? - quiet = False # Suppress output from build tool? - - # Parse arguments - if "help" in argv or "-h" in argv or "--help" in argv: - print (""" -make.py [help] [test] [force] [key ] [target ] [release ] - [module name] [module name] [...] - -test -- Copy result to Arma 3. -release -- Make archive with . -force -- Ignore cache and build all. -target -- Use rules in make.cfg under heading [] rather than - default [Make] -key -- Use key in working directory with to sign. If it does not - exist, create key. -quiet -- Suppress command line output from build tool. - -If module names are specified, only those modules will be built. - -Examples: - make.py force test - Build all modules (ignoring cache) and copy the mod folder to the Arma 3 - directory. - make.py mymodule_gun - Only build the module named 'mymodule_gun'. - make.py force key MyNewKey release 1.0 - Build all modules (ignoring cache), sign them with NewKey, and pack them - into a zip file for release with version 1.0. - - -If a file called $NOBIN$ is found in the module directory, that module will not be binarized. - -See the make.cfg file for additional build options. -""") - sys.exit(0) - - if "force" in argv: - argv.remove("force") - force_build = True - else: - force_build = False - - if "test" in argv: - test = True - argv.remove("test") - - if "release" in argv: - make_release = True - release_version = argv[argv.index("release") + 1] - argv.remove(release_version) - argv.remove("release") - - if "target" in argv: - make_target = argv[argv.index("target") + 1] - argv.remove("target") - argv.remove(make_target) - force_build = True - - if "key" in argv: - new_key = True - key_name = argv[argv.index("key") + 1] - argv.remove("key") - argv.remove(key_name) - - if "quiet" in argv: - quiet = True - argv.remove("quiet") - - # Get the directory the make script is in. - make_root = os.path.dirname(os.path.realpath(__file__)) - make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) - os.chdir(make_root) - - # Get latest commit ID - try: - gitpath = os.path.join(os.path.dirname(make_root), ".git") - assert os.path.exists(gitpath) - - commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) - commit_id = str(commit_id, "utf-8")[:8] - except: - print_error("FAILED TO DETERMINE COMMIT ID.") - commit_id = "NOGIT" - - cfg = configparser.ConfigParser(); - try: - cfg.read(os.path.join(make_root, "make.cfg")) - - # Project name (with @ symbol) - project = cfg.get(make_target, "project", fallback="@"+os.path.basename(os.getcwd())) - - # Private key path - key = cfg.get(make_target, "key", fallback=None) - - # Project prefix (folder path) - prefix = cfg.get(make_target, "prefix", fallback="") - - # Should we autodetect modules on a complete build? - module_autodetect = cfg.getboolean(make_target, "module_autodetect", fallback=True) - - # Manual list of modules to build for a complete build - modules = cfg.get(make_target, "modules", fallback=None) - # Parse it out - if modules: - modules = [x.strip() for x in modules.split(',')] - else: - modules = [] - - # List of directories to ignore when detecting - ignore = [x.strip() for x in cfg.get(make_target, "ignore", fallback="release").split(',')] - - # BI Tools work drive on Windows - work_drive = cfg.get(make_target, "work_drive", fallback="P:\\") - - # Which build tool should we use? - build_tool = cfg.get(make_target, "build_tool", fallback="addonbuilder").lower() - - # Release/build directory, relative to script dir - release_dir = cfg.get(make_target, "release_dir", fallback="release") - - # Project PBO file prefix (files are renamed to prefix_name.pbo) - pbo_name_prefix = cfg.get(make_target, "pbo_name_prefix", fallback=None) - - # Project module Root - module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) - module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) - print_green ("module_root: " + module_root) - if (os.path.isdir(module_root)): - os.chdir(module_root) - else: - print_error ("Directory " + module_root + " does not exist.") - sys.exit() - - except: - raise - print_error("Could not parse make.cfg.") - sys.exit(1) - - - - # See if we have been given specific modules to build from command line. - if len(argv) > 1 and not make_release: - arg_modules = True - modules = argv[1:] - - # Find the tools we need. - try: - tools = find_bi_tools(work_drive) - addonbuilder = tools[0] - dssignfile = tools[1] - dscreatekey = tools[2] - cfgconvert = tools[3] - - except: - print_error("Arma 3 Tools are not installed correctly or the P: drive has not been created.") - sys.exit(1) - - if build_tool == "pboproject": - try: - depbo_tools = find_depbo_tools("HKLM") - if depbo_tools == -1: - depbo_tools = find_depbo_tools("HKCU") - pboproject = depbo_tools[0] - rapifyTool = depbo_tools[1] - makepboTool = depbo_tools[2] - except: - raise - print_error("Could not find dePBO tools. Download the needed tools from: https://dev.withsix.com/projects/mikero-pbodll/files") - sys.exit(1) - - # Try to open and deserialize build cache file. - try: - cache = {} - with open(os.path.join(make_root, "make.cache"), 'r') as f: - cache_raw = f.read() - - cache = json.loads(cache_raw) - - except: - print ("No cache found.") - cache = {} - - # Get list of subdirs in make root. - dirs = next(os.walk(module_root))[1] - - # Autodetect what directories to build. - if module_autodetect and not arg_modules: - modules = [] - for path in dirs: - # Any dir that has a config.cpp in its root is an addon to build. - config_path = os.path.join(path, 'config.cpp') - if os.path.isfile(config_path) and not path in ignore: - modules.append(path) - - # Make the key specified from command line if necessary. - if new_key: - if not os.path.isfile(os.path.join(module_root, key_name + ".biprivatekey")): - print_green("\nRequested key does not exist.") - ret = subprocess.call([dscreatekey, key_name]) # Created in make_root - if ret == 0: - print_blue("Created: " + os.path.join(module_root, key_name + ".biprivatekey")) - else: - print_error("Failed to create key!") - - try: - print_blue("Copying public key to release directory.") - - try: - os.makedirs(os.path.join(module_root, release_dir, "Keys")) - except: - pass - - shutil.copyfile(os.path.join(module_root, key_name + ".bikey"), os.path.join(module_root, release_dir, "Keys", key_name + ".bikey")) - - except: - raise - print_error("Could not copy key to release directory.") - - else: - print_green("\nNOTE: Using key " + os.path.join(module_root, key_name + ".biprivatekey")) - - key = os.path.join(module_root, key_name + ".biprivatekey") - - - # For each module, prep files and then build. - for module in modules: - print_green("\nMaking " + module + "-"*max(1, (60-len(module)))) - - # Cache check - if module in cache: - old_sha = cache[module] - else: - old_sha = "" - - #We always build ACE_common so we can properly show the correct version stamp in the RPT file. - if module == "common": - old_sha = "" - - # Hash the module - new_sha = get_directory_hash(os.path.join(module_root, module)) - - # Check if it needs rebuilt - # print ("Hash:", new_sha) - if old_sha == new_sha: - if not force_build: - print("Module has not changed.") - # Skip everything else - continue - - # Only do this if the project isn't stored directly on the work drive. - # Split the path at the drive name and see if they are on the same drive (usually P:) - if os.path.splitdrive(module_root)[0] != os.path.splitdrive(work_drive)[0]: - try: - # Remove old work drive version (ignore errors) - shutil.rmtree(os.path.join(work_drive, prefix, module), True) - - # Copy module to the work drive - shutil.copytree(module, os.path.join(work_drive, prefix, module)) - - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - #else: - #print("WARNING: Module is stored on work drive (" + work_drive + ").") - - try: - # Remove the old pbo, key, and log - old = os.path.join(module_root, release_dir, project, "Addons", module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - - if pbo_name_prefix: - old = os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module) + "*" - files = glob.glob(old) - for f in files: - os.remove(f) - except: - raise - print_error("ERROR: Could not copy module to work drive. Does the module exist?") - input("Press Enter to continue...") - print("Resuming build...") - continue - - # Build the module into a pbo - print_blue("Building: " + os.path.join(work_drive, prefix, module)) - print_blue("Destination: " + os.path.join(module_root, release_dir, project, "Addons")) - - # Make destination folder (if needed) - try: - os.makedirs(os.path.join(module_root, release_dir, project, "Addons")) - except: - pass - - # Run build tool - build_successful = False - if build_tool == "pboproject": - try: - #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - - os.chdir("P:\\") - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -bin return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -txt return code == " + str(ret) + ". Usually means there is a syntax error within the config.cpp file.") - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - - # Include build number - try: - configpath = os.path.join(work_drive, prefix, module, "config.cpp") - f = open(configpath, "r") - configtext = f.read() - f.close() - - if configtext: - patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) - patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) - configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) - f = open(configpath, "w") - f.write(configtext) - f.close() - else: - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - except: - raise - print_error("Failed to include build number") - continue - - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - print_green("$NOBIN$ Found. Proceeding with non-binarizing!") - cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"Addons")] - - else: - cmd = [pboproject, "-P", os.path.join(work_drive, prefix, module), "+Engine=Arma3", "-S","+Noisy", "+X", "+Clean", "+Mod="+os.path.join(module_root, release_dir, project), "-Key"] - - color("grey") - if quiet: - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - else: - ret = subprocess.call(cmd) - color("reset") - - if ret == 0: - print_green("pboProject return code == " + str(ret)) - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(module_root, release_dir, project, "Addons", module+".pbo"), os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("pboProject return code == " + str(ret)) - print_error("Module not successfully built/signed.") - print ("Resuming build...") - continue - - #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp - #print_green("\Pabst (restoring): " + os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.remove(os.path.join(work_drive, prefix, module, "config.bin")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - # Back to the root - os.chdir(module_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - elif build_tool== "addonbuilder": - # Detect $NOBIN$ and do not binarize if found. - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): - do_binarize = False - print("$NOBIN$ file found in module, packing only.") - else: - do_binarize = True - try: - # Call AddonBuilder - os.chdir("P:\\") - - cmd = [addonbuilder, os.path.join(work_drive, prefix, module), os.path.join(make_root, release_dir, project, "Addons"), "-clear", "-project="+work_drive] - if not do_binarize: - cmd.append("-packonly") - - if quiet: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - devnull = open(os.devnull, 'w') - ret = subprocess.call(cmd, stdout=devnull) - devnull.close() - os.chdir(previousDirectory) - else: - previousDirectory = os.getcwd() - os.chdir(arma3tools_path) - print_error("Current directory - " + os.getcwd()) - ret = subprocess.call(cmd) - os.chdir(previousDirectory) - print_error("Current directory - " + os.getcwd()) - color("reset") - print_green("completed") - # Prettyprefix rename the PBO if requested. - if pbo_name_prefix: - try: - os.rename(os.path.join(make_root, release_dir, project, "Addons", module+".pbo"), os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix+module+".pbo")) - except: - raise - print_error("Could not rename built PBO with prefix.") - - if ret == 0: - # Sign result - if key: - print("Signing with " + key + ".") - if pbo_name_prefix: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", pbo_name_prefix + module + ".pbo")]) - else: - ret = subprocess.call([dssignfile, key, os.path.join(make_root, release_dir, project, "Addons", module + ".pbo")]) - - if ret == 0: - build_successful = True - else: - build_successful = True - - if not build_successful: - print_error("Module not successfully built.") - - # Back to the root - os.chdir(make_root) - - except: - raise - print_error("Could not run Addon Builder.") - input("Press Enter to continue...") - print ("Resuming build...") - continue - - else: - print_error("Unknown build_tool " + build_tool + "!") - - # Update the hash for a successfully built module - if build_successful: - cache[module] = new_sha - - # Done building all modules! - - # Write out the cache state - cache_out = json.dumps(cache) - with open(os.path.join(make_root, "make.cache"), 'w') as f: - f.write(cache_out) - - # Delete the pboproject temp files if building a release. - if make_release and build_tool == "pboproject": - try: - shutil.rmtree(os.path.join(module_root, release_dir, project, "temp"), True) - except: - print_error("ERROR: Could not delete pboProject temp files.") - - print_green("\nDone.") - - # Make release - if make_release: - print_blue("\nMaking release: " + project + "-" + release_version + ".zip") - - try: - # Delete all log files - for root, dirs, files in os.walk(os.path.join(module_root, release_dir, project, "Addons")): - for currentFile in files: - if currentFile.lower().endswith("log"): - os.remove(os.path.join(root, currentFile)) - - # Create a zip with the contents of release/ in it - shutil.make_archive(project + "-" + release_version, "zip", os.path.join(module_root, release_dir)) - except: - raise - print_error("Could not make release.") - - # Copy to Arma 3 folder for testing - if test: - print_blue("\nCopying to Arma 3.") - - if sys.platform == "win32": - reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) - try: - k = winreg.OpenKey(reg, r"SOFTWARE\Wow6432Node\Bohemia Interactive\Arma 3") - a3_path = winreg.EnumValue(k, 1)[1] - winreg.CloseKey(k) - except: - print_error("Could not find Arma 3's directory in the registry.") - else: - a3_path = cygwin_a3path - - if os.path.exists(a3_path): - try: - shutil.rmtree(os.path.join(a3_path, project), True) - shutil.copytree(os.path.join(module_root, release_dir, project), os.path.join(a3_path, project)) - except: - print_error("Could not copy files. Is Arma 3 running?") - -if __name__ == "__main__": - main(sys.argv) -input("Press Enter to continue...") diff --git a/tools/search_privates.py b/tools/search_privates.py index 9cc55fbdcc..4b418de8d6 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 import fnmatch import os @@ -21,7 +21,7 @@ def get_private_declare(content): priv_split = sorted(set(priv_split)) priv_declared += priv_split; - srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*') + srch = re.compile('PARAMS_[0-9].*|EXPLODE_[0-9]_PVT.*|DEFAULT_PARAM.*|KEY_PARAM.*|IGNORE_PRIVATE_WARNING.*') priv_srch_declared = srch.findall(content) priv_srch_declared = sorted(set(priv_srch_declared)) @@ -37,7 +37,7 @@ def get_private_declare(content): return priv_declared def check_privates(filepath): - + bad_count_file = 0 def pushClosing(t): closingStack.append(closing.expr) closing << Literal( closingFor[t[0]] ) @@ -70,17 +70,22 @@ def check_privates(filepath): if '_forEachIndex' in priv_use: priv_use.remove('_forEachIndex') if '_foreachIndex' in priv_declared: priv_declared.remove('_foreachIndex') if '_foreachIndex' in priv_use: priv_use.remove('_foreachIndex') + if '_foreachindex' in priv_declared: priv_declared.remove('_foreachindex') + if '_foreachindex' in priv_use: priv_use.remove('_foreachindex') missing = [] for s in priv_use: - if s not in priv_declared: - if s not in missing: + if s.lower() not in map(str.lower,priv_declared): + if s.lower() not in map(str.lower,missing): missing.append(s) if len(missing) > 0: print (filepath) for bad_priv in missing: print ('\t' + bad_priv) + bad_count_file = bad_count_file + 1 + + return bad_count_file def main(): @@ -89,6 +94,7 @@ def main(): print("#########################") sqf_list = [] + bad_count = 0 parser = argparse.ArgumentParser() parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default=".") @@ -99,7 +105,10 @@ def main(): sqf_list.append(os.path.join(root, filename)) for filename in sqf_list: - check_privates(filename) + bad_count = bad_count + check_privates(filename) + + + print ("Bad Count {0}".format(bad_count)) if __name__ == "__main__": main()