diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 568e7c16db..3349bb5b38 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/ace_breakLine.dll b/ace_breakLine.dll index edd00c78eb..428df80092 100644 Binary files a/ace_breakLine.dll and b/ace_breakLine.dll differ diff --git a/ace_fcs.dll b/ace_fcs.dll index 3385e53463..9cef4549c7 100644 Binary files a/ace_fcs.dll and b/ace_fcs.dll differ diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index b58a2b88e8..1d19a9c492 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -2,7 +2,6 @@ ADDON = false; -PREP(calculateAirDensity); PREP(calculateAmmoTemperatureVelocityShift); PREP(calculateAtmosphericCorrection); PREP(calculateBarrelLengthVelocityShift); diff --git a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf b/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf index ea7a77e837..298049e51d 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAirDensity.sqf @@ -1,7 +1,7 @@ /* * Author: Ruthberg * - * Displays a wind info (colored arrow) in the top left corner of the screen + * Calculates the air density * * Arguments: * 0: temperature - degrees celcius diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index 02e849399e..b0166109f5 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -24,7 +24,7 @@ _pressure = _this select 2; // in hPa _relativeHumidity = _this select 3; // as ratio 0-1 _atmosphereModel = _this select 4; // "ICAO" or "ASM" -_airDensity = [_temperature, _pressure, _relativeHumidity] call FUNC(calculateAirDensity); +_airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); if (_atmosphereModel == "ICAO") then { (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index baa3a871fa..54a7f2d5b0 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -110,7 +110,7 @@ _stabilityFactor = 1.5; if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); - _barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast; + _barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; @@ -288,7 +288,7 @@ if (GVAR(AdvancedAirDragEnabled)) then { }; if (GVAR(AtmosphericDensitySimulationEnabled)) then { - _pressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 10 * overcast; + _pressure = (_bulletPosition select 2) call EFUNC(weather,calculateBarometricPressure); _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); _humidity = EGVAR(weather,currentHumidity); _airDensity = STD_AIR_DENSITY_ICAO; @@ -315,7 +315,7 @@ if (GVAR(AdvancedAirDragEnabled)) then { _bulletVelocity = _bulletVelocity vectorDiff _accel; } else { if (GVAR(AtmosphericDensitySimulationEnabled)) then { - _pressureDeviation = 1013.25 * exp(-(EGVAR(weather,Altitude) + (_bulletPosition select 2)) / 7990) - 1013.25 - 10 * overcast; + _pressureDeviation = (_bulletPosition select 2) call EFUNC(weather,calculateBarometricPressure) - 1013.25; _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); _humidity = EGVAR(weather,currentHumidity); _airFriction = _airFriction + ((_temperature - 15) * 0.0000015 + _humidity * 0.0000040 + _pressureDeviation * -0.0000009); diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 6890937a45..cd6b75cf97 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -7,8 +7,9 @@ Pokaż inf. o wietrze Mostra indicazioni del vento Показать информацию о ветре - Afficher les info du vent + Afficher les info sur le vent Mostrar información del viento + Windinformationen anzeigen Show Protractor @@ -17,6 +18,7 @@ Показать транспортир Afficher le rapporteur Mostrar transportador + Winkelmesser anzeigen - + \ No newline at end of file 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..fe45ef67f5 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -133,40 +133,6 @@ class ATragMX_RscListNBox: ATragMX_RscListBox { idcLeft=-1; idcRight=-1; }; -class ATragMX_RscControlsGroup { - type=15; - idc=-1; - style=16; - x=0; - y=0; - w=1; - h=1; - shadow=0; - class VScrollbar { - color[]={1,1,1,0.6}; - width=0.021; - autoScrollSpeed=-1; - autoScrollDelay=5; - autoScrollRewind=0; - shadow=0; - }; - class HScrollbar { - color[]={1,1,1,0.6}; - height=0.028; - shadow=0; - }; - class ScrollBar { - color[]={1,1,1,0.6}; - colorActive[]={1,1,1,1}; - colorDisabled[]={1,1,1,0.3}; - thumb="#(argb,8,8,3)color(1,1,1,1)"; - arrowEmpty="#(argb,8,8,3)color(1,1,1,1)"; - arrowFull="#(argb,8,8,3)color(1,1,1,1)"; - border="#(argb,8,8,3)color(1,1,1,1)"; - }; - class Controls { - }; -}; class ATragMX_RscLineBreak { idc=-1; type=98; @@ -230,12 +196,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; @@ -263,7 +229,31 @@ class ATragMX_Display { idc=-1; x=0.55*safezoneW+safezoneX+0.315; }; - + + class TEXT_GUN_FRAME: ATragMX_RscText { + idc=1001; + style=64; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.25; + w=0.0925; + h=0.205; + text=""; + }; + class TEXT_ATMOSPHERE_FRAME: TEXT_GUN_FRAME { + idc=1002; + x=0.550*safezoneW+safezoneX+0.205; + }; + class TEXT_TARGET_FRAME: TEXT_GUN_FRAME { + idc=1003; + x=0.550*safezoneW+safezoneX+0.3; + }; + class TEXT_RESULT_FRAME: TEXT_GUN_FRAME { + idc=1004; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.46; + w=0.2825; + h=0.15; + }; class TEXT_GUN_PROFILE: ATragMX_RscText { idc=1000; x=0.550*safezoneW+safezoneX+0.11; @@ -316,6 +306,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 +314,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 +327,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 +336,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 +350,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 +359,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 +397,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; @@ -428,13 +428,13 @@ class ATragMX_Display { text="B"; action=QUOTE(1 call FUNC(change_target_slot)); }; - class TEXT_TARGET_C: TEXT_TARGET_B { + class TEXT_TARGET_C: TEXT_TARGET_A { idc=502; x=0.550*safezoneW+safezoneX+0.2512; text="C"; action=QUOTE(2 call FUNC(change_target_slot)); }; - class TEXT_TARGET_D: TEXT_TARGET_B { + class TEXT_TARGET_D: TEXT_TARGET_A { idc=503; x=0.550*safezoneW+safezoneX+0.2743; text="D"; @@ -445,18 +445,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 +464,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 +473,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 +481,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 +493,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; }; @@ -501,7 +501,7 @@ class ATragMX_Display { class TEXT_ELEVATION: TEXT_GUN_PROFILE { idc=40; w=0.05; - x=0.550*safezoneW+safezoneX+0.11; + x=0.550*safezoneW+safezoneX+0.115; y=0.265*safezoneH+safezoneY+0.50; text="Elev"; }; @@ -560,9 +560,10 @@ class ATragMX_Display { class TEXT_LEAD: TEXT_GUN { idc=42; w=0.05; - x=0.550*safezoneW+safezoneX+0.11; + x=0.550*safezoneW+safezoneX+0.115; 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; @@ -668,6 +669,7 @@ class ATragMX_Display { h=0.45; x=0.550*safezoneW+safezoneX+0.11; y=0.265*safezoneH+safezoneY+0.24; + sizeEx=0.025; colorSelectBackground[]={0.15,0.21,0.23,0.3}; colorSelectBackground2[]={0.15,0.21,0.23,0.3}; onMouseButtonDblClick=QUOTE(true call FUNC(toggle_gun_list)); @@ -814,13 +816,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 +863,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 +909,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 +1048,312 @@ 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_ZERO_RANGE_METER_INDICATOR: TEXT_GUN_AMMO_DATA_BORE_HEIGHT { + idc=120061; + w=0.05; + x=0.550*safezoneW+safezoneX+0.315; + y=0.265*safezoneH+safezoneY+0.520; + text=""; + }; + 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_TARGET_RANGE_METER_INDICATOR: TEXT_TARGET_DATA_LATITUDE { + idc=140061; + w=0.05; + x=0.550*safezoneW+safezoneX+0.315; + y=0.265*safezoneH+safezoneY+0.520; + text=""; + }; + 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..7f047834e2 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, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model + GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657, -0.0006400, 3.81, 0, 2, 10, 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.0003740, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], + ["12.7x99mm" , 853, 100, 0.0623, -0.0006000, 3.81, 0, 2, 10, 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.3395, -0.0001400, 3.81, 0, 2, 10, 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.0571, -0.0003950, 3.81, 0, 2, 10, 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.0010600, 3.81, 0, 2, 10, 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, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], + [".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], + [".338LM API526" , 880, 100, 0.0601, -0.0006730, 3.81, 0, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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, 2, 10, 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..f3f27f7d3e 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, _directionOfFire] 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..fbd191bb79 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, 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..f90b299ce9 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", "_drag", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude", "_directionOfFire"]; _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,10 @@ _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; +_directionOfFire = _this select 21; private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT"]; _bulletPos = [0, 0, 0]; @@ -65,31 +76,51 @@ _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; + +private ["_eoetvoesMultiplier"]; +_eoetvoesMultiplier = 0; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,EoetvoesEnabled), false]) then { + _eoetvoesMultiplier = 2 * (0.0000729 * _muzzleVelocity / -9.80665) * cos(_latitude) * sin(_directionOfFire); +}; + _TOF = 0; _bulletPos set [0, 0]; @@ -102,13 +133,16 @@ _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 { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,AdvancedAirDragEnabled), false]) then { - private ["_drag"]; _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) } else { @@ -132,15 +166,37 @@ 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]) && (_bulletPos select 1) > 0) then { + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) 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,EoetvoesEnabled), false]) then { + _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; + _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); + _elevation = _elevation + _verticalCoriolis; + }; + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) 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 +204,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 +216,24 @@ 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]) && (_bulletPos select 1) > 0) then { + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,CoriolisEnabled), false]) 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,EoetvoesEnabled), false]) then { + _verticalDeflection = (_bulletPos select 2) * _eoetvoesMultiplier; + _verticalCoriolis = - atan(_verticalDeflection / (_bulletPos select 1)); + _elevation = _elevation + _verticalCoriolis; + }; + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,SpinDriftEnabled), false]) 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..641551fca1 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, _directionOfFire] 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..7c5abac47e 100644 --- a/addons/atragmx/functions/fnc_change_gun.sqf +++ b/addons/atragmx/functions/fnc_change_gun.sqf @@ -4,6 +4,8 @@ * * Arguments: * gunID + * restore workingMemory from gunList + * update display * * Return Value: * Nothing @@ -15,24 +17,38 @@ */ #include "script_component.hpp" -if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {}; +private ["_gunID", "_restoreMemory", "_updateDisplay"]; +_gunID = _this select 0; +_restoreMemory = _this select 1; +_updateDisplay = _this select 2; -GVAR(workingMemory) = +(GVAR(gunList) select _this); -GVAR(currentGun) = _this; +if (_gunID < 0 || _gunID > (count GVAR(gunList)) - 1) exitWith {}; -lbSetCurSel [6000, GVAR(currentGun)]; +if (_restoreMemory) then { + GVAR(workingMemory) = +(GVAR(gunList) select _gunID); +}; +GVAR(currentGun) = _gunID; -if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then -{ - GVAR(currentScopeUnit) = GVAR(workingMemory) select 6; +if (_updateDisplay) then { + lbSetCurSel [6000, GVAR(currentGun)]; }; -[] call FUNC(update_gun); +GVAR(currentScopeUnit) = 0 max (GVAR(workingMemory) select 6) min 3; +GVAR(currentScopeClickUnit) = 0 max (GVAR(workingMemory) select 7) min 2; +GVAR(currentScopeClickNumber) = 1 max (GVAR(workingMemory) select 8) min 10; + +if (_updateDisplay) then { + [] 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 (_updateDisplay) 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..f805ce66b1 --- /dev/null +++ b/addons/atragmx/functions/fnc_clear_user_data.sqf @@ -0,0 +1,44 @@ +/* + * 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 ["ACE_ATragMX_latitude", nil]; +profileNamespace setVariable ["ACE_ATragMX_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]; + +profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", nil]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", nil]; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index 59ec3528af..b4d51bd894 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -26,6 +26,8 @@ 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 { @@ -33,10 +35,13 @@ if (GVAR(showRangeCard)) then { [] 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); +[GVAR(currentGun), false, true] call FUNC(change_gun); + { lbAdd [6000, _x select 0]; } forEach GVAR(gunList); 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..3796bb78e6 --- /dev/null +++ b/addons/atragmx/functions/fnc_cycle_gun_list.sqf @@ -0,0 +1,20 @@ +/* + * 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" + +if (!(GVAR(showMainPage) || GVAR(showGunList))) exitWith {}; + +[(GVAR(currentGun) + (count GVAR(gunList)) + _this) % (count GVAR(gunList)), true, 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..2e613ca9e6 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 */ @@ -18,6 +18,7 @@ GVAR(workingMemory) = +(GVAR(gunList) select 0); GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"]; +GVAR(scopeClickUnits) = ["TMOA", "SMOA", "MILs"]; GVAR(rangeCardStartRange) = 200; GVAR(rangeCardEndRange) = 2000; @@ -26,7 +27,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; @@ -40,29 +41,40 @@ GVAR(currentUnit) = 2; GVAR(currentGun) = 0; GVAR(currentTarget) = 0; GVAR(currentScopeUnit) = 0; +GVAR(currentScopeClickUnit) = 2; +GVAR(currentScopeClickNumber) = 10; +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..ca289302c9 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) = 10 max parseNumber(ctrlText 130050) min 1350; +GVAR(relativeHumidity) = (0 max parseNumber(ctrlText 130060) min 100) / 100; +if (GVAR(currentUnit) != 2) 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 round(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), round(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..55b73cc5b5 --- /dev/null +++ b/addons/atragmx/functions/fnc_restore_user_data.sqf @@ -0,0 +1,42 @@ +/* + * 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]), true, 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]]; + +GVAR(rangeCardStartRange) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardStartRange", 200]) min 3000; +GVAR(rangeCardEndRange) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardEndRange", 2000]) min 3000; +GVAR(rangeCardIncrement) = 1 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardIncrement", 50]) min 3000; +GVAR(rangeCardCurrentColumn) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardCurrentColumn", 3]) min 3; 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..dfab6da238 --- /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, 120061, 12007, 12008, 12009, 12010, 12011]; + +if (_this) then { + [] call FUNC(update_gun_ammo_data); +}; diff --git a/addons/atragmx/functions/fnc_show_main_page.sqf b/addons/atragmx/functions/fnc_show_main_page.sqf index 941c7559c8..ed999948b0 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, - 500, 501, 502, 503, 600, 601, 602, 603, 1000, 2000, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; +{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, 1001, 1002, 1003, 1004, 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_target_data.sqf b/addons/atragmx/functions/fnc_show_target_data.sqf new file mode 100644 index 0000000000..48e419f65f --- /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, 140061, 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 60de30930f..4f46932a0b 100644 --- a/addons/atragmx/functions/fnc_show_target_range_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_range_assist.sqf @@ -25,11 +25,9 @@ if (_this) then { 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 3ac05f3f4f..2e66b5ea7b 100644 --- a/addons/atragmx/functions/fnc_show_target_speed_assist.sqf +++ b/addons/atragmx/functions/fnc_show_target_speed_assist.sqf @@ -24,19 +24,15 @@ if (_this) then { 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_sord.sqf b/addons/atragmx/functions/fnc_sord.sqf index 650993cff3..a433153c0e 100644 --- a/addons/atragmx/functions/fnc_sord.sqf +++ b/addons/atragmx/functions/fnc_sord.sqf @@ -22,6 +22,6 @@ _slopeDistance = _this select 0; _azimuth = _this select 1; _inclination = _this select 2; -//_inclination = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2); -GVAR(inclinationAngle) set [GVAR(currentTarget), _inclination]; -GVAR(targetRange) set [GVAR(currentTarget), _slopeDistance]; +GVAR(inclinationAngle) set [GVAR(currentTarget), round(_inclination)]; +GVAR(directionOfFire) set [GVAR(currentTarget), round(_azimuth)]; +GVAR(targetRange) set [GVAR(currentTarget), round(_slopeDistance)]; 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..2045276426 --- /dev/null +++ b/addons/atragmx/functions/fnc_store_user_data.sqf @@ -0,0 +1,44 @@ +/* + * 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 ["ACE_ATragMX_latitude", GVAR(latitude)]; +profileNamespace setVariable ["ACE_ATragMX_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)]; + +profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", GVAR(rangeCardStartRange)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardEndRange", GVAR(rangeCardEndRange)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardIncrement", GVAR(rangeCardIncrement)]; +profileNamespace setVariable ["ACE_ATragMX_rangeCardCurrentColumn", GVAR(rangeCardCurrentColumn)]; \ No newline at end of file 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..1cc1f9338b 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, 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 572a4fe6ae..059bc7e40b 100644 --- a/addons/atragmx/functions/fnc_toggle_range_card.sqf +++ b/addons/atragmx/functions/fnc_toggle_range_card.sqf @@ -15,12 +15,10 @@ */ #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); 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..7cd34754da --- /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) == 2) then { + ctrlSetText [130040, Str(Round(GVAR(temperature) * 10) / 10)]; +} else { + ctrlSetText [130040, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) == 2) 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) == 2) 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..be7565bda7 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) == 2) then { + ctrlSetText [200, Str(Round(GVAR(temperature) * 10) / 10)]; } else { + ctrlSetText [200, Str(Round((GVAR(temperature) * 1.8 + 32) * 10) / 10)]; +}; +if (GVAR(currentUnit) == 2) 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) == 2) 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..4ca7338e57 100644 --- a/addons/atragmx/functions/fnc_update_gun.sqf +++ b/addons/atragmx/functions/fnc_update_gun.sqf @@ -16,38 +16,35 @@ #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 -{ - ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; -} else -{ - ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [140, format["*%1", Round(GVAR(workingMemory) select 2)]]; + }; + case 1: { + ctrlSetText [140, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; + }; + case 2: { + ctrlSetText [140, Str(Round(GVAR(workingMemory) select 2))]; + }; }; - [] call FUNC(update_scope_unit); 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..4ccae287e7 --- /dev/null +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -0,0 +1,79 @@ +/* + * 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) == 1) then { + ctrlSetText [120060, Str(Round((GVAR(workingMemory) select 2) * 1.0936133))]; +} else { + ctrlSetText [120060, Str(Round(GVAR(workingMemory) select 2))]; +}; +if (GVAR(currentUnit) == 0) then { + ctrlSetText [120061, "*"]; +} else { + ctrlSetText [120061, ""]; +}; + +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_scope_unit.sqf b/addons/atragmx/functions/fnc_update_scope_unit.sqf index 55bb703eee..72efeb772e 100644 --- a/addons/atragmx/functions/fnc_update_scope_unit.sqf +++ b/addons/atragmx/functions/fnc_update_scope_unit.sqf @@ -15,5 +15,10 @@ */ #include "script_component.hpp" -ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; -ctrlSetText [5000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; +if (GVAR(currentScopeUnit) == 3) then { + ctrlSetText [2000, format["Clicks=%1", GVAR(currentScopeClickNumber)]]; + ctrlSetText [5000, format["Clicks=%1", GVAR(currentScopeClickNumber)]]; +} else { + ctrlSetText [2000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; + ctrlSetText [5000, GVAR(scopeUnits) select GVAR(currentScopeUnit)]; +}; diff --git a/addons/atragmx/functions/fnc_update_target.sqf b/addons/atragmx/functions/fnc_update_target.sqf index 18d7a72cd2..ef2ef1de5c 100644 --- a/addons/atragmx/functions/fnc_update_target.sqf +++ b/addons/atragmx/functions/fnc_update_target.sqf @@ -15,23 +15,34 @@ */ #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 -{ - ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget))))]; +switch (GVAR(currentUnit)) do { + case 0: { + ctrlSetText [340, format["*%1", Round((GVAR(targetRange) select GVAR(currentTarget)))]]; + }; + case 1: { + ctrlSetText [340, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))]; + }; + case 2: { + 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..b5e6dcf85a --- /dev/null +++ b/addons/atragmx/functions/fnc_update_target_data.sqf @@ -0,0 +1,58 @@ +/* + * 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) == 0) then { + ctrlSetText [140061, "*"]; +} else { + ctrlSetText [140061, ""]; +}; + +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_unit_selection.sqf b/addons/atragmx/functions/fnc_update_unit_selection.sqf index 2882954c5b..77d96bfdd6 100644 --- a/addons/atragmx/functions/fnc_update_unit_selection.sqf +++ b/addons/atragmx/functions/fnc_update_unit_selection.sqf @@ -22,6 +22,10 @@ ((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..299c321d33 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, 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 f7ec6e68e8..6e81f79493 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -10,3 +10,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.2 diff --git a/addons/atragmx/stringtable.xml b/addons/atragmx/stringtable.xml index 1baa4fb38c..dd8fe236a7 100644 --- a/addons/atragmx/stringtable.xml +++ b/addons/atragmx/stringtable.xml @@ -19,18 +19,23 @@ Otwórz ATragMX Открыть ATragMX Abrir ATragMX + Ouvrir ATragMX + ATragMX öffnen Rugged PDA with ATragMX Przenośny PDA z kalkulatorem balistycznym ATragMX Защищенный КПК с ATragMX PDA rugerizada con ATragMX + Robuster PDA mit ATragMX Open ATragMX Otwórz ATragMX Открыть ATragMX Abrir ATragMX + Ouvrir ATragMX + ATragMX öffnen diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index db98c4fffc..33eb0d9cac 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -42,7 +42,7 @@ IR-Stroboskop befestigt Marcador IR acoplado Przyczepiono stroboskop IR - Strobe IR attaché + Balise IR attachée IR Značkovač připnutý Marcador IV Acoplado Strobo IR attaccata @@ -54,7 +54,7 @@ IR-Stroboskop entfernt Marcador IR quitado Odczepiono stroboskop IR - Strobe IR détaché + Balise IR détachée IR Značkovač odepnutý Marcador IV Separado Strobo IR staccata @@ -126,7 +126,7 @@ IR-Stroboskop Marcador IR Stroboskop IR - Strobe IR + Balise IR IR Značkovač Marcador IV Strobo IR @@ -138,7 +138,7 @@ Das IR-Stroboskop erlaubt es dir deine Position mit einem blinkenden Leuchtfeuer zu signalisieren, welches nur mit Nachtsichtgerät zu erkennen ist. Stroboskop światła podczerwieni umożliwia oznaczenie swojej pozycji pulsacyjnym światłem widocznym tylko przez optykę noktowizyjną i gogle noktowizyjne. El Marcador IR permite señalizar su posisición a través de una baliza visible solo a través de dispositivos de visión nocturna. - Le Strobe IR permet de signaler votre position grace à un clignotement visible par des JVN. + La balise IR permet de signaler votre position grace à un clignotement visible par des JVN. IR Značkovač je Infračerveně zářící stroboskop umožňující signalizaci vaší pozice díky blikajícímu světlu, které je vidět pouze při užití noktovizoru. O Marcador IV permite que você sinalize sua posição através de um pulso visível somente com equipamento de visão noturna. La Strobo IR è una luce stroboscopica che ti permette di segnalare la tua posizione grazie all'emissione di impulsi ad infrarossi visibili solo con i visori notturni. @@ -189,7 +189,7 @@ %1<br/>Acoplada %1<br/>attaccata %1<br/>hozzácsatolva - %1<br/>присоединена + %1<br/>присоединен(-а) %1<br/>Detached @@ -201,7 +201,7 @@ %1<br/>Separada %1<br/>staccata %1<br/>lecsatolva - %1<br/>отсоединена + %1<br/>отсоединен(-а) diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index c95da8d760..c75ab6339d 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1,5 +1,4 @@  - @@ -13,7 +12,7 @@ 6.5mm 30ks Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 6,5mm Caricatore 6.5mm 30Rnd Traccianti IR-DIM - Магазин из 30-ти 6.5 мм трассирующих под ПНВ + Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm IR-DIM @@ -25,7 +24,7 @@ 6.5mm IR-DIM 6,5mm IR-DIM 6.5 IR-DIM - 6.5 мм ИК-трассирующие + 6,5 мм ИК-трассирующие Caliber: 6.5x39 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -37,7 +36,7 @@ Ráže: 6.5x39 mm Svítící IR-DIM<br />Munice: 30<br />Použití: MX/C/M/SW/3GL Calibre: 6,5x39 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39 mm Traccianti IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL 6.5mm 30Rnd SD Mag @@ -49,7 +48,7 @@ 6.5mm 30ks SD Zásobník Carregador de 30 projéteis SD de 6,5mm Caricatore 6.5mm 30Rnd Sil. - Магазин из 30-ти 6.5 мм дозвуковых + Магазин из 30-ти 6,5 мм дозвуковых 6.5mm SD @@ -61,7 +60,7 @@ 6.5mm SD 6,5mm SD 6.5mm Sil. - 6.5 мм дозвуковые + 6,5 мм дозвуковые Caliber: 6.5x39 mm SD<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -73,7 +72,7 @@ Ráže: 6.5x39 mm SD<br />Munice: 30<br />Použití: MX/C/M/SW/3GL Calibre: 6,5x39 mm SD<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39 mm Sil.<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм дозвуковые<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL 6.5mm 30Rnd AP Mag @@ -85,7 +84,7 @@ 6.5mm 30ks AP Zásobník Carregador de 30 projéteis AP de 6,5mm Caricatore 6.5mm 30Rnd AP - Магазин из 30-ти 6.5 мм бронебойных + Магазин из 30-ти 6,5 мм бронебойных 6.5mm AP @@ -97,7 +96,7 @@ 6.5mm AP 6,5mm AP 6.5mm AP - 6.5 мм бронебойные + 6,5 мм бронебойные Caliber: 6.5x39 mm AP<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL @@ -109,7 +108,7 @@ Ráže: 6.5x39 mm AP<br />Munice: 30<br />Použití: MX/C/M/SW/3GL Calibre: 6,5x39 mm AP<br />Projéteis: 30<br />Usado em: MX/C/M/SW/3GL Calibro: 6.5x39 mm AP<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL - Калибр: 6.5x39 мм бронебойные<br />Патронов: 30<br />Применимы в: MX/C/M/SW/3GL + Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL @@ -122,7 +121,7 @@ 6.5mm 30ks Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 6,5mm Caricatore 6.5mm 30Rnd Traccianti IR-DIM - Магазин из 30-ти 6.5 мм трассирующих под ПНВ + Магазин из 30-ти 6,5 мм ИК-трассирующих 6.5mm IR-DIM @@ -134,7 +133,7 @@ 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM - 6.5 мм ИК-трассирующие + 6,5 мм ИК-трассирующие Caliber: 6.5x39 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: Katiba @@ -146,7 +145,7 @@ Ráže: 6.5x39 mm Svítící IR-DIM<br />Munice: 30<br />Použití: Katiba Calibre: 6,5x39 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39 mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: Katiba + Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: Katiba 6.5mm 30Rnd SD Mag @@ -158,7 +157,7 @@ 6.5mm 30ks SD Zásobník Carregador de 30 projéteis SD de 6,5mm Caricatore 6.5mm 30Rnd Sil. - Магазин из 30-ти 6.5 мм дозвуковых + Магазин из 30-ти 6,5 мм дозвуковых 6.5mm SD @@ -170,7 +169,7 @@ 6.5mm SD 6,5mm SD 6.5mm Sil. - 6.5 мм дозвуковые + 6,5 мм дозвуковые Caliber: 6.5x39 mm SD<br />Rounds: 30<br />Used in: Katiba @@ -182,7 +181,7 @@ Ráže: 6.5x39 mm SD<br />Munice: 30<br />Použití: Katiba Calibre: 6,5x39 mm SD<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39 mm Sil.<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм дозвуковые<br />Патронов: 30<br />Применимы в: Katiba + Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: Katiba 6.5mm 30Rnd AP Mag @@ -194,7 +193,7 @@ 6.5mm 30ks AP Zásobník Carregador de 30 projéteis AP de 6,5mm Caricatore 6.5mm 30Rnd AP - Магазин из 30-ти 6.5 мм бронебойных + Магазин из 30-ти 6,5 мм бронебойных 6.5mm AP @@ -206,7 +205,7 @@ 6.5mm AP 6,5mm AP 6.5mm AP - 6.5 мм бронебойные + 6,5 мм бронебойные Caliber: 6.5x39 mm AP<br />Rounds: 30<br />Used in: Katiba @@ -218,7 +217,7 @@ Ráže: 6.5x39 mm AP<br />Munice: 30<br />Použití: Katiba Calibre: 6,5x39 mm AP<br />Projéteis: 30<br />Usado em: Katiba Calibro: 6.5x39 mm AP<br />Munizioni: 30<br />In uso su: Katiba - Калибр: 6.5x39 мм бронебойные<br />Патронов: 30<br />Применимы в: Katiba + Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: Katiba @@ -231,7 +230,7 @@ 5.56mm 30ks Svítící IR-DIM Zásobník Carregador de 30 projéteis traçantes IR-DIM de 5,56mm Caricatore 5.56mm 30rnd Traccianti IR-DIM - Магазин из 30-ти 5.56 мм трассирующих под ПНВ + Магазин из 30-ти 5,56 мм ИК-трассирующих 5.56mm IR-DIM @@ -243,7 +242,7 @@ 5.56mm IR-DIM 5,56mm IR-DIM 5.56mm IR-DIM - 5.56 мм ИК-трассирующие + 5,56 мм ИК-трассирующие Caliber: 5.56x45 mm Tracer IR-DIM<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -255,7 +254,7 @@ Ráže: 5.56x45 mm Svítící IR-DIM<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Calibre: 5,56x45 mm Traçante IR-DIM<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Calibro: 5.56x45 mm Traccianti IR-DIM<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм трассирующие под ПНВ<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Калибр: 5,56x45 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR 5.56mm 30Rnd AP Mag @@ -267,7 +266,7 @@ 5.56mm 30ks AP Zásobník Carregador de 30 projéteis AP de 5,56mm Caricatore 5.56mm 30Rnd AP - Магазин из 30-ти 5.56 мм бронебойных + Магазин из 30-ти 5,56 мм бронебойных 5.56mm AP @@ -279,7 +278,7 @@ 5.56mm AP 5,56mm AP 5.56mm AP - 5.56 мм бронебойные + 5,56 мм бронебойные Caliber: 5.56x45 mm AP<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -291,7 +290,7 @@ Ráže: 5.56x45 mm AP<br />Munice: 30<br />Použití: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Calibre: 5,56x45 mm AP<br />Projéteis: 30<br />Usado em: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Calibro: 5.56x45 mm AP<br />Munizioni: 30<br />In uso su: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - Калибр: 5.56x45 мм бронебойные<br />Патронов: 30<br />Применимы в: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR + Калибр: 5,56x45 мм бронебойные<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -304,7 +303,7 @@ 7.62mm 20ks Svítící Zásobník Carregador de 20 projéteis traçantes de 7,62mm Caricatore 7.62mm 20Rnd Traccianti - Магазин из 20-ти 7.62 мм трассирующих + Магазин из 20-ти 7,62 мм трассирующих 7.62mm Tracer @@ -316,7 +315,7 @@ 7.62mm Svítící 7,62mm Traçante 7.62mm Traccianti - 7.62 мм трассирущие + 7,62 мм трассирущие Caliber: 7.62x51 mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR @@ -328,7 +327,7 @@ Ráže: 7.62x51 mm Svítící<br />Munice: 20<br />Použití: Mk18 ABR Calibre: 7,62x51 mm Traçante<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51 mm Traccianti<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм трассирующие<br />Патронов: 20<br />Применимы в: Mk18 ABR + Калибр: 7,62x51 мм трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR 7.62mm 20rnd Tracer IR-DIM Mag @@ -340,7 +339,7 @@ 7.62mm 20ks Svítící IR-DIM Zásobník Carregador de 20 projéteis IR-DIM de 7,62mm Caricatore 7.62mm 20rnd Traccianti IR-DIM - Магазин из 20-ти 7.62 мм трассирующих под ПНВ + Магазин из 20-ти 7,62 мм ИК-трассирующих 7.62mm IR-DIM @@ -352,7 +351,7 @@ 7.62mm IR-DIM 7,62mm IR-DIM 7.62mm IR-DIM - 7.62 мм ИК-трассирующие + 7,62 мм ИК-трассирующие Caliber: 7.62x51 mm Tracer IR-DIM<br />Rounds: 20<br />Used in: Mk18 ABR @@ -364,7 +363,7 @@ Ráže: 7.62x51 mm Svítící IR-DIM<br />Munice: 20<br />Použití: Mk18 ABR Calibre: 7,62x51 mm Traçante IR-DIM<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51 mm Traccianti IR-DIM<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм трассирующие под ПНВ<br />Патронов: 20<br />Применимы в: Mk18 ABR + Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR 7.62mm 20Rnd SD Mag @@ -376,7 +375,7 @@ 7.62mm 20ks SD Zásobník Carregador de 20 projéteis SD de 7,62mm Caricatore 7.62mm 20Rnd Sil. - Магазин из 20-ти 7.62 мм дозвуковых + Магазин из 20-ти 7,62 мм дозвуковых 7.62mm SD @@ -388,7 +387,7 @@ 7.62mm SD 7,62mm SD 7.62mm Sil. - 7.62 мм дозвуковые + 7,62 мм дозвуковые Caliber: 7.62x51 mm SD<br />Rounds: 20<br />Used in: Mk18 ABR @@ -400,7 +399,7 @@ Ráže: 7.62x51 mm SD<br />Munice: 20<br />Použití: Mk18 ABR Calibre: 7,62x51 mm SD<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51 mm Sil.<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR + Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: Mk18 ABR 7.62mm 20Rnd AP Mag @@ -412,7 +411,7 @@ 7.62mm 20ks AP Zásobník Carregador de 20 projéteis AP de 7,62mm Caricatore 7.62mm 20Rnd AP - Магазин из 20-ти 7.62 мм бронебойных + Магазин из 20-ти 7,62 мм бронебойных 7.62mm AP @@ -424,7 +423,7 @@ 7.62mm AP 7,62mm AP 7.62mm AP - 7.62 мм бронебойные + 7,62 мм бронебойные Caliber: 7.62x51 mm AP<br />Rounds: 20<br />Used in: Mk18 ABR @@ -436,7 +435,7 @@ Ráže: 7.62x51 mm AP<br />Munice: 20<br />Použití: Mk18 ABR Calibre: 7,62x51 mm AP<br />Projéteis: 20<br />Usado em: Mk18 ABR Calibro: 7.62x51 mm AP<br />Munizioni: 20<br />In uso su: Mk18 ABR - Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR + Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: Mk18 ABR @@ -445,6 +444,7 @@ Taśma .338 NM 130rd Smugacz Bande .338 NM 130Cps Traçante Cinta de 130 balas trazadoras de .338 NM + Лента из 130-ти .338 NM трассирующих .338 NM Tracer @@ -453,6 +453,7 @@ .338 NM Svítící .338 NM Traçante .338 NM trazadora + .338 NM трассирующие Caliber: .338 Norma Magnum Tracer<br />Rounds: 130<br />Used in: SPMG @@ -460,6 +461,7 @@ Kaliber: .338 Norma Magnum Smugacz<br />Pociski: 130<br />Używany w: SPMG Calibre: .338 Norma Magnum Traçante<br />Cartouches: 130<br />Utilisé dans: SPMG Calibre: .338 Norma Magnum trazadora<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum трассирующие<br />Патронов: 130<br />Используются в: SPMG .338 NM 130Rnd IR-DIM Belt @@ -467,6 +469,7 @@ Taśma .338 NM 130rd IR-DIM Bande .338 NM 130Cps IR-DIM Cinta de 130 balas IR-DIM de .338 NM + Лента из 130-ти .338 NM ИК-трассирующих .338 NM IR-DIM @@ -475,6 +478,7 @@ .338 NM IR-DIM .338 NM IR-DIM .338 NM IR-DIM + .338 NM ИК-трассирующие Caliber: .338 Norma Magnum Tracer IR-DIM<br />Rounds: 130<br />Used in: SPMG @@ -482,6 +486,7 @@ 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 trazadora IR-DIM<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum ИК-трассирующие<br />Патронов: 130<br />Используются с: SPMG .338 NM 130Rnd AP Belt @@ -489,6 +494,7 @@ Taśma .338 NM 130rd AP Bande .338 NM 130Cps AP Cinta de 130 balas AP de .338 NM + Лента из 130-ти .338 NM бронебойных .338 NM AP @@ -497,6 +503,7 @@ .338 NM AP .338 NM AP .338 NM AP + .338 NM бронебойные Caliber: .338 Norma Magnum AP<br />Rounds: 130<br />Used in: SPMG @@ -504,6 +511,7 @@ Kaliber: .338 Norma Magnum AP<br />Pociski: 130<br />Używane w: SPMG Calibre: .338 Norma Magnum AP<br />Cartouches: 130<br />Utilisé dans: SPMG Calibre: .338 Norma Magnum AP<br />Balas: 130<br />Se usa en: SPMG + Калибр: .338 Norma Magnum бронебойные<br />Патронов: 130<br />Используются с: SPMG @@ -512,6 +520,7 @@ Magazynek 9.3mm 10rd Smugacz Chargeur 9.3mm 10Cps Traçante Cargador de 10 balas trazadoras de 9.3mm + Магазин из 10-ти 9,3 мм трассирующих 9.3mm Tracer @@ -520,6 +529,7 @@ 9.3mm Svítící 9.3mm Traçante 9.3mm trazadora + 9,3 мм трассирующие Caliber: 9.3x64mm Tracer<br />Rounds: 10<br />Used in: Cyrus @@ -527,6 +537,7 @@ Kaliber: 9,3x64 mm Smugacz<br />Pociski: 10<br />Używany w: Cyrus Calibre: 9.3x64mm Traçante<br />Cartouches: 10<br />Utilisé dans: Cyrus Calibre: 9.3x64mm trazadora<br />Balas: 10<br />Se usa en: Cyrus + Калибр: 9,3x64 мм трассирующие<br />Патронов: 10<br />Используются с: Cyrus 9.3mm 10Rnd Tracer IR-DIM Mag @@ -534,6 +545,7 @@ Magazynek 9,3mm 10rd Smugacz IR-DIM Chargeur 9.3mm 10Cps Traçante IR-DIM Cargador de 10 balas trazadoras IR-DIM de 9.3mm + Магазин из 10-ти 9,3 мм ИК-трассирующих 9.3mm IR-DIM @@ -542,6 +554,7 @@ 9.3mm IR-DIM 9.3mm IR-DIM 9.3mm IR-DIM + 9,3 мм ИК-трассирующие Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 10<br />Used in: Cyrus @@ -549,6 +562,7 @@ Kaliber: 9,3x64 mm Smugacz IR-DIM<br />Pociski: 10<br />Używany w: Cyrus Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 10<br />Utilisé dans: Cyrus Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 10<br />Se usa en: Cyrus + Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 10<br />Используются с: Cyrus 9.3mm 10Rnd AP Mag @@ -556,6 +570,7 @@ Magazynek 9,3mm 10rd AP Chargeur 9.3mm 10Cps AP Cargador de 10 balas AP de 9.3mm + Магазин из 10-ти 9,3 мм бронебойных 9.3mm AP @@ -564,6 +579,7 @@ 9.3mm AP 9.3mm AP 9.3mm AP + 9,3 мм бронебойные Caliber: 9.3x64mm AP<br />Rounds: 10<br />Used in: Cyrus @@ -571,6 +587,7 @@ Kaliber: 9,3x64 mm AP<br />Pociski: 10<br />Używany w: Cyrus Calibre: 9.3x64mm AP<br />Cartouches: 10<br />Utilisé dans: Cyrus Calibre: 9.3x64mm AP<br />Balas: 10<br />Se usa en: Cyrus + Калибр: 9,3x64 мм бронебойные<br />Патронов: 10<br />Используются с: Cyrus @@ -579,6 +596,7 @@ Taśma 9,3mm 150rd Smugacz Bande 9.3mm 150Cps Traçante Cinta de 150 balas trazadoras de 9.3mm + Лента из 150-ти 9,3 мм трассирующих 9.3mm Tracer @@ -587,6 +605,7 @@ 9.3mm Svítící 9.3mm Traçante 9.3mm trazadora + 9,3 мм трассирующие Caliber: 9.3x64mm Tracer<br />Rounds: 150<br />Used in: Navid @@ -594,6 +613,7 @@ Kaliber: 9,3x64 mm Smugacz<br />Pociski: 150<br />Używane w: Navid Calibre: 9.3x64mm Traçante<br />Cartouches: 150<br />Utilisé dans: Navid Calibre: 9.3x64mm trazadora<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм трассирующие<br />Патронов: 150<br />Используются с: Навид 9.3mm 150Rnd Tracer IR-DIM Belt @@ -601,6 +621,7 @@ Taśma 9,3mm 150rd Smugacz IR-DIM Bande 9.3mm 150Cps Traçante IR-DIM Cinta de 150 balas trazadoras IR-DIM de 9.3mm + Лента из 150-ти 9,3 мм ИК-трассирующих 9.3mm IR-DIM @@ -609,6 +630,7 @@ 9.3mm IR-DIM 9.3mm IR-DIM 9.3mm IR-DIM + 9,3 мм ИК-трассирующие Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 150<br />Used in: Navid @@ -616,6 +638,7 @@ Kaliber: 9,3x64 mm Smugacz IR-DIM<br />Pociski: 150<br />Używane w: Navid Calibre: 9.3x64mm Traçante IR-DIM<br />Cartouches: 150<br />Utilisé dans: Navid Calibre: 9.3x64mm trazadora IR-DIM<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм ИК-трассирующие<br />Патронов: 150<br />Используются с: Навид 9.3mm 150Rnd AP Belt @@ -623,6 +646,7 @@ Taśma 9,3mm 150rd AP Bande 9.3mm 150Cps AP Cinta de 150 balas AP de 9.3mm + Лента из 150-ти 9,3 мм бронебойных 9.3mm AP @@ -631,6 +655,7 @@ 9.3mm AP 9.3mm AP 9.3mm AP + 9,3 мм бронебойные Caliber: 9.3x64mm AP<br />Rounds: 150<br />Used in: Navid @@ -638,333 +663,406 @@ Kaliber: 9,3x64 mm AP<br />Pociski: 150<br />Używane w: Navid Calibre: 9.3x64mm AP<br />Cartouches: 150<br />Utilisé dans: Navid Calibre: 9.3x64mm AP<br />Balas: 150<br />Se usa en: Navid + Калибр: 9,3x64 мм бронебойные<br />Патронов: 150<br />Используются с: Навид 9x19mm 16Rnd Mag Magazynek 9x19mm 16rd Chargeur 9x19mm 16Cps Cargador de 16 balas de 9x19mm + Магазин из 16-ти 9х19 мм 9x19mm 9x19mm 9x19mm 9x19mm + 9х19 мм 9x19mm 30Rnd Mag Magazynek 9x19mm 16rd 9x19mm 30Cps Cargador de 16 balas de 9x19mm + Магазин из 16-ти 9х19 мм 9x19mm 30Rnd Mag Magazynek 9x19mm 30rd 9x19mm 30Cps Cargador de 30 balas de 9x19mm + Магазин из 30-ти 9х19 мм 9x19mm 9x19mm 9x19mm 9x19mm + 9х19 мм 9x19mm 30Rnd Mag Magazynek 9x19mm 30rd 9x19mm 30Cps Cargador de 30 balas de 9x19mm + Магазин из 30-ти 9х19 мм 7.62x54mm 10Rnd Tracer IR-DIM Mag Magazynek 7,62x54 mm 10rd Smugacz IR-DIM Chargeur 7.62x54mm 10Rnd Traçante IR-DIM Cargador de 10 balas trazadoras IR-DIM de 7.62x54mm + Магазин из 10-ти 7,62 мм ИК-трассирующих 7.62mm IR-DIM 7,62mm IR-DIM 7.62mm IR-DIM 7.62mm IR-DIM + 7,62 мм ИК-трассирующие 7.62x54mm 10Rnd Tracer IR-DIM Mag Magazynek 7,62x54 mm 10rd Smugacz IR-DIM Chargeur 7.62x54mm 10Cps Traçante IR-DIM Cargador de 10 balas trazadoras IR-DIM de 7.62x54mm + Магазин из 10-ти 7,62 мм ИК-трассирующих 6.5mm 100Rnd Tracer IR-DIM Mag Magazynek 6,5mm 100rd Smugacz IR-DIM Chargeur 6.5mm 100Rnd Traçante IR-DIM Cargador de 100 balas trazadoras IR-DIM de 6.5mm + Магазин из 100 6,5 мм ИК-трассирующих 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM 6.5mm IR-DIM + 6,5 мм ИК-трассирующие 6.5mm 100Rnd Tracer IR-DIM Mag Magazynek 6,5mm 100rd Smugacz IR-DIM Chargeur 6.5mm 100Rnd Traçante IR-DIM Cargador de 100 balas trazadoras IR-DIM de 6.5mm + Магазин из 100 6,5 мм ИК-трассирующих 6.5mm 200Rnd Tracer IR-DIM Belt Magazynek 6,5mm 200rd Smugacz IR-DIM Bande 6.5mm 200Rnd Traçante IR-DIM Cinta de 200 balas trazadoras IR-DIM de 6.5mm + Магазин из 200-т 6,5 мм ИК-трассирующих 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM 6.5mm IR-DIM + 6,5 мм ИК-трассирующие 6.5mm 200Rnd Tracer IR-DIM Belt Magazynek 6,5mm 200rd Smugacz IR-DIM Bande 6.5mm 200Cps Traçante IR-DIM Cinta de 200 balas trazadoras IR-DIM de 6.5mm + Магазин из 200-т 6,5 мм ИК-трассирующих 5.56mm 30Rnd Mag (Mk262) Magazynek 5,56mm 30rd Mk262 5.56mm 30Cps (Mk262) Cargador de 30 balas de 5.56mm (Mk262) + Магазин из 30-ти 5.56 мм Mk262 5.56mm Mk262 5,56mm Mk262 5.56mm Mk262 5.56mm (Mk262) + 5,56 мм Mk262 Caliber: 5.56x45 mm NATO (Mk262)<br />Rounds: 30 Kaliber: 5,56x45 mm NATO (Mk262)<br />Pociski: 30 Calibre: 5.56x45 mm NATO (Mk262)<br />Cartouches: 30 Calibre: 5.56x45 mm NATO (Mk262)<br />Balas: 30 + Калибр: 5,56x45 мм NATO (Mk262)<br />Патронов: 30 5.56mm 30Rnd Mag (Mk318) Magazynek 5,56mm 30rd Mk318 5.56mm 30Cps (Mk318) Cargador de 30 balas de 5.56mm (Mk318) + Магазин из 30-ти 5.56 мм Mk318 5.56mm Mk318 5,56mm Mk318 5.56mm Mk318 5.56mm (Mk318) + 5.56 мм Mk318 Caliber: 5.56x45 mm NATO (Mk318)<br />Rounds: 30 Kaliber: 5,56x45 mm NATO (Mk318)<br />Pociski: 30 Calibre: 5.56x45 mm NATO (Mk318)<br />Cartouches: 30 Calibre: 5.56x45 mm NATO (Mk318)<br />Balas: 30 + Калибр: 5,56x45 мм NATO (Mk318)<br />Патронов: 30 7.62mm 10Rnd Mag (M118LR) Magazynek 7,62mm 10rd (M118LR) 7.62mm 10Cps (M118LR) Cargador de 10 balas de 7.62mm (M118LR) + Магазин из 10-ти 7,62 мм (M118LR) 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR 7.62mm (M118LR) + 7,62 мм M118LR Caliber: 7.62x51 mm NATO (M118LR)<br />Rounds: 10 Kaliber: 7,62x51 mm NATO (M118LR)<br />Pociski: 10 Calibre: 7.62x51 mm NATO (M118LR)<br />Cartouches: 10 Calibre: 7.62x51 mm NATO (M118LR)<br />Balas: 10 + Калибр: 7,62x51 мм NATO (M118LR)<br />Патронов: 10 7.62mm 20Rnd Mag (M118LR) Magazynek 7,62mm 20rd (M118LR) 7.62mm 20Cps (M118LR) Cargador de 20 balas de 7.62mm (M118LR) + Магазин из 20-ти 7,62 мм (M118LR) 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR 7.62mm (M118LR) + 7,62 мм M118LR Caliber: 7.62x51 mm NATO (M118LR)<br />Rounds: 20 Kaliber: 7,62x51 mm NATO (M118LR)<br />Pociski: 20 Calibre: 7.62x51 mm NATO (M118LR)<br />Cartouches: 20 Calibre: 7.62x51 mm NATO (M118LR)<br />Balas: 20 + Калибр: 7,62x51 мм NATO (M118LR)<br />Патронов: 20 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) + Магазин из 10-ти 7,62 мм (Mk319 Mod 0) 7.62mm Mk319 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,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 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) + Магазин из 20-ти 7,62 мм (Mk319 Mod 0) 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 7.62mm Mk319 + 7,62 мм 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,62x51 мм NATO (Mk319 Mod 0)<br />Патронов: 20 7.62mm 20Rnd Mag (Mk248 Mod 0) Magazynek 7,62mm 20rd (Mk248 Mod 0) 7.62mm 20Cps (Mk248 Mod 0) Cargador de 20 balas de 7.62mm (Mk248 Mod 0) + Магазин из 20-ти 7,62 мм (Mk248 Mod 0) 7.62mm (Mk248 Mod 0) 7,62mm (Mk248 Mod 0) 7.62mm (Mk248 Mod 0) 7.62mm (Mk248 Mod 0) + 7,62 мм (Mk248 Mod 0) Caliber: 7.62x67 mm NATO (Mk248 Mod 0)<br />Rounds: 20 Kaliber: 7,62x67 mm NATO (Mk248 Mod 0)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Cartouches: 20 Calibre: 7.62x67 mm NATO (Mk248 Mod 0)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Mk248 Mod 0)<br />Патронов: 20 7.62mm 20Rnd Mag (Mk248 Mod 1) Magazynek 7,62mm 20rd (Mk248 Mod 1) 7.62mm 20Cps (Mk248 Mod 1) Cargador de 20 balas de 7.62mm (Mk248 Mod 1) + Магазин из 20-ти 7,62 мм (Mk248 Mod 1) 7.62mm (Mk248 Mod 1) 7,62mm (Mk248 Mod 1) 7.62mm (Mk248 Mod 1) 7.62mm (Mk248 Mod 1) + 7,62 мм (Mk248 Mod 1) Caliber: 7.62x67 mm NATO (Mk248 Mod 1)<br />Rounds: 20 Kaliber: 7,62x67 mm NATO (Mk248 Mod 1)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Cartouches: 20 Calibre: 7.62x67 mm NATO (Mk248 Mod 1)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Mk248 Mod 1)<br />Патронов: 20 7.62mm 20Rnd Mag (Berger Hybrid OTM) Magazynek 7,62mm 20rd (Berger Hybrid OTM) 7.62 20Cps (Berger Hybrid OTM) Cargador de 20 balas de 7.62mm (Berger Hybrid OTM) + Магазин из 20-ти 7,62 мм (Berger Hybrid OTM) 7.62mm (OTM) 7,62mm (OTM) 7.62mm (OTM) 7.62mm (OTM) + 7,62 мм (OTM) Caliber: 7.62x67 mm NATO (Berger Hybrid OTM)<br />Rounds: 20 Kaliber: 7,62x67 mm NATO (Berger Hybrid OTM)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Cartouches: 20 Calibre: 7.62x67 mm NATO (Berger Hybrid OTM)<br />Balas: 20 + Калибр: 7,62x67 мм NATO (Berger Hybrid OTM)<br />Патронов: 20 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) + Магазин из 30-ти 6,5x47 мм (HPBT Scenar) 6.5mm Scenar 6.5mm Scenar 6.5mm Scenar + 6,5mm Scenar + 6,5 мм 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 + Калибр: 6,5x47 мм (HPBT Scenar)<br />Патронов: 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) + Магазин из 10-ти .338 (300 гран Sierra MatchKing HPBT) .338 (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 (300 гран Sierra MatchKing HPBT)<br />Патронов: 10 .338 10Rnd Mag (API526) .338 10Cps (API526) Cargador de 10 balas de .338 (API526) + Magazynek .338 10rd (API526) + Магазин из 10-ти .338 (API526) .338 AP .338 AP .338 AP + .338 AP + .338 бронебойные 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 + Калибр: .338 (API526)<br />Патронов: 10 12.7x99mm 5Rnd Mag 12.7x99mm 5Cps Cargador de 5 balas de 12.7x99mm + Magazynek 12,7x99 mm 5rd + Магазин из 5-ти 12,7x99 мм 12.7mm 12.7mm 12.7mm + 12,7mm + 12,7 мм 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,7x99 мм<br />Патронов: 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) + Магазин из 5-ти 12,7x99 мм (A-MAX) 12.7mm 12.7mm 12.7mm + 12,7mm + 12,7 мм 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 + Калибр: 12,7x99 мм (A-MAX)<br />Патронов: 5 - \ No newline at end of file + diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 5683eaf0d3..0a88c5d7d8 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 @@ -134,7 +134,7 @@ Surrender - Capituler + Se rendre Kapitulieren Rendirse Vzdát se @@ -156,7 +156,7 @@ Only use on alive units - Utiliser uniquement sur unité vivante + Utiliser uniquement sur une unité vivante Nur bei lebenden Einheiten verwendbar Utilizar solo en unidades vivas Použitelné jen na živé jednotky @@ -167,7 +167,7 @@ Only use on dismounted inf - Utiliser uniquement sur personnel à pied + Utiliser uniquement sur du personnel à pied Nur bei abgesessener Infanterie verwendbar Utilizar solo en infanteria desmontada Použitelné jen na pěsích jednotkách @@ -178,7 +178,7 @@ Nothing under mouse - Rien sous la souris + Rien sous le curseur Es wurde nichts ausgewählt Nada bajo el ratón Nic není vybráno @@ -188,4 +188,4 @@ Niente selezionato - + \ No newline at end of file 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/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index e470e91c95..2599e12a6d 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -4,6 +4,7 @@ // Load settings from profile if (hasInterface) then { call FUNC(loadSettingsFromProfile); + call FUNC(loadSettingsLocalizedText); }; // Listens for global "SettingChanged" events, to update the force status locally @@ -65,9 +66,31 @@ if (_currentVersion != _previousVersion) then { 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); +// ACE events "ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; "ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; +// Synced ACE events +// Handle JIP scenario +if(!isServer) then { + ["PlayerJip", { + diag_log text format["[ACE] * JIP event synchronization initialized"]; + ["SEH_all", [player]] call FUNC(serverEvent); + }] call FUNC(addEventHandler); +} else { + ["SEH_all", FUNC(_handleRequestAllSyncedEvents)] call FUNC(addEventHandler); +}; +["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); +[FUNC(syncedEventPFH), 0.5, []] call cba_fnc_addPerFrameHandler; + + +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ +/***************************************************************/ + // everything that only player controlled machines need, goes below this if (!hasInterface) exitWith {}; @@ -87,7 +110,7 @@ enableCamShake true; // Set the name for the current player ["playerChanged", { EXPLODE_2_PVT(_this,_newPlayer,_oldPlayer); - + if (alive _newPlayer) then { [_newPlayer] call FUNC(setName) }; @@ -107,7 +130,6 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ - // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -174,6 +196,31 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; }, 0, []] call cba_fnc_addPerFrameHandler; + +// PFH to raise camera created event. Only works on these cams by BI. +#define ALL_CAMERAS [ \ + missionNamespace getVariable ["BIS_DEBUG_CAM", objNull], \ + missionNamespace getVariable ["BIS_fnc_camera_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull], \ + uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull], \ + missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull] \ +] + +GVAR(OldIsCamera) = false; + +[{ + + // "activeCameraChanged" event + _isCamera = {!isNull _x} count ALL_CAMERAS > 0; + if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { + // Raise ACE event locally + GVAR(OldIsCamera) = _isCamera; + ["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent); + }; + +}, 1, []] call cba_fnc_addPerFrameHandler; // feel free to decrease the sleep time if you need it. + + [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); @@ -188,3 +235,18 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // Players can always interact with passengers of the same vehicle {!((_this select 0) isEqualTo (_this select 1)) && {vehicle (_this select 0) == vehicle (_this select 1)}} }] call FUNC(addCanInteractWithCondition); + +// Lastly, do JIP events +// JIP Detection and event trigger. Run this at the very end, just in case anything uses it +if(isMultiplayer && { time > 0 || isNull player } ) then { + // We are jipping! Get ready and wait, and throw the event + [{ + if(!(isNull player)) then { + ["PlayerJip", [player] ] call FUNC(localEvent); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + }, 0, []] call cba_fnc_addPerFrameHandler; +}; + + + diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b5382d0b5e..aebc13df95 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -119,6 +119,7 @@ PREP(loadPerson); PREP(loadPersonLocal); PREP(loadSettingsFromProfile); PREP(loadSettingsOnServer); +PREP(loadSettingsLocalizedText); PREP(map); PREP(moduleCheckPBOs); PREP(moduleLSDVehicles); @@ -269,6 +270,21 @@ PREP(hashListSelect); PREP(hashListSet); PREP(hashListPush); +// Synchronized Events +PREP(syncedEventPFH); +PREP(addSyncedEventHandler); +PREP(removeSyncedEventHandler); +PREP(requestSyncedEvent); +PREP(syncedEvent); + +PREP(_handleSyncedEvent); +PREP(_handleRequestSyncedEvent); +PREP(_handleRequestAllSyncedEvents); + +GVAR(syncedEvents) = HASH_CREATE; + +// @TODO: Generic local-managed global-synced objects (createVehicleLocal) + //Debug ACE_COUNTERS = []; diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf new file mode 100644 index 0000000000..7c566ce4d1 --- /dev/null +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -0,0 +1,25 @@ +/* + * Author: jaynus + * + * Handles a server-side request for synchronization ALL events on JIP to a client. + * + * Argument: + * 0: client (object) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_1(_client); + +{ + private["_eventName", "_eventEntry", "_eventLog"]; + _eventName = _x; + _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + _eventLog = _eventEntry select 1; + + ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); +} forEach (GVAR(syncedEvents) select 0); + +true \ No newline at end of file diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf new file mode 100644 index 0000000000..2d58aae869 --- /dev/null +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -0,0 +1,45 @@ +/* + * Author: jaynus + * + * Receives either requests for synchronization from clients, or the synchronization data from the server. + * + * Arguments [Client] : + * 0: eventName (String) + * 1: eventLog (Array) + * + * Arguments [Server] : + * 0: eventName (String) + * 1: client (Object) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +//SEH_s +if(isServer) then { + // Find the event name, and shovel out the events to the client + PARAMS_2(_eventName,_client); + private["_eventEntry", "_eventLog"]; + + if(!HASH_HASKEY(GVAR(syncedEvents),_eventName)) exitWith { + diag_log text format["[ACE] Error, request for synced event - key not found."]; + false + }; + _eventEntry = HASH_GET(GVAR(syncedEvents),_eventName); + _eventLog = _eventEntry select 1; + + ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); +} else { + PARAMS_2(_eventName,_eventLog); + // This is the client handling the response from the server + // Start running the events + { + _eventArgs = _x select 1; + [_eventName, _eventArgs, (_x select 2)] call FUNC(_handleSyncedEvent); + } forEach _eventLog; + diag_log text format["[ACE] + [%1] synchronized", _eventName]; +}; + +true \ No newline at end of file diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf new file mode 100644 index 0000000000..9807896358 --- /dev/null +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -0,0 +1,36 @@ +/* + * Author: jaynus + * + * Handles synced events being received. Server will log them, and server/client will execute them. + * + * Arguments [Client] : + * 0: eventName (String) + * 1: arguments (Array) + * 2: ttl (Scalar) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_3(_name,_args,_ttl); +private["_internalData", "_eventLog", "_eventCode"]; + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_internalData = HASH_GET(GVAR(syncedEvents),_name); + +if(isServer) then { + // Server needs to internally log it for synchronization + if(_ttl > -1) then { + _internalData = HASH_GET(GVAR(syncedEvents),_name); + _eventLog = _internalData select 1; + _eventLog pushback [diag_tickTime, _args, _ttl]; + }; +}; + +_eventCode = _internalData select 0; +_args call _eventCode; \ No newline at end of file diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf new file mode 100644 index 0000000000..5d2b221178 --- /dev/null +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -0,0 +1,32 @@ +/* + * Author: jaynus + * + * Register an event handler for an ACE synced event + * + * Argument: + * 0: Name (String) + * 1: Handler (Code) + * 2: TTL (Number or Code) [Optional] + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_2(_name,_handler); + +private["_ttl", "_eventId", "_data"]; +if( (count _this) > 2) then { + _ttl = _this select 2; +} else { + _ttl = 0; +}; + +if(HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, duplicate synced event creation."]; + false +}; + +_eventId = [_name, FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); +_data = [_handler,[],_ttl,_eventId]; +HASH_SET(GVAR(syncedEvents),_name,_data); \ No newline at end of file diff --git a/addons/common/functions/fnc_loadSettingsFromProfile.sqf b/addons/common/functions/fnc_loadSettingsFromProfile.sqf index 69d86eac98..7cb99e3400 100644 --- a/addons/common/functions/fnc_loadSettingsFromProfile.sqf +++ b/addons/common/functions/fnc_loadSettingsFromProfile.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_name", "_isClientSetable", "_isForced", "_profileValue"]; + // Iterate through settings { _name = _x select 0; @@ -34,4 +36,5 @@ }; }; }; + } forEach GVAR(settings); diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf new file mode 100644 index 0000000000..280a1e9907 --- /dev/null +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -0,0 +1,48 @@ +/* + * Author: Glowbal + * Parse all settings and load the localized displayName and description for all text + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private ["_parseConfigForDisplayNames", "_name"]; + +_parseConfigForDisplayNames = { + private "_optionEntry"; + _optionEntry = _this select 0; + if !(isClass _optionEntry) exitwith {false}; + _x set [3, getText (_optionEntry >> "displayName")]; + _x set [4, getText (_optionEntry >> "description")]; + + private "_values"; + _values = _x select 5; + { + private "_text"; + _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; + true; +}; + + +// Iterate through settings +{ + _name = _x select 0; + + if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { + if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then { + [missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames; + }; + }; + +} forEach GVAR(settings); 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_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf new file mode 100644 index 0000000000..6429120bbe --- /dev/null +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -0,0 +1,24 @@ +/* + * Author: jaynus + * + * Remove a synced event handler + * + * Argument: + * 0: Name (String) + * + * Return value: + * Boolean of success + */ +#include "script_component.hpp" +PARAMS_1(_name); + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_data = HASH_GET(GVAR(syncedEvents),_name); +_eventId = _data select 3; + +[_eventId] call ace_common_fnc_removeEventHandler; +HASH_REM(GVAR(syncedEvents),_name); \ No newline at end of file diff --git a/addons/common/functions/fnc_requestSyncedEvent.sqf b/addons/common/functions/fnc_requestSyncedEvent.sqf new file mode 100644 index 0000000000..dea0c7adef --- /dev/null +++ b/addons/common/functions/fnc_requestSyncedEvent.sqf @@ -0,0 +1,19 @@ +/* + * Author: jaynus + * + * Send a request to synchronize an event name from the client->server. Execute on client only. + * + * Argument: + * 0: eventName (String) + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_1(_eventName); + +// Only JIP machines on initialization send this off, requesting sync on events with the serverCommand +if(isServer) exitWith { false }; + +["SEH_s", [_eventName, ACE_player] ] call ace_common_fnc_serverEvent; \ No newline at end of file diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 4d81ef3535..3a1b6fd055 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -76,6 +76,18 @@ if (isNil _name) then { _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; } else { diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf new file mode 100644 index 0000000000..70c30a19da --- /dev/null +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -0,0 +1,31 @@ +/* + * Author: jaynus + * + * Call and propegate a synced event + * + * Argument: + * 0: Name (String) + * 1: Arguments (Array) + * 2: TTL (Number or Code) [Optional] for this specific event call + * + * Return value: + * Boolean of success + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +PARAMS_2(_name,_args); +private["_ttl", "_eventData", "_internalData", "_eventLog"]; + +if( (count _this) > 2) then { + _ttl = _this select 2; +} else { + _ttl = 0; +}; + +if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { + diag_log text format["[ACE] Error, synced event key not found."]; + false +}; + +_eventData = [_name, _args,_ttl]; +["SEH", _eventData] call FUNC(globalEvent); \ No newline at end of file diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf new file mode 100644 index 0000000000..e8a21202ab --- /dev/null +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -0,0 +1,52 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +if(!isServer) exitWith { false }; + +// Walk through the local synced events and clean up anything thats already EOL +// @TODO: This should be iteration limited to prevent FPS lag +private["_data"]; +{ + private["_data", "_ttl", "_eventLog", "_newEventLog", "_name"]; + _name = _x; + + _data = HASH_GET(GVAR(syncedEvents),_name); + _eventLog = _data select 1; + _globalEventTTL = _data select 2; + _newEventLog = []; + + // @TODO: This should be iteration limited to prevent FPS lag + { + private["_eventEntry", "_ttlReturn"]; + _eventEntry = _x; + + _ttlReturn = true; + if(typeName _globalEventTTL == "CODE") then { + _ttlReturn = [(_data select 0),_eventEntry] call _globalEventTTL; + } else { + _ttlReturn = call { _globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL} }; + }; + + if(_ttlReturn) then { + // Do event based TTL check + private["_eventTTL"]; + _eventTTL = _eventEntry select 2; + + if(typeName _eventTTL == "CODE") then { + _ttlReturn = [(_data select 0),_eventEntry] call _eventTTL; + } else { + _ttlReturn = call { _eventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _eventTTL} }; + }; + }; + + // Finally drop it if the TTL check fails + if(_ttlReturn) then { + _newEventLog pushBack _x; + }; + } forEach _eventLog; + + _data set[1, _newEventLog]; +} forEach (GVAR(syncedEvents) select 0); + + +// @TODO: Next, detect if we had a new request from a JIP player, and we need to continue syncing events 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/common/stringtable.xml b/addons/common/stringtable.xml index d9ee389166..de10a60893 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -272,7 +272,7 @@ Desactivar menú de mando Wyłącz menu dowodzenia Vypnout velící menu - Désactiver Menu Commande + Désactiver menu commande Выключить командное меню Parancsnoki menü kikapcsolása Disabilita Menù di comando @@ -329,7 +329,7 @@ Accetta le richieste degli altri giocatori. Queste possono riguardare l'uso o la condivisione dell'equipaggiamento, o di determinate azioni. Přijimutí žádosti poslané jinými hráči. Mohou to být žádosti k použítí/sdílení vybavení nebo k vykonání určité činnosti. Принять запросы, отправленные другими игроками. Например, запросы на использование/совместное использование снаряжения, выполнение определенных действий - Accepter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalistion d'actions. + Accepter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalisation d'actions. Más játékosok általi kérések elfogadása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. @@ -340,7 +340,7 @@ Rifiuta le richieste degli altri giocatori. Queste possono riguardare l'uso o la condivisione dell'equipaggiamento, o di determinate azioni. Zamítnutí žádostii poslané jinými hráči. Mohou to být žádosti k použítí/sdílení vybavení nebo k vykonání určité činnosti. Отклонить запросы, отправленные другими игроками. Например, запросы на использование/совместное использование снаряжения, выполнение определенных действий - Rejeter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalistion d'actions. + Rejeter les requêtes d'autres joueurs. Comme l'utilisation / l'échange d'équipement, la réalisation d'actions. Más játékosok általi kérések elutasítása. Ezek a kérések vonatkozhatnak a felszerelés használatára/megosztására, valamint különböző cselekményekre. @@ -383,7 +383,7 @@ Modifica la posizione su schermo della barra di avanzamento. Установите желаемое положение строки состояния на экране. Ustaw pożądaną lokalizację paska postępu na ekranie - Appliquer la postion de la barre de progression sur l'écran + Appliquer la position de la barre de progression sur l'écran Nastavuje pozici ukazetele průběhu činnosti na vaší obrazovce. Itt beállítható az állapotjelző sáv képernyődön lévő helyzete. @@ -405,7 +405,7 @@ Il colore di sfondo dei suggerimenti dell'ACE. Цвет фона всплывающих подсказок АСЕ. Kolor tła dla powiadomień ACE - Notifications ACE: couleur de l'arrière plan + Notification ACE: couleur de l'arrière plan Barva pozadí ACE nápověd. Az ACE-súgók hátterének színe. @@ -427,7 +427,7 @@ Il colore del testo dei suggerimenti dell'ACE. Questo è il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se questo non è altrimenti specificato. Цвет шрифта текста всплывающих подсказок АСЕ. Этот цвет является стандартным для всего текста, транслирующегося через систему подсказок АСЕ, если не установлено другого цвета для текста подсказок. Kolor tekstu dla powiadomień ACE. Ten kolor jest domyślnym dla wszystkich tekstów wyświetlanych poprzez System Powiadomień ACE, jeżeli dla powiadomienia nie określono innego koloru. - Notification ACE: couleur du texte. C'est la couleur par défaut de tout texte afficher dans les notifications ACE, si aucune couleur n'est spécifiée pour les notifications + Notification ACE: couleur du texte. C'est la couleur par défaut de tout texte affiché dans les notifications ACE, si aucune couleur n'est spécifiée pour les notifications Barva fontu ACE nápověd. Toto je standardní barva pro všechen text zobrazovaný ACE nápovědami, pokud nemá nápověda žádnou specifikanou barvu. Az ACE-súgók betűkészletének színek. Ez a szín alapértelmezett az összes szövegre az ACE-súgórendszerben, ha a súgószöveg maga nem ad meg más színt. @@ -454,4 +454,4 @@ Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes à fleurs herbacées du type Musa. - + \ No newline at end of file diff --git a/addons/disarming/stringtable.xml b/addons/disarming/stringtable.xml index 625f156b95..583080ff08 100644 --- a/addons/disarming/stringtable.xml +++ b/addons/disarming/stringtable.xml @@ -9,6 +9,7 @@ Abrir inventario Открыть инвентарь Apri l'inventario + Ouvrir l'inventaire - + \ No newline at end of file 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/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/dragging/stringtable.xml b/addons/dragging/stringtable.xml index 1c704796f8..b02979e279 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -26,14 +26,14 @@ Elengedés - Item to heavy + Item too heavy Gegenstand ist zu schwer Articulo demasiado pesado Przedmiot zbyt ciężki Objet trop lourd Não é possível carregar o item devido a seu peso Non è possibile trascinare l'oggetto a causa del suo peso - Слишком тяжело + Предмет слишком тяжёлый Moc težké Az objektum túl nehéz diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index d0b61d0814..6898274307 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -114,7 +114,7 @@ Mobiltelefon Télefono móvil Telefon komórkowy - Téléphone Portable + Téléphone portable Telefon Cellulare Mobiltelefon @@ -203,7 +203,7 @@ Consente la disattivazione degli ordigni esplosivi Robbanóanyagok hatástalanítását teszi lehetővé Permite o desarme de explosivos - Позволяет обезвреживать ВУ + Позволяет обезвреживать взрывчатку Add to Speed Dial @@ -215,7 +215,7 @@ Aggiungi alla selezione rapida Hozzáadás a gyorstárcsázóhoz Adicionar à ligação rápida - Добавить в ускоренный набор + Добавить в быстрый вызов Clear @@ -294,12 +294,12 @@ "Platzieren"-Menü Menú de colocación Menu umieszczania - Menu Placement + Menu placement Menu Umístění Menù di collocamento Elhelyezési menü Menu de posicionamento - Меню детонации + Меню установки Defuse @@ -395,7 +395,7 @@ Piastra a Pressione Nyomólap Placa de pressão - Давление + Нажимная плита Tripwire @@ -443,19 +443,19 @@ Sensore IR (Attacco laterale) Infravörös szenzor (Side Attack) Sensor infravermelho (ataque lateral) - ИК (детонация вбок) + ИК сенсор (детонация вбок) Magnetic Influence Sensor (Bottom Attack) Czujnik magnetyczny (wybuch w górę) Sensor IM (ataque inferior) Magnetfeldsensor (Bodenangriff) - Capteur Magnétique (par le bas) + Capteur magnétique (par le bas) Magnetický Senzor (Výbuch ze spoda) Sensore Magnetico di Prossimità (Attacco inferiore) Mágneses mező érzékelő (Bottom Attack) Influência magnética (ataque inferior) - Магнитный (детонация вверх) + Магнитный сенсор (детонация вверх) No explosives on trigger. @@ -467,7 +467,7 @@ Nincs robbanóanyag a gyújtóeszközhöz kötve. Brak ładunków na zapalnik. Nenhum explosivo no gatilho. - Нет доступных ВУ для взрывателя. + Взрыватель не подсоединён к взрывчатке Dead Man's Switch @@ -477,7 +477,7 @@ Czuwak Detonador de hombre muerto Dead Man's Switch - Ловушка мертвеца + Кнопка мертвеца Used to remotely trigger explosives when released. diff --git a/addons/fcs/CfgOptics.hpp b/addons/fcs/CfgOptics.hpp index c9704081f9..91f83dd6f6 100644 --- a/addons/fcs/CfgOptics.hpp +++ b/addons/fcs/CfgOptics.hpp @@ -35,13 +35,6 @@ class RscInGameUI { }; }; }; - class RscOptics_LaserDesignator { - class CA_IGUI_elements_group: RscControlsGroup { - class controls { - MACRO_RANGEFINDER - }; - }; - }; class RscWeaponRangeFinderMAAWS { class CA_IGUI_elements_group: RscControlsGroup { class controls { 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/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 758e6eb9a0..7f8321d6c6 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -20,7 +20,7 @@ Lanzamiento normal Normalny rzut Normální hod - Lancer Normal + Lancer normal Нормальный бросок Normál dobás Lancio normale @@ -32,7 +32,7 @@ Lanzamiento alto Wysoki rzut Vysoký hod - Lancer Haut + Lancer haut Высокий бросок Magas dobás Lancio verso l'alto @@ -44,7 +44,7 @@ Lanzamiento preciso Precyzyjny rzut Přesný hod - Lancer Précis + Lancer précis Точный бросок Pontos dobás Lancio preciso @@ -56,7 +56,7 @@ Rodar granada Po ziemi Po zemi - Lancer Roulé + Lancer roulé Катить гранату Gránát gurítása Fai rotolare la granata @@ -78,7 +78,7 @@ M84 Stun Grenade M84 Blendgranate Granada aturdidora M84 - M84 Grenade Incapacitante + M84 Grenade incapacitante Granat hukowy M84 Omračující granát M84 M84 светозвуковая граната @@ -243,4 +243,4 @@ M127A1 (Amarilla) - + \ No newline at end of file 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..9bc9063c8d 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. @@ -31,7 +31,7 @@ Poner tapones Włóż stopery Dát špunty do uší - Беруши надеты + Надеть беруши Bouchons mis Füldugó berakva Protetores colocados @@ -43,7 +43,7 @@ Quitar tapones Wyjmij stopery Vyndat špunty z uší - Беруши сняты + Снять беруши Bouchons enlevés Füldugó kivéve Protetores retirados @@ -80,7 +80,7 @@ Nie masz stoperów Nemáš žádné špunty У вас нет беруш - Vous n'avez pas de Bouchons Anti-Bruits + Vous n'avez pas de bouchons anti-bruits Nincsen füldugód Você não possui protetores auriculares Non hai i tappi auricolari diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index b4a3504cdd..747da7083e 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -49,4 +49,7 @@ GVAR(expandedTime) = diag_tickTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; +GVAR(foundActions) = []; +GVAR(lastTimeSearchedActions) = -1000; + ADDON = true; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 47fdfb1951..123c1d45e2 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -29,6 +29,7 @@ if (_menuType == 0) then { }; GVAR(keyDownTime) = diag_tickTime; GVAR(openedMenuType) = _menuType; +GVAR(lastTimeSearchedActions) = -1000; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 8d4734c8f8..78d5418e5a 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -24,8 +24,11 @@ _fnc_renderNearbyActions = { _cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; + GVAR(foundActions) = []; + GVAR(lastTimeSearchedActions) = diag_tickTime; + _numInteractObjects = 0; - _nearestObjects = nearestObjects [((getPosASL ACE_player) vectorAdd (_cameraDir vectorMultiply 5)) call EFUNC(common,ASLToPosition), ["All"], 8]; + _nearestObjects = nearestObjects [ACE_player, ["All"], 13]; { _target = _x; @@ -46,6 +49,7 @@ _fnc_renderNearbyActions = { _action = _x; if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; + GVAR(foundActions) pushBack [_target, _action]; }; }; } forEach GVAR(objectActionList); @@ -57,6 +61,7 @@ _fnc_renderNearbyActions = { // Try to render the menu if ([_target, _action] call FUNC(renderBaseMenu)) then { _numInteractions = _numInteractions + 1; + GVAR(foundActions) pushBack [_target, _action]; }; } forEach _classActions; @@ -71,7 +76,11 @@ _fnc_renderNearbyActions = { } forEach _nearestObjects; }; - +_fnc_renderLastFrameActions = { + { + _x call FUNC(renderBaseMenu); + } forEach GVAR(foundActions); +}; _fnc_renderSelfActions = { _target = _this; @@ -109,7 +118,13 @@ _fnc_renderSelfActions = { if (GVAR(openedMenuType) == 0) then { if (vehicle ACE_player == ACE_player) then { - call _fnc_renderNearbyActions; + if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { + // Once every 0.2 secs, collect nearby objects active and visible action points and render them + call _fnc_renderNearbyActions; + } else { + // The rest of the frames just draw the same action points rendered the last frame + call _fnc_renderLastFrameActions; + }; } else { (vehicle ACE_player) call _fnc_renderSelfActions; }; diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 98cac6116a..083a02d0f6 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -5,7 +5,7 @@ Always display cursor for self interaction Immer den Cursor für Selbst-Interaktionen anzeigen. Mostrar siempre el cursor para la interacción propia - Всегда показывать курсор для взаимодействия с собой + Показывать курсор (взаимодействия с собой) Zobrazit kurzor v menu pro vlastní interakci Zawsze wyświetlaj kursor dla własnej interakcji Toujours afficher le curseur pour les interactions sur soi-même @@ -15,10 +15,11 @@ Display interaction menus as lists Mostrar los menus de interacción como listas - Показывать меню взаимодействия в виде списка - Afficher le menu d'interaction au format liste + Меню взаимодействий в виде списка + Afficher le menu d'interaction sous forme de liste Mostra il menù di interazione come lista Wyświetlaj menu interakcji jako listę + Interaktionsmenü in Listen anzeigen Interact Key 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/inventory/stringtable.xml b/addons/inventory/stringtable.xml index f1d1e70f9d..da132cc3f1 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -5,7 +5,7 @@ Make Inventory Display Bigger Erhöhe die angezeigte Inventargröße Hacer la pantalla de inventario mas grande - Сделать окно инвентаря больше + Изменить размер окна инвентаря Zvětšit zobrazení inventáře Powiększ UI ekwipunku Agrandir la taille d'affichage de l'inventaire @@ -16,7 +16,7 @@ Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. Im Regelfall wird die Inventargröße durch die Größe der Nutzeroberfläche bestimmt. Diese Einstellung erlaubt es das Inventar unter Ausschluss der Schriftgröße zu vergrößern. Dadurch können mehr Gegenstände angezeigt werden. Normalmente la pantalla de inventario se escala por el tamaño de la interfaz de usuario. Esto permite ampliar el tamaño de la interfaz de usuario de inventario, pero no aumenta el tamaño de fuente, permitiendo mostrar más filas. - Обычно, окно инвентаря зависит от размеров пользовательского интерфейса. Эта настройка позволяет увеличить размер окна инвентаря в пользовательском интерфейсе, не увеличивая размера шрифтов, так что отображется большее количество строк. + Обычно, размер окна инвентаря зависит от размеров пользовательского интерфейса. Эта настройка позволяет увеличить размер окна инвентаря, не увеличивая размеры шрифтов, так что отображется большее количество строк. Normálně se velikost invetáře škáluje s velikostí UI. Toto nastavení dovoluje škálování velikost inventáře ale nežvětšuje velikost fontu. To dovoluje zobrazení více řad v inventáři. Ekwipunek skalowany jest poprzez rozmiar UI. Ta opcja pozwala powiększyć rozmiar UI ekwipunku, lecz nie zwiększa rozmiaru fontu pozwalając na wyświetlanie większej ilości wierszy. L'inventaire est normalement affiché en fonction de la taille de l'UI. Cette option permet d'agrandir l'affichage de l'inventaire, mais n'a aucun effet sur la taille des polices permettant d'afficher plus de ligne 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 4e7091c653..1392cd1a56 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -1,17 +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..74f7c49746 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -5,12 +5,15 @@ TRACE_1("enter", _this); #define __TRACKINTERVAL 0 // how frequent the check should be. #define __LOCKONTIME 3 // Lock on won't occur sooner +private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; +private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; +private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; +private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; +private["_runTime", "_soundTime", "_targetArray", "_zamerny"]; #define __OffsetX ((ctrlPosition __JavelinIGUITargetingLineV) select 0) - 0.5 #define __OffsetY ((ctrlPosition __JavelinIGUITargetingLineH) select 1) - 0.5 -private["_isJavelin", "_args", "_lastTick", "_runTime", "_soundTime", "_lockTime", "_newTarget", "_currentTarget", "_range", "_pos", "_targetArray"]; - // Reset arguments if we havnt rendered in over a second _args = uiNamespace getVariable[QGVAR(arguments), [] ]; if( (count _args) > 0) then { @@ -30,13 +33,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 +63,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 +160,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/javelin/functions/fnc_onOpticUnload.sqf b/addons/javelin/functions/fnc_onOpticUnload.sqf index 4086c02766..187b6cf589 100644 --- a/addons/javelin/functions/fnc_onOpticUnload.sqf +++ b/addons/javelin/functions/fnc_onOpticUnload.sqf @@ -1,6 +1,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" TRACE_1("enter", _this); +private["_args", "_disableFireEH", "_pfh"]; uiNameSpace setVariable ['ACE_RscOptics_javelin',nil]; diff --git a/addons/javelin/stringtable.xml b/addons/javelin/stringtable.xml index 32aed563a1..33abcc1e49 100644 --- a/addons/javelin/stringtable.xml +++ b/addons/javelin/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -7,7 +7,7 @@ Захватить цель (удерживать) Zamknout cíl(držet) Namierz cel (przytrzymaj) - Verrouiller cible (maintenir) + Verrouiller la cible (maintenir) Célpontra állás (Lenyomva tartott) Aggangia il bersagio Fijar objetivo (Mantener) @@ -24,4 +24,4 @@ Cambiar modo de disparo - + \ No newline at end of file diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index 8ebd4e01d2..bbad8619bc 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -19,7 +19,7 @@ private ["_playerDir", "_windSpeed", "_windDir", "_crosswind", "_headwind", "_hu if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL ACE_player) select 2); _humidity = EGVAR(weather,currentHumidity); - _barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast; + _barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); _altitude = EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2); GVAR(MIN) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; GVAR(MAX) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; @@ -82,7 +82,7 @@ GVAR(MAX) set [5, _humidity max (GVAR(MAX) select 5)]; GVAR(TOTAL) set [5, (GVAR(TOTAL) select 5) + _humidity]; // BARO -_barometricPressure = 1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast; +_barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); GVAR(MIN) set [6, (GVAR(MIN) select 6) min _barometricPressure]; GVAR(MAX) set [6, _barometricPressure max (GVAR(MAX) select 6)]; GVAR(TOTAL) set [6, (GVAR(TOTAL) select 6) + _barometricPressure]; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index e7679df53f..3f5e77b748 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -88,7 +88,7 @@ switch (GVAR(Menu)) do { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; } else { _textCenterBig = Str(round(abs(sin(GVAR(RefHeading)) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; @@ -120,7 +120,7 @@ switch (GVAR(Menu)) do { if (!GVAR(MinAvgMax)) then { if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _textCenterBig = Str(round(abs(cos(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; } else { _textCenterBig = Str(round(abs(cos(GVAR(RefHeading)) * _windSpeed) * 10) / 10); _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; @@ -174,7 +174,7 @@ switch (GVAR(Menu)) do { }; case 6: { // BARO if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round((1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast) * 10) / 10); + _textCenterBig = Str(round((((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); } else { _textCenterLine1Left = "Min"; _textCenterLine2Left = "Avg"; diff --git a/addons/kestrel4500/stringtable.xml b/addons/kestrel4500/stringtable.xml index 4757159ff5..2703e34e9f 100644 --- a/addons/kestrel4500/stringtable.xml +++ b/addons/kestrel4500/stringtable.xml @@ -19,6 +19,7 @@ Карманная метеостанция Kestrel 4500NV Station météo portable Kestrel 4500 Kestrel 4500 Pocket Weather Tracker + Kestrel 4500 Taschenwettermessgerät Open Kestrel 4500 @@ -28,6 +29,7 @@ Ouvrir Kestrel 4500 Accendi Kestrel 4500 Abrir Kestrel 4500 + Kestrel 4500 öffnen Show Kestrel 4500 @@ -36,6 +38,7 @@ Afficher Kestrel 4500 Mostra Kestrel 4500 Mostrar Kestrel 4500 + Kestrel 4500 anzeigen Hide Kestrel 4500 @@ -44,6 +47,7 @@ Cacher Kestrel 4500 Nascondi Kestrel 4500 Esconder Kestrel 4500 + Kestrel 4500 wegstecken Open Kestrel 4500 @@ -52,6 +56,7 @@ Ouvrir Kestrel 4500 Accendi Kestrel 4500 Abrir Kestrel 4500 + Kestrel 4500 öffnen Show Kestrel 4500 @@ -60,6 +65,7 @@ Afficher Kestrel 4500 Mostra Kestrel 4500 Mostrar Kestrel 4500 + Kestrel 4500 anzeigen - + \ No newline at end of file diff --git a/addons/laser/CfgVehicles.hpp b/addons/laser/CfgVehicles.hpp index f4e2ed42ab..23eb00c37c 100644 --- a/addons/laser/CfgVehicles.hpp +++ b/addons/laser/CfgVehicles.hpp @@ -4,30 +4,17 @@ class CfgVehicles { class LaserTarget: All { // @TODO: Changing the model and simulation hides it, but THEN IT DOESNT SPAWN WTF!? model = "\A3\Weapons_F\empty.p3d"; - simulation = "nvmarker"; - nvTarget = 1; - //simulation = "laserTarget"; - //threat[] = {0,0,0}; + destrType = "DestructNo"; + simulation = "house"; + class EventHandlers { init = QUOTE(_this call FUNC(laser_init)); }; - - diffuse[] = {0,0,0}; - ambient[] = {0,0,0}; - brightness = 0; - name = "pozicni blik"; - drawLight = 0; - drawLightSize = 0; - drawLightCenterSize = 0; - activeLight = 0; - blinking = 0; - dayLight = 0; - onlyInNvg = 0; - useFlare = 0; }; // Visual laserTarget override class ACE_LaserTarget_Visual : LaserTarget { - //model = "\A3\Weapons_f\laserTgt.p3d"; + simulation = "LaserTarget"; + model = "\A3\Weapons_f\laserTgt.p3d"; }; }; \ No newline at end of file diff --git a/addons/laser/RscInGameUI.hpp b/addons/laser/RscInGameUI.hpp index 457d320520..d87136c960 100644 --- a/addons/laser/RscInGameUI.hpp +++ b/addons/laser/RscInGameUI.hpp @@ -1 +1,144 @@ -// TODO: RscOptics_LaserDesignator for laser code designation \ No newline at end of file +class RscControlsGroup; +class VScrollbar; +class HScrollbar; +class RscText; +class RscMapControl; + +class RscInGameUI { + class RscOptics_LaserDesignator { + idd = 300; + controls[] = {"CA_IGUI_elements_group"}; + + onLoad = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',(_this select 0)];"; + onUnload = "uiNameSpace setVariable ['ACE_RscOptics_LaserDesignator',nil];"; + + + class CA_IGUI_elements_group: RscControlsGroup { + idc = 170; + + x = "0 * (0.01875 * SafezoneH) + (SafezoneX + ((SafezoneW - SafezoneH) / 2))"; + y = "0 * (0.025 * SafezoneH) + (SafezoneY)"; + w = "53.5 * (0.01875 * SafezoneH)"; + h = "40 * (0.025 * SafezoneH)"; + class VScrollbar: VScrollbar { + width = 0; + }; + class HScrollbar: HScrollbar { + height = 0; + }; + class controls { + class CA_OpticsZoom: RscText { + idc = 180; + style = 1; + colorText[] = {0.706,0.0745,0.0196,1}; + sizeEx = "0.038*SafezoneH"; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "4.5"; + x = "43.85 * (0.01875 * SafezoneH)"; + y = "19.6 * (0.025 * SafezoneH)"; + w = "4.5 * (0.01875 * SafezoneH)"; + h = "1.1 * (0.025 * SafezoneH)"; + }; + class ACE_Distance: RscText { + idc = 123002; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "2456"; + x = "24.6 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_Distance: RscText { + idc = 151; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "2456"; + x = 0; + y = 0; + w = 0; + h = 0; + }; + class CA_Elev: RscText { + idc = 175; + style = 1; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "80.5"; + x = "32.7 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "5 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_VisionMode: RscText { + idc = 179; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "VIS"; + x = "6.5 * (0.01875 * SafezoneH)"; + y = "19.6 * (0.025 * SafezoneH)"; + w = "4 * (0.01875 * SafezoneH)"; + h = "1.1 * (0.025 * SafezoneH)"; + }; + class CA_Laser: RscText { + idc = 158; + style = "0x30 + 0x800"; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "\A3\ui_f\data\igui\rscingameui\rscoptics\laser_designator_iconLaserOn.paa"; + x = "29.2 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "3.5 * (0.01875 * SafezoneH)"; + h = "1.5 * (0.025 * SafezoneH)"; + }; + class CA_Heading: RscText { + idc = 156; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "023"; + x = "16.1 * (0.01875 * SafezoneH)"; + y = "3 * (0.025 * SafezoneH)"; + w = "3.5 * (0.01875 * SafezoneH)"; + h = "1.6 * (0.025 * SafezoneH)"; + }; + + class ACE_LaserCode_Helper : RscMapControl { + idc = -1; + onDraw = QUOTE(_this call FUNC(onLaserDesignatorDraw)); + w = 0; + h = 0; + }; + class ACE_LaserCode : RscText { + idc = 123001; + style = 0; + sizeEx = "0.038*SafezoneH"; + colorText[] = {0.706,0.0745,0.0196,1}; + shadow = 0; + font = "EtelkaMonospacePro"; + text = "Code: 1001"; + x = "32.7 * (0.01875 * SafezoneH)"; + y = "35.5 * (0.025 * SafezoneH)"; + w = "12 * (0.01875 * SafezoneH)"; + h = "1.6 * (0.025 * SafezoneH)"; + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/laser/XEH_post_init.sqf b/addons/laser/XEH_post_init.sqf index fb189d5041..f868ef9895 100644 --- a/addons/laser/XEH_post_init.sqf +++ b/addons/laser/XEH_post_init.sqf @@ -2,3 +2,4 @@ ["laser_laserOn", {_this call DFUNC(handleLaserOn)}] call EFUNC(common,addEventHandler); ["laser_laserOff", {_this call DFUNC(handleLaserOff)}] call EFUNC(common,addEventHandler); + diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index e160a533f2..2dd6e666eb 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -8,8 +8,7 @@ PREP(checkLos); PREP(findStrongestRay); -PREP(translateToModelSpace); -PREP(translateToWeaponSpace); +PREP(onLaserDesignatorDraw); PREP(seekerFindLaserSpot); PREP(laserOn); diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 3f430619ef..ad368cdc2d 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -12,4 +12,5 @@ class CfgPatches { #include "CfgEventhandlers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" \ No newline at end of file +#include "CfgWeapons.hpp" +#include "RscInGameUI.hpp" \ No newline at end of file diff --git a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf index 161364c0f2..10d5f1e1b6 100644 --- a/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_drawVisibleLaserTargets.sqf @@ -1 +1,9 @@ -// @TODO: This is to draw the actual LaserTarget positions to utilize for laser shooting. \ No newline at end of file +// This is a debug function for displaying visible lasers for ourselves +#include "script_component.hpp" + +diag_log text format["[ACE]: Laser Emitter Dump"]; + +{ + diag_log text format[" %1", _x]; + diag_log text format[" %2", HASH_GET(GVAR(laserEmitters), _x)]; +} forEach GVAR(laserEmitters) select 0; \ No newline at end of file diff --git a/addons/laser/functions/fnc_findStrongestRay.sqf b/addons/laser/functions/fnc_findStrongestRay.sqf index e4238361cb..811b75d351 100644 --- a/addons/laser/functions/fnc_findStrongestRay.sqf +++ b/addons/laser/functions/fnc_findStrongestRay.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" - +private["_checkPos", "_i", "_largest", "_largestSpot", "_list", "_outliers", "_remainingSpots", "_samplePos", "_spot", "_spots", "_testPos"]; _list = _this select 0; _checkPos = _this select 1; _spots = []; diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index d73d9f070a..4c4f242482 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" TRACE_1("enter", _this); -private["_args", "_laserTarget"]; +private["_args", "_laserTarget", "_pos", "_shooter", "_uuid"]; //TRACE_1("enter", _this); _args = _this select 0; _laserTarget = _args select 0; diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 378ee38407..2be349c294 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -3,6 +3,7 @@ TRACE_1("enter", _this); PARAMS_1(_laserTarget); +private["_uuid"]; // Add the target to the global targets array // Everyone tracks them diff --git a/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf new file mode 100644 index 0000000000..7f8537ab9b --- /dev/null +++ b/addons/laser/functions/fnc_onLaserDesignatorDraw.sqf @@ -0,0 +1,15 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +private["_laserCode"]; + +_laserCode = ACE_player getVariable[QGVAR(code), ACE_DEFAULT_LASER_CODE]; +if(!isNil "_laserCode") then { + __LaserDesignatorIGUI_LaserCode ctrlSetText format["Code: %1", [_laserCode, 4, 0, false] call CBA_fnc_formatNumber]; +}; + +if(! (ctrlShown __LaserDesignatorIGUI_LaserOn) ) then { + // TODO: hide distance + __LaserDesignatorIGUI_ACE_Distance ctrlSetText "----"; +} else { + __LaserDesignatorIGUI_ACE_Distance ctrlSetText (ctrlText __LaserDesignatorIGUI_CA_Distance); +}; \ No newline at end of file diff --git a/addons/laser/functions/fnc_rotateVectLine.sqf b/addons/laser/functions/fnc_rotateVectLine.sqf index ec85a83cb7..8bae491c4e 100644 --- a/addons/laser/functions/fnc_rotateVectLine.sqf +++ b/addons/laser/functions/fnc_rotateVectLine.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" - +private["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 41ea877739..77713eb591 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -15,10 +15,11 @@ #include "script_component.hpp" -private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method", - "_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index", - "_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; - +private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; +private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index"]; +private ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; +private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; + _pos = _this select 0; _dir = vectorNormalized (_this select 1); _seekerFov = _this select 2; diff --git a/addons/laser/functions/fnc_shootCone.sqf b/addons/laser/functions/fnc_shootCone.sqf index 801353d4f7..a7187aa0e4 100644 --- a/addons/laser/functions/fnc_shootCone.sqf +++ b/addons/laser/functions/fnc_shootCone.sqf @@ -1,7 +1,6 @@ #include "script_component.hpp" //#define DEBUG_MODE_FULL -private ["_divergence","_pos","_vec","_longestReturn","_shortestReturn","_resultPositions","_p1","_p2","_p","_v","_cp","_vecRotateMap","_result", - "_resultPos","_distance","_count","_pos2","_radOffset","_offset","_offsetPos","_offsetVector"]; +private ["_i", "_divergence","_pos","_vec","_longestReturn","_shortestReturn","_resultPositions","_p1","_p2","_p","_v","_cp","_vecRotateMap","_result", "_resultPos","_distance","_count","_pos2","_radOffset","_offset","_offsetPos","_offsetVector"]; _divergence = 0.3; _pos = _this select 0; _vec = _this select 1; diff --git a/addons/laser/functions/fnc_translateToModelSpace.sqf b/addons/laser/functions/fnc_translateToModelSpace.sqf deleted file mode 100644 index 1e2e930ac7..0000000000 --- a/addons/laser/functions/fnc_translateToModelSpace.sqf +++ /dev/null @@ -1,16 +0,0 @@ -_object = _this select 0; -_origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; - -_offset = _this select 2; - -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; - -_out = (((_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y)) vectorAdd (_zVec vectorMultiply _z)) vectorAdd _origin; - -_out; \ No newline at end of file diff --git a/addons/laser/functions/fnc_translateToWeaponSpace.sqf b/addons/laser/functions/fnc_translateToWeaponSpace.sqf deleted file mode 100644 index 2c7dc5e6da..0000000000 --- a/addons/laser/functions/fnc_translateToWeaponSpace.sqf +++ /dev/null @@ -1,22 +0,0 @@ -_object = _this select 0; -_origin = getPosASL _object; -_matrix = _this select 1; -_xVec = _matrix select 0; -_yVec = _matrix select 1; -_zVec = _matrix select 2; - -_offset = _this select 2; - -_offset = _offset vectorDiff _origin; - -_x = _offset select 0; -_y = _offset select 1; -_z = _offset select 2; - -_out = [ - ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), - ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), - ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) - ]; - -_out; \ No newline at end of file diff --git a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf index 38cd1839f9..091c4f7acf 100644 --- a/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf +++ b/addons/laser/functions/fnc_vanillaLaserSeekerHandler.sqf @@ -12,7 +12,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_emitter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; +private["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; _emmiter = _this select 0; _owner = _this select 1; diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index 2be1e9e14b..77369ead96 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -12,4 +12,11 @@ #include "\z\ace\Addons\main\script_macros.hpp" -#define FIREMODE_DIRECT_LOAL 1 \ No newline at end of file +#define FIREMODE_DIRECT_LOAL 1 + + +#define __LaserDesignatorIGUI (uiNamespace getVariable ["ACE_RscOptics_LaserDesignator", nil]) +#define __LaserDesignatorIGUI_LaserCode (__LaserDesignatorIGUI displayCtrl 123001) +#define __LaserDesignatorIGUI_ACE_Distance (__LaserDesignatorIGUI displayCtrl 123002) +#define __LaserDesignatorIGUI_CA_Distance (__LaserDesignatorIGUI displayCtrl 151) +#define __LaserDesignatorIGUI_LaserOn (__LaserDesignatorIGUI displayCtrl 158) \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf index ac1ae7e438..27beed3c6a 100644 --- a/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf +++ b/addons/laser_selfdesignate/functions/fnc_findLaserSource.sqf @@ -13,7 +13,7 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -private["_emitter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; +private["_emmiter", "_owner", "_gunnerInfo", "_turretInfo", "_povPos", "_povDir"]; _emmiter = _this select 0; _owner = _this select 1; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 400bf21756..e0c835814e 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -43,8 +43,8 @@ FUNC(laserHudDesignatePFH) = { _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); _povPos = _turretInfo select 0; - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; _laserResult = [_povPos, [_waveLength,_waveLength], _laserCode] call EFUNC(laser,seekerFindLaserSpot); @@ -73,9 +73,9 @@ if(!GVAR(active)) then { TRACE_1("Activating laser", ""); // Get the self-designation variables, or use defaults - _laserCode = (vehicle ACE_player) getVariable[QGVAR(currentCode), ACE_DEFAULT_LASER_CODE]; - _waveLength = (vehicle ACE_player) getVariable[QGVAR(currentWaveLength), ACE_DEFAULT_LASER_WAVELENGTH]; - _beamSpread = (vehicle ACE_player) getVariable[QGVAR(currentBeamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; + _laserCode = (vehicle ACE_player) getVariable["ace_laser_code", ACE_DEFAULT_LASER_CODE]; + _waveLength = (vehicle ACE_player) getVariable["ace_laser_waveLength", ACE_DEFAULT_LASER_WAVELENGTH]; + _beamSpread = (vehicle ACE_player) getVariable["ace_laser_beamSpread", ACE_DEFAULT_LASER_BEAMSPREAD]; _laserUuid = [(vehicle ACE_player), ACE_player, QFUNC(findLaserSource), _waveLength, _laserCode, _beamSpread] call EFUNC(laser,laserOn); diff --git a/addons/laser_selfdesignate/stringtable.xml b/addons/laser_selfdesignate/stringtable.xml index f38c015c44..f587763bce 100644 --- a/addons/laser_selfdesignate/stringtable.xml +++ b/addons/laser_selfdesignate/stringtable.xml @@ -8,7 +8,7 @@ ЛЦУ ВКЛ Laserový značkovač zapnut Desygnator laserowy wł. - Désignateur Laser Allumé + Désignateur laser allumé Lézeres Megjelölő Be Designatore laser acceso @@ -19,9 +19,9 @@ ЛЦУ ВЫКЛ Laserový značkovat vypnut Desygnator laserowy wył. - Désignateur Laser Éteint + Désignateur laser éteint Lézeres Megjelölő Ki Designatore laser spento - + \ No newline at end of file diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index 6be6baf82b..8fa38e24dd 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -42,7 +42,7 @@ <t color='#9cf953'>Uso: </t>Laser ON/OFF <t color='#9cf953'>Użyj: </t>wł./wył. laser <t color='#9cf953'>Uso: </t>Ativar/Desativar laser - <t color='#9cf953'>Использовать: </t>вкл/выкл лазер + <t color='#9cf953'>Использовать: </t>ВКЛ/ВЫКЛ лазер <t color='#9cf953'>Usar: </t>encender/apagar láser <t color='#9cf953'>Használat: </t>Lézer BE/KI kapcsolása @@ -72,4 +72,4 @@ Cambiar Laser / Laser IR - + \ No newline at end of file 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/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/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 1e02260d1b..3c84a9109e 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -5,7 +5,7 @@ Repack Magazines Magazine umpacken Reorganizar cargadores - Réorganiser chargeurs + Réorganiser les chargeurs Przepakuj magazynki Přepáskovat Zásobníky Ricarica Caricatori @@ -107,4 +107,4 @@ %1 pieno e %2 parziale - + \ No newline at end of file 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/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 56e5a531ec..6ab24379c5 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -73,11 +73,22 @@ class ACE_Settings { }; class GVAR(allowLitterCreation) { typeName = "BOOL"; - value = true; + value = 1; + }; + class GVAR(litterSimulationDetail) { + displayName = "$STR_ACE_Medical_litterSimulationDetail"; + description = "$STR_ACE_Medical_litterSimulationDetail_Desc"; + typeName = "SCALAR"; + + value = 3; + values[] = {"Off", "Low", "Medium", "High", "Ultra"}; + _values[] = { 0, 50, 100, 1000, 5000 }; + + isClientSettable = 1; }; class GVAR(litterCleanUpDelay) { typeName = "SCALAR"; - value = 1800; + value = 0; }; class GVAR(medicSetting_PAK) { typeName = "SCALAR"; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 309bb2a888..9b384c67b7 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])}, @@ -265,3 +265,7 @@ if (USE_WOUND_EVENT_SYNC) then { ["playerInventoryChanged", { [ACE_player] call FUNC(itemCheck); }] call EFUNC(common,addEventHandler); + + +// Networked litter +[QGVAR(createLitter), FUNC(handleCreateLitter), GVAR(litterCleanUpDelay)] call EFUNC(common,addSyncedEventHandler); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index a27bc5ccb1..fe485cdd16 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -21,7 +21,6 @@ PREP(adjustPainLevel); PREP(canAccessMedicalEquipment); PREP(canTreat); PREP(canTreatCached); -PREP(createLitter); PREP(determineIfFatal); PREP(getBloodLoss); PREP(getBloodPressure); @@ -99,6 +98,10 @@ PREP(moduleTreatmentConfiguration); PREP(copyDeadBody); PREP(requestWoundSync); +// Networked litter +PREP(createLitter); +PREP(handleCreateLitter); + GVAR(injuredUnitCollection) = []; GVAR(IVBags) = []; 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_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 570c6d63d3..5299fbb244 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -37,21 +37,21 @@ if !(isArray (_config >> "litter")) exitwith {}; _litter = getArray (_config >> "litter"); _createLitter = { + private["_position", "_litterClass", "_direction"]; _position = getPos (_this select 0); _litterClass = _this select 1; - _litterObject = createVehicle [_litterClass, _position, [], 0, "NONE"]; if (random(1) >= 0.5) then { - _litterObject setPos [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; + _position = [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; } else { - _litterObject setPos [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; + _position = [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; }; - _litterObject setDir (random 360); - _litterObject; -}; - -if (isnil QGVAR(allCreatedLitter)) then { - GVAR(allCreatedLitter) = []; - GVAR(litterPFHRunning) = false; + _direction = (random 360); + + // Create the litter, and timeout the event based on the cleanup delay + // The cleanup delay for events in MP is handled by the server side + [QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent); + + true }; _createdLitter = []; @@ -75,37 +75,13 @@ _createdLitter = []; // Loop through through the litter options and place the litter { if (typeName _x == "ARRAY" && {(count _x > 0)}) then { - _createdLitter pushback ([_target, _x select (floor(random(count _x)))] call _createLitter); + [_target, _x select (floor(random(count _x)))] call _createLitter; }; if (typeName _x == "STRING") then { - _createdLitter pushback ([_target, _x] call _createLitter); + [_target, _x] call _createLitter; }; }foreach _litterOptions; }; }; }; -}foreach _litter; - -if (GVAR(litterCleanUpDelay) >= 0) then { - GVAR(allCreatedLitter) pushback [time, GVAR(litterCleanUpDelay), _createdLitter]; -}; - -if !(GVAR(litterPFHRunning)) then { - GVAR(litterPFHRunning) = true; - [{ - { - if (time - (_x select 0) >= (_x select 1)) then { - { - deleteVehicle _x; - }foreach (_this select 2); - GVAR(allCreatedLitter) set[_foreachIndex, objNull]; - }; - }foreach GVAR(allCreatedLitter); - GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; - - if (count GVAR(allCreatedLitter) == 0) exitwith { - GVAR(litterPFHRunning) = false; - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; - }, 30, []] call CBA_fnc_addPerFrameHandler; -}; +}foreach _litter; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf new file mode 100644 index 0000000000..ee7e591cd1 --- /dev/null +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -0,0 +1,48 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +if(!hasInterface) exitWith { false }; + +PARAMS_3(_litterClass,_position,_direction); +private["_litterObject", "_maxLitterCount"]; + +if (isNil QGVAR(allCreatedLitter)) then { + GVAR(allCreatedLitter) = []; + GVAR(litterPFHRunning) = false; +}; + +_litterObject = _litterClass createVehicleLocal _position; +_litterObject setDir _direction; + +_maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail); +if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { + // gank the first litter object, and spawn ours. + private["_oldLitter"]; + _oldLitter = GVAR(allCreatedLitter) deleteAt 0; + { + deleteVehicle _x; + } forEach (_oldLitter select 1); +}; + +GVAR(allCreatedLitter) pushBack [time, [_litterObject]]; + +if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { + [{ + { + if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { + { + deleteVehicle _x; + } forEach (_x select 1); + GVAR(allCreatedLitter) set[_foreachIndex, objNull]; + }; + } forEach GVAR(allCreatedLitter); + GVAR(allCreatedLitter) = GVAR(allCreatedLitter) - [objNull]; + + if ( (count GVAR(allCreatedLitter)) == 0) exitwith { + [(_this select 1)] call CBA_fnc_removePerFrameHandler; + GVAR(litterPFHRunning) = false; + }; + }, 30, []] call cba_fnc_addPerFrameHandler; +}; + +true \ No newline at end of file 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..e85283c471 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1,6 +1,14 @@  + + Litter Simulation Detail + Detale zużytych medykamentów + + + Litter simulation detail level sets the number of litter items which will be locally spawned in the client. Excessive amounts in local areas could cause FPS lag, so this is a client only setting. + Opcja ta ustawia liczbę zużytych medykamentów, jakie pojawiają się lokalnie wokół gracza. Ich zbyt duża ilość może spowodować spadki FPS, dlatego jest to ustawienie tylko po stronie klienta. + Inject Atropine Atropin injizieren @@ -64,8 +72,8 @@ Salzlösungtransfusion Transfundir salino Transfúze fyziologický roztoku - Przetocz solankę - Transfuser de la Saline + Przetocz sól fizjologiczną + Transfuser de la solution saline Перелить физраствор Infúzió (sós víz) Effettua trasfusione di soluzione salina @@ -84,7 +92,7 @@ Bandage Verbinden Venda - Bandaż + Bandażuj Obvázat Pansement Benda @@ -216,7 +224,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 ... @@ -287,6 +295,7 @@ Bandaż uciskowy Nyomókötszer Bendaggio compressivo + Bandage gauze Elastic Bandage @@ -328,7 +337,7 @@ Проверить давление Zkontrolovat krevní tlak Sprawdź ciśnienie krwi - Vérification de la Tension + Vérification de la tension Vérnyomás megmérése Controlla pressionsa sanguigna @@ -339,7 +348,7 @@ Медкарта Karta segregacyjna Karta Triage - Carte de Triage + Carte de triage Orvosi lap Triage Card @@ -361,7 +370,7 @@ Снять жгут Sundat škrtidlo Zdejmij stazę - Enlever le Garrot + Enlever le garrot Érszorító leszedése Rimuovi laccio emostatico @@ -369,9 +378,9 @@ Give Blood IV (1000ml) Bluttransfusion IV (1000ml) Dar Sangre IV (1000ml) - Дать кровь для в/в вливания (1000 мл) + Перелить пакет крови (1000 мл) Podaj krew IV (1000ml) - Administrer du Sang en IV (1000ml) + Administrer du sang en IV (1000ml) Podat krev. transfúzi (1000ml) Vér adása intravénásan (1000ml) Effettua trasfusione sangue IV (1000ml) @@ -380,9 +389,9 @@ Give Blood IV (500ml) Bluttransfusion IV (500ml) Dar Sangre IV (500ml) - Дать кровь для в/в вливания (500 мл) + Перелить пакет крови (500 мл) Podaj krew IV (500ml) - Administrer du Sang en IV (500ml) + Administrer du sang en IV (500ml) Podat krev. transfúzi (500ml) Vér adása intravénásan (500ml) Effettua trasfusione sangue IV (500ml) @@ -391,9 +400,9 @@ Give Blood IV (250ml) Bluttransfusion IV (250ml) Dar Sangre IV (250ml) - Дать кровь для в/в вливания (250 мл) + Перелить пакет крови (250 мл) Podaj krew IV (250ml) - Administrer du Sang en IV (250ml) + Administrer du sang en IV (250ml) Podat krev. transfúzi (250ml) Vér adása intravénásan (250ml) Effettua trasfusione sangue IV (250ml) @@ -402,9 +411,9 @@ Give Plasma IV (1000ml) Plasmatransfusion IV (1000ml) Dar Plasma IV (1000ml) - Дать плазму для в/в вливания (1000 мл) + Перелить пакет плазмы (1000 мл) Podaj osocze IV (1000ml) - Administrer du Plasma en IV (1000ml) + Administrer du plasma en IV (1000ml) Podat plazmu (1000ml) Vérplazma adása intravénásan (1000ml) Effettua trasfusione plasma IV (1000ml) @@ -413,9 +422,9 @@ Give Plasma IV (500ml) Plasmatransfusion IV (500ml) Dar Plasma IV (500ml) - Дать плазму для в/в вливания (500 мл) + Перелить пакет плазмы (500 мл) Podaj osocze IV (500ml) - Administrer du Plasma en IV (500ml) + Administrer du plasma en IV (500ml) Podat plazmu (500ml) Vérplazma adása intravénásan (500ml) Effettua trasfusione plasma IV (500ml) @@ -424,9 +433,9 @@ Give Plasma IV (250ml) Plasmatransfusion IV (250ml) Dar Plasma IV (250ml) - Дать плазму для в/в вливания (250 мл) + Перелить пакет плазмы (250 мл) Podaj osocze IV (250ml) - Administrer du Plasma en IV (250ml) + Administrer du plasma en IV (250ml) Podat plazmu (250ml) Vérplazma adása intravénásan (250ml) Effettua trasfusione plasma IV (250ml) @@ -435,9 +444,9 @@ Give Saline IV (1000ml) Kochsaltzlösung IV (1000ml) Dar Salino IV (1000ml) - Дать физраствор для в/в вливания (1000 мл) - Podaj solankę IV (1000ml) - Administrer de la Solution Saline en IV (1000ml) + Перелить пакет физраствора (1000 мл) + 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) Effettua trasfusione salina IV (1000ml) @@ -446,9 +455,9 @@ Give Saline IV (500ml) Kochsaltzlösung IV (500ml) Dar Salino IV (500ml) - Дать физраствор для в/в вливания (500 мл) - Podaj solankę IV (500ml) - Administrer de la Solution Saline en IV (500ml) + Перелить пакет физраствора (500 мл) + 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) Effettua trasfusione salina IV (500ml) @@ -457,9 +466,9 @@ Give Saline IV (250ml) Kochsaltzlösung IV (250ml) Dar Salino IV (250ml) - Дать физраствор для в/в вливания (250 мл) - Podaj solankę IV (250ml) - Administrer de la Solution Saline en IV (250ml) + Перелить пакет физраствора (250 мл) + 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) Effettua trasfusione salina IV (250ml) @@ -468,9 +477,9 @@ Minor Gering Menor - Незначительная + Несрочная помощь Normalny - Mineur + Léger Minimální Enyhe Minore @@ -478,7 +487,7 @@ Delayed Retrasado - Груз 300 + Срочная помощь Opóźniony Différé Verzögert @@ -489,7 +498,7 @@ Immediate Inmediato - Помощь отложена + Неотложная помощь Natychmiastowy Urgence Immédiate Sofort @@ -500,7 +509,7 @@ Deceased Fallecido - Груз 200 + Труп Nie żyje Décédé Verstorben @@ -511,7 +520,7 @@ None Ninguno - Нет + Отсутствует Brak Aucun Keine @@ -523,7 +532,7 @@ Normal breathing Дыхание в норме Respiración normal - Respiration Normale + Respiration normale Normalny oddech Normale Atmung Dýchá normálně @@ -535,7 +544,7 @@ Keine Atmung Дыхание отсутствует No respira - Aucune Respiration + Aucune respiration Brak oddechu Nedýchá Nincs légzés @@ -545,7 +554,7 @@ Difficult breathing Дыхание затруднено Dificultad para respirar - Difficultée Respiratoire + Difficultée respiratoire Trudności z oddychaniem Schwere Atmung Dýchá s obtížemi @@ -557,7 +566,7 @@ Fast keine Atmung Дыхание очень слабое Casi sin respiración - Respiration Faible + Respiration faible Prawie brak oddechu Skoro nedýchá Alig van légzés @@ -579,7 +588,7 @@ Hat Schmerzen Испытывает боль Con dolor - Ressent de la Douleur + Ressent de la douleur W bólu V bolestech Fájdalom alatt @@ -590,7 +599,7 @@ Hat eine große Menge Blut verloren Большая кровопотеря Mucha sangre perdida - A Perdu Bcp de Sang + A perdu beaucoup de sang Stracił dużo krwi Ztratil hodně krve Sok vért vesztett @@ -633,7 +642,7 @@ Used to cover a wound Для перевязки ран Utilizado para cubrir una herida - Utilisé Pour Couvrir Une Blessure + Utilisé pour couvrir une blessure Używany w celu przykrycia i ochrony miejsca zranienia Verwendet, um Wunden abzudecken Sebesülések befedésére alkalmas @@ -654,7 +663,7 @@ Mullbinde Тампонирующая повязка Vendaje compresivo - Bandage Mèche + Bandage gauze Bandaż (uciskowy) Nyomókötszer Bendaggio compressivo @@ -664,7 +673,7 @@ Verwendet, um mittlere bis große Wunden abzudecken und Blutungen zu stoppen Для тампонирования ран среднего и большого размера и остановки кровотечения. Se utiliza para vendar heridas medianas o grandes y detener el sangrado - Utilisé pour remplir la cavité créée dans une blessure de taille moyenne à grande. + Utilisé pour couvrir des blessures de taille moyenne à grande. Arrête l'hémorragies Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. Közepestől nagyig terjedő sebek betakarására és vérzés elállítására használt kötszer Usato su medie o larghe ferite per fermare emorragie. @@ -673,7 +682,7 @@ A bandage used to pack the wound to stem bleeding and facilitate wound healing. Packing a wound is an option in large polytrauma injuries. Повязка для тампонирования раны, остановки кровотечения и лучшего заживления. При тяжелых сочетанных ранениях возможно тампонирование раны. Se utiliza para detener la hemorragia de una herida y favorecer su cicatrización. Se usa en grandes lesiones o politraumatismos. - Bandage pouvant être inseré dans les blessures pour éponger le saignement et faciliter la guerrison. Ce bandage est optionnel pour soigner les lésions polytraumatique. + Bandage servant à recouvrir les blessures pour arrêter les hémmoragies et faciliter la guérisson. Recouvrir une blessure est optionnel dans le cas de blessures polytraumatiques Opatrunek stosowany w celu zatrzymania krwawienia i osłony większych ran. Egy kötszerfajta, melyet a sebek nyomására használnak a vérzés elállítása és sebgyógyulás érdekében. A nyomókötés egy lehetőség nagyobb polytraumatikus sérülések esetén. Un bendaggio usato per bendare ferite con emorragie e facilitare la guarigione. Bendare una ferita è una opzione su ferite di vario tipo. @@ -694,7 +703,7 @@ Elastische Binde (Kompressionsbinde) Давящая повязка Kit de vendaje (Elástico) - Bandage Compressif Élastique + Bandage compressif élastique Zestaw bandaży elastycznych. Rugalmas kötszercsomag, "rögzítő" Kit bendaggio, elastico @@ -765,7 +774,7 @@ An analgesic used to combat moderate to severe pain experiences. Обезболивающее для снятия средних и сильных болевых ощущений. Analgésico usado para combatir los estados dolorosos de moderados a severos. - Un Analgésique puissant servant à réduire les douleurs modérées à sévères. + Un analgésique puissant servant à réduire les douleurs modérées à sévères. Organiczny związek chemiczny z grupy alkaloidów. Ma silne działanie przeciwbólowe. Ein Schmerzmittel um mäßige bis starke Schmerzen zu behandeln Egy fájdalomcsillapító anyag, jellemzően mérsékelt vagy erős fájdalom esetén alkalmazandó. @@ -863,7 +872,7 @@ Plasma IV (500ml) Плазма для в/в вливания (500 мл) Plasma IV (500ml) - Plasma Sanguin IV (500ml) + Plasma sanguin IV (500ml) Osocze IV (500ml) Plasma IV (500ml) Vérplazma-infúzió (500ml) @@ -873,7 +882,7 @@ Plasma IV (250ml) Плазма для в/в вливания (250 мл) Plasma IV (250ml) - Plasma Sanguin (250ml) + Plasma sanguin (250ml) Osocze IV (250ml) Plasma IV (250ml) Vérplazma-infúzió (250ml) @@ -883,7 +892,7 @@ Blood IV (1000ml) Кровь для переливания (1000 мл) Sangre IV (1000ml) - Cullot Sanguin IV (1000ml) + Cullot sanguin IV (1000ml) Krew IV (1000ml) Blut IV (1000ml) Vér-infúzió (1000ml) @@ -893,7 +902,7 @@ Blood IV, for restoring a patients blood (keep cold) Пакет крови для возмещения объема потерянной крови (хранить в холодильнике) Sangre intravenosa, para restarurar el volumen sanguíneo (mantener frío) - Cullot Sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. + Cullot sanguin O- ,utiliser seulement lors de perte sanguine majeur afin de remplacer le volume sanguin perdu. Habituelment utiliser lors du transport ou dans un etablisement de soin. Krew IV, używana do uzupełnienia krwi u pacjenta, trzymać w warunkach chłodniczych Vér-infúzió, intravénás bejuttatásra egy páciensnek (hidegen tárolandó) Sangue usato per ripristinare pazienti in cui si è verificata una perdita di sangue (conservare al fresco) @@ -904,12 +913,13 @@ Krew 0 Rh-, używana w rzadkich i szczególnych przypadkach do uzupełnienia krwi u pacjenta, zazwyczaj w trakcie fazie transportu rannej osoby do szpitala. Utilice sólo durante gran pérdida de sangre para reemplazar el volumen de sangre perdida. Uso habitual durante el transporte de heridos. Sangue 0 negativo usato per ripristinare sangue in pazienti in cui si è verificata una perdita di sangue. + Cullot sanguin O- utilisé dans de rares et stricts cas pour compléter une perte de sang importante. Administré normalement lors d'un MEDEVAC Blood IV (500ml) Кровь для переливания (500 мл) Sangre IV (500ml) - Cullot Sanguin IV (500ml) + Cullot sanguin IV (500ml) Krew IV (500ml) Blut IV (500ml) Vér-infúzió (500ml) @@ -919,7 +929,7 @@ Blood IV (250ml) Кровь для переливания (250 мл) Sangre IV (250ml) - Cullot Sanguin IV (250ml) + Cullot sanguin IV (250ml) Krew IV (250ml) Blut IV (250ml) Vér-infúzió (250ml) @@ -929,8 +939,8 @@ Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) Solución Salina IV (1000ml) - Solution Saline 0.9% IV (1000ml) - Solanka 0,9% IV (1000ml) + Solution saline 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) @@ -939,8 +949,8 @@ Saline IV, for restoring a patients blood Пакет физраствора для возмещения объема потерянной крови 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 + Solution saline 0.9% IV, pour rétablir temporairement la tension artérielle + 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. @@ -948,7 +958,7 @@ A medical volume-replenishing agent introduced into the blood system through an IV infusion. Пакет физиологического раствора для возмещения объема потерянной крови путем внутривенного вливания Suero fisiológico inoculado al torrente sanguíneo de forma intravenosa. - Un remplacement temporaire pour rétablir la tension artérielle lors de perte sanguine, administré par intra-veineuse + Un remplacant temporaire pour rétablir la tension artérielle lors de perte sanguine, administré par intra-veineuse Używany w medycynie w formie płynu infuzyjnego jako środek nawadniający i uzupełniający niedobór elektrolitów, podawany dożylnie (IV). Egy orvosi térfogat-helyreállító készítmény, melyet intravénás módon lehet a szervezetbe juttatni. Una soluzione medica per ripristinare il volume del sangue introdotta tramite trasfusione IV. @@ -957,8 +967,8 @@ Saline IV (500ml) Физраствор для в/в вливания (500 мл) Salino IV (500ml) - Solution Saline 0.9% IV (500ml) - Solanka 0,9% IV (500ml) + Solution saline 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) @@ -967,8 +977,8 @@ Saline IV (250ml) Физраствор для в/в вливания (250 мл) Salino IV (250ml) - Solution Saline 0.9% IV (250ml) - Solanka 0,9% IV (250ml) + Solution saline 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) @@ -977,7 +987,7 @@ Basic Field Dressing (QuikClot) Первичный перевязочный пакет (QuikClot) Vendaje básico (QuickClot) - Bandage Regulier (Coagulant) + Bandage basique (Hémostatique) Podstawowy pakiet opatrunkowy (QuikClot) Verbandpäckchen(Gerinnungsmittel) Általános zárókötszer (QuikClot) @@ -987,7 +997,7 @@ QuikClot bandage Гемостатический пакет QuikClot Vendaje QuikClot - Bandage coagulant + Bandage hémostatique Hemostatyczny pakiet QuikClot. Podstawowy opatrunek stosowany na rany. Bandage mit Gerinnungsmittel QuikClot kötszer @@ -1063,7 +1073,7 @@ Bodybag - Sac à corps + Housse mortuaire Мешок для трупов Bolsa para cadáveres Worek na zwłoki @@ -1128,6 +1138,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 @@ -1425,7 +1436,7 @@ Załaduj pacjenta Naložit pacianta do Погрузить пациента в - Embarquer le Patient + Embarquer le patient Sebesült berakása Carregar Paciente Em Carica paziente nel @@ -1437,7 +1448,7 @@ Wyładuj pacjenta Vyložit pacienta Выгрузить пациента - Débarquer le Patient + Débarquer le patient Sebesült kihúzása Descarregar Paciente Scarica il paziente @@ -1447,7 +1458,7 @@ Descargar el paciente Выгрузить пациента Wyładuj pacjenta - Débarquer le Patient + Débarquer le patient Sebesült kihúzása Scarica il paziente @@ -1456,7 +1467,7 @@ Cargar el paciente en Погрузить пациента Załaduj pacjenta - Embarquer le Patient + Embarquer le patient Sebesült berakása Carica il paziente @@ -1518,89 +1529,100 @@ Heavily wounded Schwer verwundet: Ciężko ranny - Сильно ранен + Тяжелые ранения Gravemente ferito Gravemente herido + Lourdement blessé Lightly wounded Leicht verwundet: Lekko ranny - Легко ранен + Легкие ранения Leggermente ferito Levemente herido + Légèrement blessé Very lightly wounded Sehr leicht verwundet: B. lekko ranny - Очень легко ранен + Царапины Ferito lievemente Muy levemente herido + Très légèrement blessé Head Kopf Głowa - Голова + Головы Testa Cabeza + Tête Torso Torso Tors - Торс + Торса Torso Torso + Torse Left Arm Linker Arm Lewe ramię - Левая рука + Левой руки Braccio sinistro Brazo izquierdo + Bras gouche Right Arm Rechter Arm Prawe ramię - Правая рука + Правой руки Braccio destro Brazo derecho + Bras droit Left Leg Linkes Bein Lewa noga - Левая нога + Левой ноги Gamba sinistra Pierna izquierda + Jambe gauche Right Leg Rechtes Bein Prawa noga - Правая нога + Правой ноги Gamba destra Pierna derecha + Jambe droite Pain Effect Type Schmerzeffekt-Typ Rodzaj efektu bólu - Вид боли + Визуальный эффект боли Pain Effect Type Tipo de efecto de dolor + Type d'effet de douleur Colour Flashing Farbblinken Pulsujące kolory - Разноцветные вспышки + Пульсирующий свет Colore lampeggiante Parpadeo de color + Flash de couleur Chromatic Aberration @@ -1609,6 +1631,7 @@ Хроматическая аберрация Aberrazione cromatica Aberración cromática + Aberration chromatique 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/XEH_post_init.sqf b/addons/missileguidance/XEH_post_init.sqf index dc30361926..deaeef669d 100644 --- a/addons/missileguidance/XEH_post_init.sqf +++ b/addons/missileguidance/XEH_post_init.sqf @@ -1,2 +1,3 @@ #include "script_component.hpp" +[QGVAR(handoff), {_this call FUNC(handleHandoff)}] call EFUNC(common,addEventHandler); diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index d19b8475c9..08219e02f0 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -14,6 +14,9 @@ PREP(guidancePFH); PREP(doAttackProfile); PREP(doSeekerSearch); +PREP(doHandoff); +PREP(handleHandoff); + // Attack Profiles PREP(attackProfile_LIN); PREP(attackProfile_DIR); diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index ecb469527a..d84b3b126b 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -9,6 +9,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -53,7 +54,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..393abebc19 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -9,6 +9,8 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"]; +private["_cruisAlt", "_distanceShooterToTarget", "_shooterPos"]; + _seekerTargetPos = _this select 0; _launchParams = _this select 1; @@ -70,7 +72,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_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 032ae51791..8c67e68402 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -3,7 +3,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"]; -private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"]; +private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_shooterPos"]; _seekerTargetPos = _this select 0; _launchParams = _this select 1; diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index fa7c6f4f8b..b9a3502035 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -2,8 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_attackProfilePos"]; - +private["_testName", "_attackProfilePos", "_attackProfile", "_attackProfileName", "_attackProfilesCfg", "_i", "_launchParams", "_testame", "_testProfile"]; _launchParams = ((_this select 1) select 1); _attackProfileName = _launchParams select 3; diff --git a/addons/missileguidance/functions/fnc_doHandoff.sqf b/addons/missileguidance/functions/fnc_doHandoff.sqf new file mode 100644 index 0000000000..d99998c8c4 --- /dev/null +++ b/addons/missileguidance/functions/fnc_doHandoff.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +[QGVAR(handoff), [_target, _args]] call EFUNC(common,globalEvent); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index 1e43d83218..081ab16353 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); -private["_seekerProfilePos"]; +private["_seekerProfilePos", "_i", "_launchParams", "_seekerType", "_seekerTypeName", "_seekerTypesCfg", "_testName", "_testProfile"]; _launchParams = ((_this select 1) select 1); _seekerTypeName = _launchParams select 2; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index f7fd56c164..614323d63f 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -7,6 +7,7 @@ private["_launchParams", "_targetLaunchParams", "_flightParams", "_seekerParams" private["_lastRunTime", "_runtimeDelta", "_adjustTime", "_args", "_seekerTargetPos", "_projectilePos"]; private["_profileAdjustedTargetPos", "_incDeflection", "_minDeflection", "_maxDeflection"]; private["_targetVector", "_adjustVector", "_finalAdjustVector", "_changeVector", "_pitch", "_yaw", "_roll"]; +private["_PS", "_distanceToTarget", "_targetRelativeVector", "_vectorTo"]; _args = _this select 0; EXPLODE_7_PVT((_args select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); @@ -92,6 +93,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_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf new file mode 100644 index 0000000000..017a9c0160 --- /dev/null +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" +PARAMS_2(_target,_args); + +if(isNil "_target" || {isNull _target} || {!local _target} ) exitWith { false }; + +[FUNC(guidancePFH), 0, _args] call cba_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index dd96821692..7ada1d4442 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -8,6 +8,8 @@ if(GVAR(enabled) < 1 || {!local _projectile} ) exitWith { false }; if( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith { false }; private["_config", "_enabled", "_target", "_seekerType", "_attackProfile"]; +private["_args", "_canUseLock", "_guidingUnit", "_launchPos", "_lockMode", "_targetPos", "_vanillaTarget"]; + PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); // Bail on not missile @@ -60,26 +62,43 @@ if(isNil "_target") then { }; TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile); -[FUNC(guidancePFH), 0, [_this, - [_shooter, - [_target, _targetPos, _launchPos], - _seekerType, - _attackProfile, - _lockMode - ], - [ - getNumber ( _config >> "minDeflection" ), - getNumber ( _config >> "maxDeflection" ), - getNumber ( _config >> "incDeflection" ) - ], - [ - getNumber ( _config >> "seekerAngle" ), - getNumber ( _config >> "seekerAccuracy" ), - getNumber ( _config >> "seekerMaxRange" ) - ], - [ diag_tickTime, [], [] ] - ] -] call cba_fnc_addPerFrameHandler; +_args = [_this, + [_shooter, + [_target, _targetPos, _launchPos], + _seekerType, + _attackProfile, + _lockMode + ], + [ + getNumber ( _config >> "minDeflection" ), + getNumber ( _config >> "maxDeflection" ), + getNumber ( _config >> "incDeflection" ) + ], + [ + getNumber ( _config >> "seekerAngle" ), + getNumber ( _config >> "seekerAccuracy" ), + getNumber ( _config >> "seekerMaxRange" ) + ], + [ diag_tickTime, [], [] ] + ]; + +// Hand off to the guiding unit. We just use local player so local PFH fires for now +// Laser code needs to give us a shooter for LOBL, or the seeker unit needs to be able to shift locality +// Based on its homing laser +// Lasers need to be handled in a special LOAL/LOBL case + +//if(isPlayer _shooter) then { +// _guidingUnit = ACE_player; +// +// if(local _guidingUnit) then { +// [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +// } else { +// [QGVAR(handoff), [_guidingUnit, _args] ] call FUNC(doHandoff); +// }; +//} else { + [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +//}; + /* Clears locking settings (vehicle _shooter) setVariable [QGVAR(target), nil]; diff --git a/addons/missileguidance/functions/fnc_rotateVectLine.sqf b/addons/missileguidance/functions/fnc_rotateVectLine.sqf index b0360cc330..b9904f0e5a 100644 --- a/addons/missileguidance/functions/fnc_rotateVectLine.sqf +++ b/addons/missileguidance/functions/fnc_rotateVectLine.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +private["_d", "_map", "_p", "_theta", "_u"]; _map = _this select 0; _theta = _this select 1; diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 74d3b0fc71..872f33a917 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -3,6 +3,7 @@ EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); private["_targets", "_foundTargetPos", "_launchParams", "_seekerParams", "_targetLaunchParams"]; +private["_angleFov", "_angleOkay", "_losOkay", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; @@ -17,6 +18,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/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 07f997a041..7aafad1114 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -2,8 +2,8 @@ #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +private["_angleFov", "_canSeeTarget", "_foundTargetPos", "_laserResult", "_launchParams", "_seekerParams", "_seekerTargetPos", "_sensorPos", "_target"]; _seekerTargetPos = _this select 0; - _launchParams = _this select 1; _seekerParams = _launchParams select 3; _angleFov = _seekerParams select 0; diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index c9cb4c4c6b..9311ac2c0b 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -1,89 +1,94 @@  + Advanced Missile Guidance Avanzada Misiles Orientación - Avancée Missile orientation + Guidage avancé de missile Zaawansowane naprowadzanie rakiet Erweitertes Raketenlenksystem Pokročilé řízení střel Guida missili avanzata Avançado Missile Guidance 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. + Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzału. Jest to wymagana opcja dla broni rakietowych. Hydra-70 DAGR Missile - + Hydra-70 DAGR Hydra-70 DAGR Hydra-70 DAGR Rackete Hydra-70 DAGR Missile Hydra-70 DAGR Hydra-70 DAGR rakéta - + Hydra-70 DAGR DAGR - + DAGR DAGR DAGR DAGR DAGR DAGR - + DAGR Hydra-70 DAGR Laser Guided Missile - + Missile à guidage Hydra-70 DAGR Laserowo naprowadzana rakieta Hydra-70 DAGR Hydra-70 DAGR lasergelenkte Rakete Hydra-70 DAGR laserem naváděná střela Hydra-70 DAGR missile guida laser Hydra-70 DAGR lézer-irányított rakéta - + Управляемая ракета лазерного наведения Hydra-70 DAGR Hellfire II AGM-114K Missile - + Hellfire II AGM-114K Hellfire II AGM-114K Hellfire II AGM-114K Hellfire II AGM-114K Missile Hellfire II AGM-114K Hellfire II AGM-114K rakéta - + Hellfire II AGM-114K AGM-114K - + AGM-114K AGM-114K AGM-114K AGM-114K AGM-114K AGM-114K - + AGM-114K Hellfire II AGM-114K Laser Guided Missile - + Missile à guidage laser Hellfire II AGM-114K Laserowo naprowadzana rakieta Hellfire II AGM-114K Hellfire II AGM-114K Lasergelenkte Rakete Hellfire II AGM-114K laserem naváděná střela Missile guida laser Hellfire II AGM-114K Hellfire II AGM-114K lézer-irányított rakéta - + Управляемая ракета лазерного наведения Hellfire II AGM-114K - + \ No newline at end of file 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 daddd36c05..c6087541a8 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -55,6 +55,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { //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 { 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..e224ce61e4 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -10,18 +10,19 @@ Pokaż imiona Nevek mutatása Показать имена + Mostra i nomi Show player names Spielernamen anzeigen Mostrar nombres de jugadores Pokaż imiona graczy - Afficher nom des joueurs + Afficher les nom des joueurs Játékosnevek mutatása Zobrazit jména hráčů Mostrar nomes de jogadores Mostra i nomi dei giocatori - Показать имена игроков + Показывать имена игроков (включить имена) Show player name only on cursor (requires player names) @@ -30,10 +31,10 @@ 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) - Показать имена игроков только под курсором (требует имен игроков) + Показать имена игроков только под курсором (при включенных именах) Show player name only on keypress (requires player names) @@ -43,7 +44,8 @@ Zobrazit jména hráčů jen na klávesu (vyžaduje jména hráčů) 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,10 +54,10 @@ 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) - Показать звания игроков (требует имен игроков) + Показывать звания игроков (при вкл. именах) Show vehicle crew info @@ -64,28 +66,31 @@ Mostrar tripulantes Pokaż załogę pojazdu 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 Zeige Namen für KI Einheiten Mostrar etiquetas de nombre para unidades IA - Показывать именые метки ИИ + Показывать имена ботов Zobrazit jména AI 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) Zeigen Schallwellen (benötigt Spielernamen) Mostrar onda sonora (requiere Mostrar nombres de jugadores) - Показывать звуковые волны (требует имен игроков) + Индикатор разговора (при вкл. именах) Zobrazit SoundWaves (vyžaduje jména hráčů) 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/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 20c916104a..a2e24d79df 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -91,7 +91,7 @@ Sistema de visión nocturna (Panorámicas) Gogle noktowizyjne (panoramiczne) Noktovizor (Širokoúhlý) - ПНВ (Широкий) + ПНВ (Широкоугольный) JVN (Large) Éjjellátó szemüveg (széles látószögű) @@ -102,7 +102,7 @@ Czułość: %1 Jas: %1 Luminosité : %1 - Контраст: + Яркость: %1 Fényerő: %1 Luminosidade: %1 Luminosità: %1 @@ -132,4 +132,4 @@ Riduci la luminosità dell'NVG - + \ No newline at end of file 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..5aa06f41a0 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 { @@ -98,7 +98,7 @@ class CfgWeapons { class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Hamr_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_hamr_pip"; class ItemInfo: ItemInfo { @@ -147,7 +147,7 @@ class CfgWeapons { class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_Arco_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_arco_pip"; class ItemInfo: ItemInfo { @@ -197,7 +197,7 @@ class CfgWeapons { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_valdada_pip"; class ItemInfo: ItemInfo { @@ -239,7 +239,7 @@ class CfgWeapons { class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_SOS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_sos_pip"; class ItemInfo: ItemInfo { @@ -290,7 +290,7 @@ class CfgWeapons { class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { author = "$STR_ACE_Common_ACETeam"; _generalMacro = "ACE_optic_LRPS_PIP"; - scopeArsenal = 1; + //scopeArsenal = 1; displayName = "$STR_ACE_optic_lrps_pip"; class ItemInfo: ItemInfo { diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index cb3918cbc3..7f68aece74 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -22,3 +22,19 @@ if (!hasInterface) exitWith {}; uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0]; }; }] call EFUNC(common,addEventHandler); + +// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +["activeCameraChanged", { + if !(_this select 1) then { + deleteVehicle GVAR(camera); + + // PiP technique by BadBenson + GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0]; + GVAR(camera) camSetFov 0.7; + GVAR(camera) camSetTarget ACE_player; + GVAR(camera) camCommit 1; + + "ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]]; + GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"]; + }; +}] call EFUNC(common,addEventHandler); 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 5361aa7172..04e7ee5aaa 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -1,442 +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);); - SizeEx = (UNITY * 1); - Size = (UNITY * 1); - }; - 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;"; - SizeEx = (UNITY * 1); - Size = (UNITY * 1); - }; - 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..e65087936e 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,4 +1,5 @@  + @@ -22,6 +23,7 @@ Napraw animację Corriger animation Animációk kijavítása + Fixa l'animazione Reset All @@ -32,6 +34,7 @@ Resetuj wszystko Défaut Minden visszaállítása + Resetta tutto Colors @@ -42,6 +45,7 @@ Barvy Kolory Színek + Colori Options @@ -64,6 +68,7 @@ Valeurs Werte Értékek + Valori Yes @@ -95,9 +100,10 @@ Einstellung: Установки: Ajuste: - Ustawienie: + Ustaw: Paramètres Opció: + Parametri: Export @@ -108,6 +114,7 @@ Eksport Exporter Exportálás + Esporta Open Export Menu @@ -118,6 +125,7 @@ Otwórz menu eksportowania Ouvrir le menu d'exportation Exportálási menü megnyitása + Apri menù esportazione String input. @@ -127,6 +135,7 @@ Wpisywanie tekstu. Entrée String bevitel. + Stringa di unput. Array. Seperate elements by using ,. @@ -137,6 +146,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 +157,7 @@ Cyfra Nombre Szám + Numero Uknown input type @@ -157,6 +168,7 @@ Nieznany rodzaj danych Type d'entrée inconnue Ismeretlen beviteli típus + Input inserito sconosciuto Save input @@ -167,6 +179,7 @@ Zapisz dane Sauvegarder Bevitel elmentése + Salva input Include Client Settings @@ -177,6 +190,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 +201,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 +212,12 @@ 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 + Menu option: taille de l'UI + Skalowanie UI menu ustawień 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/overheating/stringtable.xml b/addons/overheating/stringtable.xml index 4bb91688fa..89993dee62 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -137,6 +137,7 @@ Vérifier la température Fegyverhő ellenőrzése Проверить температуру оружия + Waffentemperatur prüfen Checking temperature ... @@ -163,4 +164,4 @@ Температура - + \ No newline at end of file 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/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 2b02d7f5b7..a21fcb8e05 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1135,7 +1135,7 @@ Mini-Spike (AT) Mini-Spike (PALR) Mini-Spike (PT) - Mini-Spike (AA) + Mini-Spike (AT) Mini-Spike (AT) Mini-Spike (Tankelhárító) Mini-Spike (AT) @@ -1554,7 +1554,7 @@ TODO: NATO DMR (provisional) spotter TODO: NATO DMR (provisional) spotter - NATO DMR (provisoire) Observateur + NATO DMR (provisoire) observateur TODO: NATO DMR (provisional) observador TODO: NATO DMR (provisional) корректировщик @@ -1678,4 +1678,4 @@ TODO: SPMG .338 (песочный) - + \ 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..ceaf32c2d8 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 @@ -31,7 +33,7 @@ Zkontrolovat Munici Controlla le munizioni Conferir munições - Kонтроль Боеприпасы + Проверить боеприпасы 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_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index c3ab0aebf3..199495d75d 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -29,5 +29,5 @@ if (GVAR(SavePreDeathGear)) then { }; if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { - [_this, FUNC(showFriendlyFireMessage), 2] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(DFUNC(showFriendlyFireMessage)), 2] call EFUNC(common,execRemoteFnc); }; 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 409a149f83..75f711e20e 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -10,6 +10,7 @@ Rozmieszczenie za 5 sekund ... Respawn za 5 sekund... Kihelyezés 5 másodperc múlva ... + Dispiegamento in 5 secondi ... Rallypoint deployed @@ -20,6 +21,7 @@ Punkt zbiórki rozmieszczony Rallypoint umístěn Gyülekezőpont elhelyezve + Rallypoint dispiegato Teleported to Base @@ -30,6 +32,7 @@ Przeteleportowano do bazy Odteleportován na základnu Bázisra teleportálva + Teleportato alla base Teleported to Rallypoint @@ -40,36 +43,55 @@ 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) + Point de ralliement OUEST (Base) Rallypoint East (Base) Sammelpunkt Ost (Basis) Punto de reunión Este (Base) + Точка сбора Красных (База) + Punkt zbiórki Wschodu (Baza) + Point de ralliement EST (Base) Rallypoint Independent (Base) Sammelpunkt Widerstand (Basis) Punto de reunión Independiente (Base) + Точка сбора Независимых (База) + Punkt zbiórki Ruchu oporu (Baza) + Point de ralliement Indépendant (Base) Rallypoint West Sammelpunkt West Punto de reunión Oeste + Точка сбора Синих + Punkt zbiórki Zachodu + Point de ralliement OUEST Rallypoint East Sammelpunkt Ost Punto de reunión Este + Точка сбора Красных + Punkt zbiórki Wschodu + Point de ralliement EST Rallypoint Independent Sammelpunkt Widerstand Punto de reunión Independiente + Точка сбора Независимых + Punkt zbiórki Ruchu oporu + Point de ralliement Indépendant - \ 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..d13ff57ffc 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 (!(_unit isKindOf "Man")) 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..d84f0932af 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -6,54 +6,81 @@ Zerowanie powoli w górę Малая корректировка ВВЕРХ Ajuste menor arriba + Regola leggermente alzata in alto + Hausse + + Kleine Korrektur nach oben Minor adjustment down Zerowanie powoli w dół Малая корректировка ВНИЗ Ajuste menor abajo + Regola leggermente alzata in basso + Hausse - + Kleine Korrektur nach unten Minor adjustment right Zerowanie powoli w prawo Малая корректировка ВПРАВО Ajuste menor derecha + Regola leggermente il tiro a destra + Dérive + + Kleine Korrektur nach rechts Minor adjustment left Zerowanie powoli w lewo Малая корректировка ВЛЕВО Ajuste menor izquierda + Regola leggermete il tiro a sinistra + Dérive - + Kleine Korrektur nach links Major adjustment up Zerowanie w górę Большая корректировка ВВЕРХ Ajuste mayor arriba + Regola l'alzata in alto + Hausse +++ + Große Korrektur nach oben Major adjustment down Zerowanie w dół Большая корректировка ВНИЗ Ajuste mayor abajo + Regola l'alzata in basso + Hausse --- + Große Korrektur nach unten Major adjustment right Zerowanie w prawo Большая корректировка ВПРАВО Ajuste mayor derecha + Regola il tiro a destra + Dérive +++ + Große Korrektur nach rechts Major adjustment left Zerowanie w lewo Большая корректировка ВЛЕВО Ajuste mayor izquierda + Regola il tiro a sinistra + Dérive --- + Große Korrektur nach links Set zero adjustment Zresetuj wyzerowanie Сбросить корректировку Establecer ajuste a cero + Resetta i valori del tiro + RAZ corrections + Auf 0 justieren 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/CfgEventHandlers.hpp b/addons/vehicles/CfgEventHandlers.hpp index 049b154088..2725e526bc 100644 --- a/addons/vehicles/CfgEventHandlers.hpp +++ b/addons/vehicles/CfgEventHandlers.hpp @@ -18,3 +18,12 @@ class Extended_Engine_EventHandlers { }; }; }; + +class Extended_Init_EventHandlers { + class StaticWeapon { + class ACE_FixMass { + init = QUOTE(if (local (_this select 0)) then {(_this select 0) setMass (getMass (_this select 0) max 250)};); + exclude[] = {"TargetSoldierBase","Static_Designator_01_base_F","Static_Designator_02_base_F","Pod_Heli_Transport_04_base_F"}; + }; + }; +}; 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..6e06025620 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 @@ -39,7 +41,7 @@ Seleccionar fusil Wybierz karabin Zvolit hlavní zbraň - Выбрать автомат + Выбрать винтовку Sélectionner Fusil Puska Kiválasztása Selecionar Rifle @@ -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 @@ -241,7 +246,7 @@ Už nejsou žádné ostatní granáty Não há outras granadas restantes Nessun'altra granata rimanente. - Летальные гранаты закончились + Нелетальные гранаты закончились No grenade selected @@ -263,7 +268,8 @@ Tirer le lance-pots fumigènes Wystrzel granat dymny Füstvető eltüzelése - Запустить дымовую завесу + Пустить дымовую завесу + Lancia fumogeno diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 75e1277fee..e40a061aaf 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -1,6 +1,36 @@ -//XEH_postInit.sqf -//#define DEBUG_MODE_FULL #include "script_component.hpp" + +// Rain variables +GVAR(enableRain) = true; +GVAR(rain_next_period) = -1; +GVAR(rain_period_count) = 0; +GVAR(rain_initial_rain) = 0; +if(overcast >= 0.7) then { + GVAR(rain_initial_rain) = (random ((overcast-0.7)/0.3)); +}; +GVAR(current_rain) = GVAR(rain_initial_rain); +GVAR(rain_current_range) = -1+(random 2); +GVAR(overcast_multiplier) = 1; + +// Wind Variables +ACE_wind = [0, 0, 0]; +GVAR(wind_initial_dir) = (random 360); +GVAR(wind_initial_speed) = (overcast*5)+(random (overcast*5)) max 1; +GVAR(wind_mean_speed) = GVAR(wind_initial_speed); +GVAR(wind_mean_dir) = GVAR(wind_initial_dir); +GVAR(wind_current_speed) = GVAR(wind_initial_speed); +GVAR(wind_current_dir) = GVAR(wind_initial_dir); +GVAR(wind_current_range_speed) = -1+(random 2); +GVAR(wind_current_range_dir) = -1+(random 2); +GVAR(wind_next_period) = -1; //ceil((2+random(5))/(GVAR(overcast_multiplier)/10)); +GVAR(wind_next_major_period) = -1; +GVAR(wind_period_count) = 0; +GVAR(wind_major_period_count) = 0; +GVAR(wind_total_time) = 0; +GVAR(wind_period_start_time) = time; + +call FUNC(getMapData); + "ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; }; "ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; }; "ACE_MISC_PARAMS" addPublicVariableEventHandler { @@ -22,64 +52,9 @@ {false}, [37, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (SHIFT + K) -// Update Wind simulWeatherSync; -_fnc_updateWind = { - ACE_wind = [] call FUNC(getWind); - setWind [ACE_wind select 0, ACE_wind select 1, true]; - 2 setGusts 0; - // Set waves: 0 when no wind, 1 when wind >= 16 m/s - 1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); - - //systemChat format ["w:%1 %2,ACE_w:%1 %2, w", [wind select 0, wind select 1, ACE_wind select 0, ACE_wind select 1]]; -}; -[_fnc_updateWind, 1, []] call CBA_fnc_addPerFrameHandler; - - -// Update Rain -_fnc_updateRain = { - if(GVAR(enableRain)) then { - if(!isNil "ACE_RAIN_PARAMS" && {!isNil QGVAR(rain_period_start_time)}) then { - _oldStrength = ACE_RAIN_PARAMS select 0; - _rainStrength = ACE_RAIN_PARAMS select 1; - _transitionTime = ACE_RAIN_PARAMS select 2; - _periodPosition = (time - GVAR(rain_period_start_time)) min _transitionTime; - _periodPercent = (_periodPosition/_transitionTime) min 1; - - 0 setRain ((_periodPercent*(_rainStrength-_oldStrength))+_oldStrength); - }; - }; -}; -[_fnc_updateRain, 2, []] call CBA_fnc_addPerFrameHandler; - - -// Update Temperature -_fnc_updateTemperature = { - _time = daytime; - _month = date select 1; - - // Temperature - _hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440)); - - GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef; - GVAR(currentTemperature) = GVAR(currentTemperature) - 2 * humidity - 4 * overcast; - GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; - - // Humidity - GVAR(currentHumidity) = (GVAR(Humidity) select _month) / 100; - - if (rain > 0 && overcast > 0.7) then { - GVAR(currentHumidity) = 1; - } else { - _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; - _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); - _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); - GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; - }; - GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; - - // @todo: take altitude and humidity into account - GVAR(currentRelativeDensity) = (273.15 + 20) / (273.15 + GVAR(currentTemperature)); -}; -[_fnc_updateTemperature, 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateTemperature), 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateHumidity), 20, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateWind), 1, []] call CBA_fnc_addPerFrameHandler; +[FUNC(updateRain), 2, []] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index 2751e77226..ee05983a69 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -2,44 +2,16 @@ #include "script_component.hpp" ADDON = false; -LOG(MSG_INIT); +PREP(calculateAirDensity); +PREP(calculateBarometricPressure); PREP(displayWindInfo); PREP(getMapData); PREP(getWind); PREP(serverController); - - -// Rain variables -GVAR(enableRain) = true; -GVAR(rain_next_period) = -1; -GVAR(rain_period_count) = 0; -GVAR(rain_initial_rain) = 0; -if(overcast >= 0.7) then { - GVAR(rain_initial_rain) = (random ((overcast-0.7)/0.3)); -}; -GVAR(current_rain) = GVAR(rain_initial_rain); -GVAR(rain_current_range) = -1+(random 2); -GVAR(overcast_multiplier) = 1; - -// Wind Variables -ACE_wind = [0, 0, 0]; -GVAR(wind_initial_dir) = (random 360); -GVAR(wind_initial_speed) = (overcast*5)+(random (overcast*5)) max 1; -GVAR(wind_mean_speed) = GVAR(wind_initial_speed); -GVAR(wind_mean_dir) = GVAR(wind_initial_dir); -GVAR(wind_current_speed) = GVAR(wind_initial_speed); -GVAR(wind_current_dir) = GVAR(wind_initial_dir); -GVAR(wind_current_range_speed) = -1+(random 2); -GVAR(wind_current_range_dir) = -1+(random 2); -GVAR(wind_next_period) = -1; //ceil((2+random(5))/(GVAR(overcast_multiplier)/10)); -GVAR(wind_next_major_period) = -1; -GVAR(wind_period_count) = 0; -GVAR(wind_major_period_count) = 0; -GVAR(wind_total_time) = 0; -GVAR(wind_period_start_time) = time; - -// Init weather variables, in case they are needed before postInit -call FUNC(getMapData); +PREP(updateHumidity); +PREP(updateRain); +PREP(updateTemperature); +PREP(updateWind); ADDON = true; diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf new file mode 100644 index 0000000000..298049e51d --- /dev/null +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -0,0 +1,36 @@ +/* + * Author: Ruthberg + * + * Calculates the air density + * + * Arguments: + * 0: temperature - degrees celcius + * 1: pressure - hPa + * 2: relativeHumidity - value between 0.0 and 1.0 + * + * Return Value: + * 0: density of air - kg * m^(-3) + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_temperature", "_pressure", "_relativeHumidity"]; +_temperature = _this select 0; // in C +_pressure = _this select 1; // in hPa +_relativeHumidity = _this select 2; // as ratio 0-1 + +_pressure = _pressure * 100; + +if (_relativeHumidity > 0) then { + private ["_pSat", "_vaporPressure", "_partialPressure"]; + // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm + _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); + _vaporPressure = _relativeHumidity * _pSat; + _partialPressure = _pressure - _vaporPressure; + + (_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature)) +} else { + _pressure / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature)) +}; diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf new file mode 100644 index 0000000000..c65d343c93 --- /dev/null +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -0,0 +1,20 @@ +/* + * Author: Ruthberg + * + * Calculates the barometric pressure based on altitude and weather + * + * Arguments: + * 0: altitude - meters + * + * Return Value: + * 0: barometric pressure - hPA + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_altitude"]; +_altitude = _this; + +(1013.25 * exp(-(GVAR(Altitude) + _altitude) / 7990) - 10 * overcast) diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 61d556a27c..58d728bf67 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -29,13 +29,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 +46,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..cb0a961c21 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -110,3 +110,6 @@ if (worldName in ["Imrali"]) exitWith { GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; + +GVAR(currentTemperature) = 20; +GVAR(currentHumidity) = 0.5; diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index e25d53309d..54ec6efad3 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -1,4 +1,16 @@ +/* + * 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..d7dff0eb70 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -1,4 +1,16 @@ +/* + * 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/functions/fnc_updateHumidity.sqf b/addons/weather/functions/fnc_updateHumidity.sqf new file mode 100644 index 0000000000..e3ba7a0224 --- /dev/null +++ b/addons/weather/functions/fnc_updateHumidity.sqf @@ -0,0 +1,28 @@ +/* + * Author: ACE2 Team + * + * Updates GVAR(currentHumidity) based on + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +private ["_month", "_avgTemperature", "_pS1", "_pS2"]; +_month = date select 1; + +GVAR(currentHumidity) = (GVAR(Humidity) select _month) / 100; + +if (rain > 0 && overcast > 0.7) then { + GVAR(currentHumidity) = 1; +} else { + _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; + _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); + _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); + GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; +}; + +GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf new file mode 100644 index 0000000000..01e32e1734 --- /dev/null +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -0,0 +1,26 @@ +/* + * Author: ACE2 Team + * + * Updates rain based on ACE_RAIN_PARAMS + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +private ["_oldStrength", "_rainStrength", "_transitionTime", "_periodPosition", "_periodPercent"]; + +if (!GVAR(enableRain)) exitWith {}; + +if (!isNil "ACE_RAIN_PARAMS" && {!isNil QGVAR(rain_period_start_time)}) then { + _oldStrength = ACE_RAIN_PARAMS select 0; + _rainStrength = ACE_RAIN_PARAMS select 1; + _transitionTime = ACE_RAIN_PARAMS select 2; + _periodPosition = (time - GVAR(rain_period_start_time)) min _transitionTime; + _periodPercent = (_periodPosition/_transitionTime) min 1; + + 0 setRain ((_periodPercent*(_rainStrength-_oldStrength))+_oldStrength); +}; diff --git a/addons/weather/functions/fnc_updateTemperature.sqf b/addons/weather/functions/fnc_updateTemperature.sqf new file mode 100644 index 0000000000..5e342ad83d --- /dev/null +++ b/addons/weather/functions/fnc_updateTemperature.sqf @@ -0,0 +1,22 @@ +/* + * Author: ACE2 Team + * + * Updates GVAR(currentTemperature) based on the map data + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +private ["_time", "_month", "_hourlyCoef"]; +_time = daytime; +_month = date select 1; + +_hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440)); + +GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef; +GVAR(currentTemperature) = GVAR(currentTemperature) - 2 * humidity - 4 * overcast; +GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf new file mode 100644 index 0000000000..e5a52348a8 --- /dev/null +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -0,0 +1,21 @@ +/* + * Author: ACE2 Team + * + * Updates wind, gusts and waves based on ACE_wind + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ +#include "script_component.hpp" + +ACE_wind = [] call FUNC(getWind); +setWind [ACE_wind select 0, ACE_wind select 1, true]; +2 setGusts 0; + +// Set waves: 0 when no wind, 1 when wind >= 16 m/s +1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); + +//hintSilent format["Wind: %1\nACE_wind: %2\nDeviation: %3 (m/s)", wind, ACE_wind, Round((vectorMagnitude (ACE_wind vectorDiff wind)) * 1000) / 1000]; diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index a21d8245fd..edc1ac64d0 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -10,3 +10,11 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define ABSOLUTE_ZERO_IN_CELSIUS -273.15 +#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) +#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) +#define UNIVERSAL_GAS_CONSTANT 8.314 +#define WATER_VAPOR_MOLAR_MASS 0.018016 +#define DRY_AIR_MOLAR_MASS 0.028964 +#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 060d9b6f51..4e0723bb7a 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -4,9 +4,11 @@ Show Wind Info Pokaż inf. o wietrze - Показать информацию о погоде - Afficher information du vent + Показать информацию о ветре + Afficher information sur le vent Mostrar información del viento + Mostra informazioni sul vento + Zeige Windinformationen diff --git a/addons/winddeflection/ACE_Settings.hpp b/addons/winddeflection/ACE_Settings.hpp index 89235fe5af..b10b78db0c 100644 --- a/addons/winddeflection/ACE_Settings.hpp +++ b/addons/winddeflection/ACE_Settings.hpp @@ -1,4 +1,16 @@ class ACE_Settings { + class GVAR(enabled) { + displayName = "Wind Deflection"; + description = "Enables wind deflection"; + typeName = "BOOL"; + value = 1; + }; + class GVAR(vehicleEnabled) { + displayName = "Vehicle Enabled"; + description = "Enables wind deflection for static/vehicle gunners"; + typeName = "BOOL"; + value = 1; + }; class GVAR(simulationInterval) { displayName = "Simulation Interval"; description = "Defines the interval between every calculation step"; diff --git a/addons/winddeflection/CfgEventHandlers.hpp b/addons/winddeflection/CfgEventHandlers.hpp index 4f54a73c84..d856993322 100644 --- a/addons/winddeflection/CfgEventHandlers.hpp +++ b/addons/winddeflection/CfgEventHandlers.hpp @@ -5,7 +5,7 @@ class Extended_PreInit_EventHandlers { }; class Extended_FiredBIS_EventHandlers { - class CAManBase { + class AllVehicles { class ADDON { firedBIS = QUOTE(_this call FUNC(handleFired)); }; diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index f9362a2711..76ac0c13d3 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -11,6 +11,18 @@ 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 vehicleEnabled { + displayName = "Vehicle Enabled"; + description = "Enables wind deflection for static/vehicle gunners"; + 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..f7090cfc2a 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -21,14 +21,16 @@ */ #include "script_component.hpp" -if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; - private ["_unit", "_bullet"]; _unit = _this select 0; _bullet = _this select 6; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false}; + if (!hasInterface) exitWith {false}; -if (!(_bullet isKindOf "BulletBase")) exitWith {false}; +if (!(GVAR(enabled))) exitWith {false}; +if (!(GVAR(vehicleEnabled)) && !(_unit isKindOf "Man")) exitWith {false}; +if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exitWith {false}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 4cf75c885a..40be14a2b2 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -22,6 +22,8 @@ _activated = _this select 2; if !(_activated) exitWith {}; +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(vehicleEnabled), "vehicleEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index f5f1d3861e..4c2859f9b6 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -26,7 +26,7 @@ _bulletVelocity = velocity _bullet; _bulletSpeed = vectorMagnitude _bulletVelocity; - if (!alive _bullet || _bulletSpeed < 100) exitwith { + if (!alive _bullet || ((_bullet isKindOf "BulletBase") && _bulletSpeed < 100)) exitwith { [_this select 1] call cba_fnc_removePerFrameHandler; }; diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 897a3c556b..83f6c0d589 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -6,21 +6,23 @@ Wind Information Informacje o wietrze Información del viento - Ветер + Информация о ветре Informace o větru Vent Windinformationen Szélinformáció + Informazioni sul vento Direction: %1 Kierunek: %1 Dirección: %1 - Направление: %1 + Направление: %1° Směr: %1 Direction %1 Windrichtung: %1 Irány: %1 + Direzione: %1 Speed: %1 m/s @@ -31,16 +33,18 @@ Vitesse %1 m/s Geschwindigkeit: %1m/s Sebesség: %1 m/s + Velocità: %1 m/s Weather Information Informacje o pogodzie Información Meteorológica - Погода + Информация о погоде Informace o počasí 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/documentation/development/ace3-events-system.md b/documentation/development/ace3-events-system.md index d7c99e558e..33412aa8fa 100644 --- a/documentation/development/ace3-events-system.md +++ b/documentation/development/ace3-events-system.md @@ -23,6 +23,11 @@ Events can be removed or cleared with the following commands. * `[eventName, eventHandlerId] call ace_common_fnc_removeEventHandler`
will remove a specific event handler of the event name, using the ID returned from `ace_common_fnc_addEventHandler`. * `[eventName] call ace_common_fnc_removeAllEventHandlers`
will remove all event handlers for that type of event. +### Synchronized Events +* `[eventName, eventCodeBlock, ttlNumberOrCodeBlock] call ace_common_fnc_addSyncedEventHandler`
adds a globally synchronized event handler which will expire events after the provided TTL, or the code returns true. +* `[eventName] call ace_common_fnc_removeSyncedEventHandler`
will remove a specific event handler of the event name, using the ID returned from `ace_common_fnc_addSyncedEventHandler`. +* * `[eventName, args, ttlNumberOrCodeBlock] call ace_common_fnc_syncedEvent`
calls a global synchronized event, which will also be run on JIP players unless it has expired; event will expire after the provided TTL, or the code returns true. + ### Pattern: ```c++ // tapper machine @@ -52,6 +57,13 @@ PREP(onTapShoulder); [_newPlayer, _oldPlayer] local + + "PlayerJIP" + Player was a JIP player, and `player` object is now created. + common + [_player] + local + "playerInventoryChanged" diff --git a/documentation/development/coding-guidelines.md b/documentation/development/coding-guidelines.md index f72263eeaa..e39581a9d4 100644 --- a/documentation/development/coding-guidelines.md +++ b/documentation/development/coding-guidelines.md @@ -35,8 +35,8 @@ Tabs can be tricky sometimes, especially when it comes to sharing code with othe ## Braces -- opening bracket on the same line as keyword -- closing bracket in own line, same level of indentation as keyword +- opening brace on the same line as keyword +- closing brace in own line, same level of indentation as keyword **Yes:** @@ -70,7 +70,7 @@ class Something : Or { }; ``` -When using `if`/`else`, it is encouraged to put `else` on the same line as the closing bracket to save space: +When using `if`/`else`, it is encouraged to put `else` on the same line as the closing brace to save space: ```c++ if (alive player) then { @@ -90,7 +90,7 @@ class Three {foo = 3;}; #### Reasoning -Putting the opening bracket in it's own line wastes a lot of space, and keeping the closing bracket on the same level as the keyword makes it easier to recognize what exactly the bracket closes. +Putting the opening brace in it's own line wastes a lot of space, and keeping the closing brace on the same level as the keyword makes it easier to recognize what exactly the brace closes. ## How to create a new module diff --git a/documentation/development/extension-guidelines.md b/documentation/development/extension-guidelines.md index 0558d49d5e..b5e7e98586 100644 --- a/documentation/development/extension-guidelines.md +++ b/documentation/development/extension-guidelines.md @@ -11,7 +11,7 @@ order: 9 ### Requirements - A compiler (VS/GCC/Clang) - - If starting with visual studio, you need to make sure to use the Visual studio command prompt + - If starting with Visual Studio, you need to make sure to use the Visual studio command prompt - cmake 3.0 or later in your path ### Cross-Platform Guidelines diff --git a/documentation/development/modularity-and-pbo-structure.md b/documentation/development/modularity-and-pbo-structure.md index ad1194e39c..036ebb35d4 100644 --- a/documentation/development/modularity-and-pbo-structure.md +++ b/documentation/development/modularity-and-pbo-structure.md @@ -10,23 +10,21 @@ order: 4 Main principles: - As much stuff as possible should be modular -- Strive to make as much stuff as possible run-time toogable. Adding/removing PBOS would still be requiring to toogle any feature relying on config changes. +- Strive to make as much stuff as possible run-time togglable. Adding/removing PBOS would still be requiring to toggle any feature relying on config changes. ### PBO Structure Main principles: - Try to keep single module dependencies as much as possible -- InteractionMenu would be the requirement for most modules. -- Anything that is 100% config should require common and not interaction. +- Interaction would be the requirement for most modules. +- Anything that is 100% config should require Common and not Interaction. ``` -Main -> Common -> OptionsMenu -> InteractionMenu -> Most things +Main -> Common -> OptionsMenu -> Interaction -> Most things Main -> Common -> Config things -Main -> Common -> 3D Models | - InteractionMenu | -> Feature +Main -> Common -> 3D Models | + Interaction | -> Feature ``` - - diff --git a/documentation/feature/javelin.md b/documentation/feature/javelin.md index eecfa8844a..b253a25fc9 100644 --- a/documentation/feature/javelin.md +++ b/documentation/feature/javelin.md @@ -7,4 +7,15 @@ parent: wiki --- ## 1. Overview -Blah blah blah \ No newline at end of file +Blah blah blah + +Steps to lock titan/Javelin: + +1. You must be zoomed ALL THE WAY IN +2. You must be in thermal view +3. You must have a missile loaded +4. Hold TAB over a target, it will start beeping and the constraint boxes will appear +5. Once the beeping changes to LOCK tone, and the lock crosshairs appear, click fire without releasing tab + + +CTRL+TAB is default key to change firemode (configurable as a key) diff --git a/documentation/features/feature-list.md b/documentation/features/feature-list.md deleted file mode 100644 index 9edc405ba2..0000000000 --- a/documentation/features/feature-list.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -layout: wiki -title: Features Documentation -group: features -order: 0 -parent: wiki ---- - - -**This page will get updated soon.** - - -## Table of Contents - - 1. [][[Advanced Missile Guidanced Framework|WikiLink]] - 2. [yy](#yy) - 3. [zz](#zz) - - -## What ACE3 has to offer diff --git a/documentation/features/titan-javelin-usage.md b/documentation/features/titan-javelin-usage.md deleted file mode 100644 index 8115e6812b..0000000000 --- a/documentation/features/titan-javelin-usage.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: wiki -title: ACE Titan and Javelin -group: features -order: 0 -parent: wiki ---- - - -**This page will get updated soon.** 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/github_privates_bot.py b/tools/github_privates_bot.py new file mode 100644 index 0000000000..4ef04eb33c --- /dev/null +++ b/tools/github_privates_bot.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 + +import os +import argparse + +from pygithub3 import Github + +def main(): + gh = Github(user='acemod', repo='ACE3') + + pull_requests = gh.pull_requests.list().all() + + for request in pull_requests: + files = gh.pull_requests.list_files(request.number).all() + + for file in files: + # print file.filename + if '.sqf' in file.filename: + print file + +if __name__ == "__main__": + main() \ No newline at end of file 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 404c56f4db..6445a24dd7 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.*|DEFAULT_PARAM.*|KEY_PARAM.*') + 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,37 @@ 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) + + private_output = 'private['; + first = True + for bad_priv in missing: + if first: + first = False + private_output = private_output + '"' + bad_priv + else: + private_output = private_output + '", "' + bad_priv + + private_output = private_output + '"];'; + print (private_output) + for bad_priv in missing: print ('\t' + bad_priv) + bad_count_file = bad_count_file + 1 + + + + return bad_count_file def main(): @@ -89,6 +109,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 +120,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()