diff --git a/AUTHORS.txt b/AUTHORS.txt index 814ab311a3..12580bd2c4 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -14,6 +14,7 @@ Garth "L-H" de Wet Giallustio Glowbal Janus +jokoho482 ` Kieran NouberNou PabstMirror @@ -50,6 +51,7 @@ Coren Crusty Dharma Bellamkonda Dimaslg +Drill eRazeri evromalarkey F3 Project @@ -69,7 +71,6 @@ Harakhti havena Hawkins Head -jokoho482 Jonpas Karneck Kavinsky @@ -81,6 +82,7 @@ Macusercom MarcBook meat Michail Nikolaev +MikeMatrix nic547 nikolauska nomisum @@ -106,4 +108,3 @@ Valentin Torikian VyMajoris(W-Cephei) Winter zGuba -Drill diff --git a/README.md b/README.md index dade470553..2739ce55be 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,21 @@

- +

- ACE version + ACE3 version - - ACE download + + ACE3 download - ACE issues + ACE3 issues - BIF thread + BIF thread - ACE license + ACE3 license

Requires the latest version of CBA A3. Visit us on Facebook | YouTube | Twitter | Reddit

diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index 757385deb3..d88a9b1148 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -1,31 +1,31 @@ class ACE_Settings { class GVAR(enabled) { - displayName = "Advanced Ballistics"; - description = "Enables advanced ballistics"; + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); typeName = "BOOL"; value = 0; }; class GVAR(simulateForSnipers) { - displayName = "Enabled For Snipers"; - description = "Enables advanced ballistics for non local snipers (when using high power optics)"; + displayName = CSTRING(simulateForSnipers_DisplayName); + description = CSTRING(simulateForSnipers_Description); typeName = "BOOL"; value = 1; }; class GVAR(simulateForGroupMembers) { - displayName = "Enabled For Group Members"; - description = "Enables advanced ballistics for non local group members"; + displayName = CSTRING(simulateForGroupMembers_DisplayName); + description = CSTRING(simulateForGroupMembers_Description); typeName = "BOOL"; value = 0; }; class GVAR(simulateForEveryone) { - displayName = "Enabled For Everyone"; - description = "Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer)"; + displayName = CSTRING(simulateForEveryone_DisplayName); + description = CSTRING(simulateForEveryone_Description); typeName = "BOOL"; value = 0; }; class GVAR(disabledInFullAutoMode) { - displayName = "Disabled In FullAuto Mode"; - description = "Disables advanced ballistics during full auto fire"; + displayName = CSTRING(disabledInFullAutoMod_DisplayName); + description = CSTRING(disabledInFullAutoMod_Description); typeName = "BOOL"; value = 0; }; @@ -38,32 +38,32 @@ class ACE_Settings { }; */ class GVAR(ammoTemperatureEnabled) { - displayName = "Enable Ammo Temperature Simulation"; - description = "Muzzle velocity varies with ammo temperature"; + displayName = CSTRING(ammoTemperatureEnabled_DisplayName); + description = CSTRING(ammoTemperatureEnabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(barrelLengthInfluenceEnabled) { - displayName = "Enable Barrel Length Simulation"; - description = "Muzzle velocity varies with barrel length"; + displayName = CSTRING(barrelLengthInfluenceEnabled_DisplayName); + description = CSTRING(barrelLengthInfluenceEnabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(bulletTraceEnabled) { - displayName = "Enable Bullet Trace Effect"; - description = "Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)"; + displayName = CSTRING(bulletTraceEnabled_DisplayName); + description = CSTRING(bulletTraceEnabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(simulationInterval) { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = CSTRING(simulationInterval_DisplayName); + description = CSTRING(simulationInterval_Description); typeName = "SCALAR"; value = 0.0; }; class GVAR(simulationRadius) { - displayName = "Simulation Radius"; - description = "Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles"; + displayName = CSTRING(simulationRadius_DisplayName); + description = CSTRING(simulationRadius_Description); typeName = "SCALAR"; value = 3000; }; diff --git a/addons/advanced_ballistics/README.md b/addons/advanced_ballistics/README.md index ef98bcd2b6..122769b191 100644 --- a/addons/advanced_ballistics/README.md +++ b/addons/advanced_ballistics/README.md @@ -3,8 +3,9 @@ ace_advanced_ballistics The Advanced Ballistics module introduces advanced external- and internal ballistics to the game. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index b199acb9e5..1f9002e606 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -6,9 +6,8 @@ GVAR(currentbulletID) = -1; GVAR(Protractor) = false; GVAR(ProtractorStart) = ACE_time; - +GVAR(allBullets) = []; GVAR(currentGrid) = 0; -GVAR(initMessageEnabled) = false; GVAR(extensionAvailable) = true; /* @TODO: Remove this until versioning is in sync with cmake/build versioning diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index 12018ad412..f722d9c573 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -13,5 +13,5 @@ PREP(initializeTerrainExtension); PREP(initModuleSettings); PREP(readAmmoDataFromConfig); PREP(readWeaponDataFromConfig); - +PREP(handleFirePFH); ADDON = true; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 28df9d1d97..8b0c78e86c 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -8,29 +8,29 @@ * 1: temperature - degrees celcius * * Return Value: - * 0: muzzle velocity shift - m/s + * muzzle velocity shift - m/s * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; -_muzzleVelocityShiftTable = _this select 0; -_temperature = _this select 1; +private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction", + "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; +params["_muzzleVelocityShiftTable", "_temperature"]; -if (count _muzzleVelocityShiftTable != 11) exitWith { 0 }; +// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys +_muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; +if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; -_temperatureIndexA = floor((_temperature + 15) / 5); -_temperatureIndexA = 0 max _temperatureIndexA; -_temperatureIndexA = _temperatureIndexA min 10; +// Find exact data index required for given temperature +_temperatureIndexFunction = (_temperature + 15) / 5; -_temperatureIndexB = ceil((_temperature + 15) / 5); -_temperatureIndexB = 0 max _temperatureIndexB; -_temperatureIndexB = _temperatureIndexB min 10; +// lower and upper data index used for interpolation +_temperatureIndexA = (0 max (floor(_temperatureIndexFunction))) min 10; +_temperatureIndexB = (0 max (ceil(_temperatureIndexFunction))) min 10; -_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); +// Interpolation ratio +_interpolationRatio = _temperatureIndexFunction - floor(_temperatureIndexFunction); -_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio; - -_muzzleVelocityShift +// Interpolation +(_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _interpolationRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _interpolationRatio // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf index b0166109f5..fac048c061 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAtmosphericCorrection.sqf @@ -17,12 +17,9 @@ */ #include "script_component.hpp" -private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"]; -_ballisticCoefficient = _this select 0; -_temperature = _this select 1; // in C -_pressure = _this select 2; // in hPa -_relativeHumidity = _this select 3; // as ratio 0-1 -_atmosphereModel = _this select 4; // "ICAO" or "ASM" +private "_airDensity"; + +params ["_ballisticCoefficient", "_temperature"/*in C*/, "_pressure"/*in hPa*/, "_relativeHumidity"/*as ratio 0-1*/, "_atmosphereModel"/*"ICAO" or "ASM"*/]; _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index de037f49bc..9c46cc2423 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -1,5 +1,5 @@ /* - * Author: Ruthberg + * Author: Ruthberg, MikeMatrix, joko // Jonas * * Calculates the muzzle velocity shift caused by different barrel lengths * @@ -10,46 +10,61 @@ * 3: muzzle velocity - m/s * * Return Value: - * 0: muzzle velocity shift - m/s + * muzzle velocity shift - m/s * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; -_barrelLength = _this select 0; -_muzzleVelocityTable = _this select 1; -_barrelLengthTable = _this select 2; -_muzzleVelocity = _this select 3; +scopeName "main"; +private ["_muzzleVelocityTableCount", "_barrelLengthTableCount", "_lowerDataIndex", + "_upperDataIndex", "_lowerBarrelLength", "_upperBarrelLength", "_lowerMuzzleVelocity", + "_upperMuzzleVelocity", "_interpolationRatio"]; +params ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity"]; + +// If barrel length is not defined, then there is no point in calculating muzzle velocity if (_barrelLength == 0) exitWith { 0 }; -if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 }; -if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 }; -if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; -_lowerIndex = 0; -_upperIndex = (count _barrelLengthTable) - 1; +_muzzleVelocityTableCount = count _muzzleVelocityTable; +_barrelLengthTableCount = count _barrelLengthTable; -if (_barrelLength <= (_barrelLengthTable select _lowerIndex)) exitWith { (_muzzleVelocityTable select _lowerIndex) - _muzzleVelocity }; -if (_barrelLength >= (_barrelLengthTable select _upperIndex)) exitWith { (_muzzleVelocityTable select _upperIndex) - _muzzleVelocity }; +// Exit if tables are different sizes, have no elements or have only one element +if (_muzzleVelocityTableCount != _barrelLengthTableCount || _muzzleVelocityTableCount == 0 || _barrelLengthTableCount == 0) exitWith { 0 }; +if (_muzzleVelocityTableCount == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; -for "_i" from 0 to (count _barrelLengthTable) - 1 do { - if (_barrelLength >= _barrelLengthTable select _i) then { - _lowerIndex = _i; - }; -}; -for "_i" from (count _barrelLengthTable) - 1 to 0 step -1 do { - if (_barrelLength <= _barrelLengthTable select _i) then { - _upperIndex = _i; +// If we have the precise barrel length value, return result immediately +if (_barrelLength in _barrelLengthTable) exitWith { + (_muzzleVelocityTable select (_barrelLengthTable find _barrelLength)) - _muzzleVelocity +}; + +// Limit values to lower and upper bound of data we have available +if (_barrelLength <= (_barrelLengthTable select 0)) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; +if (_barrelLength >= (_barrelLengthTable select _barrelLengthTableCount - 1)) exitWith { (_muzzleVelocityTable select _barrelLengthTableCount - 1) - _muzzleVelocity }; + +// Find closest bordering values for barrel length +{ + if (_barrelLength <= _x) then { + _upperDataIndex = _forEachIndex; + _lowerDataIndex = _upperDataIndex - 1; + breakTo "main"; }; +} forEach _barrelLengthTable; + +// Worst case scenario +if (isNil "_lowerDataIndex" || isNil "_upperDataIndex") exitWith {0}; + +_lowerBarrelLength = _barrelLengthTable select _lowerDataIndex; +_upperBarrelLength = _barrelLengthTable select _upperDataIndex; +_lowerMuzzleVelocity = _muzzleVelocityTable select _lowerDataIndex; +_upperMuzzleVelocity = _muzzleVelocityTable select _upperDataIndex; + +// Calculate interpolation ratio +_interpolationRatio = if (abs (_lowerBarrelLength - _upperBarrelLength) > 0) then { + (_upperBarrelLength - _barrelLength) / (_upperBarrelLength - _lowerBarrelLength) +} else { + 0 }; -_barrelLengthRatio = 0; -if ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex) > 0) then { - _barrelLengthRatio = ((_barrelLengthTable select _upperIndex) - _barrelLength) / ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex)); -}; - -_muzzleVelocityNew = (_muzzleVelocityTable select _lowerIndex) + ((_muzzleVelocityTable select _upperIndex) - (_muzzleVelocityTable select _lowerIndex)) * (1 - _barrelLengthRatio); - -_muzzleVelocityNew - _muzzleVelocity +// Calculate interpolated muzzle velocity shift +(_lowerMuzzleVelocity + ((_upperMuzzleVelocity - _lowerMuzzleVelocity) * (1 - _interpolationRatio))) - _muzzleVelocity // Return diff --git a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf index 433dafbe10..0bd801c6b9 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateRetardation.sqf @@ -4,142 +4,129 @@ * Calculates the retardation of the bullet * * Arguments: - * 0: drag model - 1-7 + * 0: drag model - integer 1-7 * 1: drag coefficient - bc * 2: velocity - m/s * * Return Value: - * 0: retardation - m/(s^2) + * retardation - m/(s^2) * - * Return value: - * None + * Public: No */ #include "script_component.hpp" // Source: GNU Exterior Ballistics -private ["_dragModel", "_dragCoefficient", "_velocity", "_A", "_M", "_result"]; -_dragModel = _this select 0; -_dragCoefficient = _this select 1; -_velocity = (_this select 2) * 3.2808399; - -_A = -1; -_M = -1; -_result = 0; +private ["_A", "_M"]; +params ["_dragModel", "_dragCoefficient", "_velocity"]; +_velocity = _velocity * 3.2808399; switch _dragModel do { - case 1: - { - switch true do { - case (_velocity > 4230) : { _A = 0.0001477404177730177; _M = 1.9565; }; - case (_velocity > 3680) : { _A = 0.0001920339268755614; _M = 1.925 ; }; - case (_velocity > 3450) : { _A = 0.0002894751026819746; _M = 1.875 ; }; - case (_velocity > 3295) : { _A = 0.0004349905111115636; _M = 1.825 ; }; - case (_velocity > 3130) : { _A = 0.0006520421871892662; _M = 1.775 ; }; - case (_velocity > 2960) : { _A = 0.0009748073694078696; _M = 1.725 ; }; - case (_velocity > 2830) : { _A = 0.001453721560187286; _M = 1.675 ; }; - case (_velocity > 2680) : { _A = 0.002162887202930376; _M = 1.625 ; }; - case (_velocity > 2460) : { _A = 0.003209559783129881; _M = 1.575 ; }; - case (_velocity > 2225) : { _A = 0.003904368218691249; _M = 1.55 ; }; - case (_velocity > 2015) : { _A = 0.003222942271262336; _M = 1.575 ; }; - case (_velocity > 1890) : { _A = 0.002203329542297809; _M = 1.625 ; }; - case (_velocity > 1810) : { _A = 0.001511001028891904; _M = 1.675 ; }; - case (_velocity > 1730) : { _A = 0.0008609957592468259; _M = 1.75 ; }; - case (_velocity > 1595) : { _A = 0.0004086146797305117; _M = 1.85 ; }; - case (_velocity > 1520) : { _A = 0.0001954473210037398; _M = 1.95 ; }; - case (_velocity > 1420) : { _A = 0.00005431896266462351; _M = 2.125 ; }; - case (_velocity > 1360) : { _A = 0.000008847742581674416; _M = 2.375 ; }; - case (_velocity > 1315) : { _A = 0.000001456922328720298; _M = 2.625 ; }; - case (_velocity > 1280) : { _A = 0.0000002419485191895565; _M = 2.875 ; }; - case (_velocity > 1220) : { _A = 0.00000001657956321067612; _M = 3.25 ; }; - case (_velocity > 1185) : { _A = 0.0000000004745469537157371; _M = 3.75 ; }; - case (_velocity > 1150) : { _A = 0.00000000001379746590025088; _M = 4.25 ; }; - case (_velocity > 1100) : { _A = 0.0000000000004070157961147882; _M = 4.75 ; }; - case (_velocity > 1060) : { _A = 0.00000000000002938236954847331; _M = 5.125 ; }; - case (_velocity > 1025) : { _A = 0.00000000000001228597370774746; _M = 5.25 ; }; - case (_velocity > 980) : { _A = 0.00000000000002916938264100495; _M = 5.125 ; }; - case (_velocity > 945) : { _A = 0.0000000000003855099424807451; _M = 4.75 ; }; - case (_velocity > 905) : { _A = 0.00000000001185097045689854; _M = 4.25 ; }; - case (_velocity > 860) : { _A = 0.0000000003566129470974951; _M = 3.75 ; }; - case (_velocity > 810) : { _A = 0.00000001045513263966272; _M = 3.25 ; }; - case (_velocity > 780) : { _A = 0.0000001291159200846216; _M = 2.875 ; }; - case (_velocity > 750) : { _A = 0.0000006824429329105383; _M = 2.625 ; }; - case (_velocity > 700) : { _A = 0.000003569169672385163; _M = 2.375 ; }; - case (_velocity > 640) : { _A = 0.00001839015095899579; _M = 2.125 ; }; - case (_velocity > 600) : { _A = 0.00005711174688734240; _M = 1.950 ; }; - case (_velocity > 550) : { _A = 0.00009226557091973427; _M = 1.875 ; }; - case (_velocity > 250) : { _A = 0.00009337991957131389; _M = 1.875 ; }; - case (_velocity > 100) : { _A = 0.00007225247327590413; _M = 1.925 ; }; - case (_velocity > 65) : { _A = 0.00005792684957074546; _M = 1.975 ; }; - case (_velocity > 0) : { _A = 0.00005206214107320588; _M = 2.000 ; }; + case 1: { + call { + if (_velocity > 4230) exitWith { _A = 0.0001477404177730177; _M = 1.9565; }; + if (_velocity > 3680) exitWith { _A = 0.0001920339268755614; _M = 1.925; }; + if (_velocity > 3450) exitWith { _A = 0.0002894751026819746; _M = 1.875; }; + if (_velocity > 3295) exitWith { _A = 0.0004349905111115636; _M = 1.825; }; + if (_velocity > 3130) exitWith { _A = 0.0006520421871892662; _M = 1.775; }; + if (_velocity > 2960) exitWith { _A = 0.0009748073694078696; _M = 1.725; }; + if (_velocity > 2830) exitWith { _A = 0.001453721560187286; _M = 1.675; }; + if (_velocity > 2680) exitWith { _A = 0.002162887202930376; _M = 1.625; }; + if (_velocity > 2460) exitWith { _A = 0.003209559783129881; _M = 1.575; }; + if (_velocity > 2225) exitWith { _A = 0.003904368218691249; _M = 1.55; }; + if (_velocity > 2015) exitWith { _A = 0.003222942271262336; _M = 1.575; }; + if (_velocity > 1890) exitWith { _A = 0.002203329542297809; _M = 1.625; }; + if (_velocity > 1810) exitWith { _A = 0.001511001028891904; _M = 1.675; }; + if (_velocity > 1730) exitWith { _A = 0.0008609957592468259; _M = 1.75; }; + if (_velocity > 1595) exitWith { _A = 0.0004086146797305117; _M = 1.85; }; + if (_velocity > 1520) exitWith { _A = 0.0001954473210037398; _M = 1.95; }; + if (_velocity > 1420) exitWith { _A = 0.00005431896266462351; _M = 2.125; }; + if (_velocity > 1360) exitWith { _A = 0.000008847742581674416; _M = 2.375; }; + if (_velocity > 1315) exitWith { _A = 0.000001456922328720298; _M = 2.625; }; + if (_velocity > 1280) exitWith { _A = 0.0000002419485191895565; _M = 2.875; }; + if (_velocity > 1220) exitWith { _A = 0.00000001657956321067612; _M = 3.25; }; + if (_velocity > 1185) exitWith { _A = 0.0000000004745469537157371; _M = 3.75; }; + if (_velocity > 1150) exitWith { _A = 0.00000000001379746590025088; _M = 4.25; }; + if (_velocity > 1100) exitWith { _A = 0.0000000000004070157961147882; _M = 4.75; }; + if (_velocity > 1060) exitWith { _A = 0.00000000000002938236954847331; _M = 5.125; }; + if (_velocity > 1025) exitWith { _A = 0.00000000000001228597370774746; _M = 5.25; }; + if (_velocity > 980) exitWith { _A = 0.00000000000002916938264100495; _M = 5.125; }; + if (_velocity > 945) exitWith { _A = 0.0000000000003855099424807451; _M = 4.75; }; + if (_velocity > 905) exitWith { _A = 0.00000000001185097045689854; _M = 4.25; }; + if (_velocity > 860) exitWith { _A = 0.0000000003566129470974951; _M = 3.75; }; + if (_velocity > 810) exitWith { _A = 0.00000001045513263966272; _M = 3.25; }; + if (_velocity > 780) exitWith { _A = 0.0000001291159200846216; _M = 2.875; }; + if (_velocity > 750) exitWith { _A = 0.0000006824429329105383; _M = 2.625; }; + if (_velocity > 700) exitWith { _A = 0.000003569169672385163; _M = 2.375; }; + if (_velocity > 640) exitWith { _A = 0.00001839015095899579; _M = 2.125; }; + if (_velocity > 600) exitWith { _A = 0.00005711174688734240; _M = 1.950; }; + if (_velocity > 550) exitWith { _A = 0.00009226557091973427; _M = 1.875; }; + if (_velocity > 250) exitWith { _A = 0.00009337991957131389; _M = 1.875; }; + if (_velocity > 100) exitWith { _A = 0.00007225247327590413; _M = 1.925; }; + if (_velocity > 65) exitWith { _A = 0.00005792684957074546; _M = 1.975; }; + if (_velocity > 0) exitWith { _A = 0.00005206214107320588; _M = 2.000; }; }; }; - case 2: - { - switch true do { - case (_velocity > 1674) : { _A = 0.0079470052136733; _M = 1.36999902851493; }; - case (_velocity > 1172) : { _A = 0.00100419763721974; _M = 1.65392237010294; }; - case (_velocity > 1060) : { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; - case (_velocity > 949) : { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; - case (_velocity > 670) : { _A = 0.000234364342818625; _M = 1.71869536324748; }; - case (_velocity > 335) : { _A = 0.000177962438921838; _M = 1.76877550388679; }; - case (_velocity > 0) : { _A = 0.0000518033561289704; _M = 1.98160270524632; }; + case 2: { + call { + if (_velocity > 1674) exitWith { _A = 0.0079470052136733; _M = 1.36999902851493; }; + if (_velocity > 1172) exitWith { _A = 0.00100419763721974; _M = 1.65392237010294; }; + if (_velocity > 1060) exitWith { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; + if (_velocity > 949) exitWith { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; + if (_velocity > 670) exitWith { _A = 0.000234364342818625; _M = 1.71869536324748; }; + if (_velocity > 335) exitWith { _A = 0.000177962438921838; _M = 1.76877550388679; }; + if (_velocity > 0) exitWith { _A = 0.0000518033561289704; _M = 1.98160270524632; }; }; }; - case 5: - { - switch true do { - case (_velocity > 1730) : { _A = 0.00724854775171929; _M = 1.41538574492812; }; - case (_velocity > 1228) : { _A = 0.0000350563361516117; _M = 2.13077307854948; }; - case (_velocity > 1116) : { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; - case (_velocity > 1004) : { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422 ; }; - case (_velocity > 837) : { _A = 0.000000103965974081168; _M = 2.84204791809926; }; - case (_velocity > 335) : { _A = 0.0001093015938698234; _M = 1.81096361579504; }; - case (_velocity > 0) : { _A = 0.0000351963178524273; _M = 2.00477856801111; }; + case 5: { + call { + if (_velocity > 1730) exitWith { _A = 0.00724854775171929; _M = 1.41538574492812; }; + if (_velocity > 1228) exitWith { _A = 0.0000350563361516117; _M = 2.13077307854948; }; + if (_velocity > 1116) exitWith { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; + if (_velocity > 1004) exitWith { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422; }; + if (_velocity > 837) exitWith { _A = 0.000000103965974081168; _M = 2.84204791809926; }; + if (_velocity > 335) exitWith { _A = 0.0001093015938698234; _M = 1.81096361579504; }; + if (_velocity > 0) exitWith { _A = 0.0000351963178524273; _M = 2.00477856801111; }; }; }; - case 6: - { - switch true do { - case (_velocity > 3236) : { _A = 0.0455384883480781; _M = 1.15997674041274; }; - case (_velocity > 2065) : { _A = 0.07167261849653769; _M = 1.10704436538885; }; - case (_velocity > 1311) : { _A = 0.00166676386084348; _M = 1.60085100195952; }; - case (_velocity > 1144) : { _A = 0.000000101482730119215; _M = 2.9569674731838 ; }; - case (_velocity > 1004) : { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; - case (_velocity > 670) : { _A = 0.0000204835650496866; _M = 2.11688446325998; }; - case (_velocity > 0) : { _A = 0.0000750912466084823; _M = 1.92031057847052; }; + case 6: { + call { + if (_velocity > 3236) exitWith { _A = 0.0455384883480781; _M = 1.15997674041274; }; + if (_velocity > 2065) exitWith { _A = 0.07167261849653769; _M = 1.10704436538885; }; + if (_velocity > 1311) exitWith { _A = 0.00166676386084348; _M = 1.60085100195952; }; + if (_velocity > 1144) exitWith { _A = 0.000000101482730119215; _M = 2.9569674731838; }; + if (_velocity > 1004) exitWith { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; + if (_velocity > 670) exitWith { _A = 0.0000204835650496866; _M = 2.11688446325998; }; + if (_velocity > 0) exitWith { _A = 0.0000750912466084823; _M = 1.92031057847052; }; }; }; - case 7: - { - switch true do { - case (_velocity > 4200) : { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; - case (_velocity > 3000) : { _A = 0.0171422231434847; _M = 1.27907168025204; }; - case (_velocity > 1470) : { _A = 0.00233355948302505; _M = 1.52693913274526; }; - case (_velocity > 1260) : { _A = 0.000797592111627665; _M = 1.67688974440324; }; - case (_velocity > 1110) : { _A = 0.00000000000571086414289273; _M = 4.3212826264889 ; }; - case (_velocity > 960) : { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; - case (_velocity > 670) : { _A = 0.00000752285155782535; _M = 2.1738019851075 ; }; - case (_velocity > 540) : { _A = 0.0000131766281225189; _M = 2.08774690257991; }; - case (_velocity > 0) : { _A = 0.0000134504843776525; _M = 2.08702306738884; }; + case 7: { + call { + if (_velocity > 4200) exitWith { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; + if (_velocity > 3000) exitWith { _A = 0.0171422231434847; _M = 1.27907168025204; }; + if (_velocity > 1470) exitWith { _A = 0.00233355948302505; _M = 1.52693913274526; }; + if (_velocity > 1260) exitWith { _A = 0.000797592111627665; _M = 1.67688974440324; }; + if (_velocity > 1110) exitWith { _A = 0.00000000000571086414289273; _M = 4.3212826264889; }; + if (_velocity > 960) exitWith { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; + if (_velocity > 670) exitWith { _A = 0.00000752285155782535; _M = 2.1738019851075; }; + if (_velocity > 540) exitWith { _A = 0.0000131766281225189; _M = 2.08774690257991; }; + if (_velocity > 0) exitWith { _A = 0.0000134504843776525; _M = 2.08702306738884; }; }; }; - case 8: - { - switch true do { - case (_velocity > 3571) : { _A = 0.0112263766252305; _M = 1.33207346655961; }; - case (_velocity > 1841) : { _A = 0.0167252613732636; _M = 1.28662041261785; }; - case (_velocity > 1120) : { _A = 0.00220172456619625; _M = 1.55636358091189; }; - case (_velocity > 1088) : { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; - case (_velocity > 976) : { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; - case (_velocity > 0) : { _A = 0.000043917343795117; _M = 1.99978116283334; }; + case 8: { + call { + if (_velocity > 3571) exitWith { _A = 0.0112263766252305; _M = 1.33207346655961; }; + if (_velocity > 1841) exitWith { _A = 0.0167252613732636; _M = 1.28662041261785; }; + if (_velocity > 1120) exitWith { _A = 0.00220172456619625; _M = 1.55636358091189; }; + if (_velocity > 1088) exitWith { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; + if (_velocity > 976) exitWith { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; + if (_velocity > 0) exitWith { _A = 0.000043917343795117; _M = 1.99978116283334; }; }; }; }; -if (_A != -1 && _M != -1 && _velocity > 0 && _velocity < 10000) then { - _result = _A * (_velocity ^ _M) / _dragCoefficient; - _result = _result / 3.2808399; +if (!isNil "_A" && !isNil "_M" && _velocity > 0 && _velocity < 10000) then { + (_A * (_velocity ^ _M) / _dragCoefficient) / 3.2808399 +} else { + 0 }; - -_result diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 9b205c3ec2..671ab2ccb0 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -13,33 +13,23 @@ * 6: barometric Pressure - hPA * * Return Value: - * 0: stability factor + * stability factor * * Public: No */ #include "script_component.hpp" -private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"]; -_caliber = _this select 0; -_bulletLength = _this select 1; -_bulletMass = _this select 2; -_barrelTwist = _this select 3; -_muzzleVelocity = _this select 4; -_temperature = _this select 5; -_barometricPressure = _this select 6; +private ["_twist", "_length", "_stabilityFactor"]; +params ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure"]; // Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf -_t = _barrelTwist / _caliber; -_l = _bulletLength / _caliber; +_twist = _barrelTwist / _caliber; +_length = _bulletLength / _caliber; -_stabilityFactor = 7587000 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); +_stabilityFactor = 7587000 * _bulletMass / (_twist^2 * _caliber^3 * _length * (1 + _length^2)); if (_muzzleVelocity > 341.376) then { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3); + (_stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure } else { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3); + (_stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3)) * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure }; - -_stabilityFactor = _stabilityFactor * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure; - -_stabilityFactor diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 1a4c344b2e..9debec1dc8 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -8,6 +8,8 @@ * * Return value: * None + * + * Public: No */ #include "script_component.hpp" @@ -15,8 +17,6 @@ #define __ctrl1 (__dsp displayCtrl 132950) #define __ctrl2 (__dsp displayCtrl 132951) -private ["_inclinationAngle", "_refPosition"]; - if (GVAR(Protractor)) exitWith { GVAR(Protractor) = false; 1 cutText ["", "PLAIN"]; @@ -32,30 +32,26 @@ EGVAR(weather,WindInfo) = false; GVAR(Protractor) = true; [{ + params ["","_idPFH"]; if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith { GVAR(Protractor) = false; 1 cutText ["", "PLAIN"]; - [_this select 1] call cba_fnc_removePerFrameHandler; + [_idPFH] call cba_fnc_removePerFrameHandler; }; - - _refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3]; - - _inclinationAngle = asin((ACE_player weaponDirection currentWeapon ACE_player) select 2); - _inclinationAngle = -58 max _inclinationAngle min 58; - + 1 cutRsc ["RscProtractor", "PLAIN", 1, false]; - + __ctrl1 ctrlSetScale 1; __ctrl1 ctrlCommit 0; __ctrl1 ctrlSetText QUOTE(PATHTOF(UI\protractor.paa)); __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; - + __ctrl2 ctrlSetScale 1; - __ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)]; + __ctrl2 ctrlSetPosition [SafeZoneX + 0.001, SafeZoneY + 0.001 - 0.0012 * (-58 max (asin((ACE_player weaponDirection currentWeapon ACE_player) select 2)) min 58), 0.2, 0.2 * 4/3]; __ctrl2 ctrlCommit 0; __ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); __ctrl2 ctrlSetTextColor [1, 1, 1, 1]; - + }, 0.1, []] call CBA_fnc_addPerFrameHandler; true diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf new file mode 100644 index 0000000000..2ae2bf2f9c --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -0,0 +1,47 @@ +/* + * Author: Glowbal, Ruthberg, joko // Jonas + * Handle the PFH for Bullets + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private "_deleted"; + + + +_deleted = 0; + +{ + private ["_bulletVelocity", "_bulletPosition", "_bulletSpeed"]; + _x params["_bullet","_caliber","_bulletTraceVisible","_index"]; + + _bulletVelocity = velocity _bullet; + + _bulletSpeed = vectorMagnitude _bulletVelocity; + + if (!alive _bullet || _bulletSpeed < 100) exitWith { + GVAR(allBullets) deleteAt (_forEachIndex - _deleted); + _deleted = _deleted + 1; + }; + + _bulletPosition = getPosASL _bullet; + + if (_bulletTraceVisible && _bulletSpeed > 500) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; + }; + + _aceTimeSecond = floor ACE_time; + call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]); +} forEach GVAR(allBullets); + +if (GVAR(allBullets) isEqualTo []) then { + [_this select 1] call CBA_fnc_removePerFrameHandler; + GVAR(BulletPFH) = nil; +}; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index db0140756d..74c16bdd47 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -13,28 +13,28 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; -_unit = _this select 0; -_weapon = _this select 1; -_mode = _this select 3; -_ammo = _this select 4; -_magazine = _this select 5; -_bullet = _this select 6; +// Early Quiting +if (!hasInterface) exitWith {}; +if (!GVAR(enabled)) exitWith {}; + +// Parameterization +private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; +params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; _abort = false; -if (!hasInterface) exitWith {}; -if (!alive _bullet) exitWith {}; -if (!GVAR(enabled)) exitWith {}; -if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; -if (underwater _unit) exitWith {}; + + if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if (!alive _bullet) exitWith {}; +if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; +if (underwater _unit) exitWith {}; if (!GVAR(simulateForEveryone) && !(local _unit)) then { // The shooter is non local _abort = true; @@ -56,34 +56,41 @@ if (_abort || !(GVAR(extensionAvailable))) exitWith { [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; +// Get Weapon and Ammo Configurations _AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; -if (isNil {_AmmoCacheEntry}) then { +if (isNil "_AmmoCacheEntry") then { _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; _WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; -if (isNil {_WeaponCacheEntry}) then { +if (isNil "_WeaponCacheEntry") then { _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; +_AmmoCacheEntry params ["_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable"]; +_WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; + + _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = [_WeaponCacheEntry select 2, _AmmoCacheEntry select 10, _AmmoCacheEntry select 11, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); - if (_muzzleVelocityShift != 0) then { - _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); - _bullet setVelocity _bulletVelocity; - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + _barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; + if (isNil "_barrelVelocityShift") then { + _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift]; }; }; if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); - _muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); + _temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); +}; + +if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { if (_muzzleVelocityShift != 0) then { + _muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; }; }; @@ -100,43 +107,22 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { }; }; -_caliber = _AmmoCacheEntry select 1; -_bulletLength = _AmmoCacheEntry select 2; -_bulletMass = _AmmoCacheEntry select 3; -_barrelTwist = _WeaponCacheEntry select 0; _stabilityFactor = 1.5; - if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { - _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); + if (isNil "_temperature") then { + _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); + }; _barometricPressure = ((getPosASL _bullet) select 2) call EFUNC(weather,calculateBarometricPressure); _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)]; +_aceTimeSecond = floor ACE_time; +"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(common,mapLatitude), EGVAR(weather,currentTemperature), EGVAR(common,mapAltitude), EGVAR(weather,currentHumidity), overcast, _aceTimeSecond, ACE_time - _aceTimeSecond]; -[{ - private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; - _args = _this select 0; - _bullet = _args select 0; - _caliber = _args select 1; - _bulletTraceVisible = _args select 2; - _index = _args select 3; - - _bulletVelocity = velocity _bullet; - _bulletPosition = getPosASL _bullet; - - _bulletSpeed = vectorMagnitude _bulletVelocity; - - if (!alive _bullet || _bulletSpeed < 100) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; - }; - - if (_bulletTraceVisible && _bulletSpeed > 500) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""]; - }; +GVAR(allBullets) pushBack [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]; - call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, floor(ACE_time), ACE_time - floor(ACE_time)]); - -}, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler; +if (isNil QGVAR(BulletPFH)) then { + GVAR(BulletPFH) = [FUNC(handleFirePFH), GVAR(simulationInterval), []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf index 186c0d0649..4898c51c10 100644 --- a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf +++ b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf @@ -8,17 +8,13 @@ * 2: activated * * Return Value: - * None + * None * * Public: No */ - #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic","_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index b2fc7ba084..53ac6aa874 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -3,10 +3,10 @@ * Initializes the advanced ballistics dll extension with terrain data * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -22,9 +22,9 @@ _initStartTime = ACE_time; _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { - if (GVAR(initMessageEnabled)) then { + #ifdef DEBUG_MODE_FULL systemChat "AdvancedBallistics: Terrain already initialized"; - }; + #endIf }; _mapGrids = ceil(_mapSize / 50) + 1; @@ -33,19 +33,16 @@ _gridCells = _mapGrids * _mapGrids; GVAR(currentGrid) = 0; [{ - private ["_args", "_mapGrids", "_gridCells", "_initStartTime"]; - _args = _this select 0; - _mapGrids = _args select 0; - _gridCells = _args select 1; - _initStartTime = _args select 2; - + params ["_args","_idPFH"]; + _args params ["_mapGrids", "_gridCells", "_initStartTime"]; + if (GVAR(currentGrid) >= _gridCells) exitWith { - if (GVAR(initMessageEnabled)) then { + #ifdef DEBUG_MODE_FULL systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; - }; - [_this select 1] call cba_fnc_removePerFrameHandler; + #endif + [_idPFH] call cba_fnc_removePerFrameHandler; }; - + for "_i" from 1 to 50 do { _x = floor(GVAR(currentGrid) / _mapGrids) * 50; _y = (GVAR(currentGrid) - floor(GVAR(currentGrid) / _mapGrids) * _mapGrids) * 50; @@ -57,5 +54,5 @@ GVAR(currentGrid) = 0; GVAR(currentGrid) = GVAR(currentGrid) + 1; if (GVAR(currentGrid) >= _gridCells) exitWith {}; }; - + }, 0, [_mapGrids, _gridCells, _initStartTime]] call CBA_fnc_addPerFrameHandler diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 10e7e60df2..9839c1dcc3 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -4,61 +4,53 @@ * Reads the ammo class config and updates the config cache * * Arguments: - * 0: ammo - classname + * ammo - classname * * Return Value: - * 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] + * 0: _airFriction + * 1: _caliber + * 2: _bulletLength + * 3: _bulletMass + * 4: _transonicStabilityCoef + * 5: _dragModel + * 6: _ballisticCoefficients + * 7: _velocityBoundaries + * 8: _atmosphereModel + * 9: _ammoTempMuzzleVelocityShifts + * 10: _muzzleVelocityTable + * 11: _barrelLengthTable * - * Return value: - * None + * Public: No */ #include "script_component.hpp" private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; -_ammo = _this; +_ammoConfig = configFile >> "CfgAmmo" >> _this; -_airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); -_caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); -_bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); -_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); -_transonicStabilityCoef = 0.5; -if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { - _transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); +_airFriction = getNumber(_ammoConfig >> "airFriction"); +_caliber = getNumber(_ammoConfig >> "ACE_caliber"); +_bulletLength = getNumber(_ammoConfig >> "ACE_bulletLength"); +_bulletMass = getNumber(_ammoConfig >> "ACE_bulletMass"); +_transonicStabilityCoef = getNumber(_ammoConfig >> "ACE_transonicStabilityCoef"); +if (_transonicStabilityCoef == 0) then { + _transonicStabilityCoef = 0.5; }; -_dragModel = 1; -_ballisticCoefficients = []; -_velocityBoundaries = []; -_atmosphereModel = "ICAO"; -if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then { - _dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel"); - if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { - _dragModel = 1; - }; +_dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); +if (_dragModel == 0 || !(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; }; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { - _ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); -}; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { - _velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); -}; -if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { - _atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); -}; -_ammoTempMuzzleVelocityShifts = []; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { - _ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); -}; -_muzzleVelocityTable = []; -_barrelLengthTable = []; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then { - _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities"); -}; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { - _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths"); +_ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); +_velocityBoundaries = getArray(_ammoConfig >> "ACE_velocityBoundaries"); +_atmosphereModel = getText(_ammoConfig >> "ACE_standardAtmosphere"); +if (_atmosphereModel isEqualTo "") then { + _atmosphereModel = "ICAO"; }; +_ammoTempMuzzleVelocityShifts = getArray(_ammoConfig >> "ACE_ammoTempMuzzleVelocityShifts"); +_muzzleVelocityTable = getArray(_ammoConfig >> "ACE_muzzleVelocities"); +_barrelLengthTable = getArray(_ammoConfig >> "ACE_barrelLengths"); _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; -uiNamespace setVariable [format[QGVAR(%1), _ammo], _result]; +uiNamespace setVariable [format[QGVAR(%1), _this], _result]; _result diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf index 8a1a29f7b0..8e13dc04dc 100644 --- a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -4,28 +4,28 @@ * Reads the weapon class config and updates the config cache * * Arguments: - * 0: weapon - classname + * weapon - classname * * Return Value: - * 0: [_barrelTwist, _twistDirection, _barrelLength] + * 0: _barrelTwist + * 1: _twistDirection + * 2: _barrelLength * - * Return value: - * None + * Public: No */ #include "script_component.hpp" -private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; -_weapon = _this; +private ["_weaponConfig", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; +_weaponConfig = (configFile >> "CfgWeapons" >> _this); -_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); +_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); _twistDirection = 1; -if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { - _twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); - if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { - _twistDirection = 1; - }; +_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection"); +if !(_twistDirection in [-1, 0, 1]) then { + _twistDirection = 1; }; -_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); + +_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); _result = [_barrelTwist, _twistDirection, _barrelLength]; diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md index 1049493f45..3db71ca51a 100644 --- a/addons/aircraft/README.md +++ b/addons/aircraft/README.md @@ -1,9 +1,10 @@ ace_aircraft ============ -Changes to air weaponry, flightmodels and HUDs. +Changes to air weaponry, flight models and HUDs. + +- Contributions by Kimi (geraldbolso1899) for HUD updates -* Contributations by Kimi (geraldbolso1899) for HUD updates ## Maintainers @@ -11,4 +12,4 @@ The people responsible for merging changes to this component or answering potent - [KoffeinFlummi](https://github.com/KoffeinFlummi) - [commy2](https://github.com/commy2) -- [jaynus](https://github.com/walterpearce) \ No newline at end of file +- [jaynus](https://github.com/walterpearce) diff --git a/addons/apl/README.md b/addons/apl/README.md new file mode 100644 index 0000000000..13b5f9d268 --- /dev/null +++ b/addons/apl/README.md @@ -0,0 +1,11 @@ +ace_apl +============ + +Assets licensed under Arma Public License (APL). + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- None diff --git a/addons/atragmx/CfgVehicles.hpp b/addons/atragmx/CfgVehicles.hpp index 2d85b39a4a..cc4a7880fe 100644 --- a/addons/atragmx/CfgVehicles.hpp +++ b/addons/atragmx/CfgVehicles.hpp @@ -21,7 +21,7 @@ class CfgVehicles { author = "Ruthberg"; scope = 2; scopeCurator = 2; - displayName = "ATragMX"; + displayName = CSTRING(Name); vehicleClass = "Items"; class TransportItems { MACRO_ADDITEM(ACE_ATragMX,1); diff --git a/addons/atragmx/README.md b/addons/atragmx/README.md index f68b38c4a3..1b68573051 100644 --- a/addons/atragmx/README.md +++ b/addons/atragmx/README.md @@ -3,8 +3,9 @@ ace_atragmx ATragMX - Handheld ballistics calculator + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index df71f9beb9..aad591581a 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -57,6 +57,6 @@ GVAR(DialogPFH) = [{ [_this select 1] call cba_fnc_removePerFrameHandler; }; __ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))]; -}, 60, []] call cba_fnc_addPerFrameHandler; +}, 60, []] call CBA_fnc_addPerFrameHandler; true diff --git a/addons/attach/README.md b/addons/attach/README.md index 5fb73d0645..3bce88839c 100644 --- a/addons/attach/README.md +++ b/addons/attach/README.md @@ -2,7 +2,9 @@ ace_attach ========== Introducing the ability to attach various throwables to yourself or vehicles, to mark your position and assist in IFF. -Adds item `ACE_IR_Strobe_Item`. + +#### Items Added: +`ACE_IR_Strobe_Item` ## Maintainers diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6738b3e8c8..bd363b1307 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -17,10 +17,10 @@ */ #include "script_component.hpp" -private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; - -PARAMS_3(_attachToVehicle,_unit,_args); -_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam; +private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"]; +params ["_attachToVehicle","_unit","_args"]; +_args params [["_itemClassname","", [""]]]; +TRACE_3("params",_attachToVehicle,_unit,_itemClassname); //Sanity Check (_unit has item in inventory, not over attach limit) if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");}; @@ -69,9 +69,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment [{ private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"]; - - PARAMS_2(_args,_pfID); - EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID); + params ["_args","_idPFH"]; + _args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"]; _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); if (cameraView == "EXTERNAL") then { @@ -88,7 +87,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment {!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { - [_pfID] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; [_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); diff --git a/addons/attach/functions/fnc_canAttach.sqf b/addons/attach/functions/fnc_canAttach.sqf index 18071092d5..20a49c09be 100644 --- a/addons/attach/functions/fnc_canAttach.sqf +++ b/addons/attach/functions/fnc_canAttach.sqf @@ -17,14 +17,14 @@ */ #include "script_component.hpp" -PARAMS_3(_attachToVehicle,_player,_args); +private ["_attachLimit", "_attachedObjects","_playerPos"]; +params ["_attachToVehicle","_player","_args"]; +_args params [["_itemClassname","", [""]]]; +TRACE_3("params",_attachToVehicle,_unit,_itemClassname); -private ["_itemName", "_attachLimit", "_attachedObjects","_playerPos"]; - -_itemName = [_args, 0, ""] call CBA_fnc_defaultParam; _attachLimit = [6, 1] select (_player == _attachToVehicle); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); -(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])}; +(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])}; diff --git a/addons/attach/functions/fnc_canDetach.sqf b/addons/attach/functions/fnc_canDetach.sqf index dc335e6bb6..ba3182ddea 100644 --- a/addons/attach/functions/fnc_canDetach.sqf +++ b/addons/attach/functions/fnc_canDetach.sqf @@ -16,9 +16,9 @@ */ #include "script_component.hpp" -PARAMS_2(_attachToVehicle,_unit); - private ["_attachedObjects", "_inRange"]; +params ["_attachToVehicle", "_unit"]; +TRACE_2("params",_attachToVehicle,_unit); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index 92df83b5c1..98f482f17b 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -16,15 +16,16 @@ */ #include "script_component.hpp" -PARAMS_2(_attachToVehicle,_unit); - -private ["_attachedObjects", "_attachedItems", "_itemDisplayName"]; +private ["_attachedObjects", "_attachedItems", "_itemDisplayName", + "_attachedObject", "_attachedIndex", "_itemName", "_minDistance", + "_unitPos", "_objectPos" +]; +params ["_attachToVehicle","_unit"], +TRACE_2("params",_attachToVehicle,_unit); _attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []]; _attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []]; -private ["_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_unitPos", "_objectPos"]; - _attachedObject = objNull; _attachedIndex = -1; _itemName = ""; diff --git a/addons/attach/functions/fnc_getChildrenAttachActions.sqf b/addons/attach/functions/fnc_getChildrenAttachActions.sqf index fb432146be..aeb75c00d4 100644 --- a/addons/attach/functions/fnc_getChildrenAttachActions.sqf +++ b/addons/attach/functions/fnc_getChildrenAttachActions.sqf @@ -18,7 +18,8 @@ #include "script_component.hpp" private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"]; -PARAMS_2(_target,_player); +params ["_target","_player"]; +TRACE_2("params",_target,_player); _listed = []; _actions = []; @@ -30,7 +31,7 @@ _actions = []; if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; @@ -43,7 +44,7 @@ _actions = []; if (getText (_item >> "ACE_Attachable") != "") then { _displayName = getText(_item >> "displayName"); _picture = getText(_item >> "picture"); - _action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); + _action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _target]; }; }; diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index efd85769d0..0656e7880f 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -27,7 +27,8 @@ private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"]; -PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); +params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"]; +TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition); _startingOffset = _attachToVehicle worldToModel _startingPosition; diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index 299a1575ac..cfbebd33ab 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -5,7 +5,7 @@ Attach item >> Gegenstand befestigen >> Acoplar objeto >> - Przyczep przedmiot >> + Przyczep >> Attacher l'objet >> Připnout předmět >> Fixar item >> @@ -185,7 +185,7 @@ %1<br/>Attached %1<br/>befestigt %1<br/>acoplada - %1<br/>przyczepiono + Przyczepiono<br/>%1 %1<br/>attachée %1<br/>Připnutý %1<br/>Fixada @@ -197,7 +197,7 @@ %1<br/>Detached %1<br/>entfernt %1<br/>quitada - %1<br/>odczepiono + Odczepiono<br/>%1 %1<br/>détachée %1<br/>Odepnutý %1<br/>Separada @@ -206,4 +206,4 @@ %1<br/>отсоединен(-а) - + \ No newline at end of file diff --git a/addons/backpacks/README.md b/addons/backpacks/README.md index 6fa54a9897..64e37f337b 100644 --- a/addons/backpacks/README.md +++ b/addons/backpacks/README.md @@ -1,7 +1,8 @@ ace_backpacks ================= -Adds indication when someone else opens your backpack (soundeffect / camShake). +Adds indication when someone else opens your backpack (sound effect and camera shake). + ## Maintainers diff --git a/addons/backpacks/XEH_postInit.sqf b/addons/backpacks/XEH_postInit.sqf index 375fcd5f89..639bf74919 100644 --- a/addons/backpacks/XEH_postInit.sqf +++ b/addons/backpacks/XEH_postInit.sqf @@ -1,3 +1,3 @@ #include "script_component.hpp" -["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler); +["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler); diff --git a/addons/backpacks/functions/fnc_backpackOpened.sqf b/addons/backpacks/functions/fnc_backpackOpened.sqf index 3f5cf53994..9488bf6bd9 100644 --- a/addons/backpacks/functions/fnc_backpackOpened.sqf +++ b/addons/backpacks/functions/fnc_backpackOpened.sqf @@ -2,18 +2,18 @@ * Author: commy2 * * Someone opened your backpack. Execute locally. - * + * * Argument: * 0: Who accessed your inventory? (Object) * 1: Unit that wields the backpack (Object) * 2: The backpack object (Object) - * + * * Return value: * None. */ #include "script_component.hpp" - -PARAMS_3(_unit,_target,_backpack); +private ["_sounds", "_position"]; +params ["_target", "_backpack"]; // do cam shake if the target is the player if ([_target] call EFUNC(common,isPlayer)) then { @@ -21,7 +21,6 @@ if ([_target] call EFUNC(common,isPlayer)) then { }; // play a rustling sound -private ["_sounds", "_position"]; _sounds = [ /*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss", diff --git a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf index 562dc84da2..85f5966aa9 100644 --- a/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf +++ b/addons/backpacks/functions/fnc_getBackpackAssignedUnit.sqf @@ -2,21 +2,21 @@ * Author: commy2 * * Returns the unit that has the given backpack object equipped. - * + * * Argument: - * 0: A backpack object (Object) - * + * 0: Executing Unit (Object) + * 1: A backpack object (Object) + * * Return value: * Unit that has the backpack equipped. (Object) */ #include "script_component.hpp" +scopeName "main"; -private ["_backpack", "_unit"]; - -_backpack = _this select 0; - -_unit = objNull; +params ["_unit","_backpack"]; +_target = objNull; { - if (backpackContainer _x == _backpack) exitWith {_unit = _x}; -} forEach (allUnits + allDeadMen); -_unit + if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"}; +} count nearestObjects [_unit, ["Man"], 5]; +if (isNull _target) exitWith {ACE_Player}; +_target diff --git a/addons/backpacks/functions/fnc_isBackpack.sqf b/addons/backpacks/functions/fnc_isBackpack.sqf index b1d55f9ce6..3419d2ed38 100644 --- a/addons/backpacks/functions/fnc_isBackpack.sqf +++ b/addons/backpacks/functions/fnc_isBackpack.sqf @@ -11,9 +11,8 @@ */ #include "script_component.hpp" -private ["_backpack", "_config"]; - -_backpack = _this select 0; +private ["_config"]; +params ["_backpack"]; if (typeName _backpack == "OBJECT") then { _backpack = typeOf _backpack; diff --git a/addons/backpacks/functions/fnc_onOpenInventory.sqf b/addons/backpacks/functions/fnc_onOpenInventory.sqf index 63e4aa87a3..d79f8aed9b 100644 --- a/addons/backpacks/functions/fnc_onOpenInventory.sqf +++ b/addons/backpacks/functions/fnc_onOpenInventory.sqf @@ -2,29 +2,27 @@ * Author: commy2 * * Handle the open inventory event. Display message on traget client. - * + * * Argument: * Input from "InventoryOpened" eventhandler - * + * * Return value: * false. Always open the inventory dialog. (Bool) */ #include "script_component.hpp" -private ["_unit", "_backpack"]; - -_unit = _this select 0; -_backpack = _this select 1; +private "_target"; +params ["","_backpack"]; // exit if the target is not a backpack if !([_backpack] call FUNC(isBackpack)) exitWith {}; // get the unit that wears the backpack object -private "_target"; -_target = [_backpack] call FUNC(getBackpackAssignedUnit); +_target = _this call FUNC(getBackpackAssignedUnit); +if (isNull _target) exitWith {false}; // raise event on target unit -["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent); +["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent); // return false to open inventory as usual false diff --git a/addons/ballistics/README.md b/addons/ballistics/README.md index ac727f83c6..18d81bceb3 100644 --- a/addons/ballistics/README.md +++ b/addons/ballistics/README.md @@ -3,10 +3,11 @@ ace_ballistics Changes to weapon, magazine and ammunition values. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) +- [Ruthberg](http://github.com/Ulteq) - [KoffeinFlummi](https://github.com/KoffeinFlummi) - [commy2](https://github.com/commy2) diff --git a/addons/ballistics/scripts/initTargetWall.sqf b/addons/ballistics/scripts/initTargetWall.sqf index 391faaa82e..d9b16eec10 100644 --- a/addons/ballistics/scripts/initTargetWall.sqf +++ b/addons/ballistics/scripts/initTargetWall.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_wall", "_paper"]; +private "_paper"; -_wall = _this select 0; +params ["_wall"]; if (local _wall) then { _paper = "UserTexture_1x2_F" createVehicle position _wall; diff --git a/addons/captives/ACE_Settings.hpp b/addons/captives/ACE_Settings.hpp index 73bafbab41..1d0ebbf491 100644 --- a/addons/captives/ACE_Settings.hpp +++ b/addons/captives/ACE_Settings.hpp @@ -5,6 +5,13 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(requireSurrender) { + displayName = CSTRING(ModuleSettings_requireSurrender_name); + description = CSTRING(ModuleSettings_requireSurrender_description); + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), CSTRING(SurrenderOnly), CSTRING(SurrenderOrNoWeapon)}; + value = 1; + }; class GVAR(allowSurrender) { displayName = CSTRING(ModuleSettings_allowSurrender_name); description = CSTRING(ModuleSettings_allowSurrender_description); diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 746a1c4b63..774ecf87e3 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -189,6 +189,26 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class requireSurrender { + displayName = CSTRING(ModuleSettings_requireSurrender_name); + description = CSTRING(ModuleSettings_requireSurrender_description); + typeName = "NUMBER"; + class values { + class disable { + name = ECSTRING(common,No); + value = 0; + }; + class Surrender { + name = CSTRING(SurrenderOnly); + value = 1; + default = 1; + }; + class SurrenderOrNoWeapon { + name = CSTRING(SurrenderOrNoWeapon); + value = 2; + }; + }; + }; }; class ModuleDescription: ModuleDescription { description = CSTRING(ModuleSettings_Description); diff --git a/addons/captives/README.md b/addons/captives/README.md index 3938720f08..37c26db159 100644 --- a/addons/captives/README.md +++ b/addons/captives/README.md @@ -1,10 +1,10 @@ ace_captives ============ -Allows taking people captive/handcuffed +Adds ability to handcuff and surrender. -####Items: -`ACE_CableTie` - adds ability to take someone captive +#### Items Added: +`ACE_CableTie` ## Maintainers diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index e42b5455ff..5e7eb34a76 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -16,11 +16,11 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Check sides, Player has cableTie, target is alive and not already handcuffed (GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) && ("ACE_CableTie" in (items _unit)) && {alive _target} && -{!(_target getVariable [QGVAR(isHandcuffed), false])} +{!(_target getVariable [QGVAR(isHandcuffed), false])} && +(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2))) diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 1d9480fd0b..a7c799905e 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); - +params ["_unit", "_target"]; //Alive, handcuffed, not being escored, and not unconscious (_target getVariable [QGVAR(isHandcuffed), false]) && diff --git a/addons/captives/functions/fnc_canFriskPerson.sqf b/addons/captives/functions/fnc_canFriskPerson.sqf index 5eecc453d4..d164f13ac3 100644 --- a/addons/captives/functions/fnc_canFriskPerson.sqf +++ b/addons/captives/functions/fnc_canFriskPerson.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; _target getVariable [QGVAR(isHandcuffed), false] || {_target getVariable [QGVAR(isSurrendering), false]} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 04b33ad42d..0e028ac1ec 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -18,8 +18,7 @@ #include "script_component.hpp" private ["_objects"]; - -PARAMS_3(_unit,_target,_vehicle); +params ["_unit", "_target","_vehicle"]; if (isNull _target) then { _objects = attachedObjects _unit; @@ -28,7 +27,7 @@ if (isNull _target) then { }; if (isNull _vehicle) then { - _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship_F"], 10]; + _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; if ((count _objects) > 0) then {_vehicle = _objects select 0;}; }; diff --git a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf index 4642cd90fd..e8bbe3b50e 100644 --- a/addons/captives/functions/fnc_canRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_canRemoveHandcuffs.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; //Unit is handcuffed and not currently being escorted _target getVariable [QGVAR(isHandcuffed), false] && diff --git a/addons/captives/functions/fnc_canStopEscorting.sqf b/addons/captives/functions/fnc_canStopEscorting.sqf index 56065a43fc..cfafb5a0e8 100644 --- a/addons/captives/functions/fnc_canStopEscorting.sqf +++ b/addons/captives/functions/fnc_canStopEscorting.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); -DEFAULT_PARAM(1,_target,objNull); +params ["_unit", ["_target", objNull]]; if (isNull _target) then { _target = _unit getVariable [QGVAR(escortedUnit), objNull]; diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 059fb98d03..de0a88d871 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -16,12 +16,12 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_newSurrenderState); - private "_returnValue"; +params ["_unit", "_newSurrenderState"]; + _returnValue = if (_newSurrenderState) then { - //no weapon equiped AND not currently surrendering and + //no weapon equiped AND not currently surrendering and GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { //is Surrendering diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index 59e798a24c..6bd98cf4eb 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -18,6 +18,6 @@ private ["_cargo"]; -PARAMS_2(_player,_unit); +params ["_player", "_unit"]; ((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doApplyHandcuffs.sqf b/addons/captives/functions/fnc_doApplyHandcuffs.sqf index 0d15f503e8..21bfe58747 100644 --- a/addons/captives/functions/fnc_doApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_doApplyHandcuffs.sqf @@ -16,10 +16,11 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); -_unit removeItem "ACE_CableTie"; +params ["_unit", "_target"]; playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10]; ["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent); + +_unit removeItem "ACE_CableTie"; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index bc2cd97ffd..bb070b057a 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_state); +params ["_unit", "_target","_state"]; if (_state) then { if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {}; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index d79c88a5fb..e14025b88f 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -19,6 +19,7 @@ private ["_weapon", "_listedItemClasses", "_actions", "_allGear"]; PARAMS_2(_player,_unit); +params ["_player", "_unit"]; _weapon = currentWeapon _player; if (_weapon == primaryWeapon _player && {_weapon != ""}) then { diff --git a/addons/captives/functions/fnc_doLoadCaptive.sqf b/addons/captives/functions/fnc_doLoadCaptive.sqf index 97ecd98a0a..d7df42eb0a 100644 --- a/addons/captives/functions/fnc_doLoadCaptive.sqf +++ b/addons/captives/functions/fnc_doLoadCaptive.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_unit,_target,_vehicle); private "_objects"; +params ["_unit", "_target","_vehicle"]; + if (isNull _target) then { _objects = attachedObjects _unit; _objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); @@ -28,7 +29,7 @@ if (isNull _target) then { if (isNull _target) exitWith {}; if (isNull _vehicle) then { - _objects = nearestObjects [_unit, ["Car_F", "Tank_F", "Helicopter_F", "Boat_F", "Plane_F"], 10]; + _objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10]; if ((count _objects) > 0) then {_vehicle = _objects select 0;}; }; if (isNull _vehicle) exitWith {}; diff --git a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf index a69decf620..681b698de3 100644 --- a/addons/captives/functions/fnc_doRemoveHandcuffs.sqf +++ b/addons/captives/functions/fnc_doRemoveHandcuffs.sqf @@ -15,6 +15,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index 5d95189742..46ba618010 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_handleGetIn.sqf b/addons/captives/functions/fnc_handleGetIn.sqf index cf7d2c7271..487e7d4179 100644 --- a/addons/captives/functions/fnc_handleGetIn.sqf +++ b/addons/captives/functions/fnc_handleGetIn.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if (local _unit) then { if (_unit getVariable [QGVAR(isEscorting), false]) then { diff --git a/addons/captives/functions/fnc_handleGetOut.sqf b/addons/captives/functions/fnc_handleGetOut.sqf index 4bf9a1fa19..daf88b7e34 100644 --- a/addons/captives/functions/fnc_handleGetOut.sqf +++ b/addons/captives/functions/fnc_handleGetOut.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_3(_vehicle,_dontcare,_unit); +params ["_vehicle", "_dontcare","_unit"]; if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then { private ["_cargoIndex"]; diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 3eed932d5a..f7b15ec117 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_oldUnit); +params ["_oldUnit"]; if (!local _oldUnit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf index 9aa4856204..ca6362d3da 100644 --- a/addons/captives/functions/fnc_handleOnUnconscious.sqf +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_isUnconc); +params ["_unit","_isUnconc"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handlePlayerChanged.sqf b/addons/captives/functions/fnc_handlePlayerChanged.sqf index 21fd1e1ec3..aea91b5e11 100644 --- a/addons/captives/functions/fnc_handlePlayerChanged.sqf +++ b/addons/captives/functions/fnc_handlePlayerChanged.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_newUnit,_oldUnit); +params ["_newUnit","_oldUnit"]; //set showHUD based on new unit status: if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 02888c27a0..6f68aea2fe 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_dead); +params ["_unit","_dead"]; if (!local _unit) exitWith {}; diff --git a/addons/captives/functions/fnc_handleUnitInitPost.sqf b/addons/captives/functions/fnc_handleUnitInitPost.sqf index a8b601300a..66cbcff794 100644 --- a/addons/captives/functions/fnc_handleUnitInitPost.sqf +++ b/addons/captives/functions/fnc_handleUnitInitPost.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; // prevent players from throwing grenades (added to all units) [_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler); diff --git a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf index 84b90e78c2..7b30199caf 100644 --- a/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf +++ b/addons/captives/functions/fnc_handleZeusDisplayChanged.sqf @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_zeusIsOpen); +params ["_unit","_zeusIsOpen"]; //set showHUD based on unit status: if (!_zeusIsOpen) then { diff --git a/addons/captives/functions/fnc_moduleSettings.sqf b/addons/captives/functions/fnc_moduleSettings.sqf index c12ac80b99..fc8c76721f 100644 --- a/addons/captives/functions/fnc_moduleSettings.sqf +++ b/addons/captives/functions/fnc_moduleSettings.sqf @@ -13,7 +13,8 @@ #include "script_component.hpp" -PARAMS_1(_logic); +params ["_logic"]; [_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(requireSurrender), "requireSurrender"] call EFUNC(common,readSettingFromModule); diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index 5b40b7663e..64c80af35c 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -17,9 +17,10 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); private ["_bisMouseOver", "_mouseOverObject"]; +params ["_logic", "_units", "_activated"]; + if (!_activated) exitWith {}; if (local _logic) then { diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index bd141988bb..9bde3b399d 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running setHandcuffed on remote unit"); @@ -43,7 +42,7 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ - PARAMS_1(_unit); + params ["_unit"]; if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index c1a34b636c..4fad2d3853 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -16,8 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_state); - +params ["_unit","_state"]; if (!local _unit) exitwith { ERROR("running surrender on remote unit"); diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf index 626a0b34e4..7e30fe4af4 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf @@ -16,10 +16,10 @@ */ #include "script_component.hpp" -PARAMS_2(_target,_vehicle); - private ["_cargoIndex"]; +params ["_target","_vehicle"]; + _target moveInCargo _vehicle; _target assignAsCargo _vehicle; _cargoIndex = _vehicle getCargoIndex _target; diff --git a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf index 5ef6f01406..000d5ef568 100644 --- a/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf +++ b/addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf @@ -15,8 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_unit); - +params ["_unit"]; _unit setVariable [QGVAR(CargoIndex), -1, true]; moveOut _unit; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 39cf65cac7..08982b7277 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -221,5 +221,21 @@ Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben Jogadores podem se render depois de guardar sua arma + + Require surrendering + Wymagaj kapitulacji + + + Require Players to surrender before they can be arrested + Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować + + + Surrendering only + Tylko kapitulacja + + + Surrendering or No weapon + Kapitulacja lub brak broni + - + \ No newline at end of file diff --git a/addons/cargo/$PBOPREFIX$ b/addons/cargo/$PBOPREFIX$ new file mode 100644 index 0000000000..74e5e4186e --- /dev/null +++ b/addons/cargo/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\cargo \ No newline at end of file diff --git a/addons/cargo/ACE_Settings.hpp b/addons/cargo/ACE_Settings.hpp new file mode 100644 index 0000000000..574000155e --- /dev/null +++ b/addons/cargo/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(enable) { + displayName = CSTRING(ModuleSettings_enable); + description = CSTRING(ModuleSettings_enable_Description); + typeName = "BOOL"; + value = 1; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; +}; diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp new file mode 100644 index 0000000000..15aaaadad6 --- /dev/null +++ b/addons/cargo/CfgEventHandlers.hpp @@ -0,0 +1,103 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Killed_EventHandlers { + class All { + init = QUOTE(call FUNC(handleDestroyed)); + }; +}; + +class Extended_Init_EventHandlers { + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + + class ReammoBox_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + + class Cargo_base_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); + }; + }; + + class CargoNet_01_box_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); + }; + }; + + class Land_CargoBox_V1_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); + }; + }; + + class Land_PaperBox_closed_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); + }; + }; + + class Car { + class ADDON { + init = QUOTE(_this call DFUNC(initVehicle)); + }; + }; + + class Tank { + class ADDON { + init = QUOTE(_this call DFUNC(initVehicle)); + }; + }; + + class Helicopter { + class ADDON { + init = QUOTE(_this call DFUNC(initVehicle)); + }; + }; + + class Plane { + class ADDON { + init = QUOTE(_this call DFUNC(initVehicle)); + }; + }; + + class Ship_F { + class ADDON { + init = QUOTE(_this call DFUNC(initVehicle)); + }; + }; + + class ACE_RepairItem_Base { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + + class ACE_bodyBagObject { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + + class ACE_ConcertinaWireCoil { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; +}; diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp new file mode 100644 index 0000000000..25bd441b90 --- /dev/null +++ b/addons/cargo/CfgVehicles.hpp @@ -0,0 +1,294 @@ +class CfgVehicles { + class ACE_Module; + class ACE_moduleCargoSettings: ACE_Module { + scope = 2; + displayName = CSTRING(SettingsModule_DisplayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_Cargo_ca.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleSettings); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class enable { + displayName = CSTRING(ModuleSettings_enable); + description = CSTRING(ModuleSettings_enable_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(SettingsModule_Description); + sync[] = {}; + }; + }; + + + class LandVehicle; + class Car: LandVehicle { + GVAR(space) = 4; + GVAR(hasCargo) = 1; + class ACE_Cargo { + /* + class Cargo { + class ACE_medicalSupplyCrate { + type = "ACE_medicalSupplyCrate"; + amount = 1; + }; + };*/ + }; + }; + class Tank: LandVehicle { + GVAR(space) = 4; + GVAR(hasCargo) = 1; + }; + + class Car_F; + class Truck_F: Car_F { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + + class Air; + class Helicopter: Air { + GVAR(space) = 8; + GVAR(hasCargo) = 1; + }; + class Heli_Transport_02_base_F; + class I_Heli_Transport_02_F : Heli_Transport_02_base_F { + GVAR(space) = 20; + GVAR(hasCargo) = 1; + }; + class Plane: Air { + GVAR(space) = 4; + GVAR(hasCargo) = 1; + }; + + class Ship; + class Ship_F: Ship { + GVAR(space) = 4; + GVAR(hasCargo) = 1; + }; + + // Static weapons + class StaticWeapon: LandVehicle { + GVAR(size) = 2; // 1 = small, 2 = large + GVAR(canLoad) = 1; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + GVAR(size) = 2; // 1 = small, 2 = large + GVAR(canLoad) = 1; + }; + + // Ammo boxes + class ThingX; + class ReammoBox_F: ThingX { + GVAR(size) = 2; // 1 = small, 2 = large + GVAR(canLoad) = 1; + }; + + class Scrapyard_base_F; + class Land_PaperBox_closed_F: Scrapyard_base_F { + GVAR(space) = 10; + GVAR(hasCargo) = 1; + GVAR(size) = 11; + GVAR(canLoad) = 1; + XEH_ENABLED; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + distance = 5; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = ""; + }; + }; + }; + + class Cargo_base_F: ThingX { + GVAR(space) = 4; + GVAR(hasCargo) = 1; + GVAR(size) = 4; + GVAR(canLoad) = 1; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + distance = 5; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = ""; + }; + }; + }; + class Cargo10_base_F: Cargo_base_F { + GVAR(space) = 14; + GVAR(size) = 15; + XEH_ENABLED; + }; + class Land_Cargo20_blue_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_brick_red_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_cyan_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_grey_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_light_blue_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_light_green_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_military_green_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Ruins_F; + class Land_Cargo20_military_ruins_F: Ruins_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_orange_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_red_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_sand_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_vr_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_white_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + class Land_Cargo20_yellow_F: Cargo_base_F { + GVAR(space) = 49; + GVAR(size) = 50; + XEH_ENABLED; + }; + + + class Land_Cargo40_blue_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_brick_red_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_cyan_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_grey_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_light_blue_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_light_green_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_military_green_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_military_ruins_F: Ruins_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_orange_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_red_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_sand_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_vr_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_white_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + class Land_Cargo40_yellow_F: Cargo_base_F { + GVAR(space) = 99; + GVAR(size) = 100; + XEH_ENABLED; + }; + // small + class Land_CargoBox_V1_F: ThingX { + GVAR(space) = 7; + GVAR(hasCargo) = 1; + GVAR(size) = 7; + XEH_ENABLED; + class ACE_Actions { + class ACE_MainActions { + displayName = ECSTRING(interaction,MainAction); + distance = 5; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = ""; + }; + }; + }; + +}; diff --git a/addons/cargo/README.md b/addons/cargo/README.md new file mode 100644 index 0000000000..eda7079b7b --- /dev/null +++ b/addons/cargo/README.md @@ -0,0 +1,12 @@ +ace_cargo +============ + +Adds cargo menu to vehicles and allows loading and unloading of cargo items. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/cargo/UI/Icon_Module_Cargo_ca.paa b/addons/cargo/UI/Icon_Module_Cargo_ca.paa new file mode 100644 index 0000000000..a292fb4227 Binary files /dev/null and b/addons/cargo/UI/Icon_Module_Cargo_ca.paa differ diff --git a/addons/cargo/UI/Icon_load.paa b/addons/cargo/UI/Icon_load.paa new file mode 100644 index 0000000000..ccd77761e4 Binary files /dev/null and b/addons/cargo/UI/Icon_load.paa differ diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf new file mode 100644 index 0000000000..6501044c9d --- /dev/null +++ b/addons/cargo/XEH_postInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler); +["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler); +["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf new file mode 100644 index 0000000000..8924cacfd5 --- /dev/null +++ b/addons/cargo/XEH_preInit.sqf @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addCargoItem); +PREP(canLoad); +PREP(canLoadItemIn); +PREP(canUnloadItem); +PREP(findNearestVehicle); +PREP(getCargoSpaceLeft); +PREP(getSizeItem); +PREP(handleDestroyed); +PREP(initObject); +PREP(initVehicle); +PREP(loadItem); +PREP(moduleSettings); +PREP(onMenuOpen); +PREP(startLoadIn); +PREP(startUnload); +PREP(unloadItem); +PREP(validateCargoSpace); + +GVAR(initializedItemClasses) = []; + +ADDON = true; diff --git a/addons/cargo/config.cpp b/addons/cargo/config.cpp new file mode 100644 index 0000000000..1aefa49616 --- /dev/null +++ b/addons/cargo/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"commy2", "Glowbal"}; + authorUrl = "https://ace3mod.com/"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "menu.hpp" diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf new file mode 100644 index 0000000000..1233d0228d --- /dev/null +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -0,0 +1,38 @@ +/* + * Author: Glowbal, Jonpas + * Adds a cargo item to the vehicle. + * + * Arguments: + * 0: Item Classname + * 1: Vehicle + * 2: Amount (default: 1) + * + * Return Value: + * None + * + * Example: + * ["item", vehicle] call ace_cargo_fnc_addCargoItem + * + * Public: No + */ +#include "script_component.hpp" + +private ["_position", "_item", "_i"]; +params ["_itemClass", "_vehicle", ["_amount", 1]]; +TRACE_3("params",_itemClass,_vehicle,_amount); + +_position = getPos _vehicle; +_position set [1, (_position select 1) + 1]; +_position set [2, (_position select 2) + 7.5]; + +for "_i" from 1 to _amount do { + _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; + + // Load item or delete it if no space left + if !([_item, _vehicle] call FUNC(loadItem)) exitWith { + deleteVehicle _item; + }; + + // Invoke listenable event + ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); +}; diff --git a/addons/cargo/functions/fnc_canLoad.sqf b/addons/cargo/functions/fnc_canLoad.sqf new file mode 100644 index 0000000000..f5d1304a95 --- /dev/null +++ b/addons/cargo/functions/fnc_canLoad.sqf @@ -0,0 +1,34 @@ +/* + * Author: Glowbal + * Check if player can load an item into the nearest vehicle. + * + * Arguments: + * 0: Player + * 1: Object to load + * + * Return value: + * Can load + * + * Example: + * [player, object] call ace_cargo_fnc_canLoad + * + * Public: No + */ +#include "script_component.hpp" + +params ["_player", "_object"]; + +if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false}; + +private ["_nearestVehicle"]; +_nearestVehicle = [_player] call FUNC(findNearestVehicle); + +if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then { + { + if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; + } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); +}; + +if (isNull _nearestVehicle) exitWith {false}; + +[_object, _nearestVehicle] call FUNC(canLoadItemIn) diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf new file mode 100644 index 0000000000..8cfe9e194b --- /dev/null +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -0,0 +1,29 @@ +/* + * Author: Glowbal + * Check if item can be loaded into other Object. + * + * Arguments: + * 0: Item Object + * 1: Holder Object (Vehicle) + * + * Return value: + * Can load in + * + * Example: + * [item, holder] call ace_cargo_fnc_canLoadItemIn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_item", "_vehicle"]; + +if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; + +private "_itemSize"; +_itemSize = ([_item] call FUNC(getSizeItem)); + +(_itemSize > 0) && +{alive _item && alive _vehicle} && +{(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && +{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf new file mode 100644 index 0000000000..779a7533a9 --- /dev/null +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -0,0 +1,44 @@ +/* + * Author: Glowbal, ViperMaul + * Check if item can be unloaded. + * + * Arguments: + * 0: loaded Object + * 1: Object + * + * Return value: + * Can be unloaded + * + * Example: + * [item, holder] call ace_cargo_fnc_canUnloadItem + * + * Public: No + */ +#include "script_component.hpp" + +private ["_loaded", "_validVehiclestate", "_emptyPos"]; + +params ["_item", "_vehicle"]; + +_loaded = _vehicle getVariable [QGVAR(loaded), []]; +if !(_item in _loaded) exitWith {false}; + +_validVehiclestate = true; +_emptyPos = []; +if (_vehicle isKindOf "Ship" ) then { + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. +} else { + if (_vehicle isKindOf "Air" ) then { + if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; + _emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition); + _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; + } else { + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); + }; +}; + +if (!_validVehiclestate) exitWith {false}; + +(count _emptyPos != 0) diff --git a/addons/cargo/functions/fnc_findNearestVehicle.sqf b/addons/cargo/functions/fnc_findNearestVehicle.sqf new file mode 100644 index 0000000000..c0ec154d47 --- /dev/null +++ b/addons/cargo/functions/fnc_findNearestVehicle.sqf @@ -0,0 +1,37 @@ +/* + * Author: Glowbal + * Get nearest vehicle from unit, priority: Car-Air-Tank-Ship. + * + * Arguments: + * 0: Unit + * + * Return value: + * Vehicle in Distance + * + * Example: + * [unit] call ace_cargo_fnc_findNearestVehicle + * + * Public: No + */ +#include "script_component.hpp" + +private ["_loadCar", "_loadHelicopter", "_loadTank", "_loadShip", "_loadContainer"]; + +params ["_unit"]; + +_loadCar = nearestObject [_unit, "car"]; +if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitWith {_loadCar}; + +_loadHelicopter = nearestObject [_unit, "air"]; +if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitWith {_loadHelicopter}; + +_loadTank = nearestObject [_unit, "tank"]; +if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitWith {_loadTank}; + +_loadShip = nearestObject [_unit, "ship"]; +if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitWith {_loadShip}; + +_loadContainer = nearestObject [_unit,"Cargo_base_F"]; +if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitWith {_loadContainer}; + +objNull diff --git a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf new file mode 100644 index 0000000000..cae27a2d58 --- /dev/null +++ b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf @@ -0,0 +1,20 @@ +/* + * Author: Glowbal + * Get the cargo space left on object. + * + * Arguments: + * 0: Object + * + * Return value: + * Cargo space left + * + * Example: + * [object] call ace_cargo_fnc_getCargoSpaceLeft + * + * Public: No + */ +#include "script_component.hpp" + +params ["_object"]; + +_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _object >> QGVAR(space))] diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf new file mode 100644 index 0000000000..dacd6a4982 --- /dev/null +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -0,0 +1,28 @@ +/* + * Author: Glowbal + * Get the cargo size of an object. + * + * Arguments: + * 0: Object + * + * Return value: + * Cargo size (default: -1) + * + * Example: + * [object] call ace_cargo_fnc_getSizeItem + * + * Public: No + */ +#include "script_component.hpp" + +private "_config"; + +params ["_item"]; + +_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); + +if (isNumber (_config)) exitWith { + _item getVariable [QGVAR(size), getNumber (_config)] +}; + +-1 diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf new file mode 100644 index 0000000000..c11dd3bfad --- /dev/null +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -0,0 +1,31 @@ +/* + * Author: Glowbal + * Handle object being destroyed. + * + * Arguments: + * 0: Object + * + * Return value: + * None + * + * Example: + * [object] call ace_cargo_fnc_handleDestroyed + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; + +private["_loaded"]; + +_loaded = _vehicle getVariable [QGVAR(loaded), []]; +if (count _loaded == 0) exitWith {}; + +{ + // TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment? + deleteVehicle _x; + //_x setDamage 1; +} count _loaded; + +[_vehicle] call FUNC(validateCargoSpace); diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf new file mode 100644 index 0000000000..f9b48b19e1 --- /dev/null +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -0,0 +1,30 @@ +/* + * Author: Glowbal + * Initializes variables for loadable objects. Called from init EH. + * + * Arguments: + * 0: Object + * + * Return value: + * None + * + * Example: + * [object] call ace_cargo_fnc_initObject + * + * Public: No + */ +#include "script_component.hpp" + +params ["_object"]; + +if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canLoad)) != 1) exitWith {}; + +private ["_type", "_action"]; +_type = typeOf _object; + +// do nothing if the class is already initialized +if (_type in GVAR(initializedItemClasses)) exitWith {}; +GVAR(initializedItemClasses) pushBack _type; + +_action = [QGVAR(load), localize LSTRING(loadObject), QUOTE(PATHTOF(UI\Icon_load.paa)), {[_player, _target] call FUNC(startLoadIn)}, {GVAR(enable) && {[_player, _target] call FUNC(canLoad)}}] call EFUNC(interact_menu,createAction); +[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf new file mode 100644 index 0000000000..b817688336 --- /dev/null +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -0,0 +1,51 @@ +/* + * Author: Glowbal + * Initializes vehicle, adds open cargo menu action if available. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [vehicle] call ace_cargo_fnc_initVehicle + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params", _vehicle); + +private ["_type", "_initializedClasses"]; +_type = typeOf _vehicle; +_initializedClasses = GETMVAR(GVAR(initializedClasses),[]); + +if (isServer) then { + { + if (isClass _x) then { + ["AddCargoByClass", [getText (_x >> "type"), _vehicle, getNumber (_x >> "amount")]] call EFUNC(common,localEvent); + }; + } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); +}; + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; +// set class as initialized +_initializedClasses pushBack _type; +SETMVAR(GVAR(initializedClasses),_initializedClasses); + +if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; + +private ["_text", "_condition", "_statement", "_icon", "_action"]; +_condition = { + params ["_target", "_player"]; + GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} +}; +_text = localize LSTRING(openMenu); +_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);}; +_icon = ""; + +_action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); +[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf new file mode 100644 index 0000000000..cf81bdbe6c --- /dev/null +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -0,0 +1,40 @@ +/* + * Author: Glowbal + * Load object into vehicle. + * + * Arguments: + * 0: Object + * 1: Vehicle + * + * Return value: + * Object loaded + * + * Example: + * [object, vehicle] call ace_cargo_fnc_loadItem + * + * Public: No + */ +#include "script_component.hpp" + +private ["_loaded", "_space", "_itemSize"]; + +params ["_item", "_vehicle"]; + +if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; + +_loaded = _vehicle getVariable [QGVAR(loaded), []]; +_loaded pushback _item; +_vehicle setVariable [QGVAR(loaded), _loaded, true]; + +_space = [_vehicle] call FUNC(getCargoSpaceLeft); +_itemSize = [_item] call FUNC(getSizeItem); +_vehicle setVariable [QGVAR(space), _space - _itemSize, true]; + +detach _item; +_item attachTo [_vehicle,[0,0,100]]; +["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); + +// Invoke listenable event +["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + +true diff --git a/addons/cargo/functions/fnc_moduleSettings.sqf b/addons/cargo/functions/fnc_moduleSettings.sqf new file mode 100644 index 0000000000..35e6aede7a --- /dev/null +++ b/addons/cargo/functions/fnc_moduleSettings.sqf @@ -0,0 +1,28 @@ +/* + * Author: Glowbal + * Module for adjusting the cargo settings + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_cargo_fnc_loadItem" + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "_units", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Cargo Module Initialized."; diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf new file mode 100644 index 0000000000..031bea01cc --- /dev/null +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -0,0 +1,48 @@ +/* + * Author: Glowbal + * Handle the UI data display. + * + * Arguments: + * 0: Display + * + * Return value: + * None + * + * Example: + * [display] call ace_cargo_fnc_onMenuOpen + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; + +params ["_display"]; + +uiNamespace setVariable [QGVAR(menuDisplay), _display]; + +[{ + private ["_display","_loaded", "_ctrl", "_label"]; + disableSerialization; + _display = uiNamespace getVariable QGVAR(menuDisplay); + if (isnil "_display") exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitWith { + closeDialog 0; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; + _ctrl = _display displayCtrl 100; + _label = _display displayCtrl 2; + + lbClear _ctrl; + { + _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName")); + true + } count _loaded; + + _label ctrlSetText format[localize LSTRING(labelSpace), [GVAR(interactionVehicle)] call DFUNC(getCargoSpaceLeft)]; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf new file mode 100644 index 0000000000..b4ba50fbb6 --- /dev/null +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -0,0 +1,31 @@ +/* + * Author: Glowbal + * Start load item. + * + * Arguments: + * 0: Object + * + * Return value: + * Object loaded + * + * Example: + * [object] call ace_cargo_fnc_starLoadIn + * + * Public: No + */ +#include "script_component.hpp" + +params ["_player", "_object"]; + +private ["_nearestVehicle"]; +_nearestVehicle = [_player] call FUNC(findNearestVehicle); + +if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then { + { + if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; + } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); +}; + +if (isNull _nearestVehicle) exitWith {false}; + +[_object, _nearestVehicle] call FUNC(loadItem) diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf new file mode 100644 index 0000000000..28ae034167 --- /dev/null +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -0,0 +1,35 @@ +/* + * Author: Glowbal + * Start unload action. + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * [] call ace_cargo_fnc_startUnload + * + * Public: No + */ +#include "script_component.hpp" + +private ["_display", "_loaded", "_ctrl", "_selected", "_item"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(menuDisplay); +if (isnil "_display") exitWith {}; + +_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; +if (count _loaded == 0) exitWith {}; + +_ctrl = _display displayCtrl 100; + +_selected = (lbCurSel _ctrl) max 0; + +if (count _loaded <= _selected) exitWith {}; +_item = _loaded select _selected; + +[_item, GVAR(interactionVehicle)] call FUNC(unloadItem); diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf new file mode 100644 index 0000000000..1390a8c20d --- /dev/null +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -0,0 +1,68 @@ +/* + * Author: Glowbal, ViperMaul + * Unload object from vehicle. + * + * Arguments: + * 0: Object + * 1: Vehicle + * + * Return value: + * Object unloaded + * + * Example: + * [object, vehicle] call ace_cargo_fnc_unloadItem + * + * Public: No + */ +#include "script_component.hpp" + +private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"]; + +params ["_item", "_vehicle"]; + +if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { + false +}; + +_validVehiclestate = true; +_emptyPos = []; +if (_vehicle isKindOf "Ship" ) then { + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; + TRACE_1("SHIP Ground Check", getPosATL _vehicle ); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. +} else { + if (_vehicle isKindOf "Air" ) then { + if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; + TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); + _emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition); + _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; + } else { + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; + TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]); + }; +}; + +TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); +if (!_validVehiclestate) exitWith {false}; + +if (count _emptyPos == 0) exitWith {false}; //consider displaying text saying there are no safe places to exit the vehicle + +_loaded = _vehicle getVariable [QGVAR(loaded), []]; +_loaded = _loaded - [_item]; +_vehicle setVariable [QGVAR(loaded), _loaded, true]; + +_space = [_vehicle] call FUNC(getCargoSpaceLeft); +_itemSize = [_item] call FUNC(getSizeItem); +_vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; + +detach _item; +_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); +["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); + +// TOOO maybe drag/carry the unloaded item? + +// Invoke listenable event +["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + +true diff --git a/addons/cargo/functions/fnc_validateCargoSpace.sqf b/addons/cargo/functions/fnc_validateCargoSpace.sqf new file mode 100644 index 0000000000..6caf664ca5 --- /dev/null +++ b/addons/cargo/functions/fnc_validateCargoSpace.sqf @@ -0,0 +1,38 @@ +/* + * Author: Glowbal + * Validate the vehicle cargo space. + * + * Arguments: + * 0: Object + * + * Return value: + * None + * + * Example: + * [object] call ace_cargo_fnc_validateCargoSpace + * + * Public: No + */ +#include "script_component.hpp" + +private ["_loaded", "_newLoaded", "_totalSpaceOccupied"]; + +params ["_vehicle"]; + +_loaded = _vehicle getVariable [QGVAR(loaded), []]; + +_newLoaded = []; +_totalSpaceOccupied = 0; +{ + if !(isNull _x) then { + _newLoaded pushback _x; + _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); + }; + true +} count _loaded; + +if (count _loaded != count _newLoaded) then { + _vehicle setVariable [QGVAR(loaded), _newLoaded, true]; +}; + +_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; diff --git a/addons/cargo/functions/script_component.hpp b/addons/cargo/functions/script_component.hpp new file mode 100644 index 0000000000..cc6204b83b --- /dev/null +++ b/addons/cargo/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\cargo\script_component.hpp" diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp new file mode 100644 index 0000000000..bde617b311 --- /dev/null +++ b/addons/cargo/menu.hpp @@ -0,0 +1,103 @@ +#include "\z\ace\addons\common\define.hpp" + +class GVAR(menu) { + idd = 314614; + movingEnable = true; + onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen)); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];); + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0.8)"; + 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 controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 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 = CSTRING(cargoMenu); + }; + class SubHeader: HeaderName { + idc = 2; + x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = ""; + }; + class cargoList: ACE_gui_listBoxBase { + idc = 100; + x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1, 1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {1, 1, 1, 1.0}; + colorSelect2[] = {1, 1, 1, 1.0}; + colorSelectBackground[] = {0.3, 0.3, 0.3, 1.0}; + colorSelectBackground2[] = {0.3, 0.3, 0.3, 1.0}; + }; + class btnUnload: ACE_gui_buttonBase { + text = "Cancel"; + idc = 11; + x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + 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(closeDialog 0); + }; + class btnCancel: btnUnload { + text = CSTRING(unloadObject); + idc = 12; + x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE([] call FUNC(startUnload);); + }; + }; +}; diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp new file mode 100644 index 0000000000..9716d7a536 --- /dev/null +++ b/addons/cargo/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT cargo +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_CARGO + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_CARGO + #define DEBUG_SETTINGS DEBUG_ENABLED_CARGO +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define MAX_LOAD_DISTANCE 10 diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml new file mode 100644 index 0000000000..a39fb16f6f --- /dev/null +++ b/addons/cargo/stringtable.xml @@ -0,0 +1,41 @@ + + + + + Load + Załaduj + + + Unload + Wyładuj + + + Cargo + Ładunek + + + Cargo Menu + Menu ładunku + + + Cargo space left: %1 + Pozostałe miejsce: %1 + + + Enable Cargo + Aktywuj cargo + + + Enable the load in cargo module + Aktywuj możliwość załadunku skrzyń i przedmiotów do pojazdów. + + + Cargo Settings + Ustawienia cargo + + + Configure the cargo module settings + Skonfiguruj ustawienia modułu cargo. + + + \ No newline at end of file diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 8b8b3a9005..1f060c8900 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -37,6 +37,13 @@ }; }] call FUNC(addEventhandler); + +["HeadbugFixUsed", { + PARAMS_2(_profileName,_animation); + diag_log text format ["[ACE] Headbug Used: Name: %1, Animation: %2", _profileName, _animation]; +}] call FUNC(addEventHandler); + + //~~~~~Get Map Data~~~~~ //Find MGRS zone and 100km grid for current map [] call FUNC(getMGRSdata); @@ -68,16 +75,6 @@ if (isServer) then { ["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler); }; -// hack to get PFH to work in briefing -[QGVAR(onBriefingPFH), "onEachFrame", { - if (ACE_time > 0) exitWith { - [QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler; - }; - - call cba_common_fnc_onFrame; -}] call BIS_fnc_addStackedEventHandler; -///// - QGVAR(remoteFnc) addPublicVariableEventHandler { (_this select 1) call FUNC(execRemoteFnc); }; @@ -111,7 +108,9 @@ if(!isServer) then { }; ["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler); ["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); -[FUNC(syncedEventPFH), 0.5, []] call cba_fnc_addPerFrameHandler; +if (isServer) then { + [FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler; +}; call FUNC(checkFiles); @@ -149,7 +148,7 @@ call FUNC(checkFiles); //Event that settings are safe to use: ["SettingsInitialized", []] call FUNC(localEvent); -}, 0, [false]] call cba_fnc_addPerFrameHandler; +}, 0, [false]] call CBA_fnc_addPerFrameHandler; ["SettingsInitialized", { @@ -205,10 +204,11 @@ GVAR(OldCameraView) = cameraView; GVAR(OldPlayerVehicle) = vehicle ACE_player; GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); GVAR(OldPlayerWeapon) = currentWeapon ACE_player; +GVAR(OldVisibleMap) = false; // PFH to raise varios events [{ - private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"]; + private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen", "_newVisibleMap"]; // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -272,8 +272,16 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; GVAR(OldPlayerWeapon) = _newPlayerWeapon; ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); }; - -}, 0, []] call cba_fnc_addPerFrameHandler; + + // "visibleMapChanged" event + _newVisibleMap = visibleMap; + if (!_newVisibleMap isEqualTo GVAR(OldVisibleMap)) then { + // Raise ACE event locally + GVAR(OldVisibleMap) = _newVisibleMap; + ["visibleMapChanged", [ACE_player, _newVisibleMap]] call FUNC(localEvent); + }; + +}, 0, []] call CBA_fnc_addPerFrameHandler; // PFH to raise camera created event. Only works on these cams by BI. @@ -298,7 +306,7 @@ GVAR(OldIsCamera) = false; ["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent); }; -}, 1, []] call cba_fnc_addPerFrameHandler; // feel free to decrease the sleep ACE_time if you need it. +}, 1, []] call CBA_fnc_addPerFrameHandler; // feel free to decrease the sleep ACE_time if you need it. [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); @@ -319,20 +327,28 @@ GVAR(OldIsCamera) = false; // Lastly, do JIP events // JIP Detection and event trigger. Run this at the very end, just in case anything uses it -if(isMultiplayer && { ACE_time > 0 || isNull player } ) then { +if (didJip) 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; + }, 0, []] call CBA_fnc_addPerFrameHandler; }; //Device Handler: GVAR(deviceKeyHandlingArray) = []; GVAR(deviceKeyCurrentIndex) = -1; +// Register localizations for the Keybinding categories +["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call cba_fnc_registerKeybindModPrettyName; +["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call cba_fnc_registerKeybindModPrettyName; + ["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), { [] call FUNC(deviceKeyFindValidIndex); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b031e0291e..6fdf99113c 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -11,6 +11,7 @@ PREP(addCanInteractWithCondition); PREP(addLineToDebugDraw); PREP(addSetting); PREP(addToInventory); +PREP(assignObjectsInList); PREP(ambientBrightness); PREP(applyForceWalkStatus); PREP(ASLToPosition); @@ -327,7 +328,7 @@ if (hasInterface) then { // Raise ACE event ["playerChanged", [ACE_player, _oldPlayer]] call FUNC(localEvent); }; - }, 0, []] call cba_fnc_addPerFrameHandler; + }, 0, []] call CBA_fnc_addPerFrameHandler; }; // Time handling @@ -340,7 +341,7 @@ ACE_pausedTime = 0; ACE_virtualPausedTime = 0; PREP(timePFH); -[FUNC(timePFH), 0, []] call cba_fnc_addPerFrameHandler; +[FUNC(timePFH), 0, []] call CBA_fnc_addPerFrameHandler; // Init toHex [0] call FUNC(toHex); diff --git a/addons/common/functions/fnc_assignObjectsInList.sqf b/addons/common/functions/fnc_assignObjectsInList.sqf new file mode 100644 index 0000000000..0d10066d01 --- /dev/null +++ b/addons/common/functions/fnc_assignObjectsInList.sqf @@ -0,0 +1,50 @@ +/* + * Author: Glowbal + * Loops through a string and filters out object names/variables to assign a value for given variable. + * Used by moduleAssign* within various parts of the ACE3 project. + * + * Arguments: + * 0: list + * 1: variableName + * 2: value + * 3: Global + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_splittedList", "_nilCheckPassedList"]; +params ["_list", "_variable", "_setting", "_global"]; + +if (typeName _list == "STRING") then { + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call FUNC(stringRemoveWhiteSpace); + if !(isnil _x) then { + if (_nilCheckPassedList == "") then { + _nilCheckPassedList = _x; + } else { + _nilCheckPassedList = _nilCheckPassedList + ","+ _x; + }; + }; + }foreach _splittedList; + + _list = [] call compile format["[%1]",_nilCheckPassedList]; +}; + +{ + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + _x setvariable [_variable, _setting, _global]; + }; + }; + }; +}foreach _list; + +true diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index ac6d8fb270..5665ee632c 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -27,6 +27,8 @@ _whitelist = [_whitelist, {toLower _this}] call FUNC(map); ACE_Version_CheckAll = _checkAll; ACE_Version_Whitelist = _whitelist; +if (!_checkAll) exitWith {}; //ACE is checked by FUNC(checkFiles) + if (!isServer) then { [_mode, _checkAll, _whitelist] spawn { private ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer", "_text", "_error", "_rscLayer", "_ctrlHint"]; diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 520e4131b2..d9485b11e7 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -84,7 +84,7 @@ if (_state) then { openMap true; }; - if (serverCommandAvailable "#missions" || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then { + if (isServer || {serverCommandAvailable "#kick"} || {player getVariable ["ACE_isUnconscious", false] && {(call FUNC(player)) getVariable [QEGVAR(medical,AllowChatWhileUnconscious), missionNamespace getVariable [QEGVAR(medical,AllowChatWhileUnconscious), false]]}}) then { if (!(_key in (actionKeys "DefaultAction" + actionKeys "Throw")) && {_key in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) then { _key = 0; }; diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index 532850d7bb..0c3d6c8e78 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -7,9 +7,10 @@ diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; if (!isNil "ACE_PFH_COUNTER") then { { - private["_pfh"]; - _pfh = _x select 0; - diag_log text format["Registered PFH: id=%1, %1:%2", (_pfh select 0), (_pfh select 1), (_pfh select 2) ]; + private ["_isActive"]; + _x params ["_pfh", "_parameters"]; + _isActive = if (!isNil {cba_common_PFHhandles select (_pfh select 0)}) then {"ACTIVE"} else {"REMOVED"}; + diag_log text format["Registered PFH: id=%1 [%2, delay %3], %4:%5", (_pfh select 0), (_isActive), (_parameters select 1), (_pfh select 1), (_pfh select 2) ]; } forEach ACE_PFH_COUNTER; }; diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index aa2289309e..33c23c98a3 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -18,6 +18,7 @@ * 14-16: pistol (String, Array, Array) * 17: map, compass, watch, etc. (Array) * 18: binocluar (String) + * 19: active weapon, active muzzle, active weaponMode (Array) * */ #include "script_component.hpp" @@ -34,7 +35,8 @@ if (isNull _unit) exitWith {[ "", ["","","",""], [], "", ["","","",""], [], [], - "" + "", + ["","",""] ]}; [ @@ -47,5 +49,6 @@ if (isNull _unit) exitWith {[ secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit, handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit, assignedItems _unit, - binocular _unit + binocular _unit, + [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit] ] diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index 2bf568ec8a..b66700881e 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -41,14 +41,15 @@ _hitpointClasses = [_config >> "HitPoints"]; while {isClass _class} do { for "_i" from 0 to (count _class - 1) do { - private ["_entry", "_selection"]; + if (isClass (_class select _i)) then { + private ["_entry", "_selection"]; + _entry = configName (_class select _i); + _selection = getText (_class select _i >> "name"); - _entry = configName (_class select _i); - _selection = getText (_class select _i >> "name"); - - if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { - _hitpoints pushBack _entry; - _selections pushBack _selection; + if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then { + _hitpoints pushBack _entry; + _selections pushBack _selection; + }; }; }; diff --git a/addons/common/functions/fnc_headBugFix.sqf b/addons/common/functions/fnc_headBugFix.sqf index 272f64a044..fe9354f632 100644 --- a/addons/common/functions/fnc_headBugFix.sqf +++ b/addons/common/functions/fnc_headBugFix.sqf @@ -10,21 +10,33 @@ #include "script_component.hpp" private ["_pos","_dir","_anim"]; -if (player != vehicle player || {(player getvariable ["ace_isUnconscious", false])}) exitWith {}; -titleCut ["", "BLACK"]; -_pos = getposATL player; -_dir = getDir player; -_anim = animationState player; -// create invisible headbug fix vehicle -_ACE_HeadbugFix = createVehicle ["ACE_Headbug_Fix", getposATL player, [], 0, "NONE"]; -_ACE_HeadbugFix setDir _dir; -player moveInAny _ACE_HeadbugFix; -sleep 1.0; -unassignVehicle player; -player action ["Eject", vehicle player]; -sleep 1.0; -deleteVehicle _ACE_HeadbugFix; -player setposATL _pos; -player setDir _dir; -titleCut ["", "PLAIN"]; +_anim = animationState ACE_player; +["HeadbugFixUsed", [profileName, _anim]] call FUNC(serverEvent); +["HeadbugFixUsed", [profileName, _anim]] call FUNC(localEvent); + +if (ACE_player != vehicle ACE_player || { !([ACE_player, objNull, ["isNotSitting"]] call FUNC(canInteractWith)) } ) exitWith {false}; + +_pos = getposATL ACE_player; +_dir = getDir ACE_player; + +titleCut ["", "BLACK"]; +[ACE_Player, "headBugFix"] call FUNC(hideUnit); + +// create invisible headbug fix vehicle +_ACE_HeadbugFix = "ACE_Headbug_Fix" createVehicleLocal _pos; +_ACE_HeadbugFix setDir _dir; +ACE_player moveInAny _ACE_HeadbugFix; +sleep 0.1; + +unassignVehicle ACE_player; +ACE_player action ["Eject", vehicle ACE_player]; +ACE_player setDir _dir; +ACE_player setposATL _pos; +sleep 1.0; + +deleteVehicle _ACE_HeadbugFix; + +[ACE_Player, "headBugFix"] call FUNC(unhideUnit); +titleCut ["", "PLAIN"]; +true diff --git a/addons/common/functions/fnc_isFeatureCameraActive.sqf b/addons/common/functions/fnc_isFeatureCameraActive.sqf index 250beaa3ca..0b91b19e55 100644 --- a/addons/common/functions/fnc_isFeatureCameraActive.sqf +++ b/addons/common/functions/fnc_isFeatureCameraActive.sqf @@ -1,31 +1,35 @@ /* * Author: Sniperwolf572 + * Checks if one of the following common feature cameras is active: * - * Checks if one of the following BI feature cameras are active: - * - * - Classic camera (BIS_fnc_cameraOld) - * - Splendid camera (BIS_fnc_camera) + * - Curator + * - ACE Spectator * - Arsenal camera (BIS_fnc_arsenal) - * - Animation viewer (BIS_fnc_animViewer) * - Establishing shot (BIS_fnc_establishingShot) + * - Splendid camera (BIS_fnc_camera) + * - Animation viewer (BIS_fnc_animViewer) + * - Classic camera (BIS_fnc_cameraOld) * * Arguments: - * None + * 0: None * - * Return value: - * Is BI feature camera active (bool) + * Return Value: + * A feature camera is active * * Example: - * call ace_common_fnc_isFeatureCameraActive; + * [] call ace_common_fnc_isFeatureCameraActive * + * Public: No */ #include "script_component.hpp" -( - !isNull (missionNamespace getVariable ["BIS_DEBUG_CAM", objNull]) || // Classic camera - {!isNull (missionNamespace getVariable ["BIS_fnc_camera_cam", objNull])} || // Splendid camera - {!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])} || // Arsenal camera - {!isNull (uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull])} || // Animation viewer camera - {!isNull (missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull])} // Establishing shot camera -) \ No newline at end of file +!( + isNull curatorCamera && // Curator + {isNull (GETMVAR(EGVAR(spectator,camera),objNull))} && // ACE Spectator + {isNull (GETUVAR(BIS_fnc_arsenal_cam, objNull))} && // Arsenal camera + {isNull (GETMVAR(BIS_fnc_establishingShot_fakeUAV, objNull))} && // Establishing shot camera + {isNull (GETMVAR(BIS_fnc_camera_cam, objNull))} && // Splendid camera + {isNull (GETUVAR(BIS_fnc_animViewer_cam, objNull))} && // Animation viewer camera + {isNull (GETMVAR(BIS_DEBUG_CAM, objNull))} // Classic camera +) diff --git a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf index 280a1e9907..4479ba04fa 100644 --- a/addons/common/functions/fnc_loadSettingsLocalizedText.sqf +++ b/addons/common/functions/fnc_loadSettingsLocalizedText.sqf @@ -15,16 +15,16 @@ private ["_parseConfigForDisplayNames", "_name"]; _parseConfigForDisplayNames = { - private "_optionEntry"; + private ["_optionEntry", "_values", "_text"]; _optionEntry = _this select 0; if !(isClass _optionEntry) exitwith {false}; + _values = getArray (_optionEntry >> "values"); _x set [3, getText (_optionEntry >> "displayName")]; _x set [4, getText (_optionEntry >> "description")]; + _x set [5, _values]; + _x set [8, getText (_optionEntry >> "category")]; - 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 $ @@ -41,7 +41,9 @@ _parseConfigForDisplayNames = { if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then { - [missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames; + if !([missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then { + diag_log text format ["[ACE] - Setting found, but couldn't localize [%1] (server has but we don't?)", _name]; + }; }; }; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 9a95819996..f06436884f 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -65,17 +65,19 @@ if (isNil _name) then { localizedDescription, possibleValues, isForced, - defaultValue + defaultValue, + category ];*/ _settingData = [ _name, _typeName, (getNumber (_optionEntry >> "isClientSettable")) > 0, - getText (_optionEntry >> "displayName"), - getText (_optionEntry >> "description"), - getArray (_optionEntry >> "values"), + "", //getText (_optionEntry >> "displayName"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText + "", //getText (_optionEntry >> "description"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText + [], //getArray (_optionEntry >> "values"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText getNumber (_optionEntry >> "force") > 0, - _value + _value, + "" //getText (_optionEntry >> "category") //No need to broadcast, handeled by fnc_loadSettingsLocalizedText ]; //Strings in the values array won't be localized from the config, so just do that now: diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index e7966c3b4d..d43841146a 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -36,7 +36,7 @@ if (isNil QGVAR(publishSchedId)) then { GVAR(publishVarNames) = []; GVAR(publishNextTime) = 1e7; }; - }, 0, []] call cba_fnc_addPerFrameHandler; + }, 0, []] call CBA_fnc_addPerFrameHandler; }; // If the variable is not on the list diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf index 524bf6621d..da2d9ea77e 100644 --- a/addons/common/functions/fnc_unloadPersonLocal.sqf +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -30,14 +30,14 @@ if (_vehicle isKindOf "Ship" ) then { _emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition); _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; } else { - if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; + if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); -if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid vehicle state. Either moving or Not close enough on the ground. %1", getPos _vehicle]; false }; +if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4", _vehicle, getPos _vehicle, isTouchingGround _vehicle, speed _vehicle]; false }; diag_log str _emptyPos; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 6ed5e10d5a..0bbe6564da 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -479,7 +479,6 @@ Verificar PBOs - Sprawdzaj spójność addonów z serwerem Este módulo verifica la integridad de los addons con los que iniciamos el simulador Dieses Modul überprüft ob jeder Spieler die richtigen PBO-Dateien hat. @@ -598,5 +597,87 @@ Następne urządzenie podręczne Procházet ruční zařízení + + Disabled + Zakázáno + Non + Deaktiviert + Disattivato + Wyłączone + Desativado + Откл. + Desactivado + + + Enabled + Zapnuto + Oui + Aktiviert + Attivato + Włączone + Ativado + Вкл. + Activado + + + Yes + Ja + Si + Tak + Ano + Oui + Да + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + Нет + Nem + Não + No + + + Vehicles only + Tylko pojazdy + + + Do Not Force + Nie wymuszaj + No forzar + Nicht erzwingen + Nevynucovat + Não forçar + + + ACE3 Equipment + ACE3 Wyposażenie + + + ACE3 Common + ACE3 Ogólne + + + ACE3 Weapons + ACE3 Broń + + + ACE3 Movement + ACE3 Ruch + + + ACE3 Scope Adjustment + ACE3 Regulacja optyki + + + ACE3 Vehicles + ACE3 Pojazdy + - + \ No newline at end of file diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp index 2592bf5b77..81304da853 100644 --- a/addons/concertina_wire/CfgVehicles.hpp +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -3,7 +3,7 @@ class CfgVehicles { class Fence; class thingX; class NonStrategic; - + class ACE_ConcertinaWireNoGeo: Fence { XEH_ENABLED; scope = 1; @@ -48,7 +48,7 @@ class CfgVehicles { class wire_16: wire_2{}; class wire_17: wire_2{}; class wire_18: wire_2{}; - + class wire_2_1: wire_2 { animPeriod = 8; }; @@ -67,13 +67,14 @@ class CfgVehicles { class wire_15_1: wire_2_1 {}; class wire_16_1: wire_2_1 {}; class wire_17_1: wire_2_1 {}; - class wire_18_1: wire_2_1 {}; + class wire_18_1: wire_2_1 {}; }; }; class ACE_ConcertinaWire: ACE_ConcertinaWireNoGeo { scope = 2; displayName = $STR_ACE_CONCERTINA_WIRE; model = PATHTOF(data\ACE_ConcertinaWire.p3d); + EGVAR(logistics_wirecutter,isFence) = 1; class ACE_Actions { class ACE_MainActions { selection = ""; @@ -113,6 +114,8 @@ class CfgVehicles { EGVAR(dragging,canDrag) = 1; EGVAR(dragging,dragPosition[]) = {0,0.5,0.5}; EGVAR(dragging,dragDirection) = 0; + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; class ACE_Actions { class ACE_MainActions { selection = ""; @@ -123,7 +126,8 @@ class CfgVehicles { displayName = "$STR_ACE_ROLLWIRE"; distance = 4; condition = "true"; - statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; @@ -132,7 +136,7 @@ class CfgVehicles { }; }; }; - + class Land_Razorwire_F: NonStrategic { XEH_ENABLED; }; diff --git a/addons/concertina_wire/README.md b/addons/concertina_wire/README.md index ab62458de9..e1e6530f5b 100644 --- a/addons/concertina_wire/README.md +++ b/addons/concertina_wire/README.md @@ -3,8 +3,9 @@ ace_concertina_wire Adds concertina wire. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index c30e767266..5548cad649 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -37,7 +37,7 @@ deleteVehicle _wirecoil; _unit setVariable [QGVAR(wireDeployed), false]; GVAR(deployPFH) = [{ - EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action); + EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit); private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); @@ -73,7 +73,7 @@ GVAR(deployPFH) = [{ { _wireNoGeo animate [_x, _anim]; } foreach WIRE_FAST; -}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler; +}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); diff --git a/addons/concertina_wire/stringtable.xml b/addons/concertina_wire/stringtable.xml index 812de87e6c..07c2961862 100644 --- a/addons/concertina_wire/stringtable.xml +++ b/addons/concertina_wire/stringtable.xml @@ -5,7 +5,7 @@ Concertina Wire NATO-Draht Проволочная спираль - Drut kolczasty + Koncentrina Alambre de espino Concertina wire Ostnatý drát @@ -17,7 +17,7 @@ Concertina Wire Coil NATO-Draht Rolle Проволочная спираль (моток) - Zwój drutu kolczastego + Zwój koncentriny Bobina de alambre de espino Concertina wire coil Smyčka ostnatého drátu @@ -29,7 +29,7 @@ Dismount Concertina Wire NATO-Draht abbauen Демонтировать проволочную спираль - Zwiń drut kolczasty + Zwiń koncentrinę Desmontar alambre de espino Dismount Concertina wire Svinout ostnatý drát @@ -41,7 +41,7 @@ Deploy Concertina Wire NATO-Draht verlegen Монтировать проволочную спираль - Rozwiń drut kolczasty + Rozwiń koncentrinę Desplegar alambre de espino Deploy Concertina wire Rozvinout ostnatý drát @@ -50,4 +50,4 @@ Colocar arame farpado - \ No newline at end of file + diff --git a/addons/dagr/README.md b/addons/dagr/README.md index 33d095dca4..eb502e7a24 100644 --- a/addons/dagr/README.md +++ b/addons/dagr/README.md @@ -1,10 +1,11 @@ ace_dagr =============== -Defense Advanced GPS Receiver +Adds Defense Advanced GPS Receiver. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/disarming/XEH_postInit.sqf b/addons/disarming/XEH_postInit.sqf index 7315ef1785..ef17e6e96a 100644 --- a/addons/disarming/XEH_postInit.sqf +++ b/addons/disarming/XEH_postInit.sqf @@ -1,4 +1,4 @@ #include "script_component.hpp" -["DisarmDropItems", {_this call FUNC(eventTargetStart)}] call EFUNC(common,addEventHandler); -["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler); +["DisarmDropItems", FUNC(eventTargetStart)] call EFUNC(common,addEventHandler); +["DisarmDebugCallback", FUNC(eventCallerFinish)] call EFUNC(common,addEventHandler); diff --git a/addons/disarming/functions/fnc_canBeDisarmed.sqf b/addons/disarming/functions/fnc_canBeDisarmed.sqf index 25ec884919..9be20db7f4 100644 --- a/addons/disarming/functions/fnc_canBeDisarmed.sqf +++ b/addons/disarming/functions/fnc_canBeDisarmed.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Checks the conditions for being able to disarm a unit * * Arguments: @@ -15,17 +16,17 @@ */ #include "script_component.hpp" -PARAMS_1(_target); - private ["_animationStateCfgMoves", "_putDownAnim"]; +params ["_target"]; + //Check animationState for putDown anim //This ensures the unit doesn't have to actualy do any animation to drop something //This should always be true for the 3 possible status effects that allow disarming _animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions"); -if (_animationStateCfgMoves == "") exitWith {false}; +if (_animationStateCfgMoves == "") exitWith { false }; _putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown"); -if (_putDownAnim != "") exitWith {false}; +if (_putDownAnim != "") exitWith { false }; (alive _target) && diff --git a/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf b/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf index ec9e975ec2..34f1a10d32 100644 --- a/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf +++ b/addons/disarming/functions/fnc_canPlayerDisarmUnit.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Checks the conditions for being able to disarm a unit * * Arguments: @@ -16,7 +17,7 @@ */ #include "script_component.hpp" -PARAMS_2(_player,_target); +params ["_player", "_target"]; -([_target] call FUNC(canBeDisarmed)) && +([_target] call FUNC(canBeDisarmed)) && {([_player, _target, []] call EFUNC(common,canInteractWith))} diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 5422fd00a6..91eff1c99d 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Makes a unit drop items * * Arguments: @@ -22,13 +23,11 @@ private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"]; - -PARAMS_3(_caller,_target,_listOfItemsToRemove); -DEFAULT_PARAM(3,_doNotDropAmmo,false); //By default units drop all weapon mags when dropping a weapon +params ["_caller", "_target", "_listOfItemsToRemove", ["_doNotDropAmmo", false, [false]]]; //By default units drop all weapon mags when dropping a weapon _fncSumArray = { _return = 0; - {_return = _return + _x;} forEach (_this select 0); + {_return = _return + _x;} count (_this select 0); _return }; @@ -48,7 +47,7 @@ if (!_doNotDropAmmo) then { if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); }; //Create a new weapon holder diff --git a/addons/disarming/functions/fnc_eventCallerFinish.sqf b/addons/disarming/functions/fnc_eventCallerFinish.sqf index d95be98d5f..bc48a26b70 100644 --- a/addons/disarming/functions/fnc_eventCallerFinish.sqf +++ b/addons/disarming/functions/fnc_eventCallerFinish.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Recieves a possible error code from FUNC(eventTargetFinish) * * Arguments: @@ -17,7 +18,7 @@ */ #include "script_component.hpp" -PARAMS_3(_caller,_target,_errorMsg); +params ["_caller", "_target", "_errorMsg"]; if (_caller != ACE_player) exitWith {}; diff --git a/addons/disarming/functions/fnc_eventTargetFinish.sqf b/addons/disarming/functions/fnc_eventTargetFinish.sqf index d702a554a5..b9fb461356 100644 --- a/addons/disarming/functions/fnc_eventTargetFinish.sqf +++ b/addons/disarming/functions/fnc_eventTargetFinish.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * After FUNC(disarmDropItems) has completed, passing a possible error code. * Passes that error back to orginal caller. * @@ -18,7 +19,7 @@ */ #include "script_component.hpp" -PARAMS_3(_caller,_target,_errorMsg); +params ["_caller", "_target", "_errorMsg"]; if (_errorMsg != "") then { diag_log text format ["[ACE_Disarming] %1 - eventTargetFinish: %2", ACE_time, _this]; diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index 316ec2b656..29c370f2b5 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Disarm Event Handler, Starting func, called on the target. * If target has to remove uniform/vest, this will add all uniform/vest items to the drop list. * @@ -18,7 +19,7 @@ */ #include "script_component.hpp" -PARAMS_3(_caller,_target,_listOfObjectsToRemove); +params ["_caller", "_target", "_listOfObjectsToRemove"]; private "_itemsToAdd"; diff --git a/addons/disarming/functions/fnc_getAllGearContainer.sqf b/addons/disarming/functions/fnc_getAllGearContainer.sqf index c5b2c445ab..0394761197 100644 --- a/addons/disarming/functions/fnc_getAllGearContainer.sqf +++ b/addons/disarming/functions/fnc_getAllGearContainer.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Helper function to get all gear of a container * * Arguments: @@ -15,15 +16,16 @@ */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; -private ["_allGear"]; - -_allGear = [[],[]]; +private ["_items", "_counts"]; +_items = []; +_counts = []; { - (_allGear select 0) append (_x select 0); - (_allGear select 1) append (_x select 1); + _x params ["_item", "_count"]; + _items append _item; + _counts append _count; } forEach [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)]; -_allGear +[_items,_counts] // Return diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index 99d4b2d7f2..bdd1ff0bf9 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Helper function to get all gear of a unit. * * Arguments: @@ -15,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_target); +params ["_target"]; private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index 88e0e81be8..c2a3a6396e 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Opens the disarm dialog (allowing a person to remove items) * * Arguments: @@ -15,21 +16,9 @@ * Public: No */ #include "script_component.hpp" - -#define TEXTURES_RANKS [ \ - "", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\captain_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\major_gs.paa", \ - "\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \ - ] - -PARAMS_2(_caller,_target); +params ["_caller", "_target"]; private "_display"; - +#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" //Sanity Checks if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");}; @@ -47,8 +36,8 @@ GVAR(disarmTarget) = _target; //Setup Drop Event (on right pannel) (_display displayCtrl 632) ctrlAddEventHandler ["LBDrop", { if (isNull GVAR(disarmTarget)) exitWith {}; - PARAMS_5(_ctrl,_xPos,_yPos,_idc,_itemInfo); - EXPLODE_3_PVT((_itemInfo select 0),_displayText,_value,_data); + params ["_ctrl", "_xPos", "_yPos", "_idc", "_itemInfo"]; + (_itemInfo select 0) params ["_displayText", "_value", "_data"]; if (isNull GVAR(disarmTarget)) exitWith {ERROR("disarmTarget is null");}; @@ -60,18 +49,18 @@ GVAR(disarmTarget) = _target; //Setup PFEH [{ - private ["_groundContainer", "_targetContainer", "_playerName", "_rankPicture", "_rankIndex", "_targetUniqueItems", "_holderUniqueItems", "_holder"]; + private ["_groundContainer", "_targetContainer", "_playerName", "_icon", "_rankPicture", "_targetUniqueItems", "_holderUniqueItems", "_holder"]; disableSerialization; - EXPLODE_2_PVT(_this,_args,_pfID); - EXPLODE_3_PVT(_args,_player,_target,_display); + params ["_args", "_idPFH"]; + _args params ["_player", "_target", "_display"]; if ((!([_player, _target] call FUNC(canPlayerDisarmUnit))) || {isNull _display} || {_player != ACE_player}) then { - [_pfID] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; GVAR(disarmTarget) = objNull; - if (!isNull _display) then {closeDialog 0;}; //close dialog if still open + if (!isNull _display) then { closeDialog 0; }; //close dialog if still open } else { _groundContainer = _display displayCtrl 632; @@ -80,8 +69,9 @@ GVAR(disarmTarget) = _target; _rankPicture = _display displayCtrl 1203; //Show rank and name (just like BIS's inventory) - _rankIndex = ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find (rank _target)) + 1); - _rankPicture ctrlSetText (TEXTURES_RANKS select _rankIndex); + _icon = format [DEFUALTPATH, toLower (rank _target)]; + if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; + _rankPicture ctrlSetText _icon; _playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName)); //Clear both inventory lists: @@ -98,7 +88,7 @@ GVAR(disarmTarget) = _target; if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith { _holder = _x; }; - } forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); + } count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]); //If a holder exists, show it's inventory if (!isNull _holder) then { diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index b36e53e820..f675012ee3 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Shows a list of inventory items in a listBox control. * * Arguments: @@ -17,11 +18,12 @@ #include "script_component.hpp" disableSerialization; -PARAMS_2(_listBoxCtrl,_itemsCountArray); - private ["_classname", "_count", "_displayName", "_picture"]; +params ["_listBoxCtrl", "_itemsCountArray"]; + { + private "_configPath"; _displayName = ""; _picture = ""; @@ -31,21 +33,25 @@ private ["_classname", "_count", "_displayName", "_picture"]; if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon switch (true) do { - case (isClass (configFile >> "CfgWeapons" >> _classname)): { - _displayName = getText (configFile >> "CfgWeapons" >> _classname >> "displayName"); - _picture = getText (configFile >> "CfgWeapons" >> _classname >> "picture"); + case (isClass (configFile >> "CfgWeapons" >> _classname)): { + _configPath = (configFile >> "CfgWeapons"); + _displayName = getText (_configPath >> _classname >> "displayName"); + _picture = getText (_configPath >> _classname >> "picture"); }; - case (isClass (configFile >> "CfgMagazines" >> _classname)): { - _displayName = getText (configFile >> "CfgMagazines" >> _classname >> "displayName"); - _picture = getText (configFile >> "CfgMagazines" >> _classname >> "picture"); + case (isClass (configFile >> "CfgMagazines" >> _classname)): { + _configPath = (configFile >> "CfgMagazines"); + _displayName = getText (_configPath >> _classname >> "displayName"); + _picture = getText (_configPath >> _classname >> "picture"); }; - case (isClass (configFile >> "CfgVehicles" >> _classname)): { - _displayName = getText (configFile >> "CfgVehicles" >> _classname >> "displayName"); - _picture = getText (configFile >> "CfgVehicles" >> _classname >> "picture"); + case (isClass (configFile >> "CfgVehicles" >> _classname)): { + _configPath = (configFile >> "CfgVehicles"); + _displayName = getText (_configPath >> _classname >> "displayName"); + _picture = getText (_configPath >> _classname >> "picture"); }; - case (isClass (configFile >> "CfgGlasses" >> _classname)): { - _displayName = getText (configFile >> "CfgGlasses" >> _classname >> "displayName"); - _picture = getText (configFile >> "CfgGlasses" >> _classname >> "picture"); + case (isClass (configFile >> "CfgGlasses" >> _classname)): { + _configPath = (configFile >> "CfgGlasses"); + _displayName = getText (_configPath >> _classname >> "displayName"); + _picture = getText (_configPath >> _classname >> "picture"); }; default { ERROR(format ["[%1] - bad classname", _classname]); diff --git a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf index e1753f390a..efe5aae72a 100644 --- a/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf +++ b/addons/disarming/functions/fnc_verifyMagazinesMoved.sqf @@ -1,5 +1,6 @@ /* * Author: PabstMirror + * * Verifies magazines moved with exact ammo counts preserved. * Arrays will be in format from magazinesAmmo/magazinesAmmoCargo * e.g.: [["30Rnd_65x39_caseless_mag",15], ["30Rnd_65x39_caseless_mag",30]] diff --git a/addons/disposable/CfgEventHandlers.hpp b/addons/disposable/CfgEventHandlers.hpp index e4e4abffd8..98fec255c2 100644 --- a/addons/disposable/CfgEventHandlers.hpp +++ b/addons/disposable/CfgEventHandlers.hpp @@ -22,7 +22,7 @@ class Extended_FiredBIS_EventHandlers { class Extended_InitPost_EventHandlers { class CAManBase { class ADDON { - init = QUOTE([ARR_2(_this select 0, secondaryWeapon (_this select 0))] call FUNC(takeLoadedATWeapon)); + init = QUOTE([_this select 0] call FUNC(takeLoadedATWeapon)); }; }; }; diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp index 484fa36238..d26d5ecea2 100644 --- a/addons/disposable/CfgMagazines.hpp +++ b/addons/disposable/CfgMagazines.hpp @@ -1,6 +1,6 @@ class CfgMagazines { class NLAW_F; - class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine + class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine author = ECSTRING(common,ACETeam); scope = 1; scopeArsenal = 1; @@ -12,14 +12,4 @@ class CfgMagazines { class ACE_FiredMissileDummy: ACE_PreloadedMissileDummy { count = 0; }; - class ACE_UsedTube_F: NLAW_F { - author = ECSTRING(common,ACETeam); - displayName = CSTRING(UsedTube); - descriptionShort = CSTRING(UsedTubeDescription); - displayNameShort = "-"; - count = 0; - weaponPoolAvailable = 0; - modelSpecial = ""; - mass = 0; - }; }; diff --git a/addons/disposable/README.md b/addons/disposable/README.md index 73418cd49d..82281a3c52 100644 --- a/addons/disposable/README.md +++ b/addons/disposable/README.md @@ -1,7 +1,7 @@ ace_disposable ============== -Makes the NLAW a disposable one-shot weapon. +Makes the NLAW a disposable one-shot weapon and provides disposable launchers framework for use by other mods. ## Maintainers diff --git a/addons/disposable/XEH_postInit.sqf b/addons/disposable/XEH_postInit.sqf index bc51974bc6..800d749d06 100644 --- a/addons/disposable/XEH_postInit.sqf +++ b/addons/disposable/XEH_postInit.sqf @@ -3,8 +3,12 @@ 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); +["inventoryDisplayLoaded", { + [ACE_player, _this select 0] call FUNC(updateInventoryDisplay) +}] call EFUNC(common,addEventHandler); + +["playerInventoryChanged", { + params ["_unit"]; + [_unit] call FUNC(takeLoadedATWeapon); + [_unit] call FUNC(updateInventoryDisplay); }] call EFUNC(common,addEventHandler); diff --git a/addons/disposable/XEH_postInitClient.sqf b/addons/disposable/XEH_postInitClient.sqf deleted file mode 100644 index c20dfa886b..0000000000 --- a/addons/disposable/XEH_postInitClient.sqf +++ /dev/null @@ -1,10 +0,0 @@ -// by commy2 - -// The Arma InventoryOpened EH fires actually before the inventory dialog is opened (findDisplay 602 => displayNull). - -#include "script_component.hpp" - -["inventoryDisplayLoaded",{ - [ACE_player] call FUNC(takeLoadedATWeapon); - [ACE_player, (_this select 0)] call FUNC(updateInventoryDisplay); -}] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/disposable/functions/fnc_replaceATWeapon.sqf b/addons/disposable/functions/fnc_replaceATWeapon.sqf index 8c55209123..ec56f42ff4 100644 --- a/addons/disposable/functions/fnc_replaceATWeapon.sqf +++ b/addons/disposable/functions/fnc_replaceATWeapon.sqf @@ -21,17 +21,14 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_projectile", "_replacementTube", "_items"]; +params ["_unit", "_weapon", "", "", "", "", "_projectile"]; +TRACE_3("params",_unit,_weapon,_projectile); -_unit = _this select 0; -_weapon = _this select 1; -_projectile = _this select 6; - -if (!local _unit) exitWith {}; +if ((!local _unit) || {_weapon != (secondaryWeapon _unit)}) exitWith {}; +private ["_replacementTube", "_items"]; _replacementTube = getText (configFile >> "CfgWeapons" >> _weapon >> "ACE_UsedTube"); if (_replacementTube == "") exitWith {}; //If no replacement defined just exit -if (_weapon != (secondaryWeapon _unit)) exitWith {}; //just to be sure //Save array of items attached to launcher @@ -43,19 +40,19 @@ _unit selectWeapon _replacementTube; //Re-add all attachments to the used tube { if (_x != "") then {_unit addSecondaryWeaponItem _x}; -} forEach _items; +} count _items; // AI - Remove the ai's missle launcher tube after the missle has exploded if !([_unit] call EFUNC(common,isPlayer)) then { [{ - EXPLODE_2_PVT(_this,_params,_pfhId); - EXPLODE_3_PVT(_params,_unit,_tube,_projectile); + params ["_args","_idPFH"]; + _args params ["_unit", "_tube", "_projectile"]; //don't do anything until projectile is null (exploded/max range) if (isNull _projectile) then { //Remove PFEH: - [_pfhId] call cba_fnc_removePerFrameHandler; + [_idPFH] call cba_fnc_removePerFrameHandler; //If (tube is dropped) OR (is dead) OR (is player) just exit if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {}; @@ -66,13 +63,13 @@ if !([_unit] call EFUNC(common,isPlayer)) then { _container = createVehicle ["GroundWeaponHolder", position _unit, [], 0, "CAN_COLLIDE"]; _container setPosAsl (getPosAsl _unit); _container addWeaponCargoGlobal [_tube, 1]; - + //This will duplicate attachements, because we will be adding a weapon that may already have attachments on it //We either need a way to add a clean weapon, or a way to add a fully configured weapon to a container: // { // if (_x != "") then {_container addItemCargoGlobal [_x, 1];}; // } forEach _items; - + _unit removeWeaponGlobal _tube; }; }, 1, [_unit, _replacementTube, _projectile]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf index de3875dfa0..b379584b68 100644 --- a/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf +++ b/addons/disposable/functions/fnc_takeLoadedATWeapon.sqf @@ -15,16 +15,18 @@ */ #include "script_component.hpp" -private ["_unit", "_launcher", "_config"]; +params ["_unit"]; +TRACE_1("params",_unit); -PARAMS_1(_unit); if (!local _unit) exitWith {}; +private ["_launcher", "_config"]; + _launcher = secondaryWeapon _unit; _config = configFile >> "CfgWeapons" >> _launcher; if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber (_config >> "ACE_isUsedLauncher") != 1} && {count secondaryWeaponMagazine _unit == 0}) then { - private ["_magazine", "_isLauncherSelected"]; + private ["_magazine", "_isLauncherSelected", "_didAdd"]; _magazine = getArray (_config >> "magazines") select 0; @@ -34,14 +36,22 @@ if (isClass _config && {getText (_config >> "ACE_UsedTube") != ""} && {getNumber if (backpack _unit == "") then { _unit addBackpack "Bag_Base"; - _unit addMagazine _magazine; + _didAdd = _magazine in (magazines _unit); _unit addWeapon _launcher; - + if (!_didAdd) then { + TRACE_1("Failed To Add Disposable Magazine Normally, doing backup method (no backpack)",_unit); + _unit addSecondaryWeaponItem _magazine; + }; removeBackpack _unit; } else { _unit addMagazine _magazine; + _didAdd = _magazine in (magazines _unit); _unit addWeapon _launcher; + if (!_didAdd) then { + TRACE_2("Failed To Add Disposable Magazine Normally, doing backup method",_unit,(backpack _unit)); + _unit addSecondaryWeaponItem _magazine; + }; }; if (_isLauncherSelected) then { diff --git a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf index 3f9d6f9802..7f50e45089 100644 --- a/addons/disposable/functions/fnc_updateInventoryDisplay.sqf +++ b/addons/disposable/functions/fnc_updateInventoryDisplay.sqf @@ -16,9 +16,8 @@ #include "script_component.hpp" disableSerialization; - -PARAMS_1(_player); -DEFAULT_PARAM(1,_display,(findDisplay 602)); +params ["_player", ["_display",(findDisplay 602),[displayNull]]]; +TRACE_2("params",_player,_display); _player removeMagazines "ACE_PreloadedMissileDummy"; _player removeMagazines "ACE_FiredMissileDummy"; diff --git a/addons/disposable/script_component.hpp b/addons/disposable/script_component.hpp index af1f17bd86..12a05ea60d 100644 --- a/addons/disposable/script_component.hpp +++ b/addons/disposable/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT disposable #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_ATTACH #define DEBUG_MODE_FULL #endif diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp index e5c454e969..2ff7d07c0d 100644 --- a/addons/dragging/CfgEventHandlers.hpp +++ b/addons/dragging/CfgEventHandlers.hpp @@ -28,6 +28,11 @@ class Extended_Init_EventHandlers { init = QUOTE(_this call DFUNC(initObject)); }; }; + class ACE_RepairItem_Base { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; }; class Extended_Killed_EventHandlers { diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp index 5ac84b7038..d4d791724b 100644 --- a/addons/dragging/CfgVehicles.hpp +++ b/addons/dragging/CfgVehicles.hpp @@ -83,4 +83,18 @@ class CfgVehicles { GVAR(canCarry) = 0; GVAR(canDrag) = 0; }; + + class ACE_RepairItem_Base: ThingX {}; + + class ACE_Track: ACE_RepairItem_Base { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + }; + + class ACE_Wheel: ACE_RepairItem_Base { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + }; }; diff --git a/addons/dragging/README.md b/addons/dragging/README.md new file mode 100644 index 0000000000..b69484eccf --- /dev/null +++ b/addons/dragging/README.md @@ -0,0 +1,12 @@ +ace_dragging +============== + +Adds ability to drag and carry objects. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Garth "L-H" de Wet](https://github.com/CorruptedHeart) +- [commy2](https://github.com/commy2) diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf index 21d699c688..e80d63cfde 100644 --- a/addons/dragging/XEH_clientInit.sqf +++ b/addons/dragging/XEH_clientInit.sqf @@ -1,7 +1,7 @@ // by PabstMirror, commy2 #include "script_component.hpp" -[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); +[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler); if (isNil "ACE_maxWeightDrag") then { ACE_maxWeightDrag = 800; @@ -15,11 +15,11 @@ if (isNil "ACE_maxWeightCarry") then { ["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); // release object on player change. This does work when returning to lobby, but not when hard disconnecting. -["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerChanged", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler); ["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); -["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); +["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler); // handle waking up dragged unit and falling unconscious while dragging -["medical_onUnconscious", {_this call DFUNC(handleUnconscious)}] call EFUNC(common,addEventhandler); +["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler); //@todo Captivity? diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf index f6c231d275..01d78ef4e3 100644 --- a/addons/dragging/XEH_serverInit.sqf +++ b/addons/dragging/XEH_serverInit.sqf @@ -2,4 +2,4 @@ #include "script_component.hpp" // release object on hard disconnection. Function is identical to killed -addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}]; +addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)]; diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp index cc843d4a68..0c9cfb3c43 100644 --- a/addons/dragging/config.cpp +++ b/addons/dragging/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; - author[] = {"Garth 'L-H' de Wet","commy2"}; + author[] = {"Garth 'L-H' de Wet", "commy2"}; authorUrl = "https://github.com/commy2/"; VERSION_CONFIG; }; diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index 6472124aef..a6b8fed5ab 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -3,19 +3,18 @@ * * Check if unit can carry the object. Doesn't check weight. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * Can the unit carry the object? (Bool) + * Return Value: + * Can the unit carry the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 7eedfce179..4ab3562ba2 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -3,12 +3,14 @@ * * Check if unit can drag the object. Doesn't check weight. * - * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag * - * Return value: - * Can the unit drag the object? (Bool) + * Return Value: + * Can the unit drag the object? + * + * Public: No */ #include "script_component.hpp" @@ -22,4 +24,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; // a static weapon has to be empty for dragging if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; -alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; \ No newline at end of file +alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf index df75b9540f..58c02cab07 100644 --- a/addons/dragging/functions/fnc_canDrop.sqf +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -3,19 +3,18 @@ * * Check if unit can drop the object. * - * Argument: - * 0: Unit that currently drags a object (Object) - * 1: Object that is dragged (Object) + * Arguments: + * 0: Unit that currently drags a object + * 1: Object that is dragged * - * Return value: - * Can the unit drop the object? (Bool) + * Return Value: + * Can the unit drop the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_canDrop_carry.sqf b/addons/dragging/functions/fnc_canDrop_carry.sqf index 9efbbe9b0f..430b12c642 100644 --- a/addons/dragging/functions/fnc_canDrop_carry.sqf +++ b/addons/dragging/functions/fnc_canDrop_carry.sqf @@ -3,19 +3,18 @@ * * Check if unit can drop the carried object. * - * Argument: - * 0: Unit that currently carries a object (Object) - * 1: Object that is carried (Object) + * Arguments: + * 0: Unit that currently carries a object + * 1: Object that is carried * - * Return value: - * Can the unit drop the object? (Bool) + * Return Value: + * Can the unit drop the object? + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index bb413d8240..7f70b2bdc5 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -3,19 +3,18 @@ * * Carry an object. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // get attachTo offset and direction. private ["_position", "_direction"]; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index 3ad1f89f77..d0eb7fda17 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -1,21 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * + * PFH for Carry Object + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 carryObjectPFH running", ACE_time]; #endif -private ["_unit", "_target"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; +params ["_args", "_idPFH"]; +_args params ["_unit","_target"]; if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject_carry); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index e4b200c4dd..d12a98213a 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -3,28 +3,25 @@ * * Drag an object. Called from ace_dragging_fnc_startDrag * - * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +private ["_position", "_direction", "_offset", "_actionID"]; +params ["_unit", "_target"]; // get attachTo offset and direction. -private ["_position", "_direction"]; - _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; _direction = _target getVariable [QGVAR(dragDirection), 0]; // add height offset of model -private "_offset"; _offset = (_target modelToWorldVisual [0, 0, 0] select 2) - (_unit modelToWorldVisual [0, 0, 0] select 2); _position = _position vectorAdd [0, 0, _offset]; @@ -41,7 +38,6 @@ _unit setVariable [QGVAR(isDragging), true, true]; _unit setVariable [QGVAR(draggedObject), _target, true]; // add scrollwheel action to release object -private "_actionID"; _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; if (_actionID != -1) then { diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 465107af39..dea8897b27 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -1,21 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * + * PFH for Drag Object + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 dragObjectPFH running", ACE_time]; #endif -private ["_unit", "_target"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target"]; if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 9589457dbe..2ae07be091 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -3,19 +3,18 @@ * * Drop a dragged object. * - * Argument: - * 0: Unit that drags the other object (Object) - * 1: Dragged object to drop (Object) + * Arguments: + * 0: Unit that drags the other object + * 1: Dragged object to drop * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // remove scroll wheel action _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index b6dfe9fc45..86009ac867 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -3,19 +3,18 @@ * * Drop a carried object. * - * Argument: - * 0: Unit that carries the other object (Object) - * 1: Carried object to drop (Object) + * Arguments: + * 0: Unit that carries the other object + * 1: Carried object to drop * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // remove scroll wheel action _unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index 871c49db89..dcdcbbf3fe 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -1,54 +1,45 @@ /* - Name: AGM_Drag_fnc_GetWeight - - Author(s): - L-H, edited by commy2 - - Description: - Returns the weight of a crate. - - Parameters: - 0: OBJECT - Crate to get weight of - - Returns: - NUMBER - Weight - - Example: - _weight = Crate1 call AGM_Drag_fnc_GetWeight; + * Author: L-H, edited by commy2, rewritten by joko // Jonas + * + * Returns the weight of a crate. + * + * Arguments: + * 0: Crate to get weight of + * + * Return Value: + * Total Weight + * + * Example: + * _weight = Crate1 call ace_dragging_fnc_getweight; + * + * Public: No */ #include "script_component.hpp" -private "_object"; - -_object = _this select 0; - -private ["_totalWeight", "_fnc","_fnc_Extra"]; +private "_totalWeight"; +params ["_object"]; +// Initialize the total weight. _totalWeight = 0; -_fnc_Extra = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight -}; -_fnc = { - private ["_weight", "_items"]; - _items = _this select 0; - _weight = 0; - { - _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); - } foreach (_items select 0); - - _weight -}; -_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); -_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); -_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra); -_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc); -_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). +// Cycle through all item types with their assigned config paths. +{ + _x params["_items","_getConfigCode"]; + _items params ["_item", "_count"]; + // Cycle through all items and read their mass out of the config. + { + // Multiply mass with amount of items and add the mass to the total weight. + _totalWeight = _totalWeight + (getNumber ((call _getConfigCode) >> "mass") * (_count select _forEachIndex)); + } forEach _item; + true +} count [ + [getMagazineCargo _object, {configFile >> "CfgMagazines" >> _x}], + [getBackpackCargo _object, {configFile >> "CfgVehicles" >> _x}], + [getItemCargo _object, {configFile >> "CfgWeapons" >> _x >> "ItemInfo"}], + [getWeaponCargo _object, {configFile >> "CfgWeapons" >> _x >> "WeaponSlotsInfo"}] +]; -_totalWeight +// add Weight of create to totalWeight +_totalWeight = _totalWeight + (getNumber (configFile >> "CfgVehicles" >> typeof _object >> "mass")); + +// Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). +_totalWeight * 0.5 diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 14b2eff611..0694687ca4 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the animaion for a Unit for Dragging Module + * + * Arguments: + * 0: Unit + * 1: animaion + * + * Return Value: + * None + * + * Example: + * [_unit, "amovpercmstpsnonwnondnon"] call ace_dragging_fnc_handleAnimChanged; + * + * Public: No +*/ #include "script_component.hpp" private ["_unit", "_anim"]; diff --git a/addons/dragging/functions/fnc_handleKilled.sqf b/addons/dragging/functions/fnc_handleKilled.sqf index 4dcfc77fcd..2d0923d624 100644 --- a/addons/dragging/functions/fnc_handleKilled.sqf +++ b/addons/dragging/functions/fnc_handleKilled.sqf @@ -1,9 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle death of the dragger + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [_unit] call ace_dragging_fnc_handleKilled; + * + * Public: No +*/ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; if (_unit getVariable [QGVAR(isDragging), false]) then { private "_draggedObject"; diff --git a/addons/dragging/functions/fnc_handlePlayerChanged.sqf b/addons/dragging/functions/fnc_handlePlayerChanged.sqf index e2dd41021b..41c9091c72 100644 --- a/addons/dragging/functions/fnc_handlePlayerChanged.sqf +++ b/addons/dragging/functions/fnc_handlePlayerChanged.sqf @@ -1,10 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle player changes. + * + * Arguments: + * 0: New Player Unit + * 1: Old Player Unit + * + * Return Value: + * None + * + * Example: + * [_unitNew, _unitOld] call ace_dragging_fnc_handlePlayerChanged; + * + * Public: No +*/ #include "script_component.hpp" -private ["_newPlayer", "_oldPlayer"]; - -_newPlayer = _this select 0; -_oldPlayer = _this select 1; +params ["_newPlayer", "_oldPlayer"]; { if (_x getVariable [QGVAR(isDragging), false]) then { diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf index a7f9be7681..e0f1b2a8e4 100644 --- a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf +++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf @@ -1,10 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the Weapon Changed Event + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Example: + * [_unit, _currentWeapon] call ace_dragging_fnc_handlePlayerWeaponChanged; + * + * Public: No +*/ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +params ["_unit", "_weapon"]; if (_unit getVariable [QGVAR(isDragging), false]) then { diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf index 96f46413bc..cd613316ec 100644 --- a/addons/dragging/functions/fnc_handleScrollWheel.sqf +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -3,38 +3,38 @@ * * Handles raising and lowering the dragged weapon to be able to place it on top of objects. * - * Argument: - * 0: Scroll amount (Number) + * Arguments: + * 0: Scroll amount * - * Return value: - * Handled or not. (Bool) + * Return Value: + * Handled or not. + * + * Public: No */ #include "script_component.hpp" -// requires modifier key to be hold down -if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false}; +private ["_unit", "_carriedItem", "_position", "_maxHeight"]; + +params ["_scrollAmount"]; + +// requires modifier key to be hold down +if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false}; -private "_unit"; _unit = ACE_player; // EH is always assigned. Exit and don't overwrite input if not carrying if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; -private "_scrollAmount"; -_scrollAmount = _this select 0; // move carried item 15 cm per scroll interval _scrollAmount = _scrollAmount * 0.15; -private "_carriedItem"; _carriedItem = _unit getVariable [QGVAR(carriedObject), objNull]; //disabled for persons if (_carriedItem isKindOf "CAManBase") exitWith {false}; -private ["_position", "_maxHeight"]; - _position = getPosATL _carriedItem; _maxHeight = (_unit modelToWorldVisual [0,0,0]) select 2; diff --git a/addons/dragging/functions/fnc_handleUnconscious.sqf b/addons/dragging/functions/fnc_handleUnconscious.sqf index 31c703f37b..b87e36b92d 100644 --- a/addons/dragging/functions/fnc_handleUnconscious.sqf +++ b/addons/dragging/functions/fnc_handleUnconscious.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * + * Handle the Unconscious of a Unit while Dragging + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * [_unit] call ace_dragging_fnc_handleUnconscious; + * + * Public: No +*/ #include "script_component.hpp" -private ["_unit", "_isUnconscious"]; +private ["_player", "_draggedObject", "_carriedObject"]; -_unit = _this select 0; -_isUnconscious = _this select 1; +params ["_unit"]; -private "_player"; _player = ACE_player; if (_player getVariable [QGVAR(isDragging), false]) then { - private "_draggedObject"; _draggedObject = _player getVariable [QGVAR(draggedObject), objNull]; // handle falling unconscious @@ -28,7 +40,6 @@ if (_player getVariable [QGVAR(isDragging), false]) then { if (_player getVariable [QGVAR(isCarrying), false]) then { - private "_carriedObject"; _carriedObject = _player getVariable [QGVAR(carriedObject), objNull]; // handle falling unconscious diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf index 65866bd028..0dd36568bc 100644 --- a/addons/dragging/functions/fnc_initObject.sqf +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -4,23 +4,22 @@ * Initialize variables for drag or carryable objects. Called from init EH. * * Argument: - * 0: Any object (Object) + * 0: Any object * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private "_object"; +private ["_position", "_direction", "_config"]; -_object = _this select 0; +params ["_object"]; -private "_config"; _config = configFile >> "CfgVehicles" >> typeOf _object; if (getNumber (_config >> QGVAR(canDrag)) == 1) then { - private ["_position", "_direction"]; - _position = getArray (_config >> QGVAR(dragPosition)); _direction = getNumber (_config >> QGVAR(dragDirection)); @@ -28,8 +27,6 @@ if (getNumber (_config >> QGVAR(canDrag)) == 1) then { }; if (getNumber (_config >> QGVAR(canCarry)) == 1) then { - private ["_position", "_direction"]; - _position = getArray (_config >> QGVAR(carryPosition)); _direction = getNumber (_config >> QGVAR(carryDirection)); diff --git a/addons/dragging/functions/fnc_initPerson.sqf b/addons/dragging/functions/fnc_initPerson.sqf index 0dc2af1389..c0a951771c 100644 --- a/addons/dragging/functions/fnc_initPerson.sqf +++ b/addons/dragging/functions/fnc_initPerson.sqf @@ -4,16 +4,16 @@ * Initialize variables for drag or carryable persons. Called from init EH. * * Argument: - * 0: Any Unit (Object) + * 0: Unit * * Return value: - * NONE. + * None + * + * Public: No */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; [_unit, true, [0,1.1,0.092], 180] call FUNC(setDraggable); [_unit, true, [0.4,-0.1,-1.25], 195] call FUNC(setCarryable); // hard-coded selection: "LeftShoulder" diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf index 0a8624820e..e8ab5f307a 100644 --- a/addons/dragging/functions/fnc_isObjectOnObject.sqf +++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf @@ -1,6 +1,16 @@ -// by commy2 - -private "_object"; -_object = _this select 0; +/* + * Author: commy2 + * + * Check if Object is Overlapping + * + * Argument: + * 0: Object + * + * Return value: + * + * + * Public: No + */ +params ["_object"]; (getPosATL _object select 2) - (getPos _object select 2) > 1E-5 diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 52c6e5643a..6bf05e5fde 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -4,25 +4,21 @@ * Enable the object to be carried. * * Argument: - * 0: Any object (Object) - * 1: true to enable carrying, false to disable (Bool) - * 2: Position offset for attachTo command (Array, optinal; default: [0,1,1]) - * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * 0: Any object + * 1: true to enable carrying, false to disable + * 2: Position offset for attachTo command (default: [0,1,1]) + * 3: Direction in degree to rotate the object after attachTo (default: 0) * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"]; -//IGNORE_PRIVATE_WARNING("_player", "_target"); +private ["_carryAction", "_dropAction", "_type", "_initializedClasses"]; -_this resize 4; - -_object = _this select 0; -_enableCarry = _this select 1; -_position = _this select 2; -_direction = _this select 3; +params ["_object", "_enableCarry", "_position", "_direction"]; if (isNil "_position") then { _position = _object getVariable [QGVAR(carryPosition), [0,1,1]]; @@ -38,8 +34,6 @@ _object setVariable [QGVAR(carryPosition), _position]; _object setVariable [QGVAR(carryDirection), _direction]; // add action to class if it is not already present -private ["_type", "_initializedClasses"]; - _type = typeOf _object; _initializedClasses = GETGVAR(initializedClasses_carry,[]); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 7745bd2d3e..bbfca9d868 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -10,19 +10,15 @@ * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) * * Return value: - * NONE. + * None + * + * Public: Yes */ #include "script_component.hpp" -private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"]; +private ["_dragAction", "_dropAction", "_type", "_initializedClasses"]; //IGNORE_PRIVATE_WARNING("_player", "_target"); - -_this resize 4; - -_object = _this select 0; -_enableDrag = _this select 1; -_position = _this select 2; -_direction = _this select 3; +params ["_object", "_enableDrag", "_position", "_direction"]; if (isNil "_position") then { _position = _object getVariable [QGVAR(dragPosition), [0,0,0]]; @@ -38,8 +34,6 @@ _object setVariable [QGVAR(dragPosition), _position]; _object setVariable [QGVAR(dragDirection), _direction]; // add action to class if it is not already present -private ["_type", "_initializedClasses"]; - _type = typeOf _object; _initializedClasses = GETGVAR(initializedClasses,[]); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 5521bec375..a95a8f9fb4 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -3,29 +3,28 @@ * * Start the carrying process. * - * Argument: - * 0: Unit that should do the carrying (Object) - * 1: Object to carry (Object) + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry * - * Return value: - * NONE. + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" -private ["_unit", "_target"]; +private ["_weight", "_timer"]; -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // check weight -private "_weight"; _weight = [_target] call FUNC(getWeight); -if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { +if (_weight > missionNamespace getVariable ["ACE_maxWeightCarry", 1E11]) exitWith { [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; -private "_timer"; _timer = ACE_time + 5; // handle objects vs persons diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index 47824a8e76..ae5ad17978 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -1,25 +1,34 @@ -// by commy2 +/* + * Author: commy2 + * + * Carry PFH + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 startCarryPFH running", ACE_time]; #endif -private ["_unit", "_target", "_timeOut"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; -_timeOut = _this select 0 select 2; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target", "_timeOut"]; // handle aborting carry if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // handle persons vs objects @@ -27,11 +36,11 @@ if (_target isKindOf "CAManBase") then { if (ACE_time > _timeOut) exitWith { [_unit, _target] call FUNC(carryObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; } else { if (ACE_time > _timeOut) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; // drop if in timeout private "_draggedObject"; @@ -43,7 +52,7 @@ if (_target isKindOf "CAManBase") then { if (stance _unit == "STAND") exitWith { [_unit, _target] call FUNC(carryObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; }; diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index 1d4eb9a158..d3e55bdaea 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -4,24 +4,21 @@ * Start the dragging process. * * Argument: - * 0: Unit that should do the dragging (Object) - * 1: Object to drag (Object) + * 0: Unit that should do the dragging + * 1: Object to drag * * Return value: - * NONE. + * None */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +params ["_unit", "_target"]; // check weight private "_weight"; _weight = [_target] call FUNC(getWeight); -if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { +if (_weight > missionNamespace getVariable ["ACE_maxWeightDrag", 1E11]) exitWith { [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index 65cf0a2431..f527cda7d8 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -1,30 +1,39 @@ -// by commy2 +/* + * Author: commy2 + * + * Drag PFH + * + * Arguments: + * ? + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING systemChat format ["%1 startDragPFH running", ACE_time]; #endif -private ["_unit", "_target", "_timeOut"]; - -_unit = _this select 0 select 0; -_target = _this select 0 select 1; -_timeOut = _this select 0 select 2; +params ["_args", "_idPFH"]; +_args params ["_unit", "_target", "_timeOut"]; // handle aborting drag if !(_unit getVariable [QGVAR(isDragging), false]) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled)) if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then { [_unit, _target] call FUNC(dropObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; // timeout. Do nothing. Quit. ACE_time, because anim length is linked to ingame ACE_time. if (ACE_time > _timeOut) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; // drop if in timeout private "_draggedObject"; @@ -36,5 +45,5 @@ if (ACE_time > _timeOut) exitWith { if (animationState _unit in DRAG_ANIMATIONS) exitWith { [_unit, _target] call FUNC(dragObject); - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index 5df3d005bc..952f360f22 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -1,5 +1,5 @@ class ACE_Triggers { -/* onPlace parameters: + /* onPlace parameters: 0: OBJECT - unit placing 1: OBJECT - Placed explosive 2: STRING - Magazine classname @@ -7,46 +7,54 @@ class ACE_Triggers { Last Index: ACE_Triggers config of trigger type. onSetup parameters: 0: STRING - Magazine Classname -*/ + */ class Command { + isAttachable = 1; displayName = CSTRING(clacker_displayName); picture = PATHTOF(Data\UI\Clacker.paa); onPlace = QUOTE(_this call FUNC(AddClacker);false); requires[] = {"ACE_Clacker"}; }; class MK16_Transmitter:Command { + isAttachable = 1; displayName = CSTRING(MK16_displayName); picture = PATHTOF(Data\UI\MK16_Reciever_ca.paa); requires[] = {"ACE_M26_Clacker"}; }; class DeadManSwitch:Command { + isAttachable = 1; displayName = CSTRING(DeadManSwitch_displayName); picture = PATHTOF(Data\UI\DeadmanSwitch.paa); requires[] = {"ACE_DeadManSwitch"}; }; class Cellphone:Command { + isAttachable = 1; displayName = CSTRING(cellphone_displayName); picture = PATHTOF(Data\UI\Cellphone_UI.paa); onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); requires[] = {"ACE_Cellphone"}; }; class PressurePlate { + isAttachable = 0; displayName = CSTRING(PressurePlate); picture = PATHTOF(Data\UI\PressurePlate.paa); - onPlace = "_dist=GetNumber(ConfigFile >> 'CfgMagazines' >> (_this select 2) >> 'ACE_Triggers' >> 'PressurePlate' >> 'digDistance');_ex=_this select 1;_ex setPosATL ((getPosATL _ex) vectorDiff ((VectorUp _ex) vectorCrossProduct [0,0,_dist]));false"; + onPlace = QUOTE(false); }; class IRSensor { + isAttachable = 0; displayName = CSTRING(IRSensor); picture = PATHTOF(Data\UI\PressurePlate.paa); onPlace = "false"; }; class Timer { + isAttachable = 1; displayName = CSTRING(timerName); picture = PATHTOF(data\UI\Timer.paa); onPlace = QUOTE([ARR_2(_this select 1,(_this select 3) select 0)] call FUNC(startTimer);false); onSetup = QUOTE(_this call FUNC(openTimerSetUI);true); }; class Tripwire { + isAttachable = 0; displayName = CSTRING(TripWire); picture = PATHTOF(Data\UI\Tripwire.paa); onPlace = "false"; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index 89e3017e8a..e7bf74e414 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -11,7 +11,7 @@ class Extended_PostInit_EventHandlers { class Extended_Killed_EventHandlers { class CAManBase { - GVAR(killedHandler) = QUOTE(_this call FUNC(onKilled)); + GVAR(killedHandler) = QUOTE(_this call FUNC(onIncapacitated)); }; }; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 39d08917c3..686dd83ee8 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -8,7 +8,7 @@ class CfgMagazines { class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { - digDistance = 0.1; + digDistance = 0.06; }; }; }; @@ -17,7 +17,7 @@ class CfgMagazines { class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { - digDistance = 0.075; + digDistance = 0.08; }; }; }; @@ -26,7 +26,7 @@ class CfgMagazines { class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { - digDistance = 0.05; + digDistance = 0.02; }; }; }; @@ -96,7 +96,7 @@ class CfgMagazines { }; }; }; - + class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanBig"; class ACE_Triggers { @@ -113,9 +113,9 @@ class CfgMagazines { ammo = "IEDUrbanBig_Range_Ammo"; pitch = 0; }; - }; + }; }; - + class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDLandBig"; class ACE_Triggers: ACE_Triggers { diff --git a/addons/explosives/GUI_VirtualAmmo.hpp b/addons/explosives/GUI_VirtualAmmo.hpp new file mode 100644 index 0000000000..96e5b452ee --- /dev/null +++ b/addons/explosives/GUI_VirtualAmmo.hpp @@ -0,0 +1,30 @@ +class RscTitles { + class GVAR(virtualAmmo) { + idd = -1; + movingEnable = 1; + duration = 9999999; + fadein = 0; + fadeout = 0; + onLoad = "uiNamespace setVariable ['ACE_explosives_virtualAmmoDisplay', (_this select 0)];"; + class controls {}; + class objects { + class TheObject { + idc = 800851; + type = 82; + model = "\a3\weapons_f\Ammo\Handgrenade.p3d"; //dummy value, cannot be "" !!! + scale = 1; + direction[] = {0, 0, 1}; + up[] = {0, 1, 0}; + x = 0.5; + y = 0.5; + z = 1; + xBack = 0.5; + yBack = 0.5; + zBack = 0.5; + inBack = 0; + enableZoom = 0; + zoomDuration = 1; + }; + }; + }; +}; diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 27a4703906..5216db8215 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -15,20 +15,37 @@ */ #include "script_component.hpp" -if !(hasInterface) exitWith {}; +//Event for setting explosive placement angle/pitch: +[QGVAR(place), {_this call FUNC(setPosition)}] call EFUNC(common,addEventHandler); -["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); +//When getting knocked out in medical, trigger deadman explosives: +//Event is global, only run on server (ref: ace_medical_fnc_setUnconscious) +if (isServer) then { + ["medical_onUnconscious", { + params ["_unit", "_isUnconscious"]; + if (!_isUnconscious) exitWith {}; + TRACE_1("Knocked Out, Doing Deadman", _unit); + [_unit] call FUNC(onIncapacitated); + }] call EFUNC(common,addEventHandler); +}; + +if !(hasInterface) exitWith {}; GVAR(PlacedCount) = 0; GVAR(Setup) = objNull; GVAR(pfeh_running) = false; GVAR(CurrentSpeedDial) = 0; -//Cancel placement if interact menu opened + ["interactMenuOpened", { - if (GVAR(pfeh_running) && {!isNull (GVAR(Setup))}) then { - call FUNC(place_Cancel) + //Cancel placement if interact menu opened + if (GVAR(pfeh_running)) then { + GVAR(placeAction) = PLACE_CANCEL; }; + + //Show defuse actions on cfgAmmos (allMines): + _this call FUNC(interactEH); + }] call EFUNC(common,addEventHandler); -[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); +[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(common,addScrollWheelEventHandler); diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index b3888e1535..470cae661d 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -44,15 +44,11 @@ PREP(getSpeedDialExplosive); PREP(module); +PREP(onIncapacitated); PREP(onInventoryChanged); -PREP(onKilled); -PREP(onLanded); PREP(openTimerSetUI); -PREP(place_Approve); -PREP(place_Cancel); - PREP(placeExplosive); PREP(removeFromSpeedDial); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index 873c4e0dc3..99544213d3 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -12,6 +12,8 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" + #include "CfgEventHandlers.hpp" #include "CfgAmmo.hpp" @@ -21,6 +23,7 @@ class CfgPatches { #include "ACE_Triggers.hpp" #include "ExplosivesUI.hpp" +#include "GUI_VirtualAmmo.hpp" class CfgActions { class None; @@ -39,5 +42,3 @@ class CfgMineTriggers { mineTriggerRange = 1; }; }; - -#include "ACE_Settings.hpp" diff --git a/addons/explosives/functions/fnc_addCellphoneIED.sqf b/addons/explosives/functions/fnc_addCellphoneIED.sqf index 953476861b..24d254ac04 100644 --- a/addons/explosives/functions/fnc_addCellphoneIED.sqf +++ b/addons/explosives/functions/fnc_addCellphoneIED.sqf @@ -18,7 +18,8 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_unit,_explosive,_magazineClass,_extra); +params ["_unit", "_explosive", "_magazineClass", "_extra"]; +TRACE_4("params",_unit,_explosive,_magazineClass,_extra); private["_config", "_detonators", "_hasRequired", "_requiredItems", "_code", "_count", "_codeSet"]; @@ -50,6 +51,9 @@ if (isNil QGVAR(CellphoneIEDs)) then { _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")]; _count = _count + 1; publicVariable QGVAR(CellphoneIEDs); -_unit sideChat format ["IED %1 code: %2", _count,_code]; + +//display IED number message: +[format ["IED %1 code: %2", _count,_code]] call EFUNC(common,displayTextStructured); + if !(_hasRequired) exitWith {}; [format ["IED %1", _count],_code] call FUNC(addToSpeedDial); diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index d22b15eef4..f8301f73fb 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -17,8 +17,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_explosive", "_magazineClass"]; +TRACE_3("params",_unit,_explosive,_magazineClass); + private ["_clacker", "_config", "_requiredItems", "_hasRequired", "_detonators"]; -EXPLODE_3_PVT(_this,_unit,_explosive,_magazineClass); + // Config is the last item in the list of passed in items. _config = (_this select 3) select (count (_this select 3) - 1); @@ -41,4 +45,6 @@ _clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localiz GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; _unit setVariable [QGVAR(Clackers), _clacker, true]; -_unit sideChat format [localize LSTRING(DetonateCode), GVAR(PlacedCount)]; + +//display clacker code message: +[format [localize LSTRING(DetonateCode), GVAR(PlacedCount)]] call EFUNC(common,displayTextStructured); diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index 5c94649608..04e78f0f82 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -15,10 +15,13 @@ * Public: No */ #include "script_component.hpp" + +params ["_unit", "_detonator"]; +TRACE_2("params",_unit,_detonator); + private ["_result", "_item", "_children", "_range", "_required"]; -EXPLODE_2_PVT(_this,_unit,_detonator); -_range = GetNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); +_range = getNumber (ConfigFile >> "CfgWeapons" >> _detonator >> "ACE_Range"); _result = [_unit] call FUNC(getPlacedExplosives); _children = []; @@ -44,6 +47,6 @@ _children = []; ]; }; }; -} foreach _result; +} forEach _result; _children diff --git a/addons/explosives/functions/fnc_addExplosiveActions.sqf b/addons/explosives/functions/fnc_addExplosiveActions.sqf index 214b41602c..764c0cd7b8 100644 --- a/addons/explosives/functions/fnc_addExplosiveActions.sqf +++ b/addons/explosives/functions/fnc_addExplosiveActions.sqf @@ -1,6 +1,6 @@ /* * Author: Garth 'L-H' de Wet and CAA-Picard - * + * Adds sub actions for all explosive magazines (from insertChildren) * * Arguments: * 0: Unit @@ -11,9 +11,11 @@ * Public: No */ #include "script_component.hpp" -private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; -EXPLODE_1_PVT(_this,_unit); +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_mags", "_item", "_index", "_children", "_itemCount", "_list"]; _mags = magazines _unit; _list = []; @@ -41,16 +43,16 @@ _children = []; [ [ format ["Explosive_%1", _forEachIndex], - format [_name + " (%1)", _itemCount select _foreachIndex], + format [_name + " (%1)", _itemCount select _forEachIndex], getText(_x >> "picture"), - {(_this select 2) call FUNC(setupExplosive);}, + {_this call FUNC(setupExplosive);}, {true}, {}, - [_unit, configName _x] + (configName _x) ] call EFUNC(interact_menu,createAction), [], _unit ]; -} foreach _list; +} forEach _list; _children diff --git a/addons/explosives/functions/fnc_addToSpeedDial.sqf b/addons/explosives/functions/fnc_addToSpeedDial.sqf index 4f0772e601..bf409d5462 100644 --- a/addons/explosives/functions/fnc_addToSpeedDial.sqf +++ b/addons/explosives/functions/fnc_addToSpeedDial.sqf @@ -15,13 +15,16 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_name", "_code"]; +TRACE_2("params",_name,_code); + private ["_speedDial", "_found"]; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; _found = false; -EXPLODE_2_PVT(_this,_name,_code); - -if ((_code) == "") ExitWith { +if ((_code) == "") exitWith { [_name] call FUNC(removeFromSpeedDial); }; { @@ -29,7 +32,7 @@ if ((_code) == "") ExitWith { _speedDial set [_foreachindex, _this]; _found = true; }; -} foreach _speedDial; +} forEach _speedDial; if (!_found) then { _speedDial pushBack _this; }; diff --git a/addons/explosives/functions/fnc_addTransmitterActions.sqf b/addons/explosives/functions/fnc_addTransmitterActions.sqf index abaa57decc..40ec8581d4 100644 --- a/addons/explosives/functions/fnc_addTransmitterActions.sqf +++ b/addons/explosives/functions/fnc_addTransmitterActions.sqf @@ -14,8 +14,12 @@ * Public: No */ #include "script_component.hpp" -private ["_unit", "_children", "_config", "_detonators"]; -_unit = _this select 0; + +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_children", "_config", "_detonators"]; + _detonators = [_unit] call FUNC(getDetonators); _children = []; { @@ -34,6 +38,6 @@ _children = []; [], ACE_Player ]; -} foreach _detonators; +} forEach _detonators; _children diff --git a/addons/explosives/functions/fnc_addTriggerActions.sqf b/addons/explosives/functions/fnc_addTriggerActions.sqf index 6f4ece163c..ca444a4e31 100644 --- a/addons/explosives/functions/fnc_addTriggerActions.sqf +++ b/addons/explosives/functions/fnc_addTriggerActions.sqf @@ -15,10 +15,14 @@ * Public: No */ #include "script_component.hpp" -private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers"]; -EXPLODE_2_PVT(_this,_magazine,_explosive); -_detonators = [ACE_player] call FUNC(getDetonators); +params ["_magazine", "_explosive"]; +TRACE_2("params",_magazine,_explosive); + +private ["_hasRequiredItems","_triggerTypes", "_children", "_detonators", "_required", "_magTriggers", "_isAttached"]; + +_isAttached = !isNull (attachedTo _explosive); +_detonators = [ACE_player] call FUNC(getDetonators); _triggerTypes = [_magazine] call FUNC(triggerType); _magTriggers = ConfigFile >> "CfgMagazines" >> _magazine >> "ACE_Triggers"; _children = []; @@ -30,7 +34,7 @@ _children = []; _hasRequiredItems = false; }; } count _required; - if (_hasRequiredItems) then { + if (_hasRequiredItems && {(!_isAttached) || {(getNumber (_x >> "isAttachable")) == 1}}) then { _children pushBack [ [ @@ -50,6 +54,6 @@ _children = []; ACE_Player ]; }; -} foreach _triggerTypes; +} forEach _triggerTypes; _children diff --git a/addons/explosives/functions/fnc_canDefuse.sqf b/addons/explosives/functions/fnc_canDefuse.sqf index ef4bd10a83..e69ac41dac 100644 --- a/addons/explosives/functions/fnc_canDefuse.sqf +++ b/addons/explosives/functions/fnc_canDefuse.sqf @@ -4,6 +4,7 @@ * * Arguments: * 0: Unit + * 0: Target * * Return Value: * Able to defuse @@ -14,8 +15,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_target"]; +TRACE_2("params",_unit,_target); + private ["_isSpecialist"]; -EXPLODE_2_PVT(_this,_unit,_target); + if (isNull(_target getVariable [QGVAR(Explosive),objNull])) exitWith { deleteVehicle _target; false diff --git a/addons/explosives/functions/fnc_canDetonate.sqf b/addons/explosives/functions/fnc_canDetonate.sqf index 0b96f66f27..73ca3c4e70 100644 --- a/addons/explosives/functions/fnc_canDetonate.sqf +++ b/addons/explosives/functions/fnc_canDetonate.sqf @@ -14,7 +14,7 @@ * Public: Yes */ #include "script_component.hpp" -private "_unit"; -_unit = _this select 0; -[_unit] call FUNC(hasPlacedExplosives) and {count ([_unit] call FUNC(getDetonators)) > 0} +params ["_unit"]; + +([_unit] call FUNC(hasPlacedExplosives)) && {(count ([_unit] call FUNC(getDetonators))) > 0} diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index e0c7f7c85d..0af28788b3 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -15,9 +15,12 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_explosive); -if (GVAR(ExplodeOnDefuse) && (random 1.0) < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith { +params ["_unit", "_explosive"]; +TRACE_2("params",_unit,_explosive); + +if (GVAR(ExplodeOnDefuse) && {(random 1.0) < (getNumber (ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse"))}) exitWith { + TRACE_1("exploding on defuse",_explosive); [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); }; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index bfdf4a4b92..373e72ac21 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -19,12 +19,16 @@ * Public: Yes */ #include "script_component.hpp" -private ["_result", "_ignoreRange", "_helpers", "_pos"]; -EXPLODE_3_PVT(_this,_unit,_range,_item); + +params ["_unit", "_range", "_item"]; +TRACE_3("params",_unit,_range,_item); + +private ["_result", "_ignoreRange", "_pos"]; + _ignoreRange = (_range == -1); _result = true; -if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; +if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {TRACE_1("out of range",_range); false}; if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { private ["_exp", "_previousExp"]; @@ -40,11 +44,11 @@ if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhe }; }; [{ - private ["_explosive"]; - _explosive = _this; + params ["_explosive"]; + TRACE_1("exploding",_explosive); if (!isNull _explosive) then { _explosive setDamage 1; }; -}, _item select 0, _item select 1, 0] call EFUNC(common,waitAndExecute); +}, [_item select 0], (_item select 1)] call EFUNC(common,waitAndExecute); _result diff --git a/addons/explosives/functions/fnc_dialPhone.sqf b/addons/explosives/functions/fnc_dialPhone.sqf index aa163b027f..44addcda9f 100644 --- a/addons/explosives/functions/fnc_dialPhone.sqf +++ b/addons/explosives/functions/fnc_dialPhone.sqf @@ -15,8 +15,12 @@ * Public: Yes */ #include "script_component.hpp" + +params ["_unit", "_code"]; +TRACE_2("params",_unit,_code); + private ["_arr", "_ran", "_i"]; -EXPLODE_2_PVT(_this,_unit,_code); + if (_unit getVariable [QGVAR(Dialing),false]) exitWith {}; if !(alive _unit) exitWith {}; _unit setVariable [QGVAR(Dialing), true, true]; @@ -36,7 +40,7 @@ if (_unit == ace_player) then { [{ playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_this select 1),3.16228,1,75]; (_this select 0) setVariable [QGVAR(Dialing), false, true]; - }, [_unit,_explosive select 0], 0.25 * (count _arr - 4), 0] call EFUNC(common,waitAndExecute); + }, [_unit,_explosive select 0], 0.25 * (count _arr - 4)] call EFUNC(common,waitAndExecute); [_explosive select 0,(0.25 * (count _arr - 1)) + (_explosive select 2)] call FUNC(startTimer); }; }; diff --git a/addons/explosives/functions/fnc_dialingPhone.sqf b/addons/explosives/functions/fnc_dialingPhone.sqf index fa992a9cac..cb9d7f5450 100644 --- a/addons/explosives/functions/fnc_dialingPhone.sqf +++ b/addons/explosives/functions/fnc_dialingPhone.sqf @@ -17,7 +17,10 @@ * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this select 0,_unit,_i,_arr,_code); + +params ["_args", "_pfID"]; +_args params ["_unit", "_i", "_arr", "_code"]; + if ((_i mod 4) == 0) then { playSound3D [QUOTE(PATHTO_R(Data\Audio\DialTone.wss)), objNull, false, (_unit modelToWorldVisual [0,0.2,2]), 15,1,2.5]; }; @@ -27,7 +30,7 @@ private "_explosive"; _explosive = [_code] call FUNC(getSpeedDialExplosive); if (_i >= (count _arr + 2)) then { - [_this select 1] call CALLSTACK(cba_fnc_removePerFrameHandler); + [_pfID] call CALLSTACK(cba_fnc_removePerFrameHandler); if ((count _explosive) > 0) then { [_unit, -1, [_explosive select 0, _explosive select 2]] call FUNC(detonateExplosive); }; @@ -41,4 +44,4 @@ if (_i == (count _arr)) then { playSound3D [QUOTE(PATHTO_R(Data\Audio\Cellphone_Ring.wss)),objNull, false, getPosASL (_explosive select 0),3.16228,1,75]; }; }; -(_this select 0) set [1, _i + 1]; +_args set [1, _i + 1]; diff --git a/addons/explosives/functions/fnc_getDetonators.sqf b/addons/explosives/functions/fnc_getDetonators.sqf index da0bdc93d2..54c942e9de 100644 --- a/addons/explosives/functions/fnc_getDetonators.sqf +++ b/addons/explosives/functions/fnc_getDetonators.sqf @@ -16,8 +16,11 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_detonators); -private ["_unit", "_items", "_result", "_config"]; -_unit = _this select 0; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_items", "_result", "_config"]; + _items = (items _unit); _result = []; diff --git a/addons/explosives/functions/fnc_getPlacedExplosives.sqf b/addons/explosives/functions/fnc_getPlacedExplosives.sqf index 0c2080923a..56334af65b 100644 --- a/addons/explosives/functions/fnc_getPlacedExplosives.sqf +++ b/addons/explosives/functions/fnc_getPlacedExplosives.sqf @@ -18,8 +18,11 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_allExplosives,_deadmanExplosives); -private ["_unit", "_clackerList", "_adjustedList", "_list", "_filter"]; -_unit = _this select 0; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_clackerList", "_adjustedList", "_list", "_filter"]; + _filter = nil; if (count _this > 1) then { _filter = ConfigFile >> "ACE_Triggers" >> (_this select 1); @@ -30,14 +33,14 @@ _clackerList = _unit getVariable [QGVAR(Clackers), []]; _list = []; { if (isNull (_x select 0)) then { - _clackerList set [_foreachIndex, "X"]; + _clackerList set [_forEachIndex, "X"]; _adjustedList = true; } else { if (isNil "_filter" || {(ConfigFile >> "ACE_Triggers" >> (_x select 4)) == _filter}) then { _list pushBack _x; }; }; -} foreach _clackerList; +} forEach _clackerList; if (_adjustedList) then { _clackerList = _clackerList - ["X"]; if (count _clackerList == 0) then { diff --git a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf index b57f4f9f16..b6bd9b6e6f 100644 --- a/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf +++ b/addons/explosives/functions/fnc_getSpeedDialExplosive.sqf @@ -14,8 +14,12 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_code); + +params ["_code"]; +TRACE_1("params",_code); + private ["_explosive"]; + if (isNil QGVAR(CellphoneIEDs)) exitWith {[]}; _explosive = []; { @@ -24,4 +28,5 @@ _explosive = []; }; false } count GVAR(CellphoneIEDs); + _explosive diff --git a/addons/explosives/functions/fnc_handleScrollWheel.sqf b/addons/explosives/functions/fnc_handleScrollWheel.sqf index 3bef53e196..0d5fdd2aba 100644 --- a/addons/explosives/functions/fnc_handleScrollWheel.sqf +++ b/addons/explosives/functions/fnc_handleScrollWheel.sqf @@ -14,9 +14,9 @@ * Public: No */ #include "script_component.hpp" -if (isNull(GVAR(Setup)) || {ACE_Modifier == 0} || !GVAR(pfeh_running)) exitWith {false}; -_this = _this * 5; -GVAR(Setup) setDir ((getDir GVAR(Setup)) + _this); -GVAR(TweakedAngle) = GVAR(TweakedAngle) + _this; + +if ((!GVAR(pfeh_running)) || {ACE_Modifier == 0}) exitWith {false}; + +GVAR(TweakedAngle) = ((GVAR(TweakedAngle) + 7.2 * _this) + 360) % 360; true diff --git a/addons/explosives/functions/fnc_hasExplosives.sqf b/addons/explosives/functions/fnc_hasExplosives.sqf index bd790bd12f..4a626e9c63 100644 --- a/addons/explosives/functions/fnc_hasExplosives.sqf +++ b/addons/explosives/functions/fnc_hasExplosives.sqf @@ -9,16 +9,18 @@ * The unit has explosives * * Example: - * _hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives; + * hasExplosives = [player] call ACE_Explosives_fnc_hasExplosives; * * Public: Yes */ #include "script_component.hpp" -// IGNORE_PRIVATE_WARNING(_hasExplosives); -private ["_unit", "_result", "_magazines"]; +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_result", "_magazines"]; + _result = false; -_unit = _this select 0; _magazines = magazines _unit; { if (getNumber (ConfigFile >> "CfgMagazines" >> _x >> "ACE_Placeable") == 1) exitWith { diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf index 4e916edb82..9be7568530 100644 --- a/addons/explosives/functions/fnc_interactEH.sqf +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; +TRACE_1("params",_interactionType); //Ignore self-interaction menu if (_interactionType != 0) exitWith {}; @@ -26,8 +27,8 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; [{ - PARAMS_2(_args,_pfID); - EXPLODE_3_PVT(_args,_setPosition,_addedDefuseHelpers,_minesHelped); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedDefuseHelpers", "_minesHelped"]; if (!EGVAR(interact_menu,keyDown)) then { TRACE_1("Cleaning Defuse Helpers",(count _addedDefuseHelpers)); diff --git a/addons/explosives/functions/fnc_module.sqf b/addons/explosives/functions/fnc_module.sqf index 56225d8ca8..c74c73e679 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -14,20 +14,13 @@ * Public: No */ #include "script_component.hpp" + if !(isServer) exitWith {}; -private["_activated", "_logic"]; +params ["_logic"]; -_logic = _this select 0; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] - call EFUNC(Common,readSettingFromModule); -[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] - call EFUNC(Common,readSettingFromModule); -[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] - call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(RequireSpecialist), "RequireSpecialist"] call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(PunishNonSpecialists),"PunishNonSpecialists"] call EFUNC(Common,readSettingFromModule); +[_logic, QGVAR(ExplodeOnDefuse),"ExplodeOnDefuse"] call EFUNC(Common,readSettingFromModule); diag_log text "[ACE]: Explosive Module Initialized."; diff --git a/addons/explosives/functions/fnc_onKilled.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf similarity index 74% rename from addons/explosives/functions/fnc_onKilled.sqf rename to addons/explosives/functions/fnc_onIncapacitated.sqf index 74775b2e66..963f106979 100644 --- a/addons/explosives/functions/fnc_onKilled.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -14,13 +14,14 @@ * Public: No */ #include "script_component.hpp" + +//NOTE: Extended_Killed_EventHandlers runs only where _unit is local +params ["_unit"]; +TRACE_1("params",_unit); + private ["_deadman"]; -_unit = _this select 0; -if (_unit == ACE_player) then { - call FUNC(place_Cancel); -}; -if (!isServer) exitWith{}; + _deadman = [_unit, "DeadManSwitch"] call FUNC(getPlacedExplosives); { [_unit, -1, _x, true] call FUNC(detonateExplosive); -} foreach _deadman; +} forEach _deadman; diff --git a/addons/explosives/functions/fnc_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf index 53ebb2464d..3e3e1b96d3 100644 --- a/addons/explosives/functions/fnc_onInventoryChanged.sqf +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -17,8 +17,11 @@ * Public: No */ #include "script_component.hpp" + +params ["_receiver", "_giver", "_item"]; +TRACE_3("params",_receiver,_giver,_item); + private ["_config", "_detonators"]; -PARAMS_3(_receiver,_giver,_item); if (_receiver != ace_player) exitWith {}; diff --git a/addons/explosives/functions/fnc_onLanded.sqf b/addons/explosives/functions/fnc_onLanded.sqf deleted file mode 100644 index f2ed729b1a..0000000000 --- a/addons/explosives/functions/fnc_onLanded.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Handles the "EpeContactStart" event when placing the explosive. - * - * Arguments: - * 0: Explosive Placing Object - * 1: Colliding Object - * - * Return Value: - * None - * - * Example: - * object addEventHandler ["EpeContactStart", ACE_explosive_fnc_onLanded]; - * - * Public: No - */ -#include "script_component.hpp" -EXPLODE_2_PVT(_this,_explosive,_hitTarget); - -TRACE_2("Explosive EpeContactStart",_explosive,_hitTarget); - -if ((_explosive getVariable [QGVAR(Handled), false])) exitWith {}; - -_explosive setVariable [QGVAR(Handled), true]; -if (!isNull _hitTarget && {_hitTarget isKindOf "AllVehicles"}) then { - TRACE_1("Attaching to",_hitTarget); - _explosive attachTo [_hitTarget]; - private "_dir"; - _dir = _explosive getVariable [QGVAR(Direction), 0]; - _dir = _dir - (getDir _hitTarget); - [[_explosive, _dir, 0], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); -} else { - [{ - EXPLODE_2_PVT(_this,_player,_explosive); - private "_pos"; - _pos = getPosASL _explosive; - if (surfaceIsWater _pos) then { - _pos = getPosASL _explosive; - _explosive setPosASL _pos; - }else{ - _pos = getPosATL _explosive; - _explosive setPosATL _pos; - }; - }, [ACE_player, _explosive], 0.5, 0.1] call EFUNC(common,waitAndExecute); -}; diff --git a/addons/explosives/functions/fnc_openTimerSetUI.sqf b/addons/explosives/functions/fnc_openTimerSetUI.sqf index d08d7444dd..7175f425d4 100644 --- a/addons/explosives/functions/fnc_openTimerSetUI.sqf +++ b/addons/explosives/functions/fnc_openTimerSetUI.sqf @@ -15,7 +15,10 @@ * Public: No */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_explosive,_mag); + +params ["_explosive", "_mag"]; +TRACE_2("params",_explosive,_mag); + createDialog "RscACE_SelectTimeUI"; sliderSetRange [8845, 5, 900]; // 5seconds - 15minutes sliderSetPosition [8845, 30]; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 68580c2ba0..544566b4c6 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -21,9 +21,11 @@ * Public: Yes */ #include "script_component.hpp" -private ["_ammo", "_explosive", "_attachedTo", "_expPos", "_magazineTrigger"]; -EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars); -DEFAULT_PARAM(6,_setupPlaceholderObject,objNull); + +params ["_unit", "_pos", "_dir", "_magazineClass", "_triggerConfig", "_triggerSpecificVars", ["_setupPlaceholderObject", objNull]]; +TRACE_7("params",_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars,_setupPlaceholderObject); + +private ["_ammo", "_explosive", "_attachedTo", "_magazineTrigger", "_pitch", "_digDistance", "_canDigDown", "_soundEnviron", "_surfaceType"]; _unit playActionNow "PutDown"; @@ -52,6 +54,28 @@ if (isText(_magazineTrigger >> "ammo")) then { }; _triggerSpecificVars pushBack _triggerConfig; +//Dig the explosive down into the ground (usually on "pressurePlate") +if (isNumber (_magazineTrigger >> "digDistance")) then { + _digDistance = getNumber (_magazineTrigger >> "digDistance"); + + //Get Surface Type: + _canDigDown = true; + _surfaceType = surfaceType _pos; + if ((_surfaceType select [0,1]) == "#") then {_surfaceType = _surfaceType select [1, 99];}; + if ((_surfaceType != "") || {isClass (configfile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron")}) then { + _soundEnviron = getText (configfile >> "CfgSurfaces" >> _surfaceType >> "soundEnviron"); + TRACE_2("Dig Down Surface",_surfaceType,_soundEnviron); + _canDigDown = !(_soundEnviron in ["road", "tarmac", "concrete", "concrete_int", "int_concrete", "concrete_ext"]); + }; + //Don't dig down if pos ATL is high (in a building or A2 road) + if (_canDigDown && {(_pos select 2) < 0.1}) then { + TRACE_2("Can Dig Down",_digDistance,_pos); + _pos = _pos vectorAdd [0,0, (-1 * _digDistance)]; + } else { + TRACE_2("Can NOT Dig Down",_digDistance,_pos); + }; +}; + _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; _explosive setPosATL _pos; @@ -60,7 +84,17 @@ if (!isNull _attachedTo) then { _explosive attachTo [_attachedTo]; }; -if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] - call compile (getText (_triggerConfig >> "onPlace"))}) exitWith {_explosive}; -[[_explosive, _dir, getNumber (_magazineTrigger >> "pitch")], QFUNC(setPosition)] call EFUNC(common,execRemoteFnc); +//If trigger has "onPlace" and it returns true, just exitWith the explosive +if (isText(_triggerConfig >> "onPlace") && {[_unit,_explosive,_magazineClass,_triggerSpecificVars] call compile (getText (_triggerConfig >> "onPlace"))}) exitWith { + TRACE_1("onPlace returns true",_explosive); + _explosive +}; + +//TODO: placing explosives on hills looks funny + +_pitch = getNumber (_magazineTrigger >> "pitch"); + +//Globaly set the position angle: +[QGVAR(place), [_explosive, _dir, _pitch]] call EFUNC(common,globalEvent); + _explosive diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf deleted file mode 100644 index 0604045f65..0000000000 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Approves placement of the explosive, releases the placement object for it - * to settle in a location suitable for the explosive to be created. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ACE_Explosives_fnc_place_Approve; - * - * Public: No - */ -#include "script_component.hpp" -if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; -}; -private ["_setup", "_player", "_dir"]; -_setup = GVAR(Setup); -GVAR(Setup) = objNull; -[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); -GVAR(placer) = objNull; -_player = ACE_player; -call EFUNC(interaction,hideMouseHint); -if ((_setup getVariable [QGVAR(Class), ""]) == "") exitWith { - deleteVehicle _setup; -}; -_dir = (getDir _setup); -if (_dir > 180) then { - _dir = _dir - 180; -} else { - _dir = 180 + _dir; -}; -_setup setVariable [QGVAR(Direction), _dir, true]; -_player setVariable [QGVAR(PlantingExplosive), true]; -[{_this setVariable [QGVAR(PlantingExplosive), false]}, _player, 1.5, 0.5] call EFUNC(common,waitAndExecute); -_setup addEventHandler ["EpeContactStart", FUNC(onLanded)]; -_setup enableSimulationGlobal true; -_player playActionNow "PutDown"; -_player removeMagazine (_setup getVariable [QGVAR(Class), ""]); diff --git a/addons/explosives/functions/fnc_place_Cancel.sqf b/addons/explosives/functions/fnc_place_Cancel.sqf deleted file mode 100644 index 78d718e283..0000000000 --- a/addons/explosives/functions/fnc_place_Cancel.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Author: Garth 'L-H' de Wet - * Cancels placement of the explosive - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ACE_Explosives_fnc_place_Cancel; - * - * Public: Yes - */ -#include "script_component.hpp" -if (GVAR(pfeh_running)) then { - [QGVAR(Placement),"OnEachFrame"] call CALLSTACK(BIS_fnc_removeStackedEventHandler); - GVAR(pfeh_running) = false; -}; -if (!isNull (GVAR(Setup))) then { - deleteVehicle GVAR(Setup); -}; -GVAR(Setup) = objNull; -if (isNil {GVAR(placer)}) then { - GVAR(placer) = objNull; -}; -[GVAR(placer), "ACE_Explosives", false] call EFUNC(Common,setForceWalkStatus); -GVAR(placer) = objNull; -call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Place), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); diff --git a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf index c67313966c..00b1cbba2a 100644 --- a/addons/explosives/functions/fnc_removeFromSpeedDial.sqf +++ b/addons/explosives/functions/fnc_removeFromSpeedDial.sqf @@ -14,13 +14,15 @@ * Public: Yes */ #include "script_component.hpp" + private "_speedDial"; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; { if ((_x select 0) == (_this select 0)) exitWith { - _speedDial set [_foreachIndex, "x"]; + _speedDial set [_forEachIndex, "x"]; _speedDial = _speedDial - ["x"]; ace_player setVariable [QGVAR(SpeedDial),_speedDial]; }; -} foreach _speedDial; +} forEach _speedDial; diff --git a/addons/explosives/functions/fnc_selectTrigger.sqf b/addons/explosives/functions/fnc_selectTrigger.sqf index 53bc8b66cb..203bfaf606 100644 --- a/addons/explosives/functions/fnc_selectTrigger.sqf +++ b/addons/explosives/functions/fnc_selectTrigger.sqf @@ -16,12 +16,17 @@ * Public: No */ #include "script_component.hpp" + +params ["_explosive", "_magazine", "_trigger"]; +TRACE_3("params",_explosive,_magazine,_trigger); + private ["_config"]; -EXPLODE_3_PVT(_this,_explosive,_magazine,_trigger); _config = ConfigFile >> "ACE_Triggers" >> _trigger; // If the onSetup function returns true, it is handled elsewhere -if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith {}; +if (isText(_config >> "onSetup") && {[_explosive,_magazine] call compile getText (_config >> "onSetup")}) exitWith { + TRACE_2("onSetup returned true",_explosive,_trigger); +}; -[ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call ACE_Explosives_fnc_placeExplosive; +[ACE_player, getPosATL _explosive, _explosive getVariable [QGVAR(Direction), 0],_magazine, _trigger, [], _explosive] call FUNC(placeExplosive); diff --git a/addons/explosives/functions/fnc_setPosition.sqf b/addons/explosives/functions/fnc_setPosition.sqf index dcf2537776..b19e63ff5a 100644 --- a/addons/explosives/functions/fnc_setPosition.sqf +++ b/addons/explosives/functions/fnc_setPosition.sqf @@ -11,13 +11,21 @@ * None * * Example: - * [_explosive, 150, 90] call ACE_Explosives_fnc_SetPos; + * [_explosive, 150, 90] call ACE_Explosives_fnc_setPosition; * - * Public: Yes + * Public: No */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_explosive,_direction,_pitch); -_explosive setDir _direction; -if (_pitch != 0) then { - [_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank); + +params ["_explosive", "_direction", "_pitch"]; +TRACE_3("params",_explosive,_direction,_pitch); + +if (isNull (attachedTo _explosive)) then { + _explosive setDir _direction; + if (_pitch != 0) then { + [_explosive, _pitch, 0] call CALLSTACK(BIS_fnc_setPitchBank); + }; +} else { + //Attaching to a vehicle (dirAndUp based on vehicle) + _explosive setVectorDirAndUp [[0,0,1],[(sin _direction),(cos _direction),0]]; }; diff --git a/addons/explosives/functions/fnc_setSpeedDial.sqf b/addons/explosives/functions/fnc_setSpeedDial.sqf index adb2e6af03..9013c812cc 100644 --- a/addons/explosives/functions/fnc_setSpeedDial.sqf +++ b/addons/explosives/functions/fnc_setSpeedDial.sqf @@ -15,7 +15,9 @@ * Public: No */ #include "script_component.hpp" + private ["_speedDial", "_amount"]; + _speedDial = ace_player getVariable [QGVAR(SpeedDial), []]; if (count _speedDial == 0) exitWith {}; _amount = if((_this select 0))then{1}else{-1}; diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 566ab9c281..b104761fac 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -3,8 +3,9 @@ * Starts the setup process for the passed explosive. Player only. * * Arguments: - * 0: Unit - * 1: Classname of explosive to place. (CfgMagazine class) + * 0: Vehicle + * 1: Player Unit + * 2: Classname of explosive to place. (CfgMagazine class) * * Return Value: * None @@ -14,36 +15,203 @@ * * Public: Yes */ +// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" -closeDialog 0; -EXPLODE_2_PVT(_this,_unit,_class); -GVAR(placer) = _unit; -// TODO: check MP performance and MP compatible. -GVAR(Setup) = createVehicle [getText(ConfigFile >> "CfgMagazines" >> _class >> "ACE_SetupObject"),[0,0,-10000],[], 0, "NONE"]; -GVAR(Setup) enableSimulationGlobal false; -GVAR(Setup) setVariable [QGVAR(class), _class, true]; +#define PLACE_RANGE_MAX 1 +#define PLACE_RANGE_MIN 0.025 + +params ["_vehicle", "_unit", "_magClassname"]; +TRACE_3("params",_vehicle,_unit,_magClassname); + +private["_isAttachable", "_setupObjectClass", "_supportedTriggers", "_p3dModel"]; + +//Get setup object vehicle and model: +_setupObjectClass = getText(ConfigFile >> "CfgMagazines" >> _magClassname >> "ACE_SetupObject"); +if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR("Bad Vehicle");}; +_p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); +if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game! [_unit, "ACE_Explosives", true] call EFUNC(common,setForceWalkStatus); -GVAR(TweakedAngle) = 180; -[QGVAR(Placement),"OnEachFrame", { - private ["_player", "_pos"]; - _player = ACE_player; - if (GVAR(placer) != _player) exitWith { - call FUNC(place_Cancel); - }; - GVAR(pfeh_running) = true; - _pos = (ASLtoATL eyePos _player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0]); - GVAR(Setup) setPosATL _pos; - if (ACE_Modifier == 0) then { - GVAR(Setup) setDir (GVAR(TweakedAngle) + getDir _player); - }; -}] call CALLSTACK(BIS_fnc_addStackedEventHandler); +//Show mouse buttons: +[localize LSTRING(PlaceAction), localize LSTRING(CancelAction), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); +_unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; +_unit setVariable [QGVAR(cancelActionEH), [_unit, "zoomtemp", {true}, {GVAR(placeAction) = PLACE_CANCEL;}] call EFUNC(common,AddActionEventHandler)]; -[localize LSTRING(PlaceAction), localize LSTRING(CancelAction), - localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); -_unit setVariable [QGVAR(Place), [_unit, "DefaultAction", - {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Approve);}] call EFUNC(common,AddActionEventHandler)]; -_unit setVariable [QGVAR(Cancel), [_unit, "zoomtemp", - {GVAR(pfeh_running) AND !isNull (GVAR(Setup))}, {call FUNC(place_Cancel);}] call EFUNC(common,AddActionEventHandler)]; +//Display to show virtual object: +(QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutRsc [QGVAR(virtualAmmo), "PLAIN", 0, false]; +((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModel _p3dModel; + +//Make sure it has a trigger that works when attached (eg, no tripwires that only do pressurePlate) +_isAttachable = false; +_supportedTriggers = getArray (configFile >> "CfgMagazines" >> _magClassname >> "ACE_Triggers" >> "SupportedTriggers"); +{ + if ((getNumber (configFile >> "ACE_Triggers" >> _x >> "isAttachable")) == 1) exitWith {_isAttachable = true;}; +} forEach _supportedTriggers; + + +GVAR(pfeh_running) = true; +GVAR(placeAction) = PLACE_WAITING; +GVAR(TweakedAngle) = 0; + + +[{ + BEGIN_COUNTER(pfeh); + + params ["_args", "_pfID"]; + _args params ["_unit", "_magClassname", "_setupObjectClass", "_isAttachable"]; + + private["_angle", "_attachVehicle", "_badPosition", "_basePosASL", "_cameraAngle", "_distanceFromBase", "_expSetupVehicle", "_index", "_intersectsWith", "_lookDirVector", "_max", "_min", "_modelDir", "_modelOffset", "_modelUp", "_placeAngle", "_realDistance", "_return", "_screenPos", "_testBase", "_testPos", "_testPositionIsValid", "_virtualPosASL"]; + + _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,0,10]) call EFUNC(common,positionToASL)); + _basePosASL = (eyePos _unit); + if (cameraView == "EXTERNAL") then { //If external, show explosive over the right shoulder + _basePosASL = _basePosASL vectorAdd ((positionCameraToWorld [0.3,0,0]) vectorDiff (positionCameraToWorld [0,0,0])); + }; + if ((stance _unit) == "PRONE") then { + //If prone, lower base and increase up angle of look - Makes it much easier to attach to underside of vehicles + _basePosASL set [2, ((_basePosASL select 2) - 0.3)]; + _lookDirVector = ((positionCameraToWorld [0,0,0]) call EFUNC(common,positionToASL)) vectorFromTo ((positionCameraToWorld [0,3,10]) call EFUNC(common,positionToASL)); + }; + _cameraAngle = (_lookDirVector select 0) atan2 (_lookDirVector select 1); + + _testPositionIsValid = { + _testBase = _basePosASL vectorAdd (_lookDirVector vectorMultiply (_this select 0)); + _return = true; + { + _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; + #ifdef DEBUG_MODE_FULL + drawLine3d [(eyePos _unit) call EFUNC(common,ASLToPosition), (_testPos) call EFUNC(common,ASLToPosition), [1,0,0,1]]; + #endif + if (lineIntersects [eyePos _unit, _testPos, _unit]) exitWith {_return = false;}; + } forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]]; + _return + }; + + _distanceFromBase = PLACE_RANGE_MAX; + _badPosition = !([_distanceFromBase] call _testPositionIsValid); + _attachVehicle = objNull; + + if (_isAttachable && _badPosition) then { + _attachVehicle = objNull; + _testBase = _basePosASL vectorAdd _lookDirVector; + { + _testPos = _testBase vectorAdd [0.1 * (_x select 0) * (cos _cameraAngle), 0.1 * (_x select 0) * (sin _cameraAngle), 0.1 * (_x select 1)]; + _intersectsWith = lineIntersectsWith [eyePos _unit, _testPos, _unit]; + if (count _intersectsWith == 1) exitWith {_attachVehicle = (_intersectsWith select 0);}; + } forEach [[0,0], [-1,-1], [1,-1], [-1,1], [1,1]]; + if ((!isNull _attachVehicle) && {[PLACE_RANGE_MIN] call _testPositionIsValid} && + {(_attachVehicle isKindOf "Car") || {_attachVehicle isKindOf "Tank"} || {_attachVehicle isKindOf "Air"} || {_attachVehicle isKindOf "Ship"}}) then { + _min = PLACE_RANGE_MIN; + _max = PLACE_RANGE_MAX; + for "_index" from 0 to 6 do { + _distanceFromBase = (_min + _max) / 2; + if ([_distanceFromBase] call _testPositionIsValid) then { + _min = _distanceFromBase; + } else { + _max = _distanceFromBase; + }; + }; + _badPosition = false; + _distanceFromBase = ((_min + _max) / 2 + 0.075) min 1; + } else { + _attachVehicle = objNull; + }; + }; + + _virtualPosASL = _basePosASL vectorAdd (_lookDirVector vectorMultiply _distanceFromBase); + + //Update mouse hint: + if (_badPosition) then { + ((uiNamespace getVariable ["ACE_Helper_Display", objNull]) displayCtrl 1000) ctrlSetText localize LSTRING(BlockedAction); + } else { + if (isNull _attachVehicle) then { + ((uiNamespace getVariable ["ACE_Helper_Display", objNull]) displayCtrl 1000) ctrlSetText localize LSTRING(PlaceAction); + } else { + ((uiNamespace getVariable ["ACE_Helper_Display", objNull]) displayCtrl 1000) ctrlSetText localize LSTRING(AttachAction); + }; + }; + + //Don't allow Placing bellow terrain + if ((getTerrainHeightASL _virtualPosASL) > (_virtualPosASL select 2)) then { + _virtualPosASL set [2, (getTerrainHeightASL _virtualPosASL)]; + }; + + //Don't allow placing in a bad position: + if (_badPosition && {GVAR(placeAction) == PLACE_APPROVE}) then {GVAR(placeAction) = PLACE_WAITING;}; + + if (((inputAction "zoomTemp") > 0) || //Cancel on RMB, For some reason this works (when held) but AddActionEventHandler doesn't + {_unit != ACE_player} || + {!([_unit, objNull, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} || + {!(_magClassname in (magazines _unit))}) then { + GVAR(placeAction) = PLACE_CANCEL; + }; + + if (GVAR(placeAction) != PLACE_WAITING) then { + [_pfID] call CBA_fnc_removePerFrameHandler; + GVAR(pfeh_running) = false; + + [_unit, "ACE_Explosives", false] call EFUNC(common,setForceWalkStatus); + [] call EFUNC(interaction,hideMouseHint); + [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); + [_unit, "zoomtemp", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); + + (QGVAR(virtualAmmo) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; + + if (GVAR(placeAction) == PLACE_APPROVE) then { + _placeAngle = 0; + _expSetupVehicle = _setupObjectClass createVehicle (_virtualPosASL call EFUNC(common,ASLToPosition)); + + TRACE_1("Planting Mass", (getMass _expSetupVehicle)); + //If the object is too heavy, it can kill a player if it colides + if ((getMass _expSetupVehicle) > 5) then {_expSetupVehicle setMass 5;}; + + if (isNull _attachVehicle) then { + _placeAngle = _cameraAngle - GVAR(TweakedAngle) + 180; + _expSetupVehicle setPosAsl _virtualPosASL; + _expSetupVehicle setDir _placeAngle; + _placeAngle = _placeAngle + 180; //CfgAmmos seem to be 180 for some reason + } else { + _modelOffset = _attachVehicle worldToModel (_virtualPosASL call EFUNC(common,ASLToPosition)); + _placeAngle = _cameraAngle - (getDir _attachVehicle) + 180; + _expSetupVehicle attachTo [_attachVehicle, _modelOffset]; + _expSetupVehicle setVectorDirAndUp [[0,0,-1],[(sin _placeAngle),(cos _placeAngle),0]]; + }; + + TRACE_1("Place angel",_placeAngle); + + _expSetupVehicle setVariable [QGVAR(class), _magClassname, true]; + _expSetupVehicle setVariable [QGVAR(Direction), _placeAngle, true]; + + _unit removeMagazine _magClassname; + _unit playActionNow "PutDown"; + _unit setVariable [QGVAR(PlantingExplosive), true]; + [{_this setVariable [QGVAR(PlantingExplosive), false]}, _unit, 1.5] call EFUNC(common,waitAndExecute); + + }; + } else { + _screenPos = worldToScreen (_virtualPosASL call EFUNC(common,ASLToPosition)); + if (_badPosition || {_screenPos isEqualTo []}) then { + ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow false; + } else { + //Show the model on the hud in aprox the same size/location as it will be placed: + ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlShow true; + + _realDistance = ((_virtualPosASL call EFUNC(common,ASLToPosition)) distance (positionCameraToWorld [0,0,0])) / ((call CBA_fnc_getFov) select 1); + _screenPos = [(_screenPos select 0), _realDistance, (_screenPos select 1)]; + ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetPosition _screenPos; + + _modelDir = [0,0,-1]; + _modelUp = [0,-1,0]; + if (isNull _attachVehicle) then { + _angle = acos (_lookDirVector select 2); + _modelUp = [0, (cos _angle), (sin _angle)]; + _modelDir = [cos GVAR(TweakedAngle), sin GVAR(TweakedAngle), 0] vectorCrossProduct _modelUp; + }; + ((uiNamespace getVariable [QGVAR(virtualAmmoDisplay), displayNull]) displayCtrl 800851) ctrlSetModelDirAndUp [_modelDir, _modelUp]; + }; + }; + + END_COUNTER(pfeh); +}, 0, [_unit, _magClassname, _setupObjectClass, _isAttachable]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 251e1e213d..2c394a997a 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -15,14 +15,17 @@ * Public: Yes */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_target); + +params ["_unit", "_target"]; +TRACE_2("params",_unit,_target); private["_actionToPlay", "_defuseTime", "_isEOD"]; _target = attachedTo (_target); _fnc_DefuseTime = { - EXPLODE_2_PVT(_this,_specialist,_target); + params ["_specialist", "_target"]; + TRACE_2("defuseTime",_specialist,_target); private ["_defuseTime"]; _defuseTime = 5; if (isNumber(ConfigFile >> "CfgAmmo" >> typeOf (_target) >> "ACE_DefuseTime")) then { @@ -48,11 +51,12 @@ if (ACE_player != _unit) then { _unit disableAI "TARGET"; _defuseTime = [[_unit] call EFUNC(Common,isEOD), _target] call _fnc_DefuseTime; [{ - PARAMS_2(_unit,_target); + params ["_unit", "_target"]; + TRACE_2("defuse finished",_unit,_target); [_unit, _target] call FUNC(defuseExplosive); _unit enableAI "MOVE"; _unit enableAI "TARGET"; - }, [_unit, _target], _defuseTime, 0] call EFUNC(common,waitAndExecute); + }, [_unit, _target], _defuseTime] call EFUNC(common,waitAndExecute); }; } else { _unit playActionNow _actionToPlay; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 9d2ca0aee4..ca219ed13c 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -16,12 +16,13 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_explosive,_delay); +params ["_explosive", "_delay"]; +TRACE_2("params",_explosive,_delay); [{ - private ["_explosive"]; - _explosive = _this; + params ["_explosive"]; + TRACE_1("Explosive Going Boom",_explosive); if (!isNull _explosive) then { [_explosive, -1, [_explosive, 0]] call FUNC(detonateExplosive); }; -}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); +}, [_explosive], _delay] call EFUNC(common,waitAndExecute); diff --git a/addons/explosives/functions/fnc_triggerType.sqf b/addons/explosives/functions/fnc_triggerType.sqf index f9d8790a56..0fc29e34ad 100644 --- a/addons/explosives/functions/fnc_triggerType.sqf +++ b/addons/explosives/functions/fnc_triggerType.sqf @@ -9,17 +9,19 @@ * Supported triggers as ACE_Triggers config entries * * Example: - * _supports = ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_TriggerType + * ["SatchelCharge_Remote_Mag"] call ACE_Explosives_fnc_TriggerType * * Public: Yes */ #include "script_component.hpp" -private["_result", "_config", "_count", "_index", "_supports"]; -// IGNORE_PRIVATE_WARNING(_supports); +params ["_magazineClassname"]; +TRACE_1("params",_magazineClassname); + +private["_result", "_config", "_count", "_index"]; _result = []; -_config = getArray (ConfigFile >> "CfgMagazines" >> (_this select 0) >> "ACE_Triggers" >> "SupportedTriggers"); +_config = getArray (ConfigFile >> "CfgMagazines" >> _magazineClassname >> "ACE_Triggers" >> "SupportedTriggers"); _count = count _config; for "_index" from 0 to (_count - 1) do { diff --git a/addons/explosives/script_component.hpp b/addons/explosives/script_component.hpp index 5ff12b8ba3..17de3516a5 100644 --- a/addons/explosives/script_component.hpp +++ b/addons/explosives/script_component.hpp @@ -12,3 +12,7 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define PLACE_WAITING -1 +#define PLACE_CANCEL 0 +#define PLACE_APPROVE 1 diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index a985b428c1..e1255d962f 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -5,7 +5,7 @@ Explosives Sprengstoffe Explosivos - Ładunki wybuchowe + Mat. wybuchowe Explosifs Výbušniny Esplosivi @@ -61,6 +61,22 @@ Colocar Установить + + Attach + Befestigen + Acoplar + Przyczep + Attacher + Připnout + Fixar + Attacca + Hozzácsatolás + Прикрепить + + + Blocked + Obstruido + Cancel Abbrechen diff --git a/addons/fcs/README.md b/addons/fcs/README.md index dfe9b8d8e9..c4abbe3253 100644 --- a/addons/fcs/README.md +++ b/addons/fcs/README.md @@ -1,7 +1,7 @@ ace_fcs ======= -Adds a fire control system to armoured vehicles and helicoters, allowing the precise engagement of stationary and moving targets. +Adds a fire control system to armoured vehicles and helicopters, allowing precise engagement of stationary and moving targets. ## Maintainers diff --git a/addons/finger/functions/fnc_incomingFinger.sqf b/addons/finger/functions/fnc_incomingFinger.sqf index 83e2916e4f..5a1e23a278 100644 --- a/addons/finger/functions/fnc_incomingFinger.sqf +++ b/addons/finger/functions/fnc_incomingFinger.sqf @@ -16,10 +16,10 @@ */ #include "script_component.hpp" -PARAMS_2(_sourceUnit,_fingerPosPrecise); - private ["_data", "_fingerPos"]; +params ["_sourceUnit", "_fingerPosPrecise"]; + //add some random float to location if it's not our own finger: _fingerPos = if (_sourceUnit == ACE_player) then { _fingerPosPrecise diff --git a/addons/finger/functions/fnc_keyPress.sqf b/addons/finger/functions/fnc_keyPress.sqf index 8462eb7170..1ce83d62dc 100644 --- a/addons/finger/functions/fnc_keyPress.sqf +++ b/addons/finger/functions/fnc_keyPress.sqf @@ -38,7 +38,7 @@ _sendFingerToPlayers = []; _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]); { _nearbyMen append (crew _x); -} forEach (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]); +} count (ACE_player nearObjects ["StaticWeapon", (GVAR(maxRange) + 2)]); { if ((((eyePos _x) vectorDistance _playerEyePos) < GVAR(maxRange)) && @@ -50,7 +50,8 @@ _nearbyMen = (ACE_player nearObjects ["CAManBase", (GVAR(maxRange) + 2)]); _sendFingerToPlayers pushBack _x; }; -} forEach _nearbyMen; + true +} count _nearbyMen; TRACE_1("sending finger to",_sendFingerToPlayers); diff --git a/addons/finger/functions/fnc_moduleSettings.sqf b/addons/finger/functions/fnc_moduleSettings.sqf index aa623ed58c..c5189f4562 100644 --- a/addons/finger/functions/fnc_moduleSettings.sqf +++ b/addons/finger/functions/fnc_moduleSettings.sqf @@ -13,8 +13,7 @@ #include "script_component.hpp" -PARAMS_1(_logic); - +params ["_logic"]; if !(isServer) exitWith {}; [_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index a35550db76..d6297a4095 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -30,7 +30,7 @@ _iconSize = BASE_SIZE * _fovCorrection; { _data = HASH_GET(GVAR(fingersHash), _x); - EXPLODE_3_PVT(_data,_lastTime,_pos,_name); + _data params ["_lastTime", "_pos", "_name"]; _timeLeftToShow = _lastTime + FP_TIMEOUT - ACE_diagTime; if (_timeLeftToShow <= 0) then { HASH_REM(GVAR(fingersHash), _x); @@ -43,7 +43,7 @@ _iconSize = BASE_SIZE * _fovCorrection; drawIcon3D [QUOTE(PATHTOF(UI\fp_icon.paa)), _drawColor, _pos, _iconSize, _iconSize, 0, _name, 1, 0.03, "PuristaMedium"]; }; -} forEach (GVAR(fingersHash) select 0); +} count (GVAR(fingersHash) select 0); if ((count (GVAR(fingersHash) select 0)) == 0) then { [GVAR(pfeh_id)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/finger/stringtable.xml b/addons/finger/stringtable.xml index bbc308fcd7..f11f36d971 100644 --- a/addons/finger/stringtable.xml +++ b/addons/finger/stringtable.xml @@ -1,40 +1,50 @@ - - - - - Show finger indicator to self - Отображать пальце-индикатор для показывающего игрока - - - Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator - Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор - - - Finger indicator - Пальце-индикатор - - - Color of the finger-pointing indicator circle - Цвет индикатора пальце-указания - - - Action "point a finger at" - Действие "показать пальцем на" - - - Points, and shows a virtual marker of where you are looking to nearby units. Can be held down. - - - Finger Settings - - - Finger Pointing Enabled - - - Finger Max Range - - - How far away players can finger each other. [default: 4] - - - + + + + + Show pointing indicator to self + Отображать пальце-индикатор для показывающего игрока + Pokaż indykator wskazywania palcem dla siebie + + + Render the indicator for the pointing player. This option doesn't affect whether the other players would see the indicator + Отображать индикатор для показывающего игрока. Эта настройка не влияет на то, будутт ли другие игроки видеть индикатор + Wyświetl indykator kiedy wskazujesz coś palcem. Ta opcja nie wpływa na to, czy inni gracze zobaczą ten indykator czy też nie. + + + Pointing indicator + Пальце-индикатор + Indykator palca + + + Color of the pointing indicator circle + Цвет индикатора пальце-указания + Kolor okręgu wyświetlanego przy wskazywaniu palcem + + + Action "point a finger at" + Действие "показать пальцем на" + Akcja "wskaż palcem" + + + Points, and shows a virtual marker of where you are looking to nearby units. Can be held down. + Wskazuje a także wyświetla wirtualny marker-okrąg w miejscu, w które patrzysz, dla wszystkich pobliskich jednostek. Może być przytrzymywany. + + + Pointing Settings + Ustawienia wskazywania palcem + + + Pointing Enabled + Aktywuj wskazywanie + + + Pointing Max Range + Maks. zasięg wskazywania + + + Max range between players to show the pointing indicator [default: 4 meters] + Określ dystans na jakim można wskazywać coś palcem innym graczom. [domyślnie: 4m] + + + diff --git a/addons/flashlights/$PBOPREFIX$ b/addons/flashlights/$PBOPREFIX$ new file mode 100644 index 0000000000..674d0d255c --- /dev/null +++ b/addons/flashlights/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\flashlights \ No newline at end of file diff --git a/addons/flashlights/CfgEventHandlers.hpp b/addons/flashlights/CfgEventHandlers.hpp new file mode 100644 index 0000000000..d5f49bd5c3 --- /dev/null +++ b/addons/flashlights/CfgEventHandlers.hpp @@ -0,0 +1,5 @@ +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + }; +}; diff --git a/addons/flashlights/CfgSounds.hpp b/addons/flashlights/CfgSounds.hpp new file mode 100644 index 0000000000..f0fabe3a39 --- /dev/null +++ b/addons/flashlights/CfgSounds.hpp @@ -0,0 +1,7 @@ +class CfgSounds { + class ACE_flashlights_flashlightClick { + name = "ACE_flashlights_flashlightClick"; + sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/CfgVehicles.hpp b/addons/flashlights/CfgVehicles.hpp new file mode 100644 index 0000000000..fa766ad87b --- /dev/null +++ b/addons/flashlights/CfgVehicles.hpp @@ -0,0 +1,89 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + //todo: add flashlight attach actions + }; + }; + + class Item_Base_F; + + class ACE_Flashlight_MX991Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(MX991_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_MX991 { + name = "ACE_Flashlight_MX991"; + count = 1; + }; + }; + }; + + class ACE_Flashlight_KSF1Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(KSF1_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_KSF1 { + name = "ACE_Flashlight_KSF1"; + count = 1; + }; + }; + }; + + class ACE_Flashlight_XL50Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(XL50_DisplayName); + author = ECSTRING(common,ACETeam); + vehicleClass = "WeaponAccessories"; + class TransportItems { + class ACE_Flashlight_XL50 { + name = "ACE_Flashlight_XL50"; + count = 1; + }; + }; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_KSF1,12); + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_XL50,12); + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Flashlight_MX991,12); + MACRO_ADDITEM(ACE_Flashlight_KSF1,12); + MACRO_ADDITEM(ACE_Flashlight_XL50,12); + }; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/CfgWeapons.hpp b/addons/flashlights/CfgWeapons.hpp new file mode 100644 index 0000000000..09fe70d764 --- /dev/null +++ b/addons/flashlights/CfgWeapons.hpp @@ -0,0 +1,61 @@ +class CfgWeapons { + + class ItemCore; + class ACE_ItemCore; + class InventoryItem_Base_F; + class InventoryFlashlightItem_Base_F; + + class acc_flashlight: ItemCore { + class ItemInfo: InventoryFlashlightItem_Base_F { + class Flashlight { + ACE_Flashlight_Colour = "white"; + ACE_Flashlight_Size = 2.75; + }; + }; + }; + + class ACE_Flashlight_MX991: ACE_ItemCore { + displayName = CSTRING(MX991_DisplayName); + descriptionShort = CSTRING(MX991_Description); + model = QUOTE(PATHTOF(data\MX_991.p3d)); + picture = PATHTOF(UI\mx991_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "red"; + ACE_Flashlight_Size = 1.75; + }; + }; + }; + + class ACE_Flashlight_KSF1: ACE_ItemCore { + displayName = CSTRING(KSF1_DisplayName); + descriptionShort = CSTRING(KSF1_Description); + model = QUOTE(PATHTOF(data\KSF_1.p3d)); + picture = PATHTOF(UI\ksf1_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "red"; + ACE_Flashlight_Size = 1.5; + }; + }; + }; + + class ACE_Flashlight_XL50: ACE_ItemCore { + displayName = CSTRING(XL50_DisplayName); + descriptionShort = CSTRING(XL50_Description); + model = QUOTE(PATHTOF(data\Maglight.p3d)); + picture = PATHTOF(UI\xl50_ca.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + class FlashLight { + ACE_Flashlight_Colour = "white"; + ACE_Flashlight_Size = 2.15; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/flashlights/README.md b/addons/flashlights/README.md new file mode 100644 index 0000000000..6a04b78091 --- /dev/null +++ b/addons/flashlights/README.md @@ -0,0 +1,11 @@ +ace_flashlights +======= + +Flashlights for use on map and to attach to player. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [voiper](https://github.com/voiperr) diff --git a/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa new file mode 100644 index 0000000000..737780d1c8 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_blue_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_green_ca.paa b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa new file mode 100644 index 0000000000..b075990ba6 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_green_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_red_ca.paa b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa new file mode 100644 index 0000000000..5afd4e66d5 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_red_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_white_ca.paa b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa new file mode 100644 index 0000000000..08460e9a9c Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_white_ca.paa differ diff --git a/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa new file mode 100644 index 0000000000..8593ac8706 Binary files /dev/null and b/addons/flashlights/UI/Flashlight_Beam_yellow_ca.paa differ diff --git a/addons/flashlights/UI/KSF1_ca.paa b/addons/flashlights/UI/KSF1_ca.paa new file mode 100644 index 0000000000..5a89051c05 Binary files /dev/null and b/addons/flashlights/UI/KSF1_ca.paa differ diff --git a/addons/flashlights/UI/mx991_ca.paa b/addons/flashlights/UI/mx991_ca.paa new file mode 100644 index 0000000000..9385ec675a Binary files /dev/null and b/addons/flashlights/UI/mx991_ca.paa differ diff --git a/addons/flashlights/UI/xl50_ca.paa b/addons/flashlights/UI/xl50_ca.paa new file mode 100644 index 0000000000..55aaa0cbcd Binary files /dev/null and b/addons/flashlights/UI/xl50_ca.paa differ diff --git a/addons/flashlights/XEH_postInitClient.sqf b/addons/flashlights/XEH_postInitClient.sqf new file mode 100644 index 0000000000..09cdcdd1f2 --- /dev/null +++ b/addons/flashlights/XEH_postInitClient.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +// Exit on Headless as well +if !(hasInterface) exitWith {}; + +LOG(MSG_INIT); + +//todo: make flashlights attachable to players \ No newline at end of file diff --git a/addons/flashlights/config.cpp b/addons/flashlights/config.cpp new file mode 100644 index 0000000000..b34c4b8000 --- /dev/null +++ b/addons/flashlights/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_Flashlight_MX991", "ACE_Flashlight_KSF1", "ACE_Flashlight_XL50"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"voiper"}; + authorUrl = "https://github.com/voiperr/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "CfgSounds.hpp" diff --git a/addons/flashlights/data/KSF_1.p3d b/addons/flashlights/data/KSF_1.p3d new file mode 100644 index 0000000000..0ec2fd23c6 Binary files /dev/null and b/addons/flashlights/data/KSF_1.p3d differ diff --git a/addons/flashlights/data/KSF_1.rvmat b/addons/flashlights/data/KSF_1.rvmat new file mode 100644 index 0000000000..113fe0cc14 --- /dev/null +++ b/addons/flashlights/data/KSF_1.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\KSF_1_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="z\ace\addons\flashlights\data\KSF_1_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/KSF_1_co.paa b/addons/flashlights/data/KSF_1_co.paa new file mode 100644 index 0000000000..bb31888863 Binary files /dev/null and b/addons/flashlights/data/KSF_1_co.paa differ diff --git a/addons/flashlights/data/KSF_1_nohq.paa b/addons/flashlights/data/KSF_1_nohq.paa new file mode 100644 index 0000000000..8c5ada23c8 Binary files /dev/null and b/addons/flashlights/data/KSF_1_nohq.paa differ diff --git a/addons/flashlights/data/KSF_1_smdi.paa b/addons/flashlights/data/KSF_1_smdi.paa new file mode 100644 index 0000000000..b12f26e5f4 Binary files /dev/null and b/addons/flashlights/data/KSF_1_smdi.paa differ diff --git a/addons/flashlights/data/MX_991.p3d b/addons/flashlights/data/MX_991.p3d new file mode 100644 index 0000000000..c79c330ea3 Binary files /dev/null and b/addons/flashlights/data/MX_991.p3d differ diff --git a/addons/flashlights/data/MX_991.rvmat b/addons/flashlights/data/MX_991.rvmat new file mode 100644 index 0000000000..0268d4903c --- /dev/null +++ b/addons/flashlights/data/MX_991.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\MX_991_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="#(rgb,1,1,1)color(0.2,0.2,1,1)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/MX_991_co.paa b/addons/flashlights/data/MX_991_co.paa new file mode 100644 index 0000000000..598dda174b Binary files /dev/null and b/addons/flashlights/data/MX_991_co.paa differ diff --git a/addons/flashlights/data/MX_991_nohq.paa b/addons/flashlights/data/MX_991_nohq.paa new file mode 100644 index 0000000000..565df542e1 Binary files /dev/null and b/addons/flashlights/data/MX_991_nohq.paa differ diff --git a/addons/flashlights/data/Maglight.p3d b/addons/flashlights/data/Maglight.p3d new file mode 100644 index 0000000000..6ce3b9fcd4 Binary files /dev/null and b/addons/flashlights/data/Maglight.p3d differ diff --git a/addons/flashlights/data/Maglite.rvmat b/addons/flashlights/data/Maglite.rvmat new file mode 100644 index 0000000000..960599813b --- /dev/null +++ b/addons/flashlights/data/Maglite.rvmat @@ -0,0 +1,79 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.6,0.6,0.6,1}; //amount of glossiness - the higher the number, the higher the glossiness +specularPower=700; //area of glossiness - the higher the number, the smaller the area +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\flashlights\data\Maglite_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,dt)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,mc)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,as)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,1}; + }; +}; +class Stage5 { + texture="z\ace\addons\flashlights\data\Maglite_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(4.7,1.2)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_ca.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; diff --git a/addons/flashlights/data/Maglite_co.paa b/addons/flashlights/data/Maglite_co.paa new file mode 100644 index 0000000000..8a399b25cc Binary files /dev/null and b/addons/flashlights/data/Maglite_co.paa differ diff --git a/addons/flashlights/data/Maglite_nohq.paa b/addons/flashlights/data/Maglite_nohq.paa new file mode 100644 index 0000000000..43282a963b Binary files /dev/null and b/addons/flashlights/data/Maglite_nohq.paa differ diff --git a/addons/flashlights/data/Maglite_smdi.paa b/addons/flashlights/data/Maglite_smdi.paa new file mode 100644 index 0000000000..093d83e145 Binary files /dev/null and b/addons/flashlights/data/Maglite_smdi.paa differ diff --git a/addons/flashlights/script_component.hpp b/addons/flashlights/script_component.hpp new file mode 100644 index 0000000000..ba740c22fc --- /dev/null +++ b/addons/flashlights/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT flashlights +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FLASHLIGHTS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_FLASHLIGHTS + #define DEBUG_SETTINGS DEBUG_SETTINGS_FLASHLIGHTS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/flashlights/stringtable.xml b/addons/flashlights/stringtable.xml new file mode 100644 index 0000000000..e871360bf3 --- /dev/null +++ b/addons/flashlights/stringtable.xml @@ -0,0 +1,29 @@ + + + + + Fulton MX-991 + Fulton MX-991 + + + Flashlight with red filter. For use on map. + Latarka z czerwonym filtrem. Używana do podświetlania mapy. + + + Maglite XL50 + Maglite XL50 + + + White mini flashlight. For use on map. + Mini latarka. Światło białe. Używana do podświetlania mapy. + + + KSF-1 + KSF-1 + + + Flashlight with red filter. For use on map. + Latarka z czerwonym filtrem. Używana do podświetlania mapy. + + + \ No newline at end of file diff --git a/addons/fonts/README.md b/addons/fonts/README.md new file mode 100644 index 0000000000..7e6f704d67 --- /dev/null +++ b/addons/fonts/README.md @@ -0,0 +1,11 @@ +ace_fonts +======== + +Custom fonts including fixed-width font. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [jaynus](https://github.com/jaynus/) diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index 32dec890c9..680dc31c37 100644 --- a/addons/frag/functions/fnc_addTrack.sqf +++ b/addons/frag/functions/fnc_addTrack.sqf @@ -20,4 +20,4 @@ _positions set[(count _positions), [(getPos _obj), _objSpd]]; _data = [_origin, typeOf _origin, typeOf _obj, _objSpd, _positions, _color]; GVAR(traces) set[_index, _data]; -[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call cba_fnc_addPerFrameHandler; +[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf index 911203dc5f..b0e24f0972 100644 --- a/addons/frag/functions/fnc_doReflections.sqf +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -18,5 +18,5 @@ if(_depth <= 2) then { _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; - [DFUNC(findReflections), 0, _testParams] call cba_fnc_addPerFrameHandler; + [DFUNC(findReflections), 0, _testParams] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index 9eaa605b57..193e1e7154 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -121,6 +121,6 @@ if(_zIndex < 5) then { // _dirvec = _pos vectorFromTo ((ATLtoASL (player modelToWorldVisual (player selectionPosition "Spine3")))); // _dirvec = _dirvec vectorMultiply 100; // _can setVelocity _dirvec; - [DFUNC(doExplosions), 0, [_explosions, 0]] call cba_fnc_addPerFrameHandler; + [DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; [(_this select 1)] call cba_fnc_removePerFrameHandler; }; diff --git a/addons/frag/functions/fnc_startTracing.sqf b/addons/frag/functions/fnc_startTracing.sqf index 315982775e..5c0c8aaf77 100644 --- a/addons/frag/functions/fnc_startTracing.sqf +++ b/addons/frag/functions/fnc_startTracing.sqf @@ -1,5 +1,5 @@ #include "script_component.hpp" if(!GVAR(tracesStarted)) then { GVAR(tracesStarted) = true; - GVAR(traceID) = [FUNC(drawTraces), 0, []] call cba_fnc_addPerFrameHandler; + GVAR(traceID) = [FUNC(drawTraces), 0, []] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf index 17824253ff..35677657a7 100644 --- a/addons/goggles/functions/fnc_applyDust.sqf +++ b/addons/goggles/functions/fnc_applyDust.sqf @@ -56,4 +56,4 @@ GVAR(DustHandler) = [{ GVAR(DustHandler) = -1; }; }; -},0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler); +},0,[]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index b1559c6cfe..e78f1d52de 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" -["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler); +["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler); if !(hasInterface) exitWith {}; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index a98fbc2350..cd85c3fe36 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -6,7 +6,7 @@ * 0: The grenade * * Return Value: - * Nothing + * None * * Example: * [theGrenade] call ace_grenades_fnc_flashbangExplosionEH @@ -15,9 +15,8 @@ */ #include "script_component.hpp" -private ["_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; - -PARAMS_1(_grenade); +private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"]; +params ["_grenade"]; _affected = _grenade nearEntities ["CAManBase", 20]; @@ -34,7 +33,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _x setSkill ((skill _x) / 50); [{ - PARAMS_1(_unit); + params ["_unit"]; //Make sure we don't enable AI for unconscious units if (!(_unit getVariable ["ace_isunconscious", false])) then { [_unit, false] call EFUNC(common,disableAI); @@ -48,13 +47,11 @@ _affected = _grenade nearEntities ["CAManBase", 20]; _eyePos = eyePos ACE_player; //PositionASL _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground - _losCount = 0; //Check for line of sight (check 4 points in case grenade is stuck in an object or underground) - { - if (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) then { - _losCount = _losCount + 1; - }; - } forEach [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; + _losCount = { + (!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player]) + } count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; + TRACE_1("Line of sight count (out of 4)",_losCount); if (_losCount <= 1) then { _strength = _strength / 10; @@ -78,7 +75,6 @@ _affected = _grenade nearEntities ["CAManBase", 20]; TRACE_1("Final strength for player",_strength); - //Add ace_medical pain effect: if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then { [ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel); @@ -93,7 +89,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //Delete the light after 0.1 seconds [{ - PARAMS_1(_light); + params ["_light"]; deleteVehicle _light; }, [_light], 0.1] call EFUNC(common,waitAndExecute); @@ -105,7 +101,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; //PARTIALRECOVERY - start decreasing effect over ACE_time [{ - PARAMS_1(_strength); + params ["_strength"]; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); }, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute); @@ -117,4 +113,5 @@ _affected = _grenade nearEntities ["CAManBase", 20]; }; }; }; -} forEach _affected; + true +} count _affected; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index 377793ca7b..f0e2406b53 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -6,7 +6,7 @@ * 0: projectile - Flashbang Grenade * * Return Value: - * Nothing + * None * * Example: * [theFlashbang] call ace_grenades_fnc_flashbangThrownFuze @@ -14,12 +14,11 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_1(_projectile); +params ["_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/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf index 913906b8f8..7789e12ac4 100644 --- a/addons/grenades/functions/fnc_nextMode.sqf +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -3,7 +3,7 @@ * Select the next throwing mode and display message. * * Arguments: - * Nothing + * None * * Return Value: * Handeled diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index c7bc09a261..03e67a152a 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -12,7 +12,7 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Example: * [clientFiredBIS-XEH] call ace_grenades_fnc_throwGrenade @@ -21,11 +21,8 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_projectile", "_mode", "_fuzeTime"]; - -_unit = _this select 0; -_weapon = _this select 1; -_projectile = _this select 6; +private ["_mode", "_fuzeTime"]; +params ["_unit", "_weapon", "", "", "", "", "_projectile"]; if (_unit != ACE_player) exitWith {}; if (_weapon != "Throw") exitWith {}; diff --git a/addons/grenades/textures/ace_m84.rvmat b/addons/grenades/textures/ace_m84.rvmat index e668125e70..1bfb6ffc0f 100644 --- a/addons/grenades/textures/ace_m84.rvmat +++ b/addons/grenades/textures/ace_m84.rvmat @@ -8,85 +8,85 @@ PixelShaderID = "Super"; VertexShaderID = "Super"; class Stage1 { - texture = "z\ace\addons\grenades\textures\ace_m84_nohq.paa"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; + texture = "z\ace\addons\grenades\textures\ace_m84_nohq.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; }; class Stage2 { - texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; - uvSource = "tex"; - class uvTransform - { - aside[] = {0,9,0}; - up[] = {4.5,0,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {0,9,0}; + up[] = {4.5,0,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; }; class Stage3 { - texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0,MC)"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,0,MC)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; }; class Stage4 { - texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; + texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; }; class Stage5 { - texture = "z\ace\addons\grenades\textures\ace_m84_smdi.paa"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; + texture = "z\ace\addons\grenades\textures\ace_m84_smdi.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; }; class Stage6 { - texture = "#(ai,16,2,2)fresnel(10.4,8.3)"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,1}; - pos[] = {0,0,0}; - }; + texture = "#(ai,16,2,2)fresnel(10.4,8.3)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; }; class Stage7 { - texture = "a3\data_f\env_land_co.paa"; - uvSource = "tex"; - class uvTransform - { - aside[] = {1,0,0}; - up[] = {0,1,0}; - dir[] = {0,0,0}; - pos[] = {0,0,0}; - }; -}; \ No newline at end of file + texture = "a3\data_f\env_land_co.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp index c0f69dda65..262c3edc34 100644 --- a/addons/hearing/ACE_Settings.hpp +++ b/addons/hearing/ACE_Settings.hpp @@ -2,6 +2,8 @@ class ACE_Settings { class GVAR(EnableCombatDeafness) { value = 1; typeName = "BOOL"; + displayName = CSTRING(CombatDeafness_DisplayName); + description = CSTRING(CombatDeafness_Description); }; class GVAR(EarplugsVolume) { value = 0.5; @@ -17,4 +19,10 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(DisableEarRinging); }; + class GVAR(enabledForZeusUnits) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(enabledForZeusUnits_DisplayName); + description = CSTRING(enabledForZeusUnits_Description); + }; }; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 1cf06910b0..2273653c3a 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -109,6 +109,33 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class DisableEarRinging { + displayName = CSTRING(DisableEarRinging); + typeName = "NUMBER"; + class values { + class DoNotForce { + default = 1; + name = ECSTRING(common,DoNotForce); + value = -1; + }; + /* Probably don't want to allow forcing ear ringing for people who have serious problems with the effect + class NotDisabled { + name = ECSTRING(common,No); + value = 0; + }; + */ + class IsDisabled { + name = ECSTRING(common,Yes); + value = 1; + }; + }; + }; + class enabledForZeusUnits { + displayName = CSTRING(enabledForZeusUnits_DisplayName); + description = CSTRING(enabledForZeusUnits_Description); + typeName = "BOOL"; + defaultValue = 1; + }; }; class ModuleDescription { description = CSTRING(Module_Description); diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 6a896c1820..de70c4f860 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -21,6 +21,7 @@ PARAMS_2(_unit,_strength); if (_unit != ACE_player) exitWith {}; if (_strength < 0.05) exitWith {}; if (!isNull curatorCamera) exitWith {}; +if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {}; if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { _strength = _strength / 4; diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 7b78ac581b..fed6335c07 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -16,4 +16,11 @@ if !(_activated) exitWith {}; [_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); +// Do Not Force - read module setting only non-default is set due to using SCALAR +if ((_logic getVariable "DisableEarRinging") != -1) then { + [_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule); +}; + +[_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule); + diag_log text "[ACE]: Hearing Module Initialized."; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index dbd063b752..403434cf4f 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -118,7 +118,7 @@ Audição - Enable combat deafness? + Combat Deafness Wł. głuchotę bojową ¿Habilitar sordera de combate? Aktiviere Taubheit im Gefecht? @@ -126,7 +126,7 @@ Ativar surdez em combate? - Enable combat deafness? + Reduces the hearing ability as the player takes hearing damage Możliwość chwilowej utraty słuchu przy głośnych wystrzałach i jednoczesnym braku włożonych stoperów Habilita la sordera de combate Aktiviere Taubheit im Gefecht? @@ -134,11 +134,17 @@ Ativar surdez em combate? - + Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection Głuchota bojowa pojawia się w momentach, kiedy stoimy w pobliżu broni wielkokalibrowej bez ochrony słuchu, lub np. podczas ostrzału artyleryjskiego. Moduł ten pozwala na włączenie lub wyłączenie tego efektu. Dieses Modul aktiviert/deaktiviert die Taubheit im Gefecht. Wenn aktiviert, können Spieler ohne Gehörschutz taub werden, wenn eine Waffe in ihrer Nähe abgefeuert wird oder eine Explosion stattfindet. Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat. Este módulo ativa / desativa surdez em combate. Quando ativado, os jogadores podem ficar surdos quando uma arma é disparada ao seu redor ou uma explosão ocorre sem proteção auditiva. + + Effect Zeus RC + + + Allow zeus remote controlled units to be able to take hearing damage. + \ No newline at end of file diff --git a/addons/hitreactions/README.md b/addons/hitreactions/README.md new file mode 100644 index 0000000000..f770470e44 --- /dev/null +++ b/addons/hitreactions/README.md @@ -0,0 +1,11 @@ +ace_hitreactions +=========== + +Adds reactions when getting shot. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index b979d09a4f..7fa6453fe2 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -1,11 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_firer", "_damage"]; - -_unit = _this select 0; -_firer = _this select 1; -_damage = _this select 2; +params ["_unit", "_firer", "_damage"]; // don't fall on collision damage if (_unit == _firer) exitWith {}; diff --git a/addons/huntir/README.md b/addons/huntir/README.md new file mode 100644 index 0000000000..b6c8128cbc --- /dev/null +++ b/addons/huntir/README.md @@ -0,0 +1,11 @@ +ace_huntir +=========== + +Adds High-altitude Unit Navigated Tactical Imaging Round and its Monitor. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf index bcc553fff0..9eb22b9fb5 100644 --- a/addons/huntir/functions/fnc_cam.sqf +++ b/addons/huntir/functions/fnc_cam.sqf @@ -7,13 +7,13 @@ * 0: HuntIR * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -PARAMS_1(_huntIR); +params ["_huntIR"]; GVAR(huntIR) = _huntIR; GVAR(pos) = getPosVisual GVAR(huntIR); @@ -73,7 +73,8 @@ GVAR(no_cams) sort true; if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then { GVAR(no_cams) pushBack _x; }; - } forEach GVAR(nearHuntIRs); + true + } count GVAR(nearHuntIRs); { if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then { GVAR(no_cams) deleteAt _forEachIndex; @@ -82,19 +83,19 @@ GVAR(no_cams) sort true; }; }; } forEach GVAR(no_cams); - + GVAR(cur_cam) = 0 max GVAR(cur_cam) min ((count GVAR(no_cams)) - 1); if (count GVAR(no_cams) > 0) then { GVAR(huntIR) = GVAR(no_cams) select GVAR(cur_cam); }; - + GVAR(pos) = getPosVisual GVAR(huntIR); - + if ((!dialog) || (count GVAR(no_cams) == 0) || ((GVAR(pos) select 2) <= 20)) exitWith { [_this select 1] call cba_fnc_removePerFrameHandler; - + GVAR(stop) = true; - + GVAR(pphandle) ppEffectEnable true; ppEffectDestroy GVAR(pphandle); @@ -108,7 +109,7 @@ GVAR(no_cams) sort true; deleteVehicle GVAR(logic); if (player != ACE_player) then { player remoteControl ACE_player; - }; + }; }; switch (GVAR(ZOOM)) do { @@ -131,7 +132,7 @@ GVAR(no_cams) sort true; }; private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"]; - + GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); GVAR(logic) setDir GVAR(ROTATE); GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf index 121cd9fd12..1919b4547c 100644 --- a/addons/huntir/functions/fnc_handleFired.sqf +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -13,19 +13,19 @@ * 6: projectile - Object of the projectile that was shot * * Return Value: - * Nothing + * None * * Public: No */ #include "script_component.hpp" -PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"]; if (_ammo != "F_HuntIR") exitWith {}; [{ - PARAMS_1(_projectile); - + params ["_projectile"]; + //If null (deleted or hit water) exit: if (isNull _projectile) exitWith {}; //If it's not spinning (hit ground), bail: @@ -33,15 +33,16 @@ if (_ammo != "F_HuntIR") exitWith {}; "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); [{ - PARAMS_1(_position); private ["_huntir"]; + params ["_position"]; _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; _huntir setPosATL _position; _huntir setVariable [QGVAR(startTime), ACE_time, true]; [{ - EXPLODE_1_PVT(_this select 0,_huntir); + params ["_args", "_idPFH"]; + _args params ["_huntir"]; if (isNull _huntir) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; private ["_parachuteDamage", "_velocity"]; _parachuteDamage = _huntir getHitPointDamage "HitParachute"; diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf index 27fd5e280b..b1c269533d 100644 --- a/addons/huntir/functions/fnc_huntir.sqf +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -4,10 +4,10 @@ * HuntIR monitor system * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -35,21 +35,21 @@ createDialog "ace_huntir_cam_dialog_off"; GVAR(connectionDelay) = 5; GVAR(state) = "searching"; GVAR(message) = []; - GVAR(messageSearching) = toArray "Searching....."; + GVAR(messageSearching) = toArray "Searching....."; GVAR(messageConnecting) = toArray "Connecting....."; [{ //Close monitor if we no longer have item: if ((!([ACE_player, "ACE_HuntIR_monitor"] call EFUNC(common,hasItem))) && {!isNull (uiNameSpace getVariable ["ace_huntir_monitor", displayNull])}) then { closeDialog 0; }; - + private ["_elapsedTime", "_nearestHuntIRs"]; _elapsedTime = ACE_time - GVAR(startTime); _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; - + if ((!dialog) || GVAR(done)) exitWith { [_this select 1] call cba_fnc_removePerFrameHandler; - + if (dialog && GVAR(state) == "connected") then { [_nearestHuntIRs select 0] call FUNC(cam); } else { diff --git a/addons/huntir/functions/fnc_huntirCompass.sqf b/addons/huntir/functions/fnc_huntirCompass.sqf index 30fcf45900..ff06b47df3 100644 --- a/addons/huntir/functions/fnc_huntirCompass.sqf +++ b/addons/huntir/functions/fnc_huntirCompass.sqf @@ -4,10 +4,10 @@ * HuntIR monitor compass * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Public: No */ @@ -32,7 +32,7 @@ disableSerialization; private ["_fnc_correctIt"]; _fnc_correctIt = { - PARAMS_2(_pos,_dir); + params ["_pos", "_dir"]; if (_dir >= 270 || {_dir <= 90}) then { _pos set [1, (_pos select 1) + __OFFSET_Y] }; @@ -51,16 +51,17 @@ _fnc_correctIt = { HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; [{ - EXPLODE_1_PVT(_this select 0,_fnc_correctIt); - + params ["_args", "_idPFH"]; + _args params ["_fnc_correctIt"]; + if (GVAR(stop)) exitWith { HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"]; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; - + private ["_dir", "_x1", "_y1", "_pos"]; _dir = getDir GVAR(cam); // direction player; - + _x1 = __CENTER_X - (__RADIUS * sin(_dir)); _y1 = __CENTER_Y - (__RADIUS * cos(_dir)); _pos = [[_x1, _y1], _dir] call _fnc_correctIt; @@ -84,5 +85,5 @@ HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; _pos = [[_x1, _y1], _dir] call _fnc_correctIt; __CHAR_E ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; __CHAR_E ctrlCommit 0; - + }, 0.01, [_fnc_correctIt]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp index ea4d4699ed..381405987c 100644 --- a/addons/interact_menu/ACE_Settings.hpp +++ b/addons/interact_menu/ACE_Settings.hpp @@ -3,12 +3,14 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorSelfInteraction); }; class GVAR(cursorKeepCentered) { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(cursorKeepCentered); description = CSTRING(cursorKeepCenteredDescription); }; @@ -16,42 +18,49 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(AlwaysUseCursorInteraction); }; class GVAR(UseListMenu) { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(UseListMenu); }; class GVAR(colorTextMax) { value[] = {1, 1, 1, 1}; typeName = "COLOR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMax); }; class GVAR(colorTextMin) { value[] = {1, 1, 1, 0.25}; typeName = "COLOR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorTextMin); }; class GVAR(colorShadowMax) { value[] = {0, 0, 0, 1}; typeName = "COLOR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMax); }; class GVAR(colorShadowMin) { value[] = {0, 0, 0, 0.25}; typeName = "COLOR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ColorShadowMin); }; class GVAR(textSize) { value = 2; typeName = "SCALAR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(textSize); values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; }; @@ -59,6 +68,7 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(shadowSetting); description = CSTRING(shadowSettingDescription); values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", CSTRING(shadowOutline)}; @@ -67,12 +77,14 @@ class ACE_Settings { value = 1; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(ActionOnKeyRelease); }; class GVAR(menuBackground) { value = 0; typeName = "SCALAR"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(background); values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(backgroundBlur), CSTRING(backgroundBlack)}; }; @@ -80,6 +92,7 @@ class ACE_Settings { value = 0; typeName = "BOOL"; isClientSettable = 1; + category = CSTRING(Category_InteractionMenu); displayName = CSTRING(addBuildingActions); description = CSTRING(addBuildingActionsDescription); }; diff --git a/addons/interact_menu/README.md b/addons/interact_menu/README.md new file mode 100644 index 0000000000..77ac2d814a --- /dev/null +++ b/addons/interact_menu/README.md @@ -0,0 +1,12 @@ +ace_interact_menu +=========== + +Base framework for interaction menu. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [NouberNou](https://github.com/NouberNou) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index c656ab9056..73b543250e 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -4,6 +4,7 @@ ADDON = false; PREP(addActionToClass); PREP(addActionToObject); +PREP(addMainAction); PREP(compileMenu); PREP(compileMenuSelfAction); PREP(compileMenuZeus); diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index 7a8278c72d..4d300d35a2 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -19,7 +19,9 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_objectType,_typeNum,_parentPath,_action); +if (!params [["_objectType", "", [""]], ["_typeNum", 0, [0]], ["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith { + ERROR("Bad Params"); +}; // Ensure the config menu was compiled first if (_typeNum == 0) then { @@ -35,8 +37,15 @@ if((count _actionTrees) == 0) then { missionNamespace setVariable [_varName, _actionTrees]; }; +if (_parentPath isEqualTo ["ACE_MainActions"]) then { + [_objectType, _typeNum] call FUNC(addMainAction); +}; + _parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode); -if (isNil {_parentNode}) exitWith {}; +if (isNil {_parentNode}) exitWith { + ERROR("Failed to add action"); + diag_log text format ["action (%1) to parent %2 on object %3 [%4]", (_action select 0), _parentPath, _objectType, _typeNum]; +}; // Add action node as children of the correct node of action tree (_parentNode select 1) pushBack [_action,[]]; diff --git a/addons/interact_menu/functions/fnc_addActionToObject.sqf b/addons/interact_menu/functions/fnc_addActionToObject.sqf index 5c736a2da6..8cd2270d48 100644 --- a/addons/interact_menu/functions/fnc_addActionToObject.sqf +++ b/addons/interact_menu/functions/fnc_addActionToObject.sqf @@ -19,7 +19,9 @@ */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_object,_typeNum,_parentPath,_action); +if (!params [["_object", objNull, [objNull]], ["_typeNum", 0, [0]], ["_parentPath", [], [[]]], ["_action", [], [[]], 11]]) exitWith { + ERROR("Bad Params"); +}; private ["_varName","_actionList"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; @@ -28,6 +30,10 @@ if((count _actionList) == 0) then { _object setVariable [_varName, _actionList]; }; +if (_parentPath isEqualTo ["ACE_MainActions"]) then { + [(typeOf _object), _typeNum] call FUNC(addMainAction); +}; + // Add action and parent path to the list of object actions _actionList pushBack [_action, +_parentPath]; diff --git a/addons/interact_menu/functions/fnc_addMainAction.sqf b/addons/interact_menu/functions/fnc_addMainAction.sqf new file mode 100644 index 0000000000..cf2a3f51d4 --- /dev/null +++ b/addons/interact_menu/functions/fnc_addMainAction.sqf @@ -0,0 +1,31 @@ +/* + * Author: Jonpas, PabstMirror + * Makes sure there is a ACE_MainActions on the object type + * + * Argument: + * 0: Object classname + * 1: Type of action, 0 for actions, 1 for self-actions + * + * Return value: + * None + * + * Example: + * ["Table", 0] call ace_interact_menu_fnc_addMainAction; + * + * Public: No + */ +#include "script_component.hpp" + +params ["_objectType", "_typeNum"]; + +private["_actionTrees", "_mainAction", "_parentNode", "_varName"]; + +_varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; +_actionTrees = missionNamespace getVariable [_varName, []]; +_parentNode = [_actionTrees, ["ACE_MainActions"]] call FUNC(findActionNode); + +if (isNil {_parentNode}) then { + TRACE_2("No Main Action on object", _objectType, _typeNum); + _mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call FUNC(createAction); + [_objectType, _typeNum, [], _mainAction] call EFUNC(interact_menu,addActionToClass); +}; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 62d9ca1094..4da303f618 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -14,8 +14,8 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_object,_origAction,_parentPath); -EXPLODE_2_PVT(_origAction,_origActionData,_origActionChildren); +params ["_object", "_origAction", "_parentPath"]; +_origAction params ["_origActionData", "_origActionChildren"]; private ["_target","_player","_fullPath","_activeChildren","_dynamicChildren","_action","_actionData","_x"]; diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index cf4db7aab1..6dd4c5ee74 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp"; -EXPLODE_1_PVT(_this,_target); +params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; @@ -29,7 +29,7 @@ if !(isNil {missionNamespace getVariable [_actionsVarName, nil]}) exitWith {}; private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_position", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index a34c45f504..f486b3ee58 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp"; -EXPLODE_1_PVT(_this,_target); +params ["_target"]; private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; @@ -30,7 +30,7 @@ private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { @@ -71,7 +71,7 @@ _recurseFnc = { _statement, _condition, _insertChildren, - {}, + [], [0,0,0], 10, //distace [_showDisabled,_enableInside,_canCollapse,_runOnHover, true], diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index 9dc212ac40..ef7c36abc9 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -19,7 +19,7 @@ private "_recurseFnc"; _recurseFnc = { private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; - EXPLODE_1_PVT(_this,_actionsCfg); + params ["_actionsCfg"]; _actions = []; { diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index 6845683044..256984c104 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -26,56 +26,31 @@ */ #include "script_component.hpp" -EXPLODE_5_PVT(_this,_actionName,_displayName,_icon,_statement,_condition); +params [ + "_actionName", + "_displayName", + "_icon", + "_statement", + "_condition", + ["_insertChildren", {}], + ["_customParams", []], + ["_position", {[0, 0, 0]}], + ["_distance", 2], + ["_params", [false, false, false, false, false]], + ["_modifierFunction", {}] +]; -// IGNORE_PRIVATE_WARNING(_target); -private ["_insertChildren","_customParams","_position","_distance","_params", "_modifierFunction"]; - -_insertChildren = if (count _this > 5) then { - _this select 5 -} else { - {} -}; - -_customParams = if (count _this > 6) then { - _this select 6 -} else { - [] -}; - -_position = if (count _this > 7) then { - if (typeName (_this select 7) == "STRING") then { +_position = if (typeName (_position) == "STRING") then { // If the action is set to a selection, create the suitable code - compile format ["_target selectionPosition '%1'", _this select 7]; + compile format ["_target selectionPosition '%1'", _position]; } else { - if (typeName (_this select 7) == "ARRAY") then { + if (typeName (_position) == "ARRAY") then { // If the action is set to a array position, create the suitable code - compile format ["%1", _this select 7]; + compile format ["%1", _position]; } else { - _this select 7 + _position; }; - } -} else { - {[0,0,0]} -}; - -_distance = if (count _this > 8) then { - _this select 8 -} else { - 2 -}; - -_params = if (count _this > 9) then { - _this select 9 -} else { - [false,false,false,false,false] -}; - -_modifierFunction = if (count _this > 10) then { - _this select 10 -} else { - {} -}; + }; [ _actionName, diff --git a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf index b5d6a4e967..13b241e1d1 100644 --- a/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf +++ b/addons/interact_menu/functions/fnc_ctrlSetParsedTextCached.sqf @@ -1,11 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_ctrl", "_index", "_text"]; - -_ctrl = _this select 0; -_index = _this select 1; -_text = _this select 2; +params ["_ctrl", "_index", "_text"]; //systemChat str (_text != ARR_SELECT(GVAR(ParsedTextCached),_index,"-1")); diff --git a/addons/interact_menu/functions/fnc_findActionNode.sqf b/addons/interact_menu/functions/fnc_findActionNode.sqf index b8639754d2..41ab658a62 100644 --- a/addons/interact_menu/functions/fnc_findActionNode.sqf +++ b/addons/interact_menu/functions/fnc_findActionNode.sqf @@ -8,7 +8,7 @@ * 1: Path * * Return value: - * Action node . + * Action node or if not found * * Example: * [_actionTree, ["ACE_TapShoulderRight","VulcanPinchAction"]] call ace_interact_menu_fnc_findActionNode; @@ -17,7 +17,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_actionTreeList,_parentPath); +params ["_actionTreeList", "_parentPath"]; private ["_parentNode", "_foundParentNode", "_fnc_findFolder", "_actionTree"]; @@ -31,10 +31,10 @@ _parentNode = [[],_actionTreeList]; _foundParentNode = false; _fnc_findFolder = { - EXPLODE_3_PVT(_this,_parentPath,_level,_actionNode); + params ["_parentPath", "_level", "_actionNode"]; { - EXPLODE_2_PVT(_x,_actionData,_actionChildren); + _x params ["_actionData", "_actionChildren"]; if ((_actionData select 0) isEqualTo (_parentPath select _level)) exitWith { if (count _parentPath == _level + 1) exitWith { diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf index cb21d218db..a0962d7883 100644 --- a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -11,7 +11,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_newUnit,_oldUnit); +params ["_newUnit", "_oldUnit"]; // add to new unit private "_ehid"; diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf index ec22b0aa9e..0a02fe2ea7 100644 --- a/addons/interact_menu/functions/fnc_isSubPath.sqf +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_longPath,_shortPath); +params ["_longPath", "_shortPath"]; private ["_isSubPath","_i"]; _isSubPath = true; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 5bf156b69e..ca06e25eb6 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_menuType); +params ["_menuType"]; if (GVAR(openedMenuType) == _menuType) exitWith {true}; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 02e2d4db01..86580afa67 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -private "_calledByClicking"; -_calledByClicking = _this select 1; +params ["_menuType", "_calledByClicking"]; // Exit if there's no menu opened if (GVAR(openedMenuType) < 0) exitWith {true}; diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index c407273258..c95f53f152 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_objectType,_typeNum,_fullPath); +params ["_objectType", "_typeNum", "_fullPath"]; -private ["_res","_varName","_actionTrees", "_actionIndex", "_parentLevel", "_parentNode"]; +private ["_res","_varName","_actionTrees", "_parentNode", "_found"]; _res = _fullPath call FUNC(splitPath); -EXPLODE_2_PVT(_res,_parentPath,_actionName); +_res params ["_parentPath", "_actionName"]; _varName = format [[QGVAR(Act_%1), QGVAR(SelfAct_%1)] select _typeNum, _objectType]; _actionTrees = missionNamespace getVariable [_varName, []]; @@ -30,10 +30,15 @@ _parentNode = [_actionTrees, _parentPath] call FUNC(findActionNode); if (isNil {_parentNode}) exitWith {}; // Iterate through children of the father +_found = false; { if (((_x select 0) select 0) == _actionName) exitWith { + TRACE_2("Deleting Action", _forEachIndex, _x); + _found = true; (_parentNode select 1) deleteAt _forEachIndex; }; } forEach (_parentNode select 1); -_parentLevel deleteAt _actionIndex; +if (!_found) then { + WARNING("Failed to find action to delete"); +}; diff --git a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf index bab740c578..e630bf4ad1 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromObject.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromObject.sqf @@ -17,11 +17,11 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_object,_typeNum,_fullPath); +params ["_object", "_typeNum", "_fullPath"]; private ["_res","_varName","_actionList"]; _res = _fullPath call FUNC(splitPath); -EXPLODE_2_PVT(_res,_parentPath,_actionName); +_res params ["_parentPath", "_actionName"]; _varName = [QGVAR(actions),QGVAR(selfActions)] select _typeNum; _actionList = _object getVariable [_varName, []]; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 80bff14793..81a6887f97 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -78,7 +78,7 @@ _fnc_renderNearbyActions = { _fnc_renderLastFrameActions = { { - EXPLODE_3_PVT(_x,_target,_action,_objectActionList); + _x params ["_target", "_action", "_objectActionList"]; GVAR(objectActionList) = _objectActionList; [_target, _action] call FUNC(renderBaseMenu); @@ -176,6 +176,6 @@ if (count GVAR(collectedActionPoints) > 1) then { // Render the non-ocluded points { - EXPLODE_3_PVT(_x,_z,_sPos,_activeActionTree); + _x params ["_z", "_sPos", "_activeActionTree"]; [[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu); } forEach GVAR(collectedActionPoints); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 5330bbebd2..a5ccabf3bf 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -18,8 +18,8 @@ BEGIN_COUNTER(fnc_renderBaseMenu) private ["_distance","_pos","_weaponDir","_ref","_sPos","_activeActionTree", "_line"]; -EXPLODE_2_PVT(_this,_object,_baseActionNode); -EXPLODE_1_PVT(_baseActionNode,_actionData); +params ["_object", "_baseActionNode"]; +_baseActionNode params ["_actionData"]; _distance = _actionData select 8; diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 44a280a52e..ab909964de 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -16,7 +16,8 @@ #include "script_component.hpp" #define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa) private ["_ctrl", "_pos", "_displayNum"]; -PARAMS_4(_text,_icon,_sPos,_textSettings); + +params ["_text", "_icon", "_sPos", "_textSettings"]; //systemChat format ["Icon %1 - %2,%3", _text, _sPos select 0, _sPos select 1]; diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index a82b82dcb7..21c434fe03 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -17,9 +17,9 @@ private ["_menuInSelectedPath", "_path", "_menuDepth", "_x", "_offset", "_newPos", "_forEachIndex", "_player", "_pos", "_target", "_textSettings"]; -EXPLODE_4_PVT(_this,_parentPath,_action,_sPos,_angles); -EXPLODE_3_PVT(_action,_actionData,_activeChildren,_actionObject); -EXPLODE_2_PVT(_angles,_centerAngle,_maxAngleSpan); +params ["_parentPath", "_action", "_sPos", "_angles"]; +_action params ["_actionData", "_activeChildren", "_actionObject"]; +_angles params ["_centerAngle", "_maxAngleSpan"]; _menuDepth = (count GVAR(menuDepthPath)); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 96a495c715..17ded20903 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_sPos,_icon); +params ["_sPos", "_icon"]; private ["_displayNum", "_ctrl", "_pos"]; diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index e54d529668..c23d68cfd3 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -16,7 +16,7 @@ private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_text //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { - PARAMS_3(_color1,_color2,_ratio); + params ["_color1", "_color2", "_ratio"]; private ["_return", "_mix", "_index"]; _return = ""; for "_index" from 0 to 3 do { diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf index 9143db0d4d..fdd7d14573 100644 --- a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; //Ignore if not enabled: if (!GVAR(addBuildingActions)) exitWith {}; @@ -27,8 +27,8 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; [{ private ["_nearBuidlings", "_typeOfHouse", "_houseBeingScaned", "_actionSet", "_memPoints", "_memPointsActions", "_helperPos", "_helperObject"]; - PARAMS_2(_args,_pfID); - EXPLODE_4_PVT(_args,_setPosition,_addedHelpers,_housesScaned,_housesToScanForActions); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedHelpers", "_housesScaned", "_housesToScanForActions"]; if (!EGVAR(interact_menu,keyDown)) then { {deleteVehicle _x;} forEach _addedHelpers; @@ -75,7 +75,7 @@ if ((vehicle ACE_player) != ACE_player) exitWith {}; _housesScaned pushBack _houseBeingScaned; _actionSet = [_typeOfHouse] call FUNC(userActions_getHouseActions); - EXPLODE_2_PVT(_actionSet,_memPoints,_memPointsActions); + _actionSet params ["_memPoints", "_memPointsActions"]; // systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime]; { diff --git a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf index 0b3d4347c7..dee82fd939 100644 --- a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf +++ b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -PARAMS_1(_typeOfBuilding); +params ["_typeOfBuilding"]; private["_action", "_actionDisplayName", "_actionDisplayNameDefault", "_actionMaxDistance", "_actionOffset", "_actionPath", "_actionPosition", "_building", "_configPath", "_endIndex", "_iconImage", "_index", "_ladders", "_memPointIndex", "_memPoints", "_memPointsActions", "_startIndex"]; @@ -24,7 +24,7 @@ _memPointsActions = []; //Get the offset for a memory point: _fnc_getMemPointOffset = { - PARAMS_1(_memoryPoint); + params ["_memoryPoint"]; _memPointIndex = _memPoints find _memoryPoint; _actionOffset = [0,0,0]; if (_memPointIndex == -1) then { @@ -38,14 +38,14 @@ _fnc_getMemPointOffset = { // Add UserActions for the building: _fnc_userAction_Statement = { - PARAMS_3(_target,_player,_variable); - EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + params ["_target", "_player", "_variable"]; + _variable params ["_actionStatement", "_actionCondition"]; this = _target getVariable [QGVAR(building), objNull]; call _actionStatement; }; _fnc_userAction_Condition = { - PARAMS_3(_target,_player,_variable); - EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + params ["_target", "_player", "_variable"]; + _variable params ["_actionStatement", "_actionCondition"]; this = _target getVariable [QGVAR(building), objNull]; if (isNull this) exitWith {false}; call _actionCondition; @@ -84,29 +84,29 @@ for "_index" from 0 to ((count _configPath) - 1) do { // Add Ladder Actions for the building: _fnc_ladder_ladderUp = { - PARAMS_3(_target,_player,_variable); - EXPLODE_1_PVT(_variable,_ladderIndex); + params ["_target", "_player", "_variable"]; + _variable params ["_ladderIndex"]; _building = _target getVariable [QGVAR(building), objNull]; TRACE_3("Ladder Action - UP",_player,_building,_ladderIndex); _player action ["LadderUp", _building, _ladderIndex, 0]; }; _fnc_ladder_ladderDown = { - PARAMS_3(_target,_player,_variable); - EXPLODE_1_PVT(_variable,_ladderIndex); + params ["_target", "_player", "_variable"]; + _variable params ["_ladderIndex"]; _building = _target getVariable [QGVAR(building), objNull]; TRACE_3("Ladder Action - Down",_player,_building,_ladderIndex); _player action ["LadderDown", _building, _ladderIndex, 1]; }; _fnc_ladder_conditional = { - PARAMS_2(_target,_player); + params ["_target", "_player"]; //(Check distance < 2) and (Don't show actions if on a ladder) ((_target distance _player) < 2) && {((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _player) >> "onLadder")) == 0)} }; _ladders = getArray (configFile >> "CfgVehicles" >> _typeOfBuilding >> "ladders"); { - EXPLODE_2_PVT(_x,_ladderBottomMemPoint,_ladderTopMemPoint); + _x params ["_ladderBottomMemPoint", "_ladderTopMemPoint"]; _actionMaxDistance = 3; //interact_menu will check head -> target's offset; leave this high and do a precice distance check in condition diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index b55e8483a1..5bd8aefe21 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -267,5 +267,9 @@ Přidá možnost interakce pro otevření dvěří a umistňovat žebříky na budovy. (Poznámka: Použití této možnosti snižuje výkon při otevírání pomocí interakčního menu, zejména ve velkých městech.) Añade las acciones de interacción para la apertura de puertas y montaje de escaleras en los edificios. (Nota: Hay un coste de rendimiento al abrir el menú de interacción, especialmente en las ciudades) + + Interaction Menu + Menu interakcji + - + \ No newline at end of file diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 17c271f372..d2cef4c9ef 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -91,7 +91,7 @@ class CfgVehicles { class ACE_JoinGroup { displayName = CSTRING(JoinGroup); - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + condition = QUOTE(GVAR(EnableTeamManagement) && {[ARR_2(_player,_target)] call DFUNC(canJoinGroup)}); statement = QUOTE([_player] joinSilent group _target); showDisabled = 0; priority = 2.6; @@ -351,7 +351,7 @@ class CfgVehicles { hotkey = "7"; }; class ACE_Gesture_Yes { - displayName = CSTRING(Gestures_Yes); + displayName = ECSTRING(common,Yes); condition = QUOTE(canStand _target); statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); showDisabled = 1; @@ -359,7 +359,7 @@ class CfgVehicles { hotkey = "8"; }; class ACE_Gesture_No { - displayName = CSTRING(Gestures_No); + displayName = ECSTRING(common,No); condition = QUOTE(canStand _target); statement = QUOTE(_target playActionNow 'gestureNo';); showDisabled = 1; @@ -501,8 +501,8 @@ class CfgVehicles { class ACE_Push { displayName = CSTRING(Push); distance = 6; - condition = QUOTE(getMass _target < 1000 && {alive _target}); - statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); + condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3}); + statement = QUOTE(_this call FUNC(push)); showDisabled = 0; priority = -1; }; @@ -548,7 +548,7 @@ class CfgVehicles { }; }; }; - + class StaticMGWeapon: StaticWeapon {}; class HMG_01_base_F: StaticMGWeapon {}; class HMG_01_high_base_F: HMG_01_base_F { @@ -557,14 +557,14 @@ class CfgVehicles { position = "[-0.172852,0.164063,-0.476091]"; }; }; - }; + }; class AA_01_base_F: StaticMGWeapon { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { position = "[0,0.515869,-0.200671]"; }; }; - }; + }; class AT_01_base_F: StaticMGWeapon { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -592,4 +592,16 @@ class CfgVehicles { }; class ACE_SelfActions {}; }; + + class ACE_RepairItem_Base: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 2; + condition = "true"; + }; + }; + class ACE_SelfActions {}; + }; }; diff --git a/addons/interaction/README.md b/addons/interaction/README.md index 8e841e9a58..92401b2547 100644 --- a/addons/interaction/README.md +++ b/addons/interaction/README.md @@ -3,6 +3,7 @@ ace_interaction Provides interaction options between units. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 7fe151dac1..8db2d34ad1 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -10,6 +10,13 @@ ACE_Modifier = 0; _group selectLeader _leader; }] call EFUNC(common,addEventHandler); +//Pushing boats from FUNC(push) +[QGVAR(pushBoat), { + params ["_boat", "_newVelocity"]; + _boat setVelocity _newVelocity; +}] call EFUNC(common,addEventHandler); + + if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index 946a5118be..86ad673d9c 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -4,23 +4,23 @@ * * Arguments: * 0: Boat - * 1: Velocity + * 1: Player * * Return Value: * None * * Example: - * [target, [vector]] call ace_interaction_fnc_push + * [Boats, Jose] call ace_interaction_fnc_push * * Public: No */ - + #include "script_component.hpp" -PARAMS_2(_boat,_velocity); +params ["_boat", "_player"]; -if !(local _boat) exitWith { - [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); -}; +private ["_newVelocity"]; -_boat setVelocity _velocity; +_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5]; + +[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 5bd3282872..ff9990f77d 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,835 +1,811 @@ - - - - - Interactions - Interaktionen - Interacciones - Interakce - Interakcje - Interactions - Взаимодействия - Cselekvések - Interazioni - Interaçãoes - - - Torso - Torse - Torso - Torso - Trup - Tors - Торс - Testtörzs - Torso - Torso - - - Head - Tête - Kopf - Cabeza - Hlava - Głowa - Голова - Fej - Testa - Cabeça - - - Left Arm - Bras gauche - Linker Arm - Brazo izquierdo - Levá paže - Lewe ramię - Левая рука - Bal kar - Braccio sinistro - Braço Esquerdo - - - Right Arm - Rechter Arm - Brazo derecho - Pravá paže - Prawe ramię - Bras droit - Правая рука - Jobb kar - Braccio destro - Braço Direito - - - Left Leg - Linkes Bein - Pierna izquierda - Levá noha - Lewa noga - Jambe gauche - Левая нога - Bal láb - Gamba sinistra - Perna Esquerda - - - Right Leg - Rechtes Bein - Pierna derecha - Pravá noha - Prawa noga - Jambe droite - Правая нога - Jobb láb - Gamba destra - Perna Direita - - - Weapon - Arme - Waffe - Arma - Zbraň - Broń - Оружие - Fegyver - Arma - Arma - - - Interaction Menu - Interaktionsmenü - Menú de interacción - Menu interakcji - Menu interakce - Menu d'interaction - Меню взаимодействия - Cselekvő menü - Menu de Interação - Menù interazione - - - Interaction Menu (Self) - Interaktionsmenü (selbst) - Menú de interacción (Propio) - Menu interakcji (własne) - Menu interakce (vlastní) - Menu d'interaction (Perso) - Меню взаимодействия (с собой) - Cselekvő menü (saját) - Menu de Interação (Individual) - Menù interazione (individuale) - - - Open / Close Door - Tür öffnen / schließen - Abrir / Cerrar puerta - Otwórz / Zamknij drzwi - Otevřít / Zavřít dveře - Ouvrir / Fermer Portes - Открыть / Закрыть двери - Ajtó nyitása / zárása - Abrir / Fechar Porta - Apri / Chiudi la porta - - - Lock Door - Tür sperren - Bloquear puerta - Verrouiller Porte - Blocca la porta - Заблокировать дверь - Trancar Porta - Ajtó bezárása - Zablokuj drzwi - Zamknout dveře - - - Unlock Door - Tür entsperren - Desbloquear puerta - Déverrouiller Porte - Sblocca la porta - Разблокировать дверь - Destrancar Porta - Zár kinyitása - Odblokuj drzwi - Odemknout dveře - - - Locked Door - Tür gesperrt - Puerta bloqueada - Porte Verrouillée - Porta bloccata - Дверь заблокирована - Porta Trancada - Zárt ajtó - Zablokowano drzwi - Zamčené dveře - - - Unlocked Door - Tür entsperrt - Puerta desbloqueada - Porte Déverrouillée - Porta sbloccata - Дверь разблокирована - Porta Destrancada - Nyitott ajtó - Odblokowano drzwi - Odemčené dveře - - - Join group - Gruppe beitreten - Unirse al grupo - Dołącz do grupy - Přidat se do skupiny - Rejoindre Groupe - Вступить в группу - Csatlakozás a csoporthoz - Unir-se ao grupo - Unisciti alla squadra - - - Leave Group - Gruppe verlassen - Dejar grupo - Opuść grupę - Opustit skupinu - Quitter Groupe - Выйти из группы - Csoport elhagyása - Deixar grupo - Lascia la squadra - - - Become Leader - Grp.-führung übern. - Asumir el liderazgo - Przejmij dowodzenie - Stát se velitelem - Devenir Chef de groupe - Стать лидером - Vezetés átvétele - Tornar-se Líder - Prendi il comando - - - DANCE! - TANZEN! - BAILAR! - TAŃCZ! - TANČIT! - Danse! - ТАНЦЕВАТЬ! - TÁNC! - DANCE! - DANZA! - - - Stop Dancing - Tanzen abbrechen - Dejar de bailar - Przestań tańczyć - Přestat tancovat - Arrêter de danser - Прекратить танцевать - Tánc abbahagyása - Parar de dançar - Smetti di ballare - - - << Back - << Zurück - << Atrás - << Wstecz - << Zpět - << Retour - << Назад - << Vissza - << Voltar - << Indietro - - - Gestures - Gesten - Gestos - Gesty - Posunky - Signaux - Жесты - Kézjelek - Gestos - Gesti - - - Attack - Angreifen - Atacar - Do ataku - Zaútočit - Attaquer - Атаковать - Támadás - Atacar - Attaccare - - - Advance - Vordringen - Avanzar - Naprzód - Postoupit - Avancer - Продвигаться - Előre - Avançar - Avanzare - - - Go - Los - Adelante - Szybko - Jít - Aller - Идти - Mozgás - Mover-se - Muoversi - - - Follow - Folgen - Seguirme - Za mną - Následovat - Suivre - Следовать - Utánam - Seguir - Seguire - - - Point - Zeigen - Señalar - Wskazać - Ukázat - Pointer - Точка - Mutat - Apontar - Puntare a - - - Up - Aufstehen - Arriba - Do góry - Vztyk - Debout - Вверх - Fel - Acima - Alzarsi - - - Cover - Deckung - Cubrirse - Do osłony - Krýt se - A couvert - Укрыться - Fedezékbe - Proteger-se - Copertura - - - Cease Fire - Feuer einstellen - Alto el fuego - Wstrzymać ogień - Zastavit palbu - Halte au feu - Прекратить огонь - Tüzet szüntess - Cessar Fogo - Cessare il Fuoco - - - Freeze - Keine Bewegung - Alto - Stać - Stát - Halte - Замереть - Állj - Alto - Fermi - - - Hi - Hallo - Hola - Witaj - Ahoj - Salut - Привет - Helló - Olá - Ciao - - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - - - Put weapon on back - Waffe wegstecken - Arma a la espalda - Umieść broń na plecach - Dát zbraň na záda - Arme à la bretelle - Повесить оружие на спину - Fegyvert hátra - Colocar arma nas costas - Metti l'arma in spalla - - - Tap Shoulder - Auf Schulter klopfen - Tocar el hombro - Klepnij w ramię - Poklepat na rameno - Taper sur l'épaule - Похлопать по плечу - Vállveregetés - Tocar ombro - Dai un colpetto - - - You were tapped on the RIGHT shoulder - Te tocaron el hombro DERECHO - Dir wurde auf die rechte Schulter geklopft - On te tape sur l'épaule droite - Zostałeś klepnięty w prawe ramię - Megveregették a JOBB válladat. - Někdo tě poklepal na PRAVÉ rameno - Вас похлопали по ПРАВОМУ плечу - Você foi tocado no ombro - Ti è stato dato un colpetto sulla spalla destra - - - You were tapped on the LEFT shoulder. - Te tocaron el hombro IZQUIERDO. - Dir wurde auf die linke Schulter geklopft - On te tape sur l'épaule gauche - Zostałeś klepnięty w lewe ramię - Megveregették a BAL válladat. - Někdo tě poklepal na LEVÉ rameno - Вас похлопали по ЛЕВОМУ плечу - Você foi tocado no ombro. - Ti è stato dato un colpetto sulla spalla sinistra - - - Cancel - Abbrechen - Cancelar - Anuluj - Annuler - Zrušit - Annulla - Отменить - Cancelar - Mégse - - - Select - Wählen - Seleccionar - Wybierz - Sélectionner - Zvolit - Seleziona - Выбрать - Selecionar - Kiválaszt - - - Go Away! - Geh Weg! - Aléjate! - Odejdź! - Jděte pryč! - Allez-vous-en! - Уходите отсюда! - Tűnés! - Vá Embora! - Via di qui! - - - Get Down! - Auf den Boden! - Al suelo! - Padnij! - K zemi! - A terre! - A földre! - Ложись! - Abaixe-se! - A terra! - - - Team Management - Gruppenverwaltung - Gestión de equipo - Gestion d'équipe - Zarządzanie oddziałem - Správa týmu - Управление группой - Gerenciamento de Equipe - Organizzazione Squadra - Csapat kezelése - - - Red - Rot - Rojo - Rouge - Czerwonych - Červený - Красный - Vermelha - Rosso - Piros - - - Green - Grün - Verde - Vert - Zielonych - Zelený - Зеленый - Verde - Verde - Zöld - - - Blue - Blau - Azul - Bleu - Niebieskich - Modrý - Синий - Azul - Blu - Kék - - - Yellow - Gelb - Amarillo - Jaune - Żółtych - Žlutý - Жёлтый - Amarela - Giallo - Sárga - - - Assign Red - Rot zuweisen - Asignar a rojo - Przydziel do czerwonych - Atribuir Vermelho - Hozzávonás a Piroshoz - Přiřadit k červeným - Назначить в Красную группу - Assigner à rouge - Assegna al team rosso - - - Assign Green - Grün zuweisen - Asignar a verde - Przydziel do zielonych - Atribuir Verde - Hozzávonás a Zöldhöz - Přiřadit k zeleným - Назначить в Зеленую группу - Assigner à vert - Assegna al team verde - - - Assign Blue - Blau zuweisen - Asignar a azul - Przydziel do niebieskich - Atribuir Azul - Hozzávonás a Kékhez - Přiřadit k modrým - Назначить в Синюю группу - Assigner à bleu - Assegna al team blu - - - Assign Yellow - Gelb zuweisen - Asignar a amarillo - Przydziel do żółtych - Atribuir Amarelo - Hozzávonás a Sárgához - Přiřadit ke žlutým - Назначить в Желтую группу - Assigner à jaune - Assegna al team giallo - - - Join Red - Rot beitreten - Unirse a rojo - Dołącz do czerwonych - Entrar em Vermelho - Belépés a Pirosba - Připojit k červeným - Присоединиться к Красной группе - Rejoindre rouge - Unirsi al team rosso - - - Join Green - Grün beitreten - Unirse a verde - Dołącz do zielonych - Entrar em Verde - Belépés a Zöldbe - Připojit k zeleným - Присоединиться к Зеленой группе - Rejoindre vert - Unirsi al team verde - - - Join Blue - Blau beitreten - Unirse a azul - Dołącz do niebieskich - Entrar em Azul - Belépés a Kékbe - Připojit k modrým - Присоединиться к Синей группе - Rejoindre bleu - Unirsi al team blu - - - Join Yellow - Gelb beitreten - Unirse a amarillo - Dołącz do żółtych - Entrar em Amarelo - Belépés a Sárgába - Připojit ke žlutým - Присоединиться к Жёлтой группе - Rejoindre jaune - Unirsi al team giallo - - - You joined Team %1 - Du bist Gruppe %1 beigetreten - Te has unido al equipo %1 - Tu as rejoint l'équipe %1 - Dołączyłeś do %1 - Připojil ses do %1 týmu - Вы присоединились к группе %1 - Você uniu-se à Equipe %1 - Sei entrato nel team %1 - Csatlakoztál a %1 csapathoz - - - Leave Team - Gruppe verlassen - Dejar equipo - Quitter l'équipe - Opuść drużynę - Opustit tým - Покинуть группу - Deixar Equipe - Lascia il team - Csapat elhagyása - - - You left the Team - Du hast die Gruppe verlassen - Has dejado el equipo - Tu as quitté l'équipe - Opuściłeś drużynę - Opustil jsi tým - Вы покинули группу - Você deixou a Equipe - Hai lasciato il team - Elhagytad a csapatot - - - Pardon - Begnadigen - Perdonar - Przebacz - Pardon - Pardon - Извините - Perdão - Perdona - Megbocsátás - - - Scroll - Scrollen - Przewiń - Défilement - Desplazar - Пролистать - Rolar - Scorri - Görgetés - Otáčení - - - Modifier Key - Modifikator-Taste - Modyfikator - Modifier la touche - Tecla modificadora - Клавиша-модификатор - Tecla Modificadora - Tasto modifica - Módosító billentyű - Modifikátor - - - Not in Range - Außer Reichweite - Hors de portée. - Fuera de rango - Слишком далеко - Fora do Alcançe - Hatótávolságon kívül - Poza zasięgiem - Mimo dosah - Fuori limite - - - Equipment - Ausrüstung - Equipamiento - Équipement - Ekwipunek - Vybavení - Felszerelés - Снаряжение - Equipaggiamento - Equipamento - - - Push - Schieben - Empujar - Pousser - Pchnij - Odstrčit - Tolás - Толкать - Empurrar - Spingere - - - Interact - Interagir - Interagiere - Interakce - Взаимодействовать - Interakcja - Interactuar - Cselekvés - Interagire - Interagir - - - Passengers - Insassen - Pasajeros - Пассажиры - Pasažéři - Pasażerowie - Passagers - Utasok - Passeggeri - Passageiros - - - Open - Otwórz - Otevřít - Abrir - - - Interaction System - System interakcji - Sistema de interacción - Interaktionssystem - Systém interakce - Sistema de interação - - - Enable Team Management - Wł. zarządzanie drużyną - Habilitar gestión de equipos - Aktiviere Gruppenverwaltung - Povolit správu týmu - Habilitar gestão de equipes - - - Should players be allowed to use the Team Management Menu? Default: Yes - Czy gracze mogą korzystać z menu zarządzania drużyną? Domyślnie: Tak - ¿Deben tener permitido los jugadores el uso del menu de gestión de equipos? Por defecto: Si - Sollen Spieler das Gruppenverwaltungsmenü verwenden dürfen? Standard: Ja - Mohou hráči použít menu správy týmu? Výchozí: Ano - Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim - - - Team management allows color allocation for team members, taking team command and joining/leaving teams. - Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. - Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. - Správa týmu se skládá z: přidělení barev pro členy týmu, převzetí velení, připojení/odpojení. - O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes. - La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos. - - + + + + + Interactions + Interaktionen + Interacciones + Interakce + Interakcje + Interactions + Взаимодействия + Cselekvések + Interazioni + Interaçãoes + + + Torso + Torse + Torso + Torso + Trup + Tors + Торс + Testtörzs + Torso + Torso + + + Head + Tête + Kopf + Cabeza + Hlava + Głowa + Голова + Fej + Testa + Cabeça + + + Left Arm + Bras gauche + Linker Arm + Brazo izquierdo + Levá paže + Lewe ramię + Левая рука + Bal kar + Braccio sinistro + Braço Esquerdo + + + Right Arm + Rechter Arm + Brazo derecho + Pravá paže + Prawe ramię + Bras droit + Правая рука + Jobb kar + Braccio destro + Braço Direito + + + Left Leg + Linkes Bein + Pierna izquierda + Levá noha + Lewa noga + Jambe gauche + Левая нога + Bal láb + Gamba sinistra + Perna Esquerda + + + Right Leg + Rechtes Bein + Pierna derecha + Pravá noha + Prawa noga + Jambe droite + Правая нога + Jobb láb + Gamba destra + Perna Direita + + + Weapon + Arme + Waffe + Arma + Zbraň + Broń + Оружие + Fegyver + Arma + Arma + + + Interaction Menu + Interaktionsmenü + Menú de interacción + Menu interakcji + Menu interakce + Menu d'interaction + Меню взаимодействия + Cselekvő menü + Menu de Interação + Menù interazione + + + Interaction Menu (Self) + Interaktionsmenü (selbst) + Menú de interacción (Propio) + Menu interakcji (własne) + Menu interakce (vlastní) + Menu d'interaction (Perso) + Меню взаимодействия (с собой) + Cselekvő menü (saját) + Menu de Interação (Individual) + Menù interazione (individuale) + + + Open / Close Door + Tür öffnen / schließen + Abrir / Cerrar puerta + Otwórz / Zamknij drzwi + Otevřít / Zavřít dveře + Ouvrir / Fermer Portes + Открыть / Закрыть двери + Ajtó nyitása / zárása + Abrir / Fechar Porta + Apri / Chiudi la porta + + + Lock Door + Tür sperren + Bloquear puerta + Verrouiller Porte + Blocca la porta + Заблокировать дверь + Trancar Porta + Ajtó bezárása + Zablokuj drzwi + Zamknout dveře + + + Unlock Door + Tür entsperren + Desbloquear puerta + Déverrouiller Porte + Sblocca la porta + Разблокировать дверь + Destrancar Porta + Zár kinyitása + Odblokuj drzwi + Odemknout dveře + + + Locked Door + Tür gesperrt + Puerta bloqueada + Porte Verrouillée + Porta bloccata + Дверь заблокирована + Porta Trancada + Zárt ajtó + Zablokowano drzwi + Zamčené dveře + + + Unlocked Door + Tür entsperrt + Puerta desbloqueada + Porte Déverrouillée + Porta sbloccata + Дверь разблокирована + Porta Destrancada + Nyitott ajtó + Odblokowano drzwi + Odemčené dveře + + + Join group + Gruppe beitreten + Unirse al grupo + Dołącz do grupy + Přidat se do skupiny + Rejoindre Groupe + Вступить в группу + Csatlakozás a csoporthoz + Unir-se ao grupo + Unisciti alla squadra + + + Leave Group + Gruppe verlassen + Dejar grupo + Opuść grupę + Opustit skupinu + Quitter Groupe + Выйти из группы + Csoport elhagyása + Deixar grupo + Lascia la squadra + + + Become Leader + Grp.-führung übern. + Asumir el liderazgo + Przejmij dowodzenie + Stát se velitelem + Devenir Chef de groupe + Стать лидером + Vezetés átvétele + Tornar-se Líder + Prendi il comando + + + DANCE! + TANZEN! + BAILAR! + TAŃCZ! + TANČIT! + Danse! + ТАНЦЕВАТЬ! + TÁNC! + DANCE! + DANZA! + + + Stop Dancing + Tanzen abbrechen + Dejar de bailar + Przestań tańczyć + Přestat tancovat + Arrêter de danser + Прекратить танцевать + Tánc abbahagyása + Parar de dançar + Smetti di ballare + + + << Back + << Zurück + << Atrás + << Wstecz + << Zpět + << Retour + << Назад + << Vissza + << Voltar + << Indietro + + + Gestures + Gesten + Gestos + Gesty + Posunky + Signaux + Жесты + Kézjelek + Gestos + Gesti + + + Attack + Angreifen + Atacar + Do ataku + Zaútočit + Attaquer + Атаковать + Támadás + Atacar + Attaccare + + + Advance + Vordringen + Avanzar + Naprzód + Postoupit + Avancer + Продвигаться + Előre + Avançar + Avanzare + + + Go + Los + Adelante + Szybko + Jít + Aller + Идти + Mozgás + Mover-se + Muoversi + + + Follow + Folgen + Seguirme + Za mną + Následovat + Suivre + Следовать + Utánam + Seguir + Seguire + + + Point + Zeigen + Señalar + Wskazać + Ukázat + Pointer + Точка + Mutat + Apontar + Puntare a + + + Up + Aufstehen + Arriba + Do góry + Vztyk + Debout + Вверх + Fel + Acima + Alzarsi + + + Cover + Deckung + Cubrirse + Do osłony + Krýt se + A couvert + Укрыться + Fedezékbe + Proteger-se + Copertura + + + Cease Fire + Feuer einstellen + Alto el fuego + Wstrzymać ogień + Zastavit palbu + Halte au feu + Прекратить огонь + Tüzet szüntess + Cessar Fogo + Cessare il Fuoco + + + Freeze + Keine Bewegung + Alto + Stać + Stát + Halte + Замереть + Állj + Alto + Fermi + + + Hi + Hallo + Hola + Witaj + Ahoj + Salut + Привет + Helló + Olá + Ciao + + + Put weapon on back + Waffe wegstecken + Arma a la espalda + Umieść broń na plecach + Dát zbraň na záda + Arme à la bretelle + Повесить оружие на спину + Fegyvert hátra + Colocar arma nas costas + Metti l'arma in spalla + + + Tap Shoulder + Auf Schulter klopfen + Tocar el hombro + Klepnij w ramię + Poklepat na rameno + Taper sur l'épaule + Похлопать по плечу + Vállveregetés + Tocar ombro + Dai un colpetto + + + You were tapped on the RIGHT shoulder + Te tocaron el hombro DERECHO + Dir wurde auf die rechte Schulter geklopft + On te tape sur l'épaule droite + Zostałeś klepnięty w prawe ramię. + Megveregették a JOBB válladat. + Někdo tě poklepal na PRAVÉ rameno + Вас похлопали по ПРАВОМУ плечу + Você foi tocado no ombro + Ti è stato dato un colpetto sulla spalla destra + + + You were tapped on the LEFT shoulder. + Te tocaron el hombro IZQUIERDO. + Dir wurde auf die linke Schulter geklopft + On te tape sur l'épaule gauche + Zostałeś klepnięty w lewe ramię. + Megveregették a BAL válladat. + Někdo tě poklepal na LEVÉ rameno + Вас похлопали по ЛЕВОМУ плечу + Você foi tocado no ombro. + Ti è stato dato un colpetto sulla spalla sinistra + + + Cancel + Abbrechen + Cancelar + Anuluj + Annuler + Zrušit + Annulla + Отменить + Cancelar + Mégse + + + Select + Wählen + Seleccionar + Wybierz + Sélectionner + Zvolit + Seleziona + Выбрать + Selecionar + Kiválaszt + + + Go Away! + Geh Weg! + Aléjate! + Odejdź! + Jděte pryč! + Allez-vous-en! + Уходите отсюда! + Tűnés! + Vá Embora! + Via di qui! + + + Get Down! + Auf den Boden! + Al suelo! + Padnij! + K zemi! + A terre! + A földre! + Ложись! + Abaixe-se! + A terra! + + + Team Management + Gruppenverwaltung + Gestión de equipo + Gestion d'équipe + Drużyna + Správa týmu + Управление группой + Gerenciamento de Equipe + Organizzazione Squadra + Csapat kezelése + + + Red + Rot + Rojo + Rouge + Czerwonych + Červený + Красный + Vermelha + Rosso + Piros + + + Green + Grün + Verde + Vert + Zielonych + Zelený + Зеленый + Verde + Verde + Zöld + + + Blue + Blau + Azul + Bleu + Niebieskich + Modrý + Синий + Azul + Blu + Kék + + + Yellow + Gelb + Amarillo + Jaune + Żółtych + Žlutý + Жёлтый + Amarela + Giallo + Sárga + + + Assign Red + Rot zuweisen + Asignar a rojo + Przydziel do czerwonych + Atribuir Vermelho + Hozzávonás a Piroshoz + Přiřadit k červeným + Назначить в Красную группу + Assigner à rouge + Assegna al team rosso + + + Assign Green + Grün zuweisen + Asignar a verde + Przydziel do zielonych + Atribuir Verde + Hozzávonás a Zöldhöz + Přiřadit k zeleným + Назначить в Зеленую группу + Assigner à vert + Assegna al team verde + + + Assign Blue + Blau zuweisen + Asignar a azul + Przydziel do niebieskich + Atribuir Azul + Hozzávonás a Kékhez + Přiřadit k modrým + Назначить в Синюю группу + Assigner à bleu + Assegna al team blu + + + Assign Yellow + Gelb zuweisen + Asignar a amarillo + Przydziel do żółtych + Atribuir Amarelo + Hozzávonás a Sárgához + Přiřadit ke žlutým + Назначить в Желтую группу + Assigner à jaune + Assegna al team giallo + + + Join Red + Rot beitreten + Unirse a rojo + Dołącz do czerwonych + Entrar em Vermelho + Belépés a Pirosba + Připojit k červeným + Присоединиться к Красной группе + Rejoindre rouge + Unirsi al team rosso + + + Join Green + Grün beitreten + Unirse a verde + Dołącz do zielonych + Entrar em Verde + Belépés a Zöldbe + Připojit k zeleným + Присоединиться к Зеленой группе + Rejoindre vert + Unirsi al team verde + + + Join Blue + Blau beitreten + Unirse a azul + Dołącz do niebieskich + Entrar em Azul + Belépés a Kékbe + Připojit k modrým + Присоединиться к Синей группе + Rejoindre bleu + Unirsi al team blu + + + Join Yellow + Gelb beitreten + Unirse a amarillo + Dołącz do żółtych + Entrar em Amarelo + Belépés a Sárgába + Připojit ke žlutým + Присоединиться к Жёлтой группе + Rejoindre jaune + Unirsi al team giallo + + + You joined Team %1 + Du bist Gruppe %1 beigetreten + Te has unido al equipo %1 + Tu as rejoint l'équipe %1 + Dołączyłeś do %1 + Připojil ses do %1 týmu + Вы присоединились к группе %1 + Você uniu-se à Equipe %1 + Sei entrato nel team %1 + Csatlakoztál a %1 csapathoz + + + Leave Team + Gruppe verlassen + Dejar equipo + Quitter l'équipe + Opuść drużynę + Opustit tým + Покинуть группу + Deixar Equipe + Lascia il team + Csapat elhagyása + + + You left the Team + Du hast die Gruppe verlassen + Has dejado el equipo + Tu as quitté l'équipe + Opuściłeś drużynę + Opustil jsi tým + Вы покинули группу + Você deixou a Equipe + Hai lasciato il team + Elhagytad a csapatot + + + Pardon + Begnadigen + Perdonar + Przebacz + Pardon + Pardon + Извините + Perdão + Perdona + Megbocsátás + + + Scroll + Scrollen + Przewiń + Défilement + Desplazar + Пролистать + Rolar + Scorri + Görgetés + Otáčení + + + Modifier Key + Modifikator-Taste + Modyfikator + Modifier la touche + Tecla modificadora + Клавиша-модификатор + Tecla Modificadora + Tasto modifica + Módosító billentyű + Modifikátor + + + Not in Range + Außer Reichweite + Hors de portée. + Fuera de rango + Слишком далеко + Fora do Alcançe + Hatótávolságon kívül + Poza zasięgiem + Mimo dosah + Fuori limite + + + Equipment + Ausrüstung + Equipamiento + Équipement + Ekwipunek + Vybavení + Felszerelés + Снаряжение + Equipaggiamento + Equipamento + + + Push + Schieben + Empujar + Pousser + Pchnij + Odstrčit + Tolás + Толкать + Empurrar + Spingere + + + Interact + Interagir + Interagiere + Interakce + Взаимодействовать + Interakcja + Interactuar + Cselekvés + Interagire + Interagir + + + Passengers + Insassen + Pasajeros + Пассажиры + Pasažéři + Pasażerowie + Passagers + Utasok + Passeggeri + Passageiros + + + Open + Otwórz + Otevřít + Abrir + + + Interaction System + System interakcji + Sistema de interacción + Interaktionssystem + Systém interakce + Sistema de interação + + + Enable Team Management + Wł. zarządzanie drużyną + Habilitar gestión de equipos + Aktiviere Gruppenverwaltung + Povolit správu týmu + Habilitar gestão de equipes + + + Should players be allowed to use the Team Management Menu? Default: Yes + Czy gracze mogą korzystać z menu zarządzania drużyną? Domyślnie: Tak + ¿Deben tener permitido los jugadores el uso del menu de gestión de equipos? Por defecto: Si + Sollen Spieler das Gruppenverwaltungsmenü verwenden dürfen? Standard: Ja + Mohou hráči použít menu správy týmu? Výchozí: Ano + Devem os jogadores ter permissão de usar o menu de gestão de equipes? Padrão: Sim + + + Team management allows color allocation for team members, taking team command and joining/leaving teams. + Na zarządzanie drużyną składa się: przydział kolorów dla członków drużyny, przejmowanie dowodzenia, dołączanie/opuszczanie drużyn. + Die Gruppenverwaltung erlaubt die Zuweisung von Farben für Einheiten, die Kommandierung und das Beitreten/Verlassen einer Gruppe. + Správa týmu se skládá z: přidělení barev pro členy týmu, převzetí velení, připojení/odpojení. + O módulo de gestão de equipe é composto por: a atribuição de cores para os membros da equipe, comando das equipes, juntando-se / deixando equipes. + La gestión del equipo permite la asignación de colores para los miembros del equipo, tomando el mando del equipo y uniendo/dejando equipos. + + \ No newline at end of file diff --git a/addons/inventory/README.md b/addons/inventory/README.md index 1e41aa4a8b..7d644143cf 100644 --- a/addons/inventory/README.md +++ b/addons/inventory/README.md @@ -1,7 +1,7 @@ ace_inventory ============= -Increases the size of the inventory dialog. +Adds options to increase the size of the inventory dialog. ## Maintainers diff --git a/addons/kestrel4500/CfgVehicles.hpp b/addons/kestrel4500/CfgVehicles.hpp index 8efd0e2bd1..9ca6510928 100644 --- a/addons/kestrel4500/CfgVehicles.hpp +++ b/addons/kestrel4500/CfgVehicles.hpp @@ -39,7 +39,7 @@ class CfgVehicles { author = "Ruthberg"; scope = 2; scopeCurator = 2; - displayName = "Kestrel 4500"; + displayName = CSTRING(Name); vehicleClass = "Items"; class TransportItems { MACRO_ADDITEM(ACE_Kestrel4500,1); diff --git a/addons/kestrel4500/README.md b/addons/kestrel4500/README.md index 36a324beb9..c0b50a3555 100644 --- a/addons/kestrel4500/README.md +++ b/addons/kestrel4500/README.md @@ -1,10 +1,11 @@ ace_kestrel4500 =============== -Kestrel 4500 Pocket Weather Tracker +Adds Kestrel 4500 Pocket Weather Tracker. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 2be349c294..304cd5938a 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -26,7 +26,7 @@ if(!isDedicated) then { _uuid = [(vehicle ACE_player), ACE_player, QFUNC(vanillaLaserSeekerHandler), ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_CODE, ACE_DEFAULT_LASER_BEAMSPREAD] call FUNC(laserOn); _laserTarget setVariable [QGVAR(uuid), _uuid, false]; - [FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call cba_fnc_addPerFrameHandler; + [FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player, _uuid]] call CBA_fnc_addPerFrameHandler; } else { // server side ownership of laser _laserTarget setVariable [QGVAR(owner), nil, true]; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 346aec837e..22287f1342 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -12,13 +12,13 @@ * Return value: * Array, [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found. */ - + #include "script_component.hpp" -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 ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; +private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_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"]; +private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; _pos = _this select 0; _dir = vectorNormalized (_this select 1); @@ -62,17 +62,19 @@ _finalOwner = nil; }; }; }; - _laserPos = _laser select 0; - _laserDir = _laser select 1; - _res = [_laserPos, _laserDir, _divergence] call FUNC(shootCone); - { - _testPoint = _x select 0; - _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); - _testDotProduct = _dir vectorDotProduct _testPointVector; - if(_testDotProduct > _seekerCos) then { - _spots pushBack [_testPoint, _owner]; - }; - } forEach (_res select 2); + + //Handle Weird Data Return + if (_laser params [["_laserPos", [], [[]], 3], ["_laserDir", [], [[]], 3]]) then { + _res = [_laserPos, _laserDir, _divergence] call FUNC(shootCone); + { + _testPoint = _x select 0; + _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); + _testDotProduct = _dir vectorDotProduct _testPointVector; + if(_testDotProduct > _seekerCos) then { + _spots pushBack [_testPoint, _owner]; + }; + } forEach (_res select 2); + }; }; } forEach (GVAR(laserEmitters) select 1); @@ -119,10 +121,10 @@ if((count _spots) > 0) then { _largestIndex = _index; }; } forEach _buckets; - + _finalBucket = _finalBuckets select _largestIndex; _owners = HASH_CREATE; - + if(count _finalBucket > 0) then { _avgX = 0; _avgY = 0; diff --git a/addons/laser/initKeybinds.sqf b/addons/laser/initKeybinds.sqf index 5e3d017103..25fdd2ddcc 100644 --- a/addons/laser/initKeybinds.sqf +++ b/addons/laser/initKeybinds.sqf @@ -1,9 +1,9 @@ ["ACE3 Equipment", QGVAR(LaserCodeUp), localize LSTRING(laserCodeUp), { - if( EGVAR(laser_selfdesignate,active) - || + if( EGVAR(laser_selfdesignate,active) + || { (currentWeapon ACE_player) == "Laserdesignator" && (call CBA_fnc_getFoV) select 1 > 5 } // If laserdesignator & FOV, we are in scope. - || + || { [ACE_player] call FUNC(unitTurretCanLockLaser) } ) then { [] call FUNC(keyLaserCodeUp); @@ -14,14 +14,14 @@ ["ACE3 Equipment", QGVAR(LaserCodeDown), localize LSTRING(laserCodeDown), { - if( EGVAR(laser_selfdesignate,active) - || + if( EGVAR(laser_selfdesignate,active) + || { (currentWeapon ACE_player) == "Laserdesignator" && (call CBA_fnc_getFoV) select 1 > 5 } // If laserdesignator & FOV, we are in scope. - || + || { [ACE_player] call FUNC(unitTurretCanLockLaser) } ) then { [] call FUNC(keyLaserCodeDown); }; }, {false}, -[18, [true, true, true]], false, 0] call CBA_fnc_addKeybind; // (ALT+CTRL+E) +[18, [false, true, true]], false, 0] call CBA_fnc_addKeybind; // (ALT+CTRL+E) diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 0da2866738..a07b197236 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -83,7 +83,7 @@ if(!GVAR(active)) then { // @TODO: Nou gets to field all tickets about missing lasers. //_localLaserTarget = "LaserTargetW" createVehicleLocal (getpos ACE_player); - GVAR(selfDesignateHandle) = [FUNC(laserHudDesignatePFH), 0.1, [ACE_player, _laserUuid, nil]] call cba_fnc_addPerFrameHandler; + GVAR(selfDesignateHandle) = [FUNC(laserHudDesignatePFH), 0.1, [ACE_player, _laserUuid, nil]] call CBA_fnc_addPerFrameHandler; } else { [] call FUNC(laserHudDesignateOff); [] call FUNC(laserHudDesignateOn); diff --git a/addons/laserpointer/CfgJointRails.hpp b/addons/laserpointer/CfgJointRails.hpp new file mode 100644 index 0000000000..7583bd03b5 --- /dev/null +++ b/addons/laserpointer/CfgJointRails.hpp @@ -0,0 +1,8 @@ +class asdg_SlotInfo; +class asdg_FrontSideRail: asdg_SlotInfo { + class compatibleItems { + ACE_acc_pointer_red = 1; + ACE_acc_pointer_green = 1; + ACE_acc_pointer_green_IR = 1; + }; +}; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 133931578a..6e9d402529 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -4,12 +4,6 @@ // fixes laser when being captured. Needed, because the selectionPosition of the right hand is used ["SetHandcuffed", {if (_this select 1) then {(_this select 0) action ["GunLightOff", _this select 0]};}] call EFUNC(common,addEventHandler); -//If user has ASDG JR without the compat patch, then ace's' laser pointers won't be compatible with anything -if ((isClass (configFile >> "CfgPatches" >> "asdg_jointrails")) && {!(isClass (configFile >> "CfgPatches" >> "ace_asdg_comp"))}) then { - diag_log text format ["[ACE_laserpointer] - ASDG Joint Rails but no ace_asdg_comp"]; -}; - - if !(hasInterface) exitWith {}; GVAR(nearUnits) = []; @@ -32,7 +26,7 @@ GVAR(nearUnits) = []; } forEach nearestObjects [positionCameraToWorld [0,0,0], ["AllVehicles"], 50]; // when moving this, search also for units inside vehicles. currently breaks the laser in FFV GVAR(nearUnits) = _nearUnits; - + } , 5, []] call CBA_fnc_addPerFrameHandler; addMissionEventHandler ["Draw3D", { diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index d368512257..cbb3105696 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -16,3 +16,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgJointRails.hpp" diff --git a/addons/logistics_uavbattery/README.md b/addons/logistics_uavbattery/README.md index 8c89913459..d32175cb44 100644 --- a/addons/logistics_uavbattery/README.md +++ b/addons/logistics_uavbattery/README.md @@ -1,7 +1,10 @@ ace_logistics_uavbattery =========== -Adds an item `ACE_UAVBattery` that allows refueling/recharging of the "Dartar" quadcopter UAVs. +Adds an item that allows refueling/recharging of the Darter quadcopter UAVs. + +#### Items Added: +`ACE_UAVBattery` ## Maintainers diff --git a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf index aaaac3077d..451753a9e2 100644 --- a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf @@ -16,6 +16,6 @@ */ #include "script_component.hpp" -PARAMS_2(_caller,_target); +params ["_caller", "_target"]; ("ACE_UAVBattery" in (items _caller)) && {(fuel _target) < 1} && {(speed _target) < 1} && {!(isEngineOn _target)} && {(_target distance _caller) <= 4} diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index e51f17777e..25f452882c 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -15,23 +15,21 @@ * Public: No */ #include "script_component.hpp" - -PARAMS_2(_caller,_target); - private ["_onFinish", "_onFailure"]; +params ["_caller", "_target"]; if (!(_this call FUNC(canRefuelUAV))) exitWith {}; _onFinish = { - EXPLODE_2_PVT((_this select 0),_caller,_target); - _caller removeItem "ACE_UAVBattery"; - playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; - ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local + (_this select 0) params ["_caller", "_target"]; + _caller removeItem "ACE_UAVBattery"; + playSound3D [QUOTE(PATHTO_R(sounds\exchange_battery.ogg)), objNull, false, getPosASL _caller, 1, 1, 10]; + ["setFuel", [_target], [_target, 1]] call EFUNC(common,targetEvent); //setFuel is local }; _onFailure = { - EXPLODE_2_PVT((_this select 0),_caller,_target); - [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); + (_this select 0) params ["_caller", "_target"]; + [_caller, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); }; [_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp index a31d9c0d99..0b584409d3 100644 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ b/addons/logistics_wirecutter/CfgVehicles.hpp @@ -5,4 +5,22 @@ class CfgVehicles { MACRO_ADDITEM(ACE_wirecutter,4); }; }; + + class Wall_F; + class NonStrategic; + + class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; }; + class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; }; + class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; }; + class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; }; diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 4297cb3b83..2b365cc8e6 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -10,7 +10,7 @@ class CfgWeapons { picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); scope = 2; class ItemInfo: InventoryItem_Base_F { - mass = 100; + mass = 65; }; }; }; diff --git a/addons/logistics_wirecutter/README.md b/addons/logistics_wirecutter/README.md index e0bef0bed6..89d42c419f 100644 --- a/addons/logistics_wirecutter/README.md +++ b/addons/logistics_wirecutter/README.md @@ -1,7 +1,10 @@ ace_logistics_wirecutter =========== -Adds an item `ACE_wirecutter` that allows cutting of fences in A3 and AiA maps. +Adds an item that allows cutting of fences in Aarma 3 and AiA/CUP maps. + +#### Items Added: +`ACE_wirecutter` ## Maintainers diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf index 44eb941c16..39620bf35c 100644 --- a/addons/logistics_wirecutter/XEH_preInit.sqf +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -3,9 +3,6 @@ ADDON = false; PREP(cutDownFence); -PREP(cutDownFenceAbort); -PREP(cutDownFenceCallback); -PREP(getNearestFence); PREP(interactEH); PREP(isFence); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index f45f0c1511..2bf807975f 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -16,21 +16,35 @@ */ #include "script_component.hpp" -#define SOUND_CLIP_TIME_SPACEING 1.5 -private ["_timeToCut", "_progressCheck"]; +params ["_unit", "_fenceObject"]; +TRACE_2("params",_unit,_fenceObject); + +private ["_timeToCut", "_progressCheck", "_onCompletion", "_onFail"]; -PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; _timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); +_onCompletion = { + TRACE_1("_onCompletion",_this); + (_this select 0) params ["_fenceObject", "", "_unit"]; + _fenceObject setdamage 1; + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +}; + +_onFail = { + TRACE_1("_onFail", _this); + (_this select 0) params ["", "", "_unit"]; + [_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +}; + _progressCheck = { - PARAMS_2(_args,_passedTime); - EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime); + params ["_args", "_passedTime"]; + _args params ["_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]; }; @@ -38,4 +52,4 @@ _progressCheck = { ((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))}) }; -[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf deleted file mode 100644 index 20cb092131..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: commy2 - * Stops cutting down fence (reset animation) - * - * Arguments: - * Nothing - * - * Return Value: - * Nothing - * - * Example: - * [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort - * - * Public: No - */ -#include "script_component.hpp" - -[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf deleted file mode 100644 index 57495a2a03..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: PabstMirror - * Once progressbar is done: Fence is cutdown - * - * Arguments: - * 0: Fence Object - * - * Return Value: - * Nothing - * - * Example: - * [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_1(_fenceObject); - -_fenceObject setdamage 1; -// [localize LSTRING(FenceCut)] call EFUNC(common,displayTextStructured); -[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf deleted file mode 100644 index 15bfbdb8ef..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: PabstMirror - * Gets nearest fence object (not actully used, left for utility) - * - * Arguments: - * 0: Unit - * - * Return Value: - * The return value - * - * Example: - * [player] call ace_logistics_wirecutter_fnc_getNearestFence - * - * Public: Yes - */ -#include "script_component.hpp" - -private "_nearestFence"; -PARAMS_1(_unit); - -_nearestFence = objNull; -{ - 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 05c47c4454..e93296e44a 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -15,22 +15,24 @@ */ #include "script_component.hpp" -PARAMS_1(_interactionType); +params ["_interactionType"]; -//Ignore self-interaction menu -if (_interactionType != 0) exitWith {}; +//Ignore self-interaction menu or mounted vehicle interaction +if ((_interactionType != 0) || {(vehicle ACE_player) != ACE_player}) exitWith {}; //for performance only do stuff it they have a wirecutter item //(if they somehow get one durring keydown they'll just have to reopen) if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; +TRACE_1("Starting wire-cut action PFEH",_interactionType); + [{ private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"]; - PARAMS_2(_args,_pfID); - EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); + params ["_args", "_pfID"]; + _args params ["_setPosition", "_addedHelpers", "_fencesHelped"]; if (!EGVAR(interact_menu,keyDown)) then { - {deleteVehicle _x;} forEach _addedHelpers; + {deleteVehicle _x; nil} count _addedHelpers; [_pfID] call CBA_fnc_removePerFrameHandler; } else { // Prevent Rare Error when ending mission with interact key down: @@ -40,11 +42,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (((getPosASL ace_player) distance _setPosition) > 5) then { _fncStatement = { - PARAMS_3(_dummyTarget,_player,_attachedFence); + params ["", "_player", "_attachedFence"]; [_player, _attachedFence] call FUNC(cutDownFence); }; _fncCondition = { - PARAMS_3(_dummyTarget,_player,_attachedFence); + params ["", "_player", "_attachedFence"]; + if (!([_player, _attachedFence, []] call EFUNC(common,canInteractWith))) exitWith {false}; ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))}) }; @@ -52,15 +55,15 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if (!(_x in _fencesHelped)) then { if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; - _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); + _helper = "ACE_LogicDummy" createVehicleLocal (getpos _x); _action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); [_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject); _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); - _helper hideObject true; _addedHelpers pushBack _helper; }; }; - } forEach nearestObjects [ace_player, [], 15]; + nil + } count nearestObjects [ace_player, [], 15]; _args set [0, (getPosASL ace_player)]; }; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 4c247b268a..c1e30a7e6f 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -16,27 +16,26 @@ */ #include "script_component.hpp" -//find is case sensitive, so keep everything lowercase -#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", "ace_concertinawire"] - -#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"] +params ["_object"]; +TRACE_1("params",_object); private ["_typeOf", "_returnValue"]; -PARAMS_1(_object); -_typeOf = toLower (typeOf _object); +_typeOf = typeOf _object; _returnValue = false; if (_typeOf != "") then { //If the fence has configEntry we can check it directly - _returnValue = _typeOf in FENCE_TYPENAMES; + _returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence)))); } else { + //TODO: 1.50 use getModelInfo _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" { if ((_typeOf find _x) != -1) exitWith { _returnValue = true; }; - } forEach FENCE_P3DS; + nil + } count FENCE_P3DS; }; _returnValue diff --git a/addons/logistics_wirecutter/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp index 6dae60dfd2..a86ace1592 100644 --- a/addons/logistics_wirecutter/script_component.hpp +++ b/addons/logistics_wirecutter/script_component.hpp @@ -1,6 +1,8 @@ #define COMPONENT logistics_wirecutter #include "\z\ace\addons\main\script_mod.hpp" +// #define DEBUG_MODE_FULL + #ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER #define DEBUG_MODE_FULL #endif @@ -10,3 +12,9 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + + +//find is case sensitive, so keep everything lowercase +#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"] + +#define SOUND_CLIP_TIME_SPACEING 1.5 diff --git a/addons/magazinerepack/README.md b/addons/magazinerepack/README.md index 28b7c3115a..e86adcd976 100644 --- a/addons/magazinerepack/README.md +++ b/addons/magazinerepack/README.md @@ -1,7 +1,8 @@ ace_magazinerepack ================== -Adds the ability to consolidate multiple half-empty magazines. +Adds the ability to consolidate multiple unfull magazines. + ## Maintainers diff --git a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf index fbd07cf31a..34e369199f 100644 --- a/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf +++ b/addons/magazinerepack/functions/fnc_getMagazineChildren.sqf @@ -7,7 +7,7 @@ * 1: Player * * Return value: - * ChildActiosn + * ChildActions * * Example: * [player, player] call ace_magazinerepack_fnc_getMagazineChildren @@ -16,15 +16,17 @@ */ #include "script_component.hpp" -private ["_unitMagazines", "_unitMagCounts", "_xFullMagazineCount", "_index", "_actions", "_displayName", "_picture", "_action"]; +private ["_unitMagazines", "_unitMagCounts", "_index", "_actions", "_displayName", "_picture", "_action"]; -PARAMS_2(_target,_player); +params ["_target", "_player"]; // get all mags and ammo count _unitMagazines = []; _unitMagCounts = []; { - EXPLODE_4_PVT(_x,_xClassname,_xCount,_xLoaded,_xType); + private "_xFullMagazineCount"; + _x params ["_xClassname", "_xCount", "_xLoaded", "_xType"]; + _xFullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _xClassname >> "count"); //for every partial magazine, that is either in inventory or can be moved there diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index 1f5be8f72a..ab380cb1ed 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -10,7 +10,7 @@ * 3: Error Code * * Return Value: - * Nothing + * None * * Example: * (args from progressBar) call ace_magazinerepack_fnc_magazineRepackFinish @@ -21,8 +21,9 @@ private ["_structuredOutputText", "_picture", "_fullMags", "_partialMags", "_fullMagazineCount"]; -PARAMS_4(_args,_elapsedTime,_totalTime,_errorCode); -EXPLODE_2_PVT(_args,_magazineClassname,_lastAmmoCount); +params ["_args", "_elapsedTime", "_totalTime", "_errorCode"]; +_args params ["_magazineClassname", "_lastAmmoCount"]; + _fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); //Don't show anything if player can't interact: diff --git a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf index 64ce05d12d..c1bf5ebdab 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackProgress.sqf @@ -20,17 +20,19 @@ private ["_currentAmmoCount", "_addedMagazines", "_missingAmmo", "_index", "_updateMagazinesOnPlayerFnc"]; -PARAMS_3(_args,_elapsedTime,_totalTime); -EXPLODE_3_PVT(_args,_magazineClassname,_lastAmmoCount,_simEvents); -if ((count _simEvents) == 0) exitWith {ERROR("No Event"); false}; -EXPLODE_3_PVT((_simEvents select 0),_nextEventTime,_nextEventIsBullet,_nextEventMags); +params ["_ars", "_elapsedTime", "_totalTime"]; +_args params ["_magazineClassname", "_lastAmmoCount", "_simEvents"]; -if (_nextEventTime > _elapsedTime) exitWith {true};//waiting on next event +if !((_simEvents select 0) params ["_nextEventTime", "_nextEventIsBullet", "_nextEventMags"]) exitWith { ERROR("No Event"); false }; + + + +if (_nextEventTime > _elapsedTime) exitWith { true };//waiting on next event //Verify we aren't missing any ammo _currentAmmoCount = []; { - EXPLODE_2_PVT(_x,_xClassname,_xCount); + _x params ["_xClassname", "_xCount"]; if (_xClassname == _magazineClassname) then { _currentAmmoCount pushBack _xCount; }; @@ -50,7 +52,7 @@ _missingAmmo = false; }; } forEach _lastAmmoCount; -if (_missingAmmo) exitWith {false}; //something removed ammo that was being repacked (could be other players or scripts) +if (_missingAmmo) exitWith { false }; //something removed ammo that was being repacked (could be other players or scripts) _updateMagazinesOnPlayerFnc = { ACE_player removeMagazines _magazineClassname; //remove inventory magazines @@ -75,4 +77,4 @@ if (_nextEventIsBullet) then { _simEvents deleteAt 0; //pop off the event -true; +true diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index e57e569dc1..646bd880af 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -19,20 +19,20 @@ */ #include "script_component.hpp" -private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; +private ["_fnc_newMag", "_time", "_events", "_fnc_swapAmmo", "_ammoSwaped", "_lowIndex", "_highIndex", "_ammoToTransfer", "_ammoAvailable", "_ammoNeeded", "_swapProgress"]; -PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); +params ["_fullMagazineCount", "_arrayOfAmmoCounts", "_isBelt"]; // Sort Ascending - Don't modify original _arrayOfAmmoCounts = +_arrayOfAmmoCounts; _arrayOfAmmoCounts sort true; -_newMagFnc = { +_fnc_newMag = { _time = _time + GVAR(TimePerMagazine); _events pushBack [_time, false, +_arrayOfAmmoCounts]; }; -_swapAmmoFnc = if (_isBelt) then { +_fnc_swapAmmo = if (_isBelt) then { { _time = _time + GVAR(TimePerBeltLink); _arrayOfAmmoCounts set [_lowIndex, ((_arrayOfAmmoCounts select _lowIndex) - _ammoSwaped)]; @@ -64,14 +64,14 @@ while {_lowIndex < _highIndex} do { if (_ammoAvailable == 0) then { _lowIndex = _lowIndex + 1; - call _newMagFnc; + call _fnc_newMag; } else { if (_ammoNeeded == 0) then { _highIndex = _highIndex - 1; - call _newMagFnc; + call _fnc_newMag; } else { _ammoSwaped = _ammoAvailable min _ammoNeeded; - call _swapAmmoFnc; + call _fnc_swapAmmo; }; }; }; diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index e0621a41be..b11fc3697d 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -21,7 +21,7 @@ private ["_magazineCfg", "_fullMagazineCount", "_isBelt", "_startingAmmoCounts", "_simEvents", "_totalTime"]; -PARAMS_3(_target,_player,_magazineClassname); +params ["_target", "_player", "_magazineClassname"]; if (isNil "_magazineClassname" || {_magazineClassname == ""}) exitWith {ERROR("Bad Mag Classname");}; _magazineCfg = configfile >> "CfgMagazines" >> _magazineClassname; @@ -63,11 +63,11 @@ _simEvents = [_fullMagazineCount, _startingAmmoCounts, _isBelt] call FUNC(simula _totalTime = (_simEvents select ((count _simEvents) - 1) select 0); [ -_totalTime, -[_magazineClassname, _startingAmmoCounts, _simEvents], -{_this call FUNC(magazineRepackFinish)}, -{_this call FUNC(magazineRepackFinish)}, -(localize LSTRING(RepackingMagazine)), -{_this call FUNC(magazineRepackProgress)}, -["isNotInside", "isNotSitting"] + _totalTime, + [_magazineClassname, _startingAmmoCounts, _simEvents], + {_this call FUNC(magazineRepackFinish)}, + {_this call FUNC(magazineRepackFinish)}, + (localize LSTRING(RepackingMagazine)), + {_this call FUNC(magazineRepackProgress)}, + ["isNotInside", "isNotSitting"] ] call EFUNC(common,progressBar); diff --git a/addons/main/CfgModuleCategories.hpp b/addons/main/CfgModuleCategories.hpp index 5297ec1e99..a3dd65c544 100644 --- a/addons/main/CfgModuleCategories.hpp +++ b/addons/main/CfgModuleCategories.hpp @@ -5,4 +5,7 @@ class CfgFactionClasses { priority = 2; side = 7; }; + class ACE_Logistics: ACE { + displayName = CSTRING(Category_Logistics); + }; }; diff --git a/addons/main/CfgVehicleClasses.hpp b/addons/main/CfgVehicleClasses.hpp new file mode 100644 index 0000000000..9aa807f3f5 --- /dev/null +++ b/addons/main/CfgVehicleClasses.hpp @@ -0,0 +1,5 @@ +class CfgVehicleClasses { + class ACE_Logistics_Items { + displayName = CSTRING(Category_Logistics); + }; +}; diff --git a/addons/main/config.cpp b/addons/main/config.cpp index eb136f84cf..c44f9d1d46 100644 --- a/addons/main/config.cpp +++ b/addons/main/config.cpp @@ -1,4 +1,4 @@ -#include "script_component.hpp" +#include "script_component.hpp" class CfgPatches { class ADDON { @@ -541,7 +541,7 @@ class CfgPatches { "a3_weapons_f_vests", "a3data", "map_vr", - "extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3" + "extended_eventhandlers", "cba_ui", "cba_xeh", "cba_xeh_a3", "cba_jr" }; author[] = {"ACE Team"}; authorUrl = ""; @@ -587,3 +587,4 @@ class CfgSettings { }; #include "CfgModuleCategories.hpp" +#include "CfgVehicleClasses.hpp" diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index e67c45e675..41514e4aaf 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -97,5 +97,87 @@ // Time functions for accuracy per frame #define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime)) +#define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message) +#define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message) -#include "script_debug.hpp" \ No newline at end of file +#define ACE_LOGERROR(message) ACE_LOG(COMPONENT,"ERROR",message) +#define ACE_LOGERROR_1(message,arg1) ACE_LOGERROR(FORMAT_1(message,arg1)) +#define ACE_LOGERROR_2(message,arg1,arg2) ACE_LOGERROR(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGERROR_3(message,arg1,arg2,arg3) ACE_LOGERROR(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGERROR_4(message,arg1,arg2,arg3,arg4) ACE_LOGERROR(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGERROR_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGERROR(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGERROR_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGERROR(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGERROR_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGERROR(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGERROR_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGERROR(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_ERRORFORMAT(message) ACE_LOGFORMAT(COMPONENT,"ERROR",message) +#define ACE_ERRORFORMAT_1(message,arg1) ACE_ERRORFORMAT(FORMAT_1(message,arg1)) +#define ACE_ERRORFORMAT_2(message,arg1,arg2) ACE_ERRORFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_ERRORFORMAT_3(message,arg1,arg2,arg3) ACE_ERRORFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_ERRORFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_ERRORFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_ERRORFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_ERRORFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_ERRORFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_ERRORFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_ERRORFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_ERRORFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_ERRORFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_ERRORFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGWARNING(message) ACE_LOG(COMPONENT,"WARNING",message) +#define ACE_LOGWARNING_1(message,arg1) ACE_LOGWARNING(FORMAT_1(message,arg1)) +#define ACE_LOGWARNING_2(message,arg1,arg2) ACE_LOGWARNING(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGWARNING_3(message,arg1,arg2,arg3) ACE_LOGWARNING(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGWARNING_4(message,arg1,arg2,arg3,arg4) ACE_LOGWARNING(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGWARNING_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGWARNING(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGWARNING_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGWARNING(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message) +#define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1)) +#define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_WARNINGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_WARNINGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_WARNINGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_WARNINGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_WARNINGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_WARNINGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_WARNINGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_WARNINGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_WARNINGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_WARNINGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGINFO(message) ACE_LOG(COMPONENT,"INFO",message) +#define ACE_LOGINFO_1(message,arg1) ACE_LOGINFO(FORMAT_1(message,arg1)) +#define ACE_LOGINFO_2(message,arg1,arg2) ACE_LOGINFO(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGINFO_3(message,arg1,arg2,arg3) ACE_LOGINFO(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGINFO_4(message,arg1,arg2,arg3,arg4) ACE_LOGINFO(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGINFO_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGINFO(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGINFO_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGINFO(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGINFO_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGINFO(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGINFO_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGINFO(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_INFOFORMAT(message) ACE_LOGFORMAT(COMPONENT,"INFO",message) +#define ACE_INFOFORMAT_1(message,arg1) ACE_INFOFORMAT(FORMAT_1(message,arg1)) +#define ACE_INFOFORMAT_2(message,arg1,arg2) ACE_INFOFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_INFOFORMAT_3(message,arg1,arg2,arg3) ACE_INFOFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_INFOFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_INFOFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_INFOFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_INFOFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_INFOFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_INFOFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_INFOFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_INFOFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_INFOFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_INFOFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_LOGDEBUG(message) ACE_LOG(COMPONENT,"DEBUG",message) +#define ACE_LOGDEBUG_1(message,arg1) ACE_LOGDEBUG(FORMAT_1(message,arg1)) +#define ACE_LOGDEBUG_2(message,arg1,arg2) ACE_LOGDEBUG(FORMAT_2(message,arg1,arg2)) +#define ACE_LOGDEBUG_3(message,arg1,arg2,arg3) ACE_LOGDEBUG(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_LOGDEBUG_4(message,arg1,arg2,arg3,arg4) ACE_LOGDEBUG(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_LOGDEBUG_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGDEBUG(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_LOGDEBUG_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGDEBUG(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_LOGDEBUG_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGDEBUG(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_LOGDEBUG_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGDEBUG(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#define ACE_DEBUGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"DEBUG",message) +#define ACE_DEBUGFORMAT_1(message,arg1) ACE_DEBUGFORMAT(FORMAT_1(message,arg1)) +#define ACE_DEBUGFORMAT_2(message,arg1,arg2) ACE_DEBUGFORMAT(FORMAT_2(message,arg1,arg2)) +#define ACE_DEBUGFORMAT_3(message,arg1,arg2,arg3) ACE_DEBUGFORMAT(FORMAT_3(message,arg1,arg2,arg3)) +#define ACE_DEBUGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_DEBUGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4)) +#define ACE_DEBUGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_DEBUGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5)) +#define ACE_DEBUGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_DEBUGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6)) +#define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7)) +#define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)) + +#include "script_debug.hpp" diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 7c8a83f4b1..e38e71ac4b 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -5,7 +5,7 @@ #define MAJOR 3 #define MINOR 2 -#define PATCHLVL 0 +#define PATCHLVL 2 #define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml new file mode 100644 index 0000000000..266e21bf40 --- /dev/null +++ b/addons/main/stringtable.xml @@ -0,0 +1,9 @@ + + + + + ACE Logistics + ACE Logistyka + + + \ No newline at end of file diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp index 15e2a174e4..4e2a5d5706 100644 --- a/addons/map/ACE_Settings.hpp +++ b/addons/map/ACE_Settings.hpp @@ -15,6 +15,10 @@ class ACE_Settings { value = 1; typeName = "BOOL"; }; + class GVAR(mapGlow) { + value = 1; + typeName = "BOOL"; + }; class GVAR(mapShake) { value = 1; typeName = "BOOL"; diff --git a/addons/map/CfgAmmo.hpp b/addons/map/CfgAmmo.hpp new file mode 100644 index 0000000000..805e7b3627 --- /dev/null +++ b/addons/map/CfgAmmo.hpp @@ -0,0 +1,48 @@ +class CfgAmmo { + + class FlareCore; + + class FlareBase: FlareCore {}; + class F_20mm_White: FlareBase {}; + + class ACE_FlashlightProxy_White: F_20mm_White { + model = ""; + effectFlare = "FlareShell"; + + triggerTime = 0; + intensity = 0.5; + flareSize = 1; + timeToLive = 10e10; + + lightColor[] = {1,1,1,1}; + + grenadeBurningSound[] = {}; + grenadeFireSound[] = {}; + soundTrigger[] = {}; + SmokeShellSoundHit1[] = {}; + SmokeShellSoundHit2[] = {}; + SmokeShellSoundHit3[] = {}; + SmokeShellSoundLoop1[] = {}; + SmokeShellSoundLoop2[] = {}; + }; + + class ACE_FlashlightProxy_Red: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {1,0,0,1}; + }; + + class ACE_FlashlightProxy_Green: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {0,1,0,1}; + }; + + class ACE_FlashlightProxy_Blue: ACE_FlashlightProxy_White { + intensity = 1.5; + lightColor[] = {0.25,0.25,1,1}; + }; + + class ACE_FlashlightProxy_Yellow: ACE_FlashlightProxy_White { + intensity = 1; + lightColor[] = {1,1,0.5,1}; + }; +}; \ No newline at end of file diff --git a/addons/map/CfgSounds.hpp b/addons/map/CfgSounds.hpp new file mode 100644 index 0000000000..ede59914a7 --- /dev/null +++ b/addons/map/CfgSounds.hpp @@ -0,0 +1,7 @@ +class CfgSounds { + class ACE_map_flashlightClick { + name = "ACE_map_flashlightClick"; + sound[] = {"\a3\sounds_f\weapons\Other\dry4.wss", 0.2, 2}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index d1b7e38dba..3b203c1f62 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,4 +1,20 @@ class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_MapFlashlight { + displayName = CSTRING(Action_Flashlights); + icon = QUOTE(\a3\ui_f\data\IGUI\Cfg\VehicleToggles\lightsiconon_ca.paa); + condition = QUOTE(GVAR(mapIllumination) && visibleMap && (count ([ACE_player] call FUNC(getUnitFlashlights)) > 0)); + statement = "true"; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; + insertChildren = QUOTE(_this call DFUNC(compileFlashlightMenu)); + showDisabled = 0; + priority = 99; + }; + }; + }; + class ACE_Module; class ACE_ModuleMap: ACE_Module { author = ECSTRING(common,ACETeam); @@ -15,6 +31,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class MapGlow { + displayName = CSTRING(MapGlow_DisplayName); + description = CSTRING(MapGlow_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class MapShake { displayName = CSTRING(MapShake_DisplayName); description = CSTRING(MapShake_Description); @@ -39,8 +61,7 @@ class CfgVehicles { }; }; - class Module_F; - class ACE_ModuleBlueForceTracking: Module_F { + class ACE_ModuleBlueForceTracking: ACE_Module { author = ECSTRING(common,ACETeam); category = "ACE"; displayName = CSTRING(BFT_Module_DisplayName); @@ -72,4 +93,4 @@ class CfgVehicles { description = CSTRING(BFT_Module_Description); }; }; -}; +}; \ No newline at end of file diff --git a/addons/map/README.md b/addons/map/README.md index 6544d0f236..7567986ba5 100644 --- a/addons/map/README.md +++ b/addons/map/README.md @@ -1,12 +1,12 @@ ace_map ======= -Various tweaks to the in-game map. Including: +Various tweaks to the in-game map, including: - Better map styling (countours, legend, hiding bushes and trees, etc). - Max zoom level (optional) - Map shaking while walking (optional) - Map illumination (optional) -- Blufor tracker (optional) +- Blue Force Tracker (optional) ## Maintainers diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 52c904b1ce..ef528d5233 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,23 +1,24 @@ #include "script_component.hpp" // Exit on Headless as well -if !(hasInterface) exitWith {}; +if (!hasInterface) exitWith {}; LOG(MSG_INIT); // Calculate the maximum zoom allowed for this map call FUNC(determineZoom); -// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. -// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. -[] spawn { - // Wait until the map display is detected - waitUntil {(!isNull findDisplay 12)}; +[{ + if (isNull findDisplay 12) exitWith {}; GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; GVAR(lastStillTime) = ACE_time; GVAR(isShaking) = false; + //map sizes are multiples of 1280 + GVAR(worldSize) = worldSize / 1280; + GVAR(mousePos) = [0.5,0.5]; + //Allow panning the lastStillPosition while mapShake is active GVAR(rightMouseButtonLastPos) = []; ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; @@ -42,7 +43,17 @@ call FUNC(determineZoom); GVAR(rightMouseButtonLastPos) = []; }; }]; -}; + + //get mouse position on map + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", { + GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2]; + }]; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseHolding", { + GVAR(mousePos) = (_this select 0) ctrlMapScreenToWorld [_this select 1, _this select 2]; + }]; + + [_this select 1] call CBA_fnc_removePerFrameHandler; +}, 0] call CBA_fnc_addPerFrameHandler; ["SettingsInitialized", { // Start Blue Force Tracking if Enabled @@ -50,4 +61,41 @@ call FUNC(determineZoom); GVAR(BFT_markers) = []; [FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; }; -}] call EFUNC(common,addEventHandler); + + //illumination settings + if (GVAR(mapIllumination)) then { + GVAR(flashlightInUse) = ""; + GVAR(glow) = objNull; + + ["playerInventoryChanged", { + _flashlights = [ACE_player] call FUNC(getUnitFlashlights); + if ((GVAR(flashlightInUse) != "") && !(GVAR(flashlightInUse) in _flashlights)) then { + GVAR(flashlightInUse) = ""; + }; + }] call EFUNC(common,addEventHandler); + + if (GVAR(mapGlow)) then { + ["visibleMapChanged", { + params ["_player", "_mapOn"]; + if (_mapOn) then { + if (!alive _player && !isNull GVAR(glow)) then { + GVAR(flashlightInUse) = ""; + }; + if (GVAR(flashlightInUse) != "") then { + if (isNull GVAR(glow)) then { + [GVAR(flashlightInUse)] call FUNC(flashlightGlow); + }; + } else { + if (!isNull GVAR(glow)) then { + [""] call FUNC(flashlightGlow); + }; + }; + } else { + if (!isNull GVAR(glow)) then { + [""] call FUNC(flashlightGlow); + }; + }; + }] call EFUNC(common,addEventHandler); + }; + }; +}] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index c5645a52e7..9e123a3877 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -5,10 +5,15 @@ LOG(MSG_INIT); PREP(blueForceTrackingModule); PREP(blueForceTrackingUpdate); +PREP(compileFlashlightMenu); PREP(determineMapLight); PREP(determineZoom); +PREP(flashlightGlow); +PREP(getUnitFlashlights); PREP(moduleMap); PREP(onDrawMap); +PREP(simulateMapLight); +PREP(switchFlashlight); PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 078c06b41d..6d6b4030ec 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -27,6 +27,8 @@ class RscEdit; #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" +#include "CfgAmmo.hpp" +#include "CfgSounds.hpp" class RscMapControl { maxSatelliteAlpha = 0.5; @@ -125,13 +127,6 @@ class RscDisplayDiary { }; }; }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; }; // BRIEFING SCREEN @@ -149,13 +144,6 @@ class RscDisplayGetReady: RscDisplayMainMap { #include "MapControls.hpp" }; }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; }; class RscDisplayClientGetReady: RscDisplayGetReady { // get rid of the "center to player position" - button (as it works even on elite) @@ -164,13 +152,6 @@ class RscDisplayClientGetReady: RscDisplayGetReady { #include "MapControls.hpp" }; }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; }; class RscDisplayServerGetReady: RscDisplayGetReady { // get rid of the "center to player position" - button (as it works even on elite) @@ -179,11 +160,4 @@ class RscDisplayServerGetReady: RscDisplayGetReady { #include "MapControls.hpp" }; }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; }; diff --git a/addons/map/functions/fnc_compileFlashlightMenu.sqf b/addons/map/functions/fnc_compileFlashlightMenu.sqf new file mode 100644 index 0000000000..0d081bb57c --- /dev/null +++ b/addons/map/functions/fnc_compileFlashlightMenu.sqf @@ -0,0 +1,65 @@ +/* + * Author: voiper + * Compile list of flashlight classnames and add to the "Flashlight" parent menu. + * + * Arguments: + * 0: Vehicle + * 1: Player + * 3: Parameters + * + * Return value: + * None + * + * Example: + * [_player, _player, []] call ace_map_fnc_compileFlashlightMenu; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_vehicle", "_player", "_parameters"]; + +_actions = []; +_flashlights = [_player] call FUNC(getUnitFlashlights); + +//add all carried flashlight menus and on/off submenu actions +{ + _displayName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); + _icon = getText (configFile >> "CfgWeapons" >> _x >> "picture"); + + _children = { + params ["_vehicle", "_player", "_flashlight"]; + _actions = []; + + _onAction = [ + (_flashlight + "_On"), + "On", + "", + {[_this select 2] call FUNC(switchFlashlight)}, + {GVAR(flashlightInUse) != (_this select 2)}, + {}, + _flashlight + ] call EFUNC(interact_menu,createAction); + + _offAction = [ + (_flashlight + "_Off"), + "Off", + "", + {[""] call FUNC(switchFlashlight)}, + {GVAR(flashlightInUse) == (_this select 2)}, + {}, + _flashlight + ] call EFUNC(interact_menu,createAction); + + _actions pushBack [_onAction, [], _player]; + _actions pushBack [_offAction, [], _player]; + + _actions + }; + + _parentAction = [_x, _displayName, _icon, {true}, {true}, _children, _x] call EFUNC(interact_menu,createAction); + _actions pushBack [_parentAction, [], _player]; +} forEach _flashlights; + +_actions \ No newline at end of file diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 9c205299e6..8204b4b7f8 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -55,11 +55,13 @@ _fnc_calcColor = { _lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); +/* // check if player has NVG enabled if (currentVisionMode _unit == 1) exitWith { // stick to nvg color [true, [154/255,253/255,177/255,0.5]] }; +*/ // Do not obscure the map if the ambient light level is above 0.95 if (_lightLevel > 0.95) exitWith { @@ -122,4 +124,4 @@ if (_lightLevel > 0.95) exitWith { }; // Calculate resulting map color -[true, [_lightTint, _lightLevel] call _fnc_calcColor] +[true, [_lightTint, _lightLevel] call _fnc_calcColor] \ No newline at end of file diff --git a/addons/map/functions/fnc_flashlightGlow.sqf b/addons/map/functions/fnc_flashlightGlow.sqf new file mode 100644 index 0000000000..5e72a6c183 --- /dev/null +++ b/addons/map/functions/fnc_flashlightGlow.sqf @@ -0,0 +1,35 @@ +/* + * Author: voiper + * Add or remove global flashlight glow for when player is looking at map. + * + * Arguments: + * 0: Flashlight classname ("" for off) + * + * Return value: + * None + * + * Example: + * ["ACE_Flashlight_MX991"] call ace_map_fnc_flashlightGlow; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_flashlight"]; + +_light = GVAR(glow); +if (!isNull _light) then {deleteVehicle _light}; + +if (_flashlight != "") then { + _colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); + if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; + _class = format["ACE_FlashlightProxy_%1", _colour]; + + _light = _class createVehicle [0,0,0]; + _light attachTo [ACE_player, [0,0.5,-0.1], "head"]; +} else { + _light = objNull; +}; + +GVAR(glow) = _light; \ No newline at end of file diff --git a/addons/map/functions/fnc_getUnitFlashlights.sqf b/addons/map/functions/fnc_getUnitFlashlights.sqf new file mode 100644 index 0000000000..8fb8066374 --- /dev/null +++ b/addons/map/functions/fnc_getUnitFlashlights.sqf @@ -0,0 +1,29 @@ +/* + * Author: voiper + * Check a unit for any flashlights that can be used on map. + * + * Arguments: + * 0: Unit to check + * + * Return value: + * Flashlight classnames (empty for none) + * + * Example: + * [unit] call ace_map_fnc_getUnitFlashlights; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_unit"]; + +_flashlights = []; + +{ + if ((isText (configFile >> "CfgWeapons" >> _x >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour")) && !(_x in _flashlights)) then { + _flashlights pushBack _x; + }; +} forEach (items _unit); + +_flashlights \ No newline at end of file diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index 514d2af034..b763db7eea 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -8,15 +8,17 @@ * Return Value: * None */ + #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; [_logic, QGVAR(mapIllumination), "MapIllumination" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapGlow), "MapGlow" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); diff --git a/addons/map/functions/fnc_simulateMapLight.sqf b/addons/map/functions/fnc_simulateMapLight.sqf new file mode 100644 index 0000000000..9554409e15 --- /dev/null +++ b/addons/map/functions/fnc_simulateMapLight.sqf @@ -0,0 +1,89 @@ +/* +* Author: voiper +* Draw nearby lighting and sexy flashlight beams on main map. +* +* Arguments: +* 0: Map control +* 1: Map zoom level +* 2: Current map centre +* 3: Light level from ace_map_fnc_determineMapLight +* +* Return Value: +* None +* +* Public: No +*/ + +#include "script_component.hpp" + +params ["_mapCtrl", "_mapScale", "_mapCentre", "_lightLevel"]; + +_hmd = hmd ACE_player; +_flashlight = GVAR(flashlightInUse); + +//map width (on screen) in pixels +_screenSize = 640 * safeZoneW; + +//resolution params (every frame in case resolution change) +getResolution params ["_resX", "_resY", "_viewPortX", "_viewPortY", "", "_uiScale"]; + +//engine rounds the viewport ratios, when they should be fractions; this can cause problems +_realViewPortY = _resY * _uiScale; +_realViewPortX = _realViewPortY * 4/3; + +//textures +_fillTex = "#(rgb,8,8,3)color(0,0,0,1)"; + +//colour/alpha +_lightLevel params ["_r", "_g", "_b", "_a"]; +_colourAlpha = (_r + _g + _b) min _a; +_shadeAlpha = _a; + +_colourList = [_r, _g, _b]; +_colourList sort false; +_maxColour = _colourList select 0; + +//ambient colour fill +_mapCtrl drawIcon [format["#(rgb,8,8,3)color(%1,%2,%3,1)", _r / _maxColour, _g / _maxColour, _b / _maxColour], [1,1,1,_colourAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0]; + +if (_flashlight == "") then { + //ambient shade fill + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], _mapCentre, _screenSize, _screenSize, 0, "", 0]; +} else { + //mouse pos + _mousePos = GVAR(mousePos); + + //flashlight settings + _colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour"); + if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"}; + _size = getNumber (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Size"); + _flashTex = format[QUOTE(PATHTOF_SYS(ace,flashlights,UI\Flashlight_Beam_%1_ca.paa)), _colour]; + _beamSize = _screenSize / _size; + + //after 5x zoom, it's simulated to be fixed (it actually gets bigger relative to zoom) + if (_mapScale < 0.2) then {_beamSize = _beamSize / (_mapScale * (1 / 0.2))}; + + //assign corrective ratio to fix sub-pixel gaps/overlaps (symptom of viewport * X/Y resolution rounding) + _viewPortRatioFixY = if (_realViewPortY != _viewPortY) then { + _realViewPortX / (_realViewPortY / _viewPortY * _viewPortX) + } else { + if (_realViewPortX != _viewPortX) then { + _realViewPortX / _viewPortX + } else { + 1 + }; + }; + + //offset the elements + _offsetX = _mapScale * GVAR(worldSize) * (_screenSize * 2 + _beamSize); + _offsetYDown = _mapScale * GVAR(worldSize) * (_screenSize + _beamSize) * _viewPortRatioFixY; + //up is bigger because of a potential exploit + _offsetYUp = _mapScale * GVAR(worldSize) * (_screenSize * 4 + _beamSize) * _viewPortRatioFixY; + + //draw the matrix /whoa + _mapCtrl drawIcon [_flashTex, [1,1,1,_shadeAlpha], _mousePos, _beamSize, _beamSize, 0, "", 0]; //centre beam + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) - _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //left + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0) + _offsetX, (_mousePos select 1)], _screenSize * 2, _beamSize, 0, "", 0]; //right + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) - _offsetYDown], _screenSize * 4, _screenSize, 0, "", 0]; //down + _mapCtrl drawIcon [_fillTex, [1,1,1,_shadeAlpha], [(_mousePos select 0), (_mousePos select 1) + _offsetYUp], _screenSize * 4, _screenSize * 4, 0, "", 0]; //up +}; \ No newline at end of file diff --git a/addons/map/functions/fnc_switchFlashlight.sqf b/addons/map/functions/fnc_switchFlashlight.sqf new file mode 100644 index 0000000000..e177f886fa --- /dev/null +++ b/addons/map/functions/fnc_switchFlashlight.sqf @@ -0,0 +1,25 @@ +/* + * Author: voioper + * Switch flashlight. + * + * Arguments: + * 0: Flashlight classname ("" for off) + * + * Return value: + * None + * + * Example: + * ["ACE_Flashlight_MX991"] call ace_map_fnc_switchFlashlight; + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_flashlight"]; + +GVAR(flashlightInUse) = _flashlight; +if (GVAR(mapGlow)) then { + [GVAR(flashlightInUse)] call FUNC(flashlightGlow); +}; +playSound "ACE_map_flashlightClick"; \ No newline at end of file diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index 3550df517c..72f5d0cec1 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -10,23 +10,21 @@ * * Public: No */ + #include "script_component.hpp" -private ["_mapCtrl","_mapScale"]; - -_mapCtrl = ((findDisplay 12) displayCtrl 51); +_mapCtrl = findDisplay 12 displayCtrl 51; _mapScale = ctrlMapScale _mapCtrl; +_mapCentre = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; if (GVAR(mapIllumination)) then { - private ["_data","_darkenFill"]; + //get nearby lighting + _light = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); - // Calculate map illumination - _data = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); + _light params ["_applyLighting", "_lightLevel"]; - EXPLODE_2_PVT(_data,_darkenMap,_darkenColor); - if (_darkenMap) then { - _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; - _mapCtrl drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; + if (_applyLighting) then { + [_mapCtrl, _mapScale, _mapCentre, _lightLevel] call FUNC(simulateMapLight); }; }; @@ -63,7 +61,7 @@ if (GVAR(mapShake)) then { GVAR(isShaking) = false; } else { // The map is still, store state - GVAR(lastStillPosition) = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillPosition) = _mapCentre; GVAR(lastStillTime) = ACE_time; }; }; @@ -72,7 +70,7 @@ if (GVAR(mapShake)) then { if (GVAR(mapLimitZoom)) then { if (GVAR(minMapSize) >= _mapScale) then { ctrlMapAnimClear _mapCtrl; - _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_mapCtrl ctrlMapScreenToWorld [0.5, 0.5])]; + _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, _mapCentre]; ctrlMapAnimCommit _mapCtrl; }; -}; +}; \ No newline at end of file diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 3f2d312fae..69a5ce6941 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -18,12 +18,13 @@ Iluminação do mapa? - Calculate dynamic map illumination based on light conditions? - Oblicza dynamiczne oświetlenie mapy bazujące na warunkach oświetleniowych - Calcula la iluminación dinámica del mapa basandose en las condiciones de luz - Berechne die Kartenauslichtung anhand des Umgebungslichts? - Vypočítat dynamické osvětlení mapy na základně světelných podmínek? - Calcular a iluminação dinâmica do mapa de acordo com as condições de luz? + Simulate map lighting based on ambient lighting and player's items? + + + Map flashlight glow? + + + Add external glow to players who use flashlight on map? Map shake? @@ -83,7 +84,7 @@ Blue Force Tracking Blue Force Tracking - Blue Force Tracking + Seguimiento de fuerzas amigas Blue Force Tracking Blue Force Tracking Rastreio de forças azuis @@ -141,5 +142,29 @@ Umožňuje sledovat přátelské jednokty na mapě v rámci BFT. Permite que você acompanhe as posições no mapa das unidades aliadas com marcadores RFA. + + Flashlights + Latarki + + + NVG + Noktowizja + + + On + Włącz + + + Off + Wyłącz + + + Increase Brightness + Zwiększ czułość + + + Decrease Brightness + Zmniejsz czułość + \ No newline at end of file diff --git a/addons/maptools/README.md b/addons/maptools/README.md index 9248948efa..f03474b5c0 100644 --- a/addons/maptools/README.md +++ b/addons/maptools/README.md @@ -1,11 +1,12 @@ ace_maptools ============ -Map tools: +Adds the following map tools: - Roamer - Map drawing - Showing GPS on map + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/maptools/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf index 30d86160ab..7658c2c1d2 100644 --- a/addons/maptools/functions/fnc_canUseMapTools.sqf +++ b/addons/maptools/functions/fnc_canUseMapTools.sqf @@ -14,7 +14,13 @@ visibleMap && {alive ACE_player} && -{"ItemMap" in (assignedItems ACE_player)} && +{ + scopeName "hasMap"; + { + if (_x isKindOf ["ItemMap", configFile >> "CfgWeapons"]) exitWith {true breakOut "hasMap"}; + } forEach (assignedItems ACE_player); + false +} && {"ACE_MapTools" in (items ACE_player)} && {!GVAR(mapTool_isDragging)} && {!GVAR(mapTool_isRotating)} diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf index b2b9ed5c00..e47514f4fa 100644 --- a/addons/markers/XEH_preInit.sqf +++ b/addons/markers/XEH_preInit.sqf @@ -46,7 +46,8 @@ if (isNil QGVAR(MarkerColorsCache)) then { _rgba set [_forEachIndex, call compile _x]; }; } forEach _rgba; - _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3]; + _rgba params ["_red", "_green", "_blue", "_alpha"]; + _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha]; GVAR(MarkerColorsCache) pushBack [_name, _a, _icon]; }; diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index c55e07c360..07e2bc46c4 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -7,7 +7,7 @@ * 0: RscDisplayInsertMarker * * Return Value: - * Nothing + * None * * Example: * [onLoad] call ace_markers_fnc_initInsertMarker; @@ -19,11 +19,12 @@ #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"]; + private ["_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"]; disableserialization; - PARAMS_1(_display); - + params ["_display"]; + TRACE_1("params",_display); + //Can't place markers when can't interact if (!([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith { _display closeDisplay 2; //emulate "Cancel" button @@ -76,10 +77,8 @@ //--- Background _pos = ctrlposition _text; - _posX = (_pos select 0) + 0.01; - _posY = _pos select 1; - _posW = _pos select 2; - _posH = _pos select 3; + _pos params ["_posX", "_posY", "_posW", "_posH"]; + _posX = _posX + 0.01; _posY = _posY min ((safeZoneH + safeZoneY) - (8 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen _pos set [0,_posX]; _pos set [1,_posY]; @@ -173,9 +172,10 @@ // init marker shape lb lbClear _aceShapeLB; { - _aceShapeLB lbAdd (_x select 0); - _aceShapeLB lbSetValue [_forEachIndex, _x select 1]; - _aceShapeLB lbSetPicture [_forEachIndex, _x select 2]; + _x params ["_add", "_set", "_pic"]; + _aceShapeLB lbAdd _add; + _aceShapeLB lbSetValue [_forEachIndex, _set]; + _aceShapeLB lbSetPicture [_forEachIndex, _pic]; } forEach GVAR(MarkersCache); _curSelShape = GETGVAR(curSelMarkerShape,0); _aceShapeLB lbSetCurSel _curSelShape; @@ -188,9 +188,10 @@ // init marker color lb lbClear _aceColorLB; { - _aceColorLB lbAdd (_x select 0); - _aceColorLB lbSetValue [_forEachIndex, _x select 1]; - _aceColorLB lbSetPicture [_forEachIndex, _x select 2]; + _x params ["_add", "_set", "_pic"]; + _aceColorLB lbAdd _add; + _aceColorLB lbSetValue [_forEachIndex, _set]; + _aceColorLB lbSetPicture [_forEachIndex, _pic]; } forEach GVAR(MarkerColorsCache); _curSelColor = GETGVAR(curSelMarkerColor,0); _aceColorLB lbSetCurSel _curSelColor; diff --git a/addons/markers/functions/fnc_mapDrawEH.sqf b/addons/markers/functions/fnc_mapDrawEH.sqf index 2e23dacec8..babdfbbb44 100644 --- a/addons/markers/functions/fnc_mapDrawEH.sqf +++ b/addons/markers/functions/fnc_mapDrawEH.sqf @@ -6,7 +6,7 @@ * 0: TheMap * * Return Value: - * Nothing + * None * * Example: * [theMapControl] call ace_markers_fnc_mapDrawEH; @@ -15,9 +15,10 @@ */ #include "script_component.hpp" -private ["_theMap", "_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"]; +private ["_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"]; -PARAMS_1(_theMap); +params ["_theMap"]; +// TRACE_1("params",_theMap); //Only show if marker place is open: if (isNull (findDisplay 54)) exitWith {}; diff --git a/addons/markers/functions/fnc_onLBSelChangedColor.sqf b/addons/markers/functions/fnc_onLBSelChangedColor.sqf index e089569761..0b9c5af209 100644 --- a/addons/markers/functions/fnc_onLBSelChangedColor.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedColor.sqf @@ -7,7 +7,7 @@ * 1: Selected Index * * Return Value: - * Nothing + * None * * Example: * [ColorLB, 5] call ace_markers_fnc_onLBSelChangedColor; @@ -18,7 +18,9 @@ private ["_data", "_config"]; -PARAMS_2(_ctrl,_index); +params ["_ctrl", "_index"]; +TRACE_2("params",_ctrl,_index); + _data = _ctrl lbValue _index; GVAR(curSelMarkerColor) = _index; diff --git a/addons/markers/functions/fnc_onLBSelChangedShape.sqf b/addons/markers/functions/fnc_onLBSelChangedShape.sqf index ff067a467b..c8587e6205 100644 --- a/addons/markers/functions/fnc_onLBSelChangedShape.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedShape.sqf @@ -7,7 +7,7 @@ * 1: Selected Index * * Return Value: - * Nothing + * None * * Example: * [ColorLB, 5] call ace_markers_fnc_onLBSelChangedShape; @@ -18,7 +18,9 @@ private ["_data", "_config"]; -PARAMS_2(_ctrl,_index); +params ["_ctrl", "_index"]; +TRACE_2("params",_ctrl,_index); + _data = _ctrl lbValue _index; GVAR(curSelMarkerShape) = _index; diff --git a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf index 1210b8ce71..16c6acfad9 100644 --- a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf +++ b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf @@ -7,7 +7,7 @@ * 1: Slider Data (angle: -180..180) * * Return Value: - * Nothing + * None * * Example: * [Slider, 2] call ace_markers_fnc_onSliderPosChangedAngle; @@ -18,7 +18,8 @@ private ["_direction"]; -PARAMS_2(_ctrl,_data); +params ["_ctrl", "_data"]; +TRACE_2("params",_ctrl,_data); _direction = round _data; if (_direction < 0) then { diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf index fd584c1c99..36b61151ee 100644 --- a/addons/markers/functions/fnc_placeMarker.sqf +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -7,7 +7,7 @@ * 1: CloseNumber (1 = ButtonOk) * * Return Value: - * Nothing + * None * * Example: * [onUnloadEvent] call ace_markers_fnc_placeMarker; @@ -17,7 +17,8 @@ #include "script_component.hpp" disableserialization; -PARAMS_2(_display,_closeNum); +params ["_display", "_closeNum"]; +TRACE_2("params",_display,_closeNum); if (_closeNum == 1) then { diff --git a/addons/markers/functions/fnc_sendMarkersJIP.sqf b/addons/markers/functions/fnc_sendMarkersJIP.sqf index 99eea2f2d9..73a00519e3 100644 --- a/addons/markers/functions/fnc_sendMarkersJIP.sqf +++ b/addons/markers/functions/fnc_sendMarkersJIP.sqf @@ -6,7 +6,7 @@ * 0: Logic * * Return Value: - * Nothing + * None * * Example: * [onUnloadEvent] call ace_markers_fnc_sendMarkerJIP; @@ -15,11 +15,11 @@ */ #include "script_component.hpp" -PARAMS_1(_logic); +params ["_logic"]; +TRACE_1("params",_logic); -[QGVAR(setMarkerJIP), [_logic], [ -GETGVAR(allMapMarkers,[]), -GETGVAR(allMapMarkersProperties,[]), -_logic -] +[ + QGVAR(setMarkerJIP), + [_logic], + [GETGVAR(allMapMarkers,[]), GETGVAR(allMapMarkersProperties,[]), _logic] ] call EFUNC(common,targetEvent); diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf index 0760cc6fe5..4e6b47b46b 100644 --- a/addons/markers/functions/fnc_setMarkerJIP.sqf +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -8,7 +8,7 @@ * 2: Logic * * Return Value: - * Nothing + * None * * Example: * [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP; @@ -17,32 +17,34 @@ */ #include "script_component.hpp" -private ["_index", "_data", "_config"]; - -PARAMS_3(_allMapMarkers,_allMapMarkersProperties,_logic); +params ["_allMapMarkers", "_allMapMarkersProperties", "_logic"]; +TRACE_3("params",_allMapMarkers,_allMapMarkersProperties,_logic); { + private ["_index", "_data", "_config"]; + _index = _allMapMarkers find _x; if (_index != -1) then { _data = _allMapMarkersProperties select _index; + _data params ["_name", "_color", "_pos", "_dir"]; - _config = (configfile >> "CfgMarkers") >> (_data select 0); + _config = (configfile >> "CfgMarkers") >> _name; if (!isClass _config) then { WARNING("CfgMarker not found, changed to milDot"); _config == (configFile >> "CfgMarkers" >> "MilDot"); }; _x setMarkerTypeLocal (configName _config); - _config = (configfile >> "CfgMarkerColors") >> (_data select 1); + _config = (configfile >> "CfgMarkerColors") >> _color; if (!isClass _config) then { WARNING("CfgMarkerColors not found, changed to Default"); _config == (configFile >> "CfgMarkerColors" >> "Default"); }; _x setMarkerColorLocal (configName _config); - _x setMarkerPosLocal (_data select 2); - _x setMarkerDirLocal (_data select 3); + _x setMarkerPosLocal _pos; + _x setMarkerDirLocal _dir; }; } forEach allMapMarkers; diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf index 457d5dac37..c56a1fb93c 100644 --- a/addons/markers/functions/fnc_setMarkerNetwork.sqf +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -8,7 +8,7 @@ * 1: Marker Data * * Return Value: - * Nothing + * None * * Example: * [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP; @@ -19,8 +19,10 @@ private ["_config"]; -PARAMS_2(_marker,_data); -EXPLODE_4_PVT(_data,_markerClassname,_colorClassname,_markerPos,_markerDir); +params ["_marker", "_data"]; +_data params ["_markerClassname", "_colorClassname", "_markerPos", "_markerDir"]; +TRACE_2("params",_marker,_data); + _config = (configfile >> "CfgMarkers") >> _markerClassname; if (!isClass _config) then { diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 079ae40506..96f5493aec 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -4,8 +4,9 @@ class ACE_Medical_Actions { class Bandage { displayName = CSTRING(Bandage); displayNameProgress = CSTRING(Bandaging); - + category = "bandage"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"All"}; requiredMedic = 0; treatmentTime = 5; treatmentTimeSelfCoef = 1; @@ -25,11 +26,13 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; }; class Morphine: Bandage { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; treatmentTime = 2; items[] = {"ACE_morphine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); @@ -39,6 +42,8 @@ class ACE_Medical_Actions { class Epinephrine: Bandage { displayName = CSTRING(Inject_Epinephrine); displayNameProgress = CSTRING(Injecting_Epinephrine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; requiredMedic = 1; treatmentTime = 3; items[] = {"ACE_epinephrine"}; @@ -49,6 +54,8 @@ class ACE_Medical_Actions { class BloodIV: Bandage { displayName = CSTRING(Transfuse_Blood); displayNameProgress = CSTRING(Transfusing_Blood); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "advanced"; requiredMedic = 1; treatmentTime = 20; items[] = {"ACE_bloodIV"}; @@ -57,14 +64,17 @@ class ACE_Medical_Actions { litter[] = {}; }; class BloodIV_500: BloodIV { + category = "advanced"; items[] = {"ACE_bloodIV_500"}; }; class BloodIV_250: BloodIV { + category = "advanced"; items[] = {"ACE_bloodIV_250"}; }; class BodyBag: Bandage { displayName = CSTRING(PlaceInBodyBag); displayNameProgress = CSTRING(PlacingInBodyBag); + category = "advanced"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 4; @@ -81,7 +91,9 @@ class ACE_Medical_Actions { class Diagnose: Bandage { displayName = CSTRING(Actions_Diagnose); displayNameProgress = CSTRING(Actions_Diagnosing); + category = "examine"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"head"}; requiredMedic = 0; treatmentTime = 1; items[] = {}; @@ -97,14 +109,16 @@ class ACE_Medical_Actions { class Advanced { class FieldDressing { - displayName = CSTRING(Bandage); + displayName = CSTRING(Actions_FieldDressing); displayNameProgress = CSTRING(Bandaging); + category = "bandage"; // Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All. treatmentLocations[] = {"All"}; + allowedSelections[] = {"All"}; // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor requiredMedic = 0; // The time it takes for a treatment action to complete. Time is in seconds. - treatmentTime = 5; + treatmentTime = 8; // Item required for the action. Leave empty for no item required. items[] = {"ACE_fieldDressing"}; condition = ""; @@ -121,22 +135,28 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic"; animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic"; - litter[] = { {"All", "", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} }; }; class PackingBandage: fieldDressing { + displayName = CSTRING(Actions_PackingBandage); items[] = {"ACE_packingBandage"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_packingBandage"}}}; }; class ElasticBandage: fieldDressing { + displayName = CSTRING(Actions_ElasticBandage); items[] = {"ACE_elasticBandage"}; }; class QuikClot: fieldDressing { + displayName = CSTRING(Actions_QuikClot); items[] = {"ACE_quikclot"}; + litter[] = { {"All", "", {"ACE_MedicalLitter_QuickClot"}}}; }; class Tourniquet: fieldDressing { displayName = CSTRING(Apply_Tourniquet); displayNameProgress = CSTRING(Applying_Tourniquet); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; items[] = {"ACE_tourniquet"}; - treatmentTime = 6; + treatmentTime = 4; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); condition = QUOTE(!([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo))); litter[] = {}; @@ -144,6 +164,8 @@ class ACE_Medical_Actions { class Morphine: fieldDressing { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "medication"; items[] = {"ACE_morphine"}; treatmentTime = 3; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication)); @@ -163,8 +185,10 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: fieldDressing { - displayName = CSTRING(Transfuse_Blood); + displayName = CSTRING(Actions_Blood4_1000); displayNameProgress = CSTRING(Transfusing_Blood); + allowedSelections[] = {"hand_l", "hand_r", "leg_l", "leg_r"}; + category = "advanced"; items[] = {"ACE_bloodIV"}; requiredMedic = 1; treatmentTime = 7; @@ -173,38 +197,45 @@ class ACE_Medical_Actions { litter[] = {}; }; class BloodIV_500: BloodIV { + displayName = CSTRING(Actions_Blood4_500); items[] = {"ACE_bloodIV_500"}; }; class BloodIV_250: BloodIV { + displayName = CSTRING(Actions_Blood4_250); items[] = {"ACE_bloodIV_250"}; }; class PlasmaIV: BloodIV { - displayName = CSTRING(Transfuse_Plasma); + displayName = CSTRING(Actions_Plasma4_1000); displayNameProgress = CSTRING(Transfusing_Plasma); items[] = {"ACE_plasmaIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class PlasmaIV_500: PlasmaIV { + displayName = CSTRING(Actions_Plasma4_500); items[] = {"ACE_plasmaIV_500"}; }; class PlasmaIV_250: PlasmaIV { + displayName = CSTRING(Actions_Plasma4_250); items[] = {"ACE_plasmaIV_250"}; }; class SalineIV: BloodIV { - displayName = CSTRING(Transfuse_Saline); + displayName = CSTRING(Actions_Saline4_1000); displayNameProgress = CSTRING(Transfusing_Saline); items[] = {"ACE_salineIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; class SalineIV_500: SalineIV { + displayName = CSTRING(Actions_Saline4_500); items[] = {"ACE_salineIV_500"}; }; class SalineIV_250: SalineIV { + displayName = CSTRING(Actions_Saline4_250); items[] = {"ACE_salineIV_250"}; }; class SurgicalKit: fieldDressing { - displayName = ""; - displayNameProgress = CSTRING(TreatmentAction); + displayName = CSTRING(Use_SurgicalKit); + displayNameProgress = CSTRING(Stitching); + category = "advanced"; items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; requiredMedic = QGVAR(medicSetting_SurgicalKit); @@ -217,8 +248,9 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }}; }; class PersonalAidKit: fieldDressing { - displayName = ""; + displayName = CSTRING(Use_Aid_Kit); displayNameProgress = CSTRING(TreatmentAction); + category = "advanced"; items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QGVAR(useLocation_PAK)}; requiredMedic = QGVAR(medicSetting_PAK); @@ -232,11 +264,16 @@ class ACE_Medical_Actions { animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther"; animationCallerSelf = ""; animationCallerSelfProne = ""; - litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; + litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}}, + {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} }, + {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, + {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} + }; }; class CheckPulse: fieldDressing { - displayName = ""; + displayName = CSTRING(Actions_CheckPulse); displayNameProgress = CSTRING(Check_Pulse_Content); + category = "examine"; treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -246,27 +283,36 @@ class ACE_Medical_Actions { callbackProgress = ""; animationPatient = ""; animationCaller = ""; // TODO + animationCallerProne = ""; + animationCallerSelfProne = ""; itemConsumed = 0; litter[] = {}; }; class CheckBloodPressure: CheckPulse { + displayName = CSTRING(Actions_CheckBloodPressure); callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); displayNameProgress = CSTRING(Check_Bloodpressure_Content); }; class CheckResponse: CheckPulse { + displayName = CSTRING(Check_Response); callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); displayNameProgress = CSTRING(Check_Response_Content); }; - class RemoveTourniquet: CheckPulse { + class RemoveTourniquet: Tourniquet { + displayName = CSTRING(Actions_RemoveTourniquet); + items[] = {}; treatmentTime = 2.5; callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet)); condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)); displayNameProgress = CSTRING(RemovingTourniquet); + litter[] = {}; }; class CPR: fieldDressing { displayName = CSTRING(Actions_CPR); displayNameProgress = CSTRING(Actions_PerformingCPR); + category = "advanced"; treatmentLocations[] = {"All"}; + allowedSelections[] = {"body"}; requiredMedic = 0; treatmentTime = 15; items[] = {}; @@ -286,9 +332,10 @@ class ACE_Medical_Actions { class BodyBag: fieldDressing { displayName = CSTRING(PlaceInBodyBag); displayNameProgress = CSTRING(PlacingInBodyBag); + category = "advanced"; treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 2; + treatmentTime = 15; items[] = {"ACE_bodyBag"}; condition = "!alive (_this select 1);"; callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag)); @@ -817,9 +864,9 @@ class ACE_Medical_Advanced { // specific details for the ACE_Morphine treatment action class Morphine { painReduce = 15; - hrIncreaseLow[] = {-10, -30, 35}; - hrIncreaseNormal[] = {-10, -50, 40}; - hrIncreaseHigh[] = {-10, -40, 50}; + hrIncreaseLow[] = {-10, -20, 35}; + hrIncreaseNormal[] = {-10, -30, 35}; + hrIncreaseHigh[] = {-10, -35, 50}; timeInSystem = 900; maxDose = 4; inCompatableMedication[] = {}; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index fcaba03aa0..910f152292 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -1,94 +1,116 @@ class ACE_Settings { class GVAR(level) { + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Basic", "Advanced"}; }; class GVAR(medicSetting) { + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "Normal", "Advanced"}; }; class GVAR(enableFor) { + category = CSTRING(Category_Medical); value = 0; typeName = "SCALAR"; values[] = {"Players only", "Players and AI"}; }; class GVAR(enableOverdosing) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(bleedingCoefficient) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(painCoefficient) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableAirway) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableFractures) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableAdvancedWounds) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = false; }; class GVAR(enableVehicleCrashes) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(enableScreams) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(playerDamageThreshold) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(AIDamageThreshold) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; }; class GVAR(enableUnconsciousnessAI) { + category = CSTRING(Category_Medical); value = 1; typeName = "SCALAR"; values[] = {"Disabled", "50/50", "Enabled"}; }; class GVAR(remoteControlledAI) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(preventInstaDeath) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(enableRevive) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"Disabled", "Players only", "Players and AI"}; }; class GVAR(maxReviveTime) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 120; }; class GVAR(amountOfReviveLives) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = -1; }; class GVAR(allowDeadBodyMovement) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(allowLitterCreation) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(litterSimulationDetail) { + category = CSTRING(Category_Medical); displayName = CSTRING(litterSimulationDetail); description = CSTRING(litterSimulationDetail_Desc); typeName = "SCALAR"; @@ -100,40 +122,48 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(litterCleanUpDelay) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; }; class GVAR(medicSetting_PAK) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(medicSetting_SurgicalKit) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 1; values[] = {"Anyone", "Medics only", "Doctors only"}; }; class GVAR(consumeItem_PAK) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(consumeItem_SurgicalKit) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 0; values[] = {"No", "Yes"}; }; class GVAR(useLocation_PAK) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 3; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useLocation_SurgicalKit) { + category = CSTRING(Category_Medical); typeName = "SCALAR"; value = 2; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; class GVAR(useCondition_PAK) { + category = CSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description); typeName = "SCALAR"; @@ -141,6 +171,7 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(useCondition_SurgicalKit) { + category = CSTRING(Category_Medical); displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName); description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description); typeName = "SCALAR"; @@ -148,20 +179,24 @@ class ACE_Settings { values[] = {"Anytime", "Stable"}; }; class GVAR(keepLocalSettingsSynced) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 1; }; class GVAR(healHitPointAfterAdvBandage) { + category = CSTRING(Category_Medical); displayName = CSTRING(healHitPointAfterAdvBandage); typeName = "BOOL"; value = 0; }; class GVAR(painIsOnlySuppressed) { + category = CSTRING(Category_Medical); displayName = CSTRING(painIsOnlySuppressed); typeName = "BOOL"; value = 1; }; class GVAR(painEffectType) { + category = CSTRING(Category_Medical); displayName = CSTRING(painEffectType); typeName = "SCALAR"; value = 0; @@ -169,15 +204,18 @@ class ACE_Settings { isClientSettable = 1; }; class GVAR(allowUnconsciousAnimationOnTreatment) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(moveUnitsFromGroupOnUnconscious) { + category = CSTRING(Category_Medical); typeName = "BOOL"; value = 0; }; class GVAR(menuTypeStyle) { + category = CSTRING(Category_Medical); displayName = CSTRING(menuTypeDisplay); description = CSTRING(menuTypeDescription); typeName = "SCALAR"; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index aab193c098..350f83b3f7 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -92,7 +92,7 @@ class CfgVehicles { typeName = "NUMBER"; class values { class disable { - name = CSTRING(disabled); + name = ECSTRING(common,Disabled); value = 0; }; class normal { @@ -101,7 +101,7 @@ class CfgVehicles { default = 1; }; class full { - name = CSTRING(enabled); + name = ECSTRING(common,Enabled); value = 2; }; }; @@ -198,8 +198,8 @@ class CfgVehicles { description = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_Description); typeName = "NUMBER"; class values { - class keep { name = CSTRING(No); value = 0; }; - class remove { name = CSTRING(Yes); value = 1; default = 1; }; + class keep { name = ECSTRING(common,No); value = 0; }; + class remove { name = ECSTRING(common,Yes); value = 1; default = 1; }; }; }; class useCondition_PAK { @@ -220,7 +220,7 @@ class CfgVehicles { class vehicle { name = CSTRING(AdvancedMedicalSettings_vehicle); value = 1; }; class facility { name = CSTRING(AdvancedMedicalSettings_facility); value = 2; }; class vehicleAndFacility { name = CSTRING(AdvancedMedicalSettings_vehicleAndFacility); value = 3; default = 1; }; - class disabled { name = CSTRING(AdvancedMedicalSettings_disabled); value = 4;}; + class disabled { name = ECSTRING(common,Disabled); value = 4;}; }; }; class medicSetting_SurgicalKit: medicSetting_PAK { @@ -280,7 +280,7 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 0; class values { - class disable { name = CSTRING(disabled); value = 0; default = 1;}; + class disable { name = ECSTRING(common,Disabled); value = 0; default = 1;}; class playerOnly { name = CSTRING(playeronly); value = 1; }; class playerAndAI { name = CSTRING(playersandai); value = 2; }; }; @@ -373,11 +373,11 @@ class CfgVehicles { typeName = "NUMBER"; class values { class none { - name = CSTRING(No); + name = ECSTRING(common,No); value = 0; }; class medic { - name = CSTRING(Yes); + name = ECSTRING(common,Yes); value = 1; default = 1; }; @@ -697,6 +697,8 @@ class CfgVehicles { EGVAR(dragging,canDrag) = 1; EGVAR(dragging,dragPosition[]) = {0,1.2,0}; EGVAR(dragging,dragDirection) = 0; + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; class ACE_Actions { class ACE_MainActions { displayName = ECSTRING(interaction,MainAction); @@ -717,6 +719,9 @@ class CfgVehicles { destrType = "DestructNo"; model = QUOTE(PATHTOF(data\littergeneric.p3d)); }; + class ACE_MedicalLitter_clean: ACE_MedicalLitterBase { + model = QUOTE(PATHTOF(data\littergeneric_clean.p3d)); + }; class ACE_MedicalLitter_bandage1: ACE_MedicalLitterBase { model = QUOTE(PATHTOF(data\littergeneric_bandages1.p3d)); }; diff --git a/addons/medical/README.md b/addons/medical/README.md index b7a5fd2a3b..ecf8f5793e 100644 --- a/addons/medical/README.md +++ b/addons/medical/README.md @@ -3,6 +3,7 @@ ace_medical Provides a basic and advanced medical system. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/medical/data/EpiMorphine_co.paa b/addons/medical/data/EpiMorphine_co.paa new file mode 100644 index 0000000000..04d5f4aae5 Binary files /dev/null and b/addons/medical/data/EpiMorphine_co.paa differ diff --git a/addons/medical/data/Epipen_co.paa b/addons/medical/data/Epipen_co.paa deleted file mode 100644 index 2a1afe1f33..0000000000 Binary files a/addons/medical/data/Epipen_co.paa and /dev/null differ diff --git a/addons/medical/data/QuikClot.p3d b/addons/medical/data/QuikClot.p3d index 85ec2e9923..9fe747cb54 100644 Binary files a/addons/medical/data/QuikClot.p3d and b/addons/medical/data/QuikClot.p3d differ diff --git a/addons/medical/data/ace_litterclean_co.paa b/addons/medical/data/ace_litterclean_co.paa new file mode 100644 index 0000000000..68fb2a2b22 Binary files /dev/null and b/addons/medical/data/ace_litterclean_co.paa differ diff --git a/addons/medical/data/atropine.p3d b/addons/medical/data/atropine.p3d index 582f495291..fa9fb72c84 100644 Binary files a/addons/medical/data/atropine.p3d and b/addons/medical/data/atropine.p3d differ diff --git a/addons/medical/data/atropine_co.paa b/addons/medical/data/atropine_co.paa index 3e44836bee..aadcb955f8 100644 Binary files a/addons/medical/data/atropine_co.paa and b/addons/medical/data/atropine_co.paa differ diff --git a/addons/medical/data/bandage.p3d b/addons/medical/data/bandage.p3d index 873d0feb8b..28c727e842 100644 Binary files a/addons/medical/data/bandage.p3d and b/addons/medical/data/bandage.p3d differ diff --git a/addons/medical/data/bodybagItem.p3d b/addons/medical/data/bodybagItem.p3d index 72c8fec886..73b3bfe404 100644 Binary files a/addons/medical/data/bodybagItem.p3d and b/addons/medical/data/bodybagItem.p3d differ diff --git a/addons/medical/data/epinephrine.p3d b/addons/medical/data/epinephrine.p3d index a06831867a..45f0aee1f7 100644 Binary files a/addons/medical/data/epinephrine.p3d and b/addons/medical/data/epinephrine.p3d differ diff --git a/addons/medical/data/epinephrine_co.paa b/addons/medical/data/epinephrine_co.paa deleted file mode 100644 index 2a1afe1f33..0000000000 Binary files a/addons/medical/data/epinephrine_co.paa and /dev/null differ diff --git a/addons/medical/data/littergeneric_Quikclot.p3d b/addons/medical/data/littergeneric_Quikclot.p3d index e309736148..e54e331721 100644 Binary files a/addons/medical/data/littergeneric_Quikclot.p3d and b/addons/medical/data/littergeneric_Quikclot.p3d differ diff --git a/addons/medical/data/littergeneric_atropine.p3d b/addons/medical/data/littergeneric_atropine.p3d index c6b6450ca4..4490a11c0e 100644 Binary files a/addons/medical/data/littergeneric_atropine.p3d and b/addons/medical/data/littergeneric_atropine.p3d differ diff --git a/addons/medical/data/littergeneric_clean.p3d b/addons/medical/data/littergeneric_clean.p3d new file mode 100644 index 0000000000..7fa6fb3e91 Binary files /dev/null and b/addons/medical/data/littergeneric_clean.p3d differ diff --git a/addons/medical/data/littergeneric_epinephrine.p3d b/addons/medical/data/littergeneric_epinephrine.p3d index 0f45dab936..8246ef607e 100644 Binary files a/addons/medical/data/littergeneric_epinephrine.p3d and b/addons/medical/data/littergeneric_epinephrine.p3d differ diff --git a/addons/medical/data/littergeneric_gloves.p3d b/addons/medical/data/littergeneric_gloves.p3d index abc55ebcc9..ca92017688 100644 Binary files a/addons/medical/data/littergeneric_gloves.p3d and b/addons/medical/data/littergeneric_gloves.p3d differ diff --git a/addons/medical/data/littergeneric_morphine.p3d b/addons/medical/data/littergeneric_morphine.p3d index 945db92aab..906280227c 100644 Binary files a/addons/medical/data/littergeneric_morphine.p3d and b/addons/medical/data/littergeneric_morphine.p3d differ diff --git a/addons/medical/data/littergeneric_packingbandage.p3d b/addons/medical/data/littergeneric_packingbandage.p3d index 73e86d92b4..185b8a73ff 100644 Binary files a/addons/medical/data/littergeneric_packingbandage.p3d and b/addons/medical/data/littergeneric_packingbandage.p3d differ diff --git a/addons/medical/data/morphine.p3d b/addons/medical/data/morphine.p3d index 4457c97cc9..3328630ac9 100644 Binary files a/addons/medical/data/morphine.p3d and b/addons/medical/data/morphine.p3d differ diff --git a/addons/medical/data/morphine_co.paa b/addons/medical/data/morphine_co.paa deleted file mode 100644 index 8d91fd0e10..0000000000 Binary files a/addons/medical/data/morphine_co.paa and /dev/null differ diff --git a/addons/medical/data/packingbandage.p3d b/addons/medical/data/packingbandage.p3d index 002c68ed13..0e083c4766 100644 Binary files a/addons/medical/data/packingbandage.p3d and b/addons/medical/data/packingbandage.p3d differ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf index e8e03bb4c0..646e472f70 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressure.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressure.sqf @@ -14,7 +14,8 @@ #include "script_component.hpp" -private ["_caller","_target"]; +private ["_caller","_target","_selectionName"]; _caller = _this select 0; _target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +_selectionName = _this select 2; +[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 19bd75caad..92120a280c 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -14,9 +14,10 @@ #include "script_component.hpp" -private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; +private ["_caller","_target","_selectionName","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"]; _caller = _this select 0; _target = _this select 1; +_selectionName = _this select 2; _bloodPressure = [_target] call FUNC(getBloodPressure); if (!alive _target) then { @@ -54,8 +55,14 @@ if ([_caller] call FUNC(isMedic)) then { }; }; +if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then { + _output = LSTRING(Check_Bloodpressure_Output_6); + _logOutPut = ""; +}; + ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckPulse.sqf b/addons/medical/functions/fnc_actionCheckPulse.sqf index fd96321e8f..f615c69983 100644 --- a/addons/medical/functions/fnc_actionCheckPulse.sqf +++ b/addons/medical/functions/fnc_actionCheckPulse.sqf @@ -14,7 +14,8 @@ #include "script_component.hpp" -private ["_caller","_target"]; +private ["_caller","_target","_selectionName"]; _caller = _this select 0; _target = _this select 1; -[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +_selectionName = _this select 2; +[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 9af18d0a6d..f719aad2d8 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -14,10 +14,10 @@ #include "script_component.hpp" -private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"]; +private ["_caller", "_unit", "_selectionName", "_heartRateOutput", "_heartRate", "_logOutPut"]; _caller = _this select 0; _unit = _this select 1; - +_selectionName = _this select 2; _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (!alive _unit) then { @@ -46,8 +46,14 @@ if (_heartRate > 1.0) then { }; }; +if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then { + _heartRateOutput = LSTRING(Check_Pulse_Output_5); + _logOutPut = LSTRING(Check_Pulse_None); +}; + ["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { [_unit,"activity", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); + [_unit,"quick_view", LSTRING(Check_Pulse_Log),[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf index 2d62df12f6..b5df63047e 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -28,3 +28,4 @@ if ([_target] call EFUNC(common,isAwake)) then { ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); [_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target,"quick_view",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 4795ccc561..e0cab95420 100644 --- a/addons/medical/functions/fnc_canTreat.sqf +++ b/addons/medical/functions/fnc_canTreat.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition", "_allowedSelections"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -44,6 +44,8 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; +_allowedSelections = getArray (_config >> "allowedSelections"); +if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; _return = true; if (getText (_config >> "condition") != "") then { diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 6797785763..a3b71b7f9c 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -16,12 +16,13 @@ #define MIN_ENTRIES_LITTER_CONFIG 3 -private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems"]; +private ["_target", "_className", "_config", "_litter", "_createLitter", "_position", "_createdLitter", "_caller", "_selectionName", "_usersOfItems", "_previousDamage"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; _className = _this select 3; _usersOfItems = _this select 5; +_previousDamage = _this select 6; if !(GVAR(allowLitterCreation)) exitwith {}; if (vehicle _caller != _caller || vehicle _target != _target) exitwith {}; @@ -76,7 +77,7 @@ _createdLitter = []; _litterCondition = missionNamespace getvariable _litterCondition; if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; }; - if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {}; + if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {}; if (typeName _litterOptions == "ARRAY") then { // Loop through through the litter options and place the litter diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index cd61550152..e181328318 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -13,6 +13,7 @@ */ #include "script_component.hpp" +#define MAX_DISTANCE 10 // Exit for basic medical if (GVAR(level) < 2) exitWith {}; @@ -39,6 +40,11 @@ if (_show) then { if (GVAR(displayPatientInformationTarget) != _target || GVAR(currentSelectedSelectionN) != _selectionN) exitwith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; + if (ACE_player distance _target > MAX_DISTANCE) exitwith { + ("ACE_MedicalRscDisplayInformation" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + ["displayTextStructured", [ACE_player], [[LSTRING(DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + }; disableSerialization; _display = uiNamespace getvariable QGVAR(DisplayInformation); diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index f13fbc8c05..d7595ec439 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -31,6 +31,7 @@ if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { GVAR(allCreatedLitter) pushBack [ACE_time, [_litterObject]]; if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { + GVAR(litterPFHRunning) = true; [{ { if (ACE_time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { @@ -46,7 +47,7 @@ if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { [(_this select 1)] call CBA_fnc_removePerFrameHandler; GVAR(litterPFHRunning) = false; }; - }, 30, []] call cba_fnc_addPerFrameHandler; + }, 30, []] call CBA_fnc_addPerFrameHandler; }; true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index aad69ee2fa..a4e5525276 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -112,7 +112,7 @@ if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitW }; 0.89; }; - 0.89; + _damageReturn min 0.89; }; if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index c96c1b05f8..0c7113f69a 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -110,6 +110,11 @@ if (GVAR(level) >= 2) then { _bloodPressure = [_unit] call FUNC(getBloodPressure); _unit setvariable [QGVAR(bloodPressure), _bloodPressure, _syncValues]; + if (_painStatus > 0 && {_painStatus < 10}) then { + _painReduce = if (_painStatus > 5) then {0.002} else {0.001}; + _unit setVariable [QGVAR(pain), (_painStatus - _painReduce * _interval) max 0, _syncValues]; + }; + // TODO Disabled until implemented fully // Handle airway /*if (GVAR(setting_allowAirwayInjuries)) then { diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index 18f3406df2..a319d50440 100644 --- a/addons/medical/functions/fnc_treatment.sqf +++ b/addons/medical/functions/fnc_treatment.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition", "_allowedSelections"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -49,6 +49,9 @@ _medicRequired = if (isNumber (_config >> "requiredMedic")) then { if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; +_allowedSelections = getArray (_config >> "allowedSelections"); +if !("All" in _allowedSelections || {(_selectionName in _allowedSelections)}) exitwith {false}; + // Check item _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; @@ -156,7 +159,7 @@ if (_caller == _target) then { _callerAnim = [getText (_config >> "animationCallerSelf"), getText (_config >> "animationCallerSelfProne")] select (stance _caller == "PRONE"); }; -_caller setvariable [QGVAR(selectedWeaponOnTreatment), currentWeapon _caller]; +_caller setvariable [QGVAR(selectedWeaponOnTreatment), (weaponState _caller)]; // Cannot use secondairy weapon for animation if (currentWeapon _caller == secondaryWeapon _caller) then { @@ -173,8 +176,17 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { _caller selectWeapon (primaryWeapon _caller); // unit always has a primary weapon here }; - if (stance _caller == "STAND") then { - _caller setvariable [QGVAR(treatmentPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; + if (isWeaponDeployed _caller) then { + TRACE_1("Weapon Deployed, breaking out first",(stance _caller)); + [_caller, "", 0] call EFUNC(common,doAnimation); + }; + + if ((stance _caller) == "STAND") then { + switch (_wpn) do {//If standing, end in a crouched animation based on their current weapon + case ("rfl"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWrflDnon"];}; + case ("pst"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSrasWpstDnon"];}; + case ("non"): {_caller setvariable [QGVAR(treatmentPrevAnimCaller), "AmovPknlMstpSnonWnonDnon"];}; + }; } else { _caller setvariable [QGVAR(treatmentPrevAnimCaller), animationState _caller]; }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 61723319a5..a7c8ea6744 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -18,17 +18,20 @@ private ["_caller","_target", "_reviveStartTime"]; _caller = _this select 0; _target = _this select 1; -if (_target getvariable [QGVAR(inReviveState), false]) exitwith { +if (_target getvariable [QGVAR(inReviveState), false]) then { _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; if (_reviveStartTime > 0) then { _target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time]; }; }; -if (random(1)>= 0.6) exitwith { +if ((random 1) >= 0.6) then { _target setvariable [QGVAR(inCardiacArrest), nil,true]; _target setvariable [QGVAR(heartRate), 40]; _target setvariable [QGVAR(bloodPressure), [50,70]]; }; +[_target, "activity", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message + true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 6b6b7adb81..1278994a11 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -38,5 +38,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }foreach _items;*/ [_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index 544ef6ae55..df7594921d 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -68,4 +68,7 @@ if (alive _target) exitwith { // Resetting damage _target setDamage 0; + + [_target, "activity", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message }; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index e3d07616f3..0b401a73cc 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -29,9 +29,10 @@ _items = _this select 4; { if (_x != "") then { [_target, _x] call FUNC(addToTriageCard); + [_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); + [_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog); }; }foreach _items; -[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index fc6b91b057..e0c4d20ed6 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -30,3 +30,4 @@ _removeItem = _items select 0; [[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); [_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index cab44d3295..148ed06252 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -44,6 +44,7 @@ _removeItem = _items select 0; [_target, _removeItem] call FUNC(addToTriageCard); [_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message true; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index dd49729686..8a5d784301 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -44,9 +44,14 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); -if (_weaponSelect != "") then { - _caller selectWeapon _weaponSelect; +_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]); +if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { + for "_index" from 0 to 99 do { + _caller action ["SwitchWeapon", _caller, _caller, _index]; + //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) + if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; + if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; + }; } else { _caller action ["SwitchWeapon", _caller, _caller, 99]; }; diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index 19c12d9299..f5cb9baf71 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -42,9 +42,14 @@ if (vehicle _caller == _caller) then { }; _caller setvariable [QGVAR(treatmentPrevAnimCaller), nil]; -_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), ""]); -if (_weaponSelect != "") then { - _caller selectWeapon _weaponSelect; +_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnTreatment), []]); +if ((_weaponSelect params [["_previousWeapon", ""]]) && {(_previousWeapon != "") && {_previousWeapon in (weapons _caller)}}) then { + for "_index" from 0 to 99 do { + _caller action ["SwitchWeapon", _caller, _caller, _index]; + //Just check weapon, muzzle and mode (ignore ammo in case they were reloading) + if (((weaponState _caller) select [0,3]) isEqualTo (_weaponSelect select [0,3])) exitWith {TRACE_1("Restoring", (weaponState _caller));}; + if ((weaponState _caller) isEqualTo ["","","","",0]) exitWith {ERROR("weaponState not found");}; + }; } else { _caller action ["SwitchWeapon", _caller, _caller, 99]; }; @@ -62,11 +67,24 @@ if (isNil _callback) then { _callback = missionNamespace getvariable _callback; }; -_args call _callback; +//Get current damage before treatment (for litter) +_previousDamage = switch (toLower _selectionName) do { + case ("head"): {_target getHitPointDamage "HitHead"}; + case ("body"): {_target getHitPointDamage "HitBody"}; + case ("hand_l"): {_target getHitPointDamage "HitLeftArm"}; + case ("hand_r"): {_target getHitPointDamage "HitRightArm"}; + case ("leg_l"): {_target getHitPointDamage "HitLeftLeg"}; + case ("leg_r"): {_target getHitPointDamage "HitRightLeg"}; + default {damage _target}; +}; +_args call _callback; +_args pushBack _previousDamage; _args call FUNC(createLitter); //If we're not already tracking vitals, start: if (!(_target getvariable [QGVAR(addedToUnitLoop),false])) then { [_target] call FUNC(addToInjuredCollection); }; + +["medical_treatmentSuccess", [_caller, _target, _selectionName, _className]] call EFUNC(common,localEvent); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 32c38397c0..3dfa42860a 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -762,7 +762,7 @@ Erhalte IV [%1ml] Reciviendo IV [%1ml] Принимается переливание [%1 мл] - Otrzymywanie IV [%1ml] + Otrzymywanie IV [pozostało %1ml] Transfusion en IV [%1ml] Přijímání transfúze [%1ml] Infúzióra kötve [%1ml] @@ -786,7 +786,7 @@ Для перевязки ран Utilizado para cubrir una herida Utilisé pour couvrir une blessure - Używany w celu przykrycia i ochrony miejsca zranienia + Używany w celu przykrycia i ochrony miejsca zranienia. Najczęściej stosowany bandaż na otarcia i draśnięcia. Verwendet um Wunden abzudecken Sebesülések befedésére alkalmas Usato per coprire una ferita @@ -823,7 +823,7 @@ Для тампонирования ран среднего и большого размера и остановки кровотечения. Se utiliza para vendar heridas medianas o grandes y detener el sangrado 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. + Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. Dobrze radzi sobie z tamowaniem ran płatowych oraz postrzałowych. Közepestől nagyig terjedő sebek betakarására és vérzés elállítására használt kötszer Usato su ferite medie o larghe per fermare emorragie. Usado para o preenchimento de cavidades geradas por ferimentos médios e grandes e estancar o sangramento. @@ -859,7 +859,7 @@ Давящая повязка Kit de vendaje (Elástico) Bandage compressif élastique - Zestaw bandaży elastycznych. + Bandaż elastyczny służy do opatrywania ran ciętych oraz kłutych. Dobrze radzi sobie również ze zgniecieniami tkanek miękkich oraz rozerwaniami powierzchni skóry. Rugalmas kötszercsomag, "rögzítő" Kit di bendaggio, elastico Kit de Bandagem, Elástica @@ -894,7 +894,7 @@ Замедляет кровопотерю при кровотечении Reduce la velocidad de pérdida de sangre Ralentit le saignement - Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. + Zmniejsza ubytek krwi z kończyn w przypadku krwawienia. Nie może być noszony zbyt długo ze względu na narastający ból z kończyny. Verringert den Blutverlust während einer Blutung Lelassítja a vérvesztést vérzés esetén Rallenta la perdita di sangue in caso di sanguinamento @@ -931,7 +931,7 @@ Для снятия средних и сильных болевых ощущений Usado para combatir los estados dolorosos de moderados a severos Utilisé pour réduire les douleurs modérées à sévères. - Morfina. Ma silne działanie przeciwbólowe. + Morfina. Ma silne działanie przeciwbólowe. Powoduje spowolnienie tętna oraz rozrzedzenie krwi, zwiększając tym samym ciśnienie tętnicze krwi. Działa przez ok. 15 minut. Mérsékelttől erős fájdalomig, ellene alkalmazandó termék Usato per combattere il dolore. Usado para combater dores moderadas e severas @@ -950,7 +950,7 @@ Analgetikum slouží k tlumení středně těžkých a těžkých bolestí - Atropin autoinjector + Atropine autoinjector Атропин в пневмошприце Atropina auto-inyectable Auto-injecteur d'Atropine @@ -1002,7 +1002,7 @@ Стимулирует работу сердца и купирует аллергические реакции Aumenta la frecuencia cardiaca y contraresta los efectos de las reacciones alérgicas Augmente la fréquence cadiaque et annule les effets d'une réaction anaphylactique - Adrenalina. Zwiększa puls i przeciwdziała efektom wywołanym przez reakcje alergiczne + Adrenalina. Przyśpiesza tętno oraz zwiększa ciśnienie krwi a także przeciwdziała efektom wywołanym przez reakcje alergiczne. Steigert die Herzfrequenz und bekämpft Symptome von allergischen Reaktionen. Növeli a szívverést és ellenzi az allergiás reakciók hatásait Aumenta il battito cardiaco e combatte gli effetti di reazioni allergiche. @@ -1098,7 +1098,7 @@ Пакет крови для возмещения объёма потерянной крови (хранить в холодильнике) 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. - Krew IV, używana do uzupełnienia krwi u pacjenta, trzymać w warunkach chłodniczych + 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) Blut IV, Bluthaushalt des Patienten wiederherstellen. (Kühl halten) @@ -1158,7 +1158,7 @@ Пакет физраствора для возмещения объёма потерянной крови Solución salina intravenosa, para restaurar el volumen sanguíneo 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 + 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). 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. Kochsalzlösung, ein medizinisches Volumenersatzmittel @@ -1206,7 +1206,7 @@ Первичный перевязочный пакет (QuikClot) Vendaje básico (QuickClot) Bandage basique (Hémostatique) - Podstawowy pakiet opatrunkowy (QuikClot) + Opatrunek QuikClot ACS Verbandpäckchen(Gerinnungsmittel) Általános zárókötszer (QuikClot) Bendaggio emostatico (QuikClot) @@ -1218,7 +1218,7 @@ Гемостатический пакет QuikClot Vendaje QuikClot Bandage hémostatique - Hemostatyczny pakiet QuikClot. Podstawowy opatrunek stosowany na rany. + Proszkowy opatrunek adsorbcyjny przeznaczony do tamowania zagrażających życiu krwawień średniej i dużej intensywności. Bandage mit Gerinnungsmittel QuikClot kötszer Bendaggio emostatico (QuikClot) @@ -1243,7 +1243,7 @@ Trousse de premiers soins Equipo de primeros auxilios Apteczka osobista - Persönliches Verbandpäckchen + Persönliches Erste-Hilfe-Set Elsősegélycsomag Pronto soccorso personale Kit De Primeiros Socorros Pessoal @@ -1254,7 +1254,7 @@ Содержит различные материалы и инструменты для зашивания ран и оказания специальной медпомощи. Incluye material médico para tratamientos avanzados Inclue du matériel medical pour les traitements avancés, tel les points de suture. - Zestaw środków medycznych do opatrywania ran i dodatkowego leczenia po-urazowego + Zestaw środków medycznych do opatrywania ran i dodatkowego leczenia po-urazowego. Beinhaltet medizinisches Material für fortgeschrittene Behandlung und zum Nähen. Változatos segédfelszereléseket tartalmaz sebvarráshoz és haladó elsősegélynyújtáshoz Include vario materiale medico per trattamenti avanzati. @@ -1265,7 +1265,7 @@ Personal Aid Kit for in field stitching or advanced treatment W znacznym stopniu poprawia stan pacjenta Полевая аптчека для продвинутого лечения и зашивания ран - Persönliches Verbandspäckchen zum ambulanten Nähen und fortgeschrittener Behandlung. + Persönliches Erste-Hilfe-Set zum ambulanten Nähen und fortgeschrittener Behandlung. Trousse de premiers soins pour coudre sur le terrain et traitements avancés. Equipo de primeros auxilios para sutura de campaña o tratamientos avanzados Elsősegélycsomag, terepen való sebvarráshoz és haladó ellátáshoz @@ -1275,7 +1275,7 @@ Use Personal Aid Kit - Verbandpäckchen benutzen + Erste-Hilfe-Set benutzen Использовать аптечку Utiliser la Trousse de premier soins Użyj apteczki osobistej @@ -2043,7 +2043,7 @@ Colocando cuerpo en bolsa para cadáveres Упаковка тела ... Verstaue Körper in Leichensack - Pakowanie ciała do worka na zwłoki + Pakowanie ciała do worka na zwłoki ... Placement du corps dans la housse Test hullazsákba helyezése ... Stai mettendo il corpo nella sacca @@ -2055,7 +2055,7 @@ %1 has vendado al paciente %1 перевязал пациента %1 hat den Patienten verbunden - %1 zabandażował pacjenta + %1 założył bandaż %1 a pansé le patient %1 bekötözte a pácienst %1 ha bendato il paziente @@ -2098,6 +2098,10 @@ %1 aplicou um torniquete %1 použil škrtidlo + + %1 performed CPR + %1 wykonał cykl RKO + Heavily wounded Schwer verwundet: @@ -2706,7 +2710,7 @@ Treating ... Behandeln ... Ellátás ... - Leczenie ... + Opatrywanie ran ... Traitement ... Лечение ... Tratando ... @@ -2738,7 +2742,7 @@ Medical Settings [ACE] Настройки медицины [ACE] - Ustawienia medyczne [ACE] + Ustawienia medyczne Ajustes médicos [ACE] Medizinische Einstellungen [ACE] Lékařské nastavení [ACE] @@ -2928,24 +2932,6 @@ Traktuj jednostki zdalnie sterowane (przez Zeusa) jako AI, nie jako graczy? Ošetřit vzdáleně ovládané jednotky jako AI, ne jako hráče? - - Disabled - Отключено - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - - - Enabled - Включено - Włączone - Activado - Aktiviert - Povoleno - Ativado - Prevent instant death Отключить мгновенную смерть @@ -3030,7 +3016,7 @@ Advanced Medical Settings [ACE] Настройки усложненной медицины [ACE] - Zaawansowane ustawienia medyczne [ACE] + Zaawansowane ustawienia medyczne Ajustes médicos avanzados [ACE] Erweiterte medizinische Einstellungen [ACE] Pokročilé zdravotnické nastavení [ACE] @@ -3113,7 +3099,7 @@ Использование аптечки Ust. apteczek osobistych Permitir EPA - Erlaube Erstehilfekasten + Erlaube Erste-Hilfe-Set Povolit osobní lékárničky Permitir Kit de Primeiros Socorros @@ -3122,7 +3108,7 @@ Кому разрешено выполнять полное лечение с помощью аптечки? Kto może skorzystać z apteczki osobistej w celu pełnego uleczenia? ¿Quién puede utilizar el EPA para una cura completa? - Wer kann den Erstehilfekasten für eine Endheilung verwenden? + Wer kann das Erste-Hilfe-Set für eine Endheilung verwenden? Kdo může použít osobní lékárničku pro plné vyléčení? Quem pode usar o KPS para cura completa? @@ -3158,7 +3144,7 @@ Удалять аптечки после использования Usuń apteczkę po użyciu Eliminar EPA después del uso - Entferne Erstehilfekasten bei Verwendung + Entferne Erste-Hilfe-Set bei Verwendung Odebrat osobní lékárničku po použití Remover o KPS depois do uso @@ -3167,7 +3153,7 @@ Нужно ли удалять аптечки после использования? Czy apteczka osobista powinna zniknąć z ekwipunku po jej użyciu? El EPA será eliminado después de usarlo - Sollen Erstehilfekästen bei Verwendung entfernt werden? + Sollen Erste-Hilfe-Sets bei Verwendung entfernt werden? Má se osobní lékárnička odstranit po použití? Deve o KPS ser removido depois do uso? @@ -3176,7 +3162,7 @@ Место использования аптечки Ogr. apteczek osobistych Ubicacions del EPA - Orte für Erstehilfekasten + Orte für Erste-Hilfe-Set Lokace osobní lékárničky Localizações do KPS @@ -3185,7 +3171,7 @@ Где может использоваться аптечка? Gdzie można korzystać z apteczek osobistych? ¿Dónde se puede utilizar el equipo de primeros auxilios? - Wo kann der Erstehilfekasten verwendet werden? + Wo kann das Erste-Hilfe-Set verwendet werden? Kde může být použita osobní lékárnička? Onde o kit de primeiros socorros pode ser utilizado? @@ -3193,11 +3179,13 @@ Condition PAK Podmínka osobní lékárničky Condición EPA + Warunek apteczek When can the Personal Aid Kit be used? Kde může být použita osobní lékárnička? ¿Cuando se puede utilizar el Equipo de primeros auxilios? + Po spełnieniu jakich warunków apteczka osobista może zostać zastosowana na pacjencie? Anywhere @@ -3235,15 +3223,6 @@ Vozidla a zařízení Veículos e instalações - - Disabled - Отключено - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - Allow Surgical kit (Adv) Разрешить хирургический набор (усл.) @@ -3302,11 +3281,13 @@ Condition Surgical kit (Adv) Podmínka chirurgické soupravy (Pokr.) Condición de equipo quirúrgico (Av) + Warunek zestawu chir. When can the Surgical kit be used? Kde může být použita chirurgická souprava? ¿Cuando se puede utilizar el equipo quirúrgico? + Po spełnieniu jakich warunków zestaw chirurgiczny może zostać zastosowany na pacjencie? Bloodstains @@ -3352,7 +3333,7 @@ Revive Settings [ACE] Настройки реанимации [ACE] - Ustawienia wskrzeszania [ACE] + Ustawienia wskrzeszania Sistema de resucitado [ACE] Wiederbelebungseinstellungen [ACE] Nastavení oživení [ACE] @@ -3424,7 +3405,7 @@ Set Medic Class [ACE] Сделать медиком [ACE] - Ustaw klasę medyka [ACE] + Ustaw klasę medyka Establecer case médica [ACE] Setze Sanitäterklassen [ACE] Určit třídu medika [ACE] @@ -3503,7 +3484,7 @@ Set Medical Vehicle [ACE] Сделать мед. транспортом [ACE] - Ustaw pojazd medyczny [ACE] + Ustaw pojazd medyczny Establecer vehículos médicos [ACE] Setze medizinisches Fahrzeug [ACE] Určit zdravotnické vozidlo [ACE] @@ -3523,7 +3504,7 @@ Список транспортных средств, которые будут считаться медицинским транспортом (через запятую). Lista nazw pojazdów, które są sklasyfikowane jako pojazdy medyczne, oddzielone przecinkami. Lista de los vehículos que se clasifican como vehículo médicos, separados por comas. - Liste ovn Fahrzeugen, die als medizinische Fahrzeuge verwendet werden. Wird durch Kommas getrennt. + Liste von Fahrzeugen, die als medizinische Fahrzeuge verwendet werden. Wird durch Kommas getrennt. Seznam vozidel které budou klasifikovány jako zdravotnická vozidla, oddělené čárkami. Lista de veículos que serão classificados como veículos médicos, separados por vírgulas. @@ -3539,7 +3520,7 @@ Whatever or not the objects in the list will be a medical vehicle. Будут ли объекты в списке считаться медицинским транспортом. - Czy pojazdy z tej listy są pojazdami medycznymi. + Czy pojazdy z tej listy są pojazdami medycznymi? Cualquiera de la lista o fuera de ella será un vehículo médico. Leg fest ob das Objekt in der Liste ein medizinisches Fahrzeug ist. Ať už jsou nebo nejsou objekty v seznamu budou zdravotnická vozidla. @@ -3557,7 +3538,7 @@ Set Medical Facility [ACE] Сделать госпиталем [ACE] - Ustaw budynek medyczny [ACE] + Ustaw budynek medyczny Establece el centro médico [ACE] Setze medizinische Einrichtung [ACE] Určit zdravotnické zařízení [ACE] @@ -3608,39 +3589,33 @@ [ACE] Zdravotnické zásoby (pokročilé) [ACE] Caixa com suprimentos médicos (Avançados) - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - Anytime Kdykoli Siempre + Zawsze Stable Stabilní Estable + Po stabilizacji + + + Medical + Zdravotní + Médical + Sanitäter + Medico + Medyczne + Médico + Медик + Médico + Orvosi + + + Distance to %1 has become to far for treatment + %1 odszedł zbyt daleko, nie można kontynuować leczenia \ No newline at end of file diff --git a/addons/medical/ui/body_background.png b/addons/medical/ui/body_background.png deleted file mode 100644 index 65791a01c0..0000000000 Binary files a/addons/medical/ui/body_background.png and /dev/null differ diff --git a/addons/medical_menu/$PBOPREFIX$ b/addons/medical_menu/$PBOPREFIX$ new file mode 100644 index 0000000000..6ca7434932 --- /dev/null +++ b/addons/medical_menu/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\medical_menu \ No newline at end of file diff --git a/addons/medical_menu/ACE_Settings.hpp b/addons/medical_menu/ACE_Settings.hpp new file mode 100644 index 0000000000..1f2b9cc3ea --- /dev/null +++ b/addons/medical_menu/ACE_Settings.hpp @@ -0,0 +1,25 @@ + +class ACE_Settings { + class GVAR(allow) { + displayName = CSTRING(allow); + description = CSTRING(allow_Descr); + value = 1; + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + }; + class GVAR(useMenu) { + displayName = CSTRING(useMenu); + description = CSTRING(useMenu_Descr); + value = 0; + typeName = "SCALAR"; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), ECSTRING(common,VehiclesOnly)}; + isClientSettable = 1; + }; + class GVAR(openAfterTreatment) { + displayName = CSTRING(openAfterTreatment); + description = CSTRING(openAfterTreatment_Descr); + typeName = "BOOL"; + value = 1; + isClientSettable = 1; + }; +}; diff --git a/addons/medical_menu/CfgEventHandlers.hpp b/addons/medical_menu/CfgEventHandlers.hpp new file mode 100644 index 0000000000..7392999c9a --- /dev/null +++ b/addons/medical_menu/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/medical_menu/CfgVehicles.hpp b/addons/medical_menu/CfgVehicles.hpp new file mode 100644 index 0000000000..7bbe7db2ad --- /dev/null +++ b/addons/medical_menu/CfgVehicles.hpp @@ -0,0 +1,70 @@ + +class CfgVehicles { + + class ACE_Module; + class ACE_moduleMedicalMenuSettings: ACE_Module { + scope = 2; + displayName = CSTRING(module_DisplayName); + icon = QUOTE(PATHTOEF(medical,UI\Icon_Module_Medical_ca.paa)); + category = "ACE_medical"; + function = QUOTE(DFUNC(module)); + functionPriority = 1; + isGlobal = 0; + isTriggerActivated = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class allow { + displayName = CSTRING(allow); + description = CSTRING(allow_Descr); + typeName = "NUMBER"; + class values { + class disable { + name = ECSTRING(common,Disabled); + value = 0; + }; + class enable { + name = ECSTRING(common,Enabled); + value = 1; + default = 1; + }; + class VehiclesOnly { + name = ECSTRING(common,VehiclesOnly); + value = 2; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(module_Desc); + sync[] = {}; + }; + }; + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class Medical_Menu { + displayName = CSTRING(OpenMenu); + runOnHover = 0; + exceptions[] = {"isNotInside"}; + condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); + statement = QUOTE([_target] call DFUNC(openMenu)); + icon = PATHTOEF(medical,UI\icons\medical_cross.paa); + }; + }; + + class ACE_Actions { + // Create a consolidates medical menu for treatment while boarded + class ACE_MainActions { + class Medical_Menu { + displayName = CSTRING(OpenMenu); + runOnHover = 0; + exceptions[] = {"isNotInside"}; + condition = QUOTE([ARR_2(ACE_player,_target)] call FUNC(canOpenMenu)); + statement = QUOTE([_target] call DFUNC(openMenu)); + icon = PATHTOEF(medical,UI\icons\medical_cross.paa); + }; + }; + }; + }; +}; diff --git a/addons/medical_menu/README.md b/addons/medical_menu/README.md new file mode 100644 index 0000000000..86ae2039ea --- /dev/null +++ b/addons/medical_menu/README.md @@ -0,0 +1,11 @@ +ace_medical_menu +=============== + +Provides the CSE medical menu for the advanced medical system. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/medical_menu/XEH_postInit.sqf b/addons/medical_menu/XEH_postInit.sqf new file mode 100644 index 0000000000..eaf356f608 --- /dev/null +++ b/addons/medical_menu/XEH_postInit.sqf @@ -0,0 +1,35 @@ +#include "script_component.hpp" + +if (!hasInterface) exitwith {}; + +["medical_treatmentSuccess", { + + if (GVAR(openAfterTreatment) && {GVAR(pendingReopen)}) then { + GVAR(pendingReopen) = false; + [{ + [GVAR(INTERACTION_TARGET)] call FUNC(openMenu); + }, []] call EFUNC(common,execNextFrame); + }; +}] call EFUNC(common,addEventhandler); + + +["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey), +{ + _target = cursorTarget; + if (!(_target isKindOf "CAManBase") || ACE_player distance _target > 10) then {_target = ACE_player}; + // Conditions: canInteract + if !([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitwith {false}; + + // Statement + [_target] call FUNC(openMenu); + false +}, +{ + if (ACE_time - GVAR(lastOpenedOn) > 0.5) exitWith { + [ObjNull] call FUNC(openMenu); + }; + false +}, +[35, [false, false, false]], false, 0] call CBA_fnc_addKeybind; + diff --git a/addons/medical_menu/XEH_preInit.sqf b/addons/medical_menu/XEH_preInit.sqf new file mode 100644 index 0000000000..c231c7df6e --- /dev/null +++ b/addons/medical_menu/XEH_preInit.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(onMenuOpen); +PREP(openMenu); + +PREP(canOpenMenu); +PREP(updateIcons); +PREP(updateUIInfo); +PREP(handleUI_DisplayOptions); +PREP(handleUI_dropDownTriageCard); +PREP(getTreatmentOptions); +PREP(updateActivityLog); +PREP(updateQuickViewLog); +PREP(updateBodyImage); +PREP(updateInformationLists); +PREP(setTriageStatus); +PREP(collectActions); +PREP(module); + +GVAR(INTERACTION_TARGET) = objNull; +GVAR(actionsOther) = []; +GVAR(actionsSelf) = []; +GVAR(selectedBodyPart) = 0; + +call FUNC(collectActions); + +ADDON = true; diff --git a/addons/medical_menu/config.cpp b/addons/medical_menu/config.cpp new file mode 100644 index 0000000000..27e0db03b9 --- /dev/null +++ b/addons/medical_menu/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_medical"}; + author[] = {$STR_ACE_Common_ACETeam, "Glowbal"}; + authorUrl = "http://ace3mod.com"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ui\menu.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/medical_menu/data/background_img.paa b/addons/medical_menu/data/background_img.paa new file mode 100644 index 0000000000..de59065e3b Binary files /dev/null and b/addons/medical_menu/data/background_img.paa differ diff --git a/addons/medical_menu/data/icons/advanced_treatment_small.paa b/addons/medical_menu/data/icons/advanced_treatment_small.paa new file mode 100644 index 0000000000..8becb9d2df Binary files /dev/null and b/addons/medical_menu/data/icons/advanced_treatment_small.paa differ diff --git a/addons/medical_menu/data/icons/airway_management_small.paa b/addons/medical_menu/data/icons/airway_management_small.paa new file mode 100644 index 0000000000..ab4da47958 Binary files /dev/null and b/addons/medical_menu/data/icons/airway_management_small.paa differ diff --git a/addons/medical_menu/data/icons/bandage_fracture_small.paa b/addons/medical_menu/data/icons/bandage_fracture_small.paa new file mode 100644 index 0000000000..a869f260ec Binary files /dev/null and b/addons/medical_menu/data/icons/bandage_fracture_small.paa differ diff --git a/addons/medical_menu/data/icons/examine_patient_small.paa b/addons/medical_menu/data/icons/examine_patient_small.paa new file mode 100644 index 0000000000..2e9fc9831d Binary files /dev/null and b/addons/medical_menu/data/icons/examine_patient_small.paa differ diff --git a/addons/medical_menu/data/icons/icon_advanced_treatment.paa b/addons/medical_menu/data/icons/icon_advanced_treatment.paa new file mode 100644 index 0000000000..d6bf6effd9 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_advanced_treatment.paa differ diff --git a/addons/medical_menu/data/icons/icon_airway_management.paa b/addons/medical_menu/data/icons/icon_airway_management.paa new file mode 100644 index 0000000000..f444f5f385 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_airway_management.paa differ diff --git a/addons/medical_menu/data/icons/icon_bandage_fracture.paa b/addons/medical_menu/data/icons/icon_bandage_fracture.paa new file mode 100644 index 0000000000..df8d1de571 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_bandage_fracture.paa differ diff --git a/addons/medical_menu/data/icons/icon_bleeding.paa b/addons/medical_menu/data/icons/icon_bleeding.paa new file mode 100644 index 0000000000..d11c2ed496 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_bleeding.paa differ diff --git a/addons/medical_menu/data/icons/icon_carry.paa b/addons/medical_menu/data/icons/icon_carry.paa new file mode 100644 index 0000000000..7ebb830b03 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_carry.paa differ diff --git a/addons/medical_menu/data/icons/icon_examine_patient.paa b/addons/medical_menu/data/icons/icon_examine_patient.paa new file mode 100644 index 0000000000..12eb06c890 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_examine_patient.paa differ diff --git a/addons/medical_menu/data/icons/icon_medication.paa b/addons/medical_menu/data/icons/icon_medication.paa new file mode 100644 index 0000000000..98893ad863 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_medication.paa differ diff --git a/addons/medical_menu/data/icons/icon_toggle_self.paa b/addons/medical_menu/data/icons/icon_toggle_self.paa new file mode 100644 index 0000000000..3078eb5dd5 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_toggle_self.paa differ diff --git a/addons/medical_menu/data/icons/icon_tourniquet.paa b/addons/medical_menu/data/icons/icon_tourniquet.paa new file mode 100644 index 0000000000..8b34a7bfbb Binary files /dev/null and b/addons/medical_menu/data/icons/icon_tourniquet.paa differ diff --git a/addons/medical_menu/data/icons/icon_tourniquet_small.paa b/addons/medical_menu/data/icons/icon_tourniquet_small.paa new file mode 100644 index 0000000000..a457e2c0d5 Binary files /dev/null and b/addons/medical_menu/data/icons/icon_tourniquet_small.paa differ diff --git a/addons/medical_menu/data/icons/icon_triage_card.paa b/addons/medical_menu/data/icons/icon_triage_card.paa new file mode 100644 index 0000000000..850ab0f4ce Binary files /dev/null and b/addons/medical_menu/data/icons/icon_triage_card.paa differ diff --git a/addons/medical_menu/data/icons/medication_small.paa b/addons/medical_menu/data/icons/medication_small.paa new file mode 100644 index 0000000000..b6acd670c8 Binary files /dev/null and b/addons/medical_menu/data/icons/medication_small.paa differ diff --git a/addons/medical_menu/data/icons/toggle_self_small.paa b/addons/medical_menu/data/icons/toggle_self_small.paa new file mode 100644 index 0000000000..73108e5a98 Binary files /dev/null and b/addons/medical_menu/data/icons/toggle_self_small.paa differ diff --git a/addons/medical_menu/data/icons/triage_card_small.paa b/addons/medical_menu/data/icons/triage_card_small.paa new file mode 100644 index 0000000000..92eb0f0d20 Binary files /dev/null and b/addons/medical_menu/data/icons/triage_card_small.paa differ diff --git a/addons/medical_menu/data/ui_background.paa b/addons/medical_menu/data/ui_background.paa new file mode 100644 index 0000000000..f1c42c7d7d Binary files /dev/null and b/addons/medical_menu/data/ui_background.paa differ diff --git a/addons/medical_menu/functions/fnc_canOpenMenu.sqf b/addons/medical_menu/functions/fnc_canOpenMenu.sqf new file mode 100644 index 0000000000..9b7c3bcbff --- /dev/null +++ b/addons/medical_menu/functions/fnc_canOpenMenu.sqf @@ -0,0 +1,24 @@ +/* + * Author: Glowbal + * Check if ACE_player can Open the medical menu + * + * Arguments: + * 0: Caller + * 1: Target + * + * Return Value: + * Can open + * + * Example: + * [] call ace_medical_menu_canOpenMenu + * + * Public: No + */ +#include "script_component.hpp" + +params ["_caller", "_target"]; + +if !(GVAR(allow) == 1 || (GVAR(allow) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; +if !(GVAR(useMenu) == 1 || (GVAR(useMenu) == 2 && {vehicle _caller != _caller || vehicle _target != _target} && {alive ACE_player})) exitwith {false}; + +true diff --git a/addons/medical_menu/functions/fnc_collectActions.sqf b/addons/medical_menu/functions/fnc_collectActions.sqf new file mode 100644 index 0000000000..ad189139ea --- /dev/null +++ b/addons/medical_menu/functions/fnc_collectActions.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Collect treatment actions from medical config + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_fnc_collectActions + * + * Public: No + */ +#include "script_component.hpp" + +private ["_configBasic", "_configAdvanced", "_fnc_compileActionsLevel"]; +_configBasic = (configFile >> "ACE_Medical_Actions" >> "Basic"); +_configAdvanced = (configFile >> "ACE_Medical_Actions" >> "Advanced"); + +_fnc_compileActionsLevel = { + private ["_entryCount", "_actions", "_displayName", "_condition", "_category", "_statement"]; + params ["_config"]; + _actions = []; + + { + if (isClass _x) then { + _displayName = getText (_x >> "displayName"); + _category = getText (_x >> "category"); + _condition = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,canTreatCached)), configName _x]; + _statement = format[QUOTE([ARR_4(ACE_player, GVAR(INTERACTION_TARGET), EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart), '%1')] call DEFUNC(medical,treatment)), configName _x]; + _actions pushBack [_displayName, _category, compile _condition, compile _statement]; + }; + nil + } count ("true" configClasses _config); + + _actions // return +}; + +GVAR(actionsBasic) = [_configBasic] call _fnc_compileActionsLevel; +GVAR(actionsAdvanced) = [_configAdvanced] call _fnc_compileActionsLevel; diff --git a/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf new file mode 100644 index 0000000000..4b03d27970 --- /dev/null +++ b/addons/medical_menu/functions/fnc_getTreatmentOptions.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Grab available treatment options for given category + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: Category name + * + * Return Value: + * Available actions + * + * Exmaple: + * [ACE_player, poor_dude, "some category"] call ace_medical_menu_fnc_getTreatmentOptions + * + * Public: No + */ +#include "script_component.hpp" + +private "_actions"; +params ["_player", "_target", "_name"]; + +if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitwith {[]}; + +_actions = if (EGVAR(medical,level) == 2) then { + GVAR(actionsAdvanced); +} else { + GVAR(actionsBasic); +}; + +_collectedActions = []; + +_bodyPart = EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart); +{ + _x params ["", "_currentCategory", "_currentCondition"]; + if (_name == _currentCategory && {call _currentCondition}) then { + _collectedActions pushBack _x; + }; + nil +} count _actions; + +_collectedActions // return diff --git a/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf new file mode 100644 index 0000000000..c65aba5074 --- /dev/null +++ b/addons/medical_menu/functions/fnc_handleUI_DisplayOptions.sqf @@ -0,0 +1,110 @@ +/* + * Author: Glowbal + * Display the available treatment options in category + * + * Arguments: + * 0: Category name + * + * Return Value: + * None + * + * Example: + * ["some category"] call ace_medical_menu_handleUI_DisplayOptions + * + * Public: No + */ +#include "script_component.hpp" + +#define START_IDC 20 +#define END_IDC 27 +#define AMOUNT_OF_ENTRIES (count _entries) + +if (!hasInterface) exitwith{}; + +private ["_entries", "_display", "_newTarget", "_card", "_ctrl", "_code"]; + +params ["_name"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); +if (isNil "_display") exitwith {}; // no valid dialog present + +if (_name isEqualTo "toggle") exitwith { + if (GVAR(INTERACTION_TARGET) != ACE_player) then { + _newTarget = ACE_player; + } else { + _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); + }; + + GVAR(INTERACTION_TARGET_PREVIOUS) = GVAR(INTERACTION_TARGET); + + closeDialog 0; + [{ + [_this select 0] call FUNC(openMenu); + }, [_newTarget], 0.1] call EFUNC(common,waitAndExecute); +}; + +// Clean the dropdown options list from all actions +for [{_x = START_IDC}, {_x <= END_IDC}, {_x = _x + 1}] do { + _ctrl = (_display displayCtrl (_x)); + _ctrl ctrlSetText ""; + _ctrl ctrlShow false; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + _ctrl ctrlSetTooltip ""; + _ctrl ctrlCommit 0; +}; + +GVAR(LatestDisplayOptionMenu) = _name; + +// The triage card has no options available +lbClear 212; +if (_name isEqualTo "triage") exitwith { + + ctrlEnable [212, true]; + private ["_log", "_triageCardTexts", "_message"]; + _log = GVAR(INTERACTION_TARGET) getvariable [QEGVAR(medical,triageCard), []]; + _triageCardTexts = []; + { + _x params ["_item", "_amount", "_time"]; + _message = _item; + if (isClass(configFile >> "CfgWeapons" >> _item)) then { + _message = getText(configFile >> "CfgWeapons" >> _item >> "DisplayName"); + } else { + if (isLocalized _message) then { + _message = localize _message; + }; + }; + _triageCardTexts pushback format["%1x - %2 (%3m)", _amount, _message, round((ACE_time - _time) / 60)]; + nil; + } count _log; + + if (count _triageCardTexts == 0) exitwith { + lbAdd [212,(localize ELSTRING(medical,TriageCard_NoEntry))]; + }; + { + lbAdd [212,_x]; + nil; + }count _triageCardTexts; +}; + +ctrlEnable [212, false]; + +_entries = [ACE_player, GVAR(INTERACTION_TARGET), _name] call FUNC(getTreatmentOptions); + +{ + //player sidechat format["TRIGGERED: %1",_x]; + if (_forEachIndex > END_IDC) exitwith {}; + _ctrl = (_display displayCtrl (START_IDC + _forEachIndex)); + if (!(_forEachIndex > AMOUNT_OF_ENTRIES)) then { + _ctrl ctrlSetText (_x select 0); + _code = format ["ace_medical_menu_pendingReopen = true; call %1;", (_x select 3)]; + _ctrl ctrlSetEventHandler ["ButtonClick", _code]; + _ctrl ctrlSetTooltip (_x select 0); // TODO implement + _ctrl ctrlShow true; + } else { + _ctrl ctrlSetText ""; + _ctrl ctrlSetEventHandler ["ButtonClick", ""]; + }; + _ctrl ctrlCommit 0; +} forEach _entries; diff --git a/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf new file mode 100644 index 0000000000..fb924fc40b --- /dev/null +++ b/addons/medical_menu/functions/fnc_handleUI_dropDownTriageCard.sqf @@ -0,0 +1,35 @@ +/* + * Author: Glowbal + * Handle the triage card display + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_handleUI_dropDownTriageCard + * + * Public: No + */ +#include "script_component.hpp" + +private ["_display", "_pos", "_ctrl", "_currentPos", "_idc"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); +_pos = [0, 0, 0, 0]; +_currentPos = ctrlPosition (_display displayCtrl 2002); +_currentPos params ["_currentPosX", "_currentPosY"]; +if (_currentPosX == 0 && _currentPosY == 0) then { + _pos = ctrlPosition (_display displayCtrl 2001); +}; + +for "_idc" from 2002 to 2006 step 1 do { + _pos set [1, (_pos select 1) + (_pos select 3)]; + _ctrl = _display displayCtrl _idc; + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; +}; diff --git a/addons/medical_menu/functions/fnc_module.sqf b/addons/medical_menu/functions/fnc_module.sqf new file mode 100644 index 0000000000..d95110c200 --- /dev/null +++ b/addons/medical_menu/functions/fnc_module.sqf @@ -0,0 +1,22 @@ +/* + * Author: Glowbal + * Module for adjusting the medical menu settings + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(allow), "allow"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical_menu/functions/fnc_onMenuOpen.sqf b/addons/medical_menu/functions/fnc_onMenuOpen.sqf new file mode 100644 index 0000000000..164353fe73 --- /dev/null +++ b/addons/medical_menu/functions/fnc_onMenuOpen.sqf @@ -0,0 +1,85 @@ +/* + * Author: Glowbal + * Handle medical menu opened + * + * Arguments: + * 0: Medical Menu display + * + * Return Value: + * None + * + * Example: + * [medical_menu] call ace_medical_menu_onMenuOpen + * + * Public: No + */ +#include "script_component.hpp" +#define MAX_DISTANCE 10 + +private "_target"; + +params ["_display"]; + +if (isNil "_display") exitwith {}; + +if (isNil QGVAR(LatestDisplayOptionMenu)) then { + GVAR(LatestDisplayOptionMenu) = "triage"; +} else { + if (GVAR(LatestDisplayOptionMenu) == "toggle") then { + GVAR(LatestDisplayOptionMenu) = "triage"; + GVAR(INTERACTION_TARGET) = GVAR(INTERACTION_TARGET_PREVIOUS); + }; +}; + +_target = GVAR(INTERACTION_TARGET); +if (isNil QGVAR(INTERACTION_TARGET_PREVIOUS)) then { + GVAR(INTERACTION_TARGET_PREVIOUS) = _target; +}; +[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + +disableSerialization; + +[_target, _display] call FUNC(updateUIInfo); + +(_display displayCtrl 11) ctrlSetTooltip localize LSTRING(VIEW_TRIAGE_CARD); +(_display displayCtrl 12) ctrlSetTooltip localize LSTRING(EXAMINE_PATIENT); +(_display displayCtrl 13) ctrlSetTooltip localize LSTRING(BANDAGE_FRACTURES); +(_display displayCtrl 14) ctrlSetTooltip localize LSTRING(MEDICATION); +(_display displayCtrl 15) ctrlSetTooltip localize LSTRING(AIRWAY_MANAGEMENT); +(_display displayCtrl 16) ctrlSetTooltip localize LSTRING(ADVANCED_TREATMENT); +(_display displayCtrl 17) ctrlSetTooltip localize LSTRING(DRAG_CARRY); +(_display displayCtrl 18) ctrlSetTooltip localize LSTRING(TOGGLE_SELF); + +(_display displayCtrl 301) ctrlSetTooltip localize LSTRING(SELECT_HEAD); +(_display displayCtrl 302) ctrlSetTooltip localize LSTRING(SELECT_TORSO); +(_display displayCtrl 303) ctrlSetTooltip localize LSTRING(SELECT_ARM_R); +(_display displayCtrl 304) ctrlSetTooltip localize LSTRING(SELECT_ARM_L); +(_display displayCtrl 305) ctrlSetTooltip localize LSTRING(SELECT_LEG_R); +(_display displayCtrl 306) ctrlSetTooltip localize LSTRING(SELECT_LEG_L); +(_display displayCtrl 2001) ctrlSetTooltip localize LSTRING(SELECT_TRIAGE_STATUS); + +(_display displayCtrl 1) ctrlSetText format ["%1", [_target] call EFUNC(common,getName)]; +setMousePosition [0.4, 0.4]; + +GVAR(MenuPFHID) = [{ + + (_this select 0) params ["_display"]; + if (isNull GVAR(INTERACTION_TARGET)) then { + GVAR(INTERACTION_TARGET) = ACE_player; + }; + [GVAR(INTERACTION_TARGET), _display] call FUNC(updateUIInfo); + [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); + [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + + _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); + (_display displayCtrl 2000) ctrlSetText (_status select 0); + (_display displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); + + if (ACE_player distance _target > MAX_DISTANCE) exitwith { + closeDialog 314412; + ["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [_target] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent); + }; + +}, 0, [_display]] call CBA_fnc_addPerFrameHandler; + + ["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call EFUNC(common,localEvent); diff --git a/addons/medical_menu/functions/fnc_openMenu.sqf b/addons/medical_menu/functions/fnc_openMenu.sqf new file mode 100644 index 0000000000..067e7bda13 --- /dev/null +++ b/addons/medical_menu/functions/fnc_openMenu.sqf @@ -0,0 +1,39 @@ +/* + * Author: Glowbal + * Open the medical menu for target + * + * Arguments: + * 0: Target + * + * Return Value: + * If action was taken + * + * Example: + * [some_player] call ace_medical_menu_openMenu + * + * Public: No + */ +#include "script_component.hpp" + +params ["_interactionTarget"]; + +if (dialog || isNull _interactionTarget) exitwith { + disableSerialization; + + private ["_display", "_handled"]; + _handled = false; + _display = uiNamespace getVariable QGVAR(medicalMenu); + if (!isNil "_display") then { + closeDialog 314412; + _handled = true; + }; + + _handled +}; + +GVAR(INTERACTION_TARGET) = _interactionTarget; + +createDialog QGVAR(medicalMenu); +GVAR(lastOpenedOn) = ACE_time; + +true diff --git a/addons/medical_menu/functions/fnc_setTriageStatus.sqf b/addons/medical_menu/functions/fnc_setTriageStatus.sqf new file mode 100644 index 0000000000..7e7c764aee --- /dev/null +++ b/addons/medical_menu/functions/fnc_setTriageStatus.sqf @@ -0,0 +1,18 @@ +/* + * Author: Glowbal + * Set the triage status of object + * + * Arguments: + * 0: Target + * 1: Status + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_status"]; + +_target setvariable [QEGVAR(medical,triageLevel), _status, true]; diff --git a/addons/medical_menu/functions/fnc_updateActivityLog.sqf b/addons/medical_menu/functions/fnc_updateActivityLog.sqf new file mode 100644 index 0000000000..335aea0c58 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateActivityLog.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the activity log + * + * Arguments: + * 0: display + * 1: log collection + * + * Return Value: + * None + * + * Example: + * [some_display, log] call ace_medical_menu_updateActivityLog + * + * Public: No + */ +#include "script_component.hpp" + +private "_logCtrl"; + +params ["_display", "_logs"]; + +_logCtrl = _display displayCtrl 214; +lbClear _logCtrl; + +{ + _x params ["_message", "_moment", "_dummy", "_arguments"]; + + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + } forEach _arguments; + + _message = format ([_message] + _arguments); + _logCtrl lbAdd format ["%1 %2", _moment, _message]; + nil +} count _logs; diff --git a/addons/medical_menu/functions/fnc_updateBodyImage.sqf b/addons/medical_menu/functions/fnc_updateBodyImage.sqf new file mode 100644 index 0000000000..34b2f450c8 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateBodyImage.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the body image on the menu + * + * Arguments: + * 0: selection bloodloss + * 1: display + * + * Return Value: + * None + * + * Example: + * [0.3, some_display] call ace_medical_menu_updateBodyImage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_selectionBloodLoss", "_display"]; + +// Handle the body image coloring +_availableSelections = [50, 51, 52, 53, 54, 55]; +{ + private ["_red", "_green", "_blue"]; + + _red = 1; + _green = 1; + _blue = 1; + + if (_x > 0) then { + if (_damaged select _forEachIndex) then { + _green = (0.9 - _x) max 0; + _blue = _green; + } else { + _green = (0.9 - _x) max 0; + _red = _green; + //_blue = _green; + }; + }; + + (_display displayCtrl (_availableSelections select _forEachIndex)) ctrlSetTextColor [_red, _green, _blue, 1.0]; +} forEach _selectionBloodLoss; diff --git a/addons/medical_menu/functions/fnc_updateIcons.sqf b/addons/medical_menu/functions/fnc_updateIcons.sqf new file mode 100644 index 0000000000..f9d3fc5ab4 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateIcons.sqf @@ -0,0 +1,35 @@ +/* + * Author: Glowbal + * Update the category icons + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_medical_menu_updateIcons + * + * Public: No + */ +#include "script_component.hpp" + +#define START_IDC 111 +#define END_IDC 118 + +private ["_display", "_idc", "_options", "_name", "_amount"]; + +disableSerialization; + +_display = uiNamespace getVariable QGVAR(medicalMenu); + +_options = ["triage" , "examine", "bandage", "medication", "airway", "advanced", "drag", "toggle"]; +for "_idc" from START_IDC to END_IDC step 1 do { + _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - START_IDC)] call FUNC(getTreatmentOptions); + if ((count _amount) > 0 || _idc == START_IDC || _idc == END_IDC) then { + (_display displayCtrl _idc) ctrlSettextColor [1, 1, 1, 1]; + } else { + (_display displayCtrl _idc) ctrlSettextColor [0.4, 0.4, 0.4, 1]; + }; +}; diff --git a/addons/medical_menu/functions/fnc_updateInformationLists.sqf b/addons/medical_menu/functions/fnc_updateInformationLists.sqf new file mode 100644 index 0000000000..70903347b5 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateInformationLists.sqf @@ -0,0 +1,38 @@ +/* + * Author: Glowbal + * Update the treatment information list + * + * Arguments: + * 0: display + * 1: message collection + * 2: injury collection + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +private "_lbCtrl"; + +params ["_display", "_genericMessages", "_allInjuryTexts"]; + +_lbCtrl = _display displayCtrl 213; +lbClear _lbCtrl; +{ + _x params ["_add", "_color"]; + _lbCtrl lbAdd _add; + _lbCtrl lbSetColor [_forEachIndex, _color]; +} forEach _genericMessages; + +_amountOfGeneric = count _genericMessages; +{ + _x params ["_add", "_Color"]; + _lbCtrl lbAdd _add; + _lbCtrl lbSetColor [_forEachIndex + _amountOfGeneric, _color]; +} forEach _allInjuryTexts; + +if !(_allInjuryTexts isEqualTo []) then { + _lbCtrl lbAdd localize ELSTRING(medical,NoInjuriesBodypart); +}; diff --git a/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf new file mode 100644 index 0000000000..8ca81f28ed --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateQuickViewLog.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Update the quick view log + * + * Arguments: + * 0: display + * 1: log collection + * + * Return Value: + * None + * + * Example: + * [some_display, log] call ace_medical_menu_updateQuickViewLog + * + * Public: No + */ +#include "script_component.hpp" + +private "_logCtrl"; + +params ["_display", "_logs"]; + +_logCtrl = _display displayCtrl 215; +lbClear _logCtrl; + +{ + _x params ["_message", "_moment", "_dummy", "_arguments"]; + + if (isLocalized _message) then { + _message = localize _message; + }; + + { + if (typeName _x == "STRING" && {isLocalized _x}) then { + _arguments set [_foreachIndex, localize _x]; + }; + } forEach _arguments; + + _message = format ([_message] + _arguments); + _logCtrl lbAdd format ["%1 %2", _moment, _message]; + nil +} count _logs; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf new file mode 100644 index 0000000000..7dee2d5123 --- /dev/null +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -0,0 +1,142 @@ +/* + * Author: Glowbal + * Update all UI information in the medical menu + * + * Arguments: + * 0: target + * 1: display + * + * Return Value: + * None + * + * Example: + * [some_player, some_display] call ace_medical_menu_updateUIInfo + * + * Public: No + */ +#include "script_component.hpp" + +private ["_genericMessages", "_totalIvVolume", "_damaged", "_selectionBloodLoss", "_allInjuryTexts"]; + +params ["_target", "_display"]; + +_selectionN = GVAR(selectedBodyPart); +if (_selectionN < 0 || _selectionN > 5) exitwith {}; + +_genericMessages = []; +_partText = [ELSTRING(medical,Head), ELSTRING(medical,Torso), ELSTRING(medical,LeftArm) ,ELSTRING(medical,RightArm) ,ELSTRING(medical,LeftLeg), ELSTRING(medical,RightLeg)] select _selectionN; +_genericMessages pushBack [localize _partText, [1, 1, 1, 1]]; + +if (_target getVariable [QEGVAR(medical,isBleeding), false]) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Bleeding), [1, 0.1, 0.1, 1]]; +}; + +if (_target getVariable [QEGVAR(medical,hasLostBlood), 0] > 1) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Lost_Blood), [1, 0.1, 0.1, 1]]; +}; + +if (((_target getVariable [QEGVAR(medical,tourniquets), [0, 0, 0, 0, 0, 0]]) select _selectionN) > 0) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; +}; + +if (_target getVariable [QEGVAR(medical,hasPain), false]) then { + _genericMessages pushBack [localize ELSTRING(medical,Status_Pain), [1, 1, 1, 1]]; +}; + +_totalIvVolume = 0; +{ + private "_value"; + _value = _target getVariable _x; + if (!isNil "_value") then { + _totalIvVolume = _totalIvVolume + (_target getVariable [_x, 0]); + }; +} count EGVAR(medical,IVBags); + +if (_totalIvVolume >= 1) then { + _genericMessages pushBack [format [localize ELSTRING(medical,receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; +}; + +_damaged = [false, false, false, false, false, false]; +_selectionBloodLoss = [0, 0, 0, 0, 0, 0]; + +_allInjuryTexts = []; +if (EGVAR(medical,level) >= 2) then { + _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; + private "_amountOf"; + { + _amountOf = _x select 3; + // Find how much this bodypart is bleeding + if (_amountOf > 0) then { + _damaged set [_x select 2, true]; + _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + + if (_selectionN == (_x select 2)) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format["%2x %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [1,1,1,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format["Partial %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6], [1,1,1,1]]; + }; + }; + }; + } forEach _openWounds; + + _bandagedwounds = _target getVariable [QEGVAR(medical,bandagedWounds), []]; + { + _amountOf = _x select 3; + // Find how much this bodypart is bleeding + if !(_damaged select (_x select 2)) then { + _selectionBloodLoss set [_x select 2, (_selectionBloodLoss select (_x select 2)) + (20 * ((_x select 4) * _amountOf))]; + }; + if (_selectionN == (_x select 2)) then { + // Collect the text to be displayed for this injury [ Select injury class type definition - select the classname DisplayName (6th), amount of injuries for this] + if (_amountOf > 0) then { + if (_amountOf >= 1) then { + // TODO localization + _allInjuryTexts pushBack [format ["[B] %2x %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6, _amountOf], [0.88,0.7,0.65,1]]; + } else { + // TODO localization + _allInjuryTexts pushBack [format ["[B] Partial %1", (EGVAR(medical,AllWoundInjuryTypes) select (_x select 1)) select 6], [0.88,0.7,0.65,1]]; + }; + }; + }; + } forEach _bandagedwounds; +} else { + _damaged = [true, true, true, true, true, true]; + { + _selectionBloodLoss set [_forEachIndex, _target getHitPointDamage _x]; + + if (_target getHitPointDamage _x > 0 && _forEachIndex == _selectionN) then { + _pointDamage = _target getHitPointDamage _x; + _severity = switch (true) do { + case (_pointDamage > 0.5): {localize ELSTRING(medical,HeavilyWounded)}; + case (_pointDamage > 0.1): {localize ELSTRING(medical,LightlyWounded)}; + default {localize ELSTRING(medical,VeryLightlyWounded)}; + }; + _part = localize ([ + ELSTRING(medical,Head), + ELSTRING(medical,Torso), + ELSTRING(medical,LeftArm), + ELSTRING(medical,RightArm), + ELSTRING(medical,LeftLeg), + ELSTRING(medical,RightLeg) + ] select _forEachIndex); + _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; + }; + } forEach ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; +}; + +[_selectionBloodLoss, _display] call FUNC(updateBodyImage); +[_display, _genericMessages, _allInjuryTexts] call FUNC(updateInformationLists); + +_logs = _target getVariable [QEGVAR(medical,logFile_activity_view), []]; +[_display, _logs] call FUNC(updateActivityLog); + +_logs = _target getVariable [QEGVAR(medical,logFile_quick_view), []]; +[_display, _logs] call FUNC(updateQuickViewLog); + +_triageStatus = [_target] call EFUNC(medical,getTriageStatus); +(_display displayCtrl 2000) ctrlSetText (_triageStatus select 0); +(_display displayCtrl 2000) ctrlSetBackgroundColor (_triageStatus select 2); diff --git a/addons/medical_menu/functions/script_component.hpp b/addons/medical_menu/functions/script_component.hpp new file mode 100644 index 0000000000..8c2e419166 --- /dev/null +++ b/addons/medical_menu/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\medical_menu\script_component.hpp" diff --git a/addons/medical_menu/script_component.hpp b/addons/medical_menu/script_component.hpp new file mode 100644 index 0000000000..3119d48e19 --- /dev/null +++ b/addons/medical_menu/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT medical_menu +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MEDICAL_MENU + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MEDICAL_MENU + #define DEBUG_SETTINGS DEBUG_SETTINGS_MEDICAL_MENU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/medical_menu/stringtable.xml b/addons/medical_menu/stringtable.xml new file mode 100644 index 0000000000..0a4f1a5388 --- /dev/null +++ b/addons/medical_menu/stringtable.xml @@ -0,0 +1,360 @@ + + + + + Medical Menu + Menu medyczne + + + Allow Medical Menu + Akt. menu medyczne + + + Allow clients to use the medical menu + Zezwalaj graczom korzystać z menu medycznego + + + Use Medical menu + Użyj menu medycznego + + + If allowed by server, enable the option to use the Medical Menu through keybinding and interaction menu + Jeżeli zezwolone przez serwer, aktywuj menu medyczne poprzez skrót klawiszowy i menu interakcji. + + + Re-open Medical menu + Otwieraj ponownie menu medyczne + + + Re-open the medical menu after succesful treatment + Otwórz ponownie menu medyczne po udanym zakończeniu leczenia + + + Open Medical Menu + Otwórz menu medyczne + + + Medical Menu Settings + Ustawienia menu medycznego + + + Configure the usage of the Medical Menu + Skonfiguruj opcje menu medycznego + + + EXAMINE & TREATMENT + ОСМОТР И ЛЕЧЕНИЕ + EXAMINAR & TRATAMIENTO + EXAMINER & TRAITEMENTS + BADANIE & LECZENIE + + + STATUS + СОСТОЯНИЕ + ESTADO + ÉTATS + STATUS + + + OVERVIEW + ОБЩАЯ ИНФОРМАЦИЯ + DESCRIPCIÓN + DESCRIPTION + OPIS + + + ACTIVITY LOG + ПРОВЕДЕННЫЕ МАНИПУЛЯЦИИ + REGISTRO DE ACTIVIDAD + REGISTRE DES SOINS + LOGI AKTYWNOŚCI + + + QUICK VIEW + БЫСТРЫЙ ОСМОТР + VISTA RÁPIDA + VUE RAPIDE + SZYBKI PODGLĄD + + + View triage Card + Смотреть первичную карточку + Ver Triage + Voir Carte de Triage + Pokaż kartę segregacyjną + + + Examine Patient + Осмотреть пациента + Examinar Paciente + Examiner Patient + Zbadaj pacjenta + + + Bandage / Fractures + Раны / переломы + Vendajes/Fracturas + Bandages / Fractures + Bandaże / Złamania + + + Medication + Медикаменты + Medicación + Médications + Leki + + + Airway Management + Дыхательные пути + Vías Aéreas + Gestion Des Voie REspiratoire + Drogi oddechowe + + + Advanced Treatments + Специальная медпомощь + Tratamientos Avanzados + Traitement Avancé + Zaawansowane zabiegi + + + Drag/Carry + Тащить/нести + Arrastrar/Cargar + Glisser/Porter + Ciągnij/Nieś + + + Toggle (Self) + Лечить себя/другого раненого + Activer (sois) + Przełącz (na siebie) + Alternar + + + Select triage status + Сортировка + Seleccionar estado de Triage + Selectioner l'état de Triage + Wybierz priorytet + + + + Select Head + Выбрать голову + Seleccionar Cabeza + Selectioner Tête + Wybierz głowę + + + Select Torso + Выбрать торс + Seleccionar Torso + Selectioner Torse + Wybierz tors + + + Select Left Arm + Выбрать левую руку + Seleccionar Brazo Izquierdo + Selectioner Bras Gauche + Wybierz lewą rękę + + + Select Right Arm + Выбрать правую руку + Seleccionar Brazo Derecho + Selectioner Bras Droit + Wybierz prawą rękę + + + Select Left Leg + Выбрать левую ногу + Seleccionar Pierna Izquierda + Selectioner Jambe Gauche + Wybierz lewą nogę + + + Select Right Leg + Выбрать правую ногу + Seleccionar Pierna Derecha + Selectioner Jambe Droite + Wybierz prawą nogę + + + Head + Голова + Cabeza + Tête + Głowa + + + Torso + Торс + Torse + Tors + + + Left Arm + Левая рука + Brazo Izquierdo + Bras Gauche + Lewa ręka + + + Right Arm + Правая рука + Brazo Derecho + Bras Droit + Prawa ręka + + + Left Leg + Левая нога + Pierna Izquierda + Jambe Gauche + Lewa noga + + + Right Leg + Правая нога + Pierna Derecha + Jambe Droite + Prawa noga + + + Body Part: %1 + Часть тела: %1 + Parte del cuerpo: %1 + Partie du corps: %1 + Część ciała: %1 + + + Small + малого размера + Pequeña + Petite + małym + + + Medium + среднего размера + Mediana + moyenne + średnim + + + Large + большого размера + Grande + Grande + dużym + + + There are %2 %1 Open Wounds + %2 открытые раны %1 + Hay %2 Heridas Abiertas %1 + Il y a %2 %1 Blessure Ouverte + Widzisz otwarte rany w ilości %2 o %1 rozmiarze + + + There is 1 %1 Open Wound + Открытая рана %1 + Hay 1 Herida Abierta %1 + Il y a 1 blessure ouverte %1 + Widzisz 1 otwartą ranę o %1 rozmiarze + + + There is a partial %1 Open wound + Частично открытая рана %1 + Hay una herida parcial abierta %1 + Il y a une Blessure Patiellement Ouverte %1 + Widzisz częściowo otwartą ranę o %1 rozmiarze + + + There are %2 %1 Bandaged Wounds + %2 перевязанные раны %1 + Hay %2 Heridas %1 Vendadas + Il y a %2 %1 Blessure Bandée + Widzisz %2 zabandażowanych ran o %1 rozmiarze + + + There is 1 %1 Bandaged Wound + 1 перевязанная рана %1 + Hay 1 Herida Vendada %1 + Il y a 1 %1 Blessure Bandée + Widzisz 1 zabandażowaną ranę o %1 rozmiarze + + + There is a partial %1 Bandaged wound + Частично перевязанная рана %1 + Hay una Herida parcial %1 Vendada + Il y a %1 Blessure Partielment Bandée + Widzisz 1 częściowo zabandażowaną ranę o %1 rozmiarze + + + Normal breathing + Дыхание в норме + Respiración normal + Respiration Normale + Normalny oddech + + + No breathing + Дыхания нет + No respira + Apnée + Brak oddechu + + + Difficult breathing + Дыхание затруднено + Dificultad para respirar + Difficultée Respiratoire + Trudności z oddychaniem + + + Almost no breathing + Дыхания почти нет + Casi sin respirar + Respiration Faible + Prawie brak oddechu + + + Bleeding + Кровотечение + Sangrando + Seignement + Krwawienie zewnętrzne + + + in Pain + Испытывает боль + Con Dolor + A De La Douleur + W bólu + + + Lost a lot of Blood + Большая кровопотеря + Mucha Sangre perdida + A Perdu Bcp de Sang + Stracił dużo krwi + + + Tourniquet [CAT] + Жгут + Torniquete [CAT] + Garot [CAT] + Opaska uciskowa [CAT] + + + Nasopharyngeal Tube [NPA] + Назотрахеальная трубка + Torniquete [CAT] + Canule Naseaupharyngée [NPA] + Rurka nosowo-gardłowa [NPA] + + + diff --git a/addons/medical_menu/ui/menu.hpp b/addons/medical_menu/ui/menu.hpp new file mode 100644 index 0000000000..ab078d4c72 --- /dev/null +++ b/addons/medical_menu/ui/menu.hpp @@ -0,0 +1,570 @@ +#include "\z\ace\addons\common\define.hpp" + +class GVAR(medicalMenu) { + idd = 314412; + movingEnable = true; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(common,blurScreen); [_this select 0] call FUNC(onMenuOpen);); + onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(common,blurScreen); [GVAR(MenuPFHID)] call CBA_fnc_removePerFrameHandler;); + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "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)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0.8)"; + 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 BottomBackground: CenterBackground { + y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "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)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 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 IconsBackGroundBar: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.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 = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = QUOTE(PATHTOF(data\background_img.paa)); + colorText[] = {1, 1, 1, 0.0}; + }; + class CatagoryLeft: HeaderName { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = CSTRING(EXAMINE_TREATMENT); + }; + class CatagoryCenter: CatagoryLeft { + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = CSTRING(STATUS); + }; + class CatagoryRight: CatagoryCenter{ + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = CSTRING(OVERVIEW); + }; + class Line: ACE_gui_backgroundBase { + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(1,1,1,0.5)"; + }; + + class iconImg1: ACE_gui_backgroundBase { + idc = 111; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + colorBackground[] = {0,0,0,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOF(data\icons\triage_card_small.paa)); + }; + class iconImg2: iconImg1 { + idc = 112; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\examine_patient_small.paa)); + }; + class iconImg3: iconImg1 { + idc = 113; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)); + }; + class iconImg4: iconImg1 { + idc = 114; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\medication_small.paa)); + }; + class iconImg5: iconImg1 { + idc = 115; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\airway_management_small.paa)); + }; + class iconImg6: iconImg1 { + idc = 116; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\advanced_treatment_small.paa)); + }; + class iconImg7: iconImg1 { + idc = 117; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\icon_carry.paa)); + }; + class iconImg8: iconImg1 { + idc = 118; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\toggle_self_small.paa)); + }; + + + class BtnIconLeft1: ACE_gui_buttonBase { + idc = 11; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(['triage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft2: BtnIconLeft1 { + idc = 12; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['examine'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft3: BtnIconLeft1 { + idc = 13; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['bandage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft4: BtnIconLeft1 { + idc = 14; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['medication'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft5: BtnIconLeft1 { + idc = 15; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['airway'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft6: BtnIconLeft1 { + idc = 16; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['advanced'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft7: BtnIconLeft1 { + idc = 17; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['drag'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft8: BtnIconLeft1 { + idc = 18; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['toggle'] call FUNC(handleUI_DisplayOptions);); + }; + + class TriageCardList: ACE_gui_listBoxBase { + idc = 212; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + }; + + // Left side + class BtnMenu1: BtnIconLeft1 { + idc = 20; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; + 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 = ""; + }; + class BtnMenu2: BtnMenu1 { + idc = 21; + y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu3: BtnMenu1 { + idc = 22; + y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu4: BtnMenu1 { + idc = 23; + y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text =""; + }; + class BtnMenu5: BtnMenu1 { + idc = 24; + y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu6: BtnMenu1 { + idc = 25; + y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu7: BtnMenu1 { + idc = 26; + y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu8: BtnMenu1 { + idc = 27; + y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + // center + + class bodyImgBackground: ACE_gui_backgroundBase { + idc = -1; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOEF(medical,ui\body_background.paa)); + }; + class bodyImgHead: bodyImgBackground { + idc = 50; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,0.75}; + colorText[] = {1,1,1,0.75}; + text = QUOTE(PATHTOEF(medical,ui\body_head.paa)); + }; + + class bodyImgTorso: bodyImgHead { + idc = 51; + text = QUOTE(PATHTOEF(medical,ui\body_torso.paa)); + }; + class bodyImgArms_l: bodyImgHead { + idc = 52; + text = QUOTE(PATHTOEF(medical,ui\body_arm_left.paa)); + }; + class bodyImgArms_r: bodyImgHead { + idc = 53; + text = QUOTE(PATHTOEF(medical,ui\body_arm_right.paa)); + }; + class bodyImgLegs_l: bodyImgHead { + idc = 54; + text = QUOTE(PATHTOEF(medical,ui\body_leg_left.paa)); + }; + class bodyImgLegs_r: bodyImgHead { + idc = 55; + text = QUOTE(PATHTOEF(medical,ui\body_leg_right.paa)); + }; + + + class selectHead: ACE_gui_buttonBase { + idc = 301; + x = "18.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(GVAR(selectedBodyPart) = 0; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectTorso : selectHead { + idc = 302; + x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 1; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftArm: selectHead{ + idc = 303; + x = "17.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 3; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightArm: selectLeftArm{ + idc = 304; + x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 2; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftLeg :selectHead { + idc = 305; + x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 5; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightLeg :selectLeftLeg { + idc = 306; + x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 4; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + + + class TriageTextBottom: HeaderName { + idc = 2000; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 1}; + colorBackground[] = {0,0.0,0.0,0.7}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + + // Right side + class InjuryList: ACE_gui_listBoxBase { + idc = 213; + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + }; + // bottom + + class ActivityLogHeader: CatagoryLeft { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {0.6, 0.7, 1.0, 1}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = CSTRING(ACTIVITY_LOG); + }; + class QuickViewHeader: ActivityLogHeader { + x = "19.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = CSTRING(QUICK_VIEW); + }; + class LineBottomHeaders: Line { + y = "19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + }; + class ActivityLog: InjuryList { + idc = 214; + //style = 16; + //type = 102; + //rows=1; + colorBackground[] = {0, 0, 0, 0}; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + //colorSelectBackground[] = {0, 0, 0, 0.0}; + //colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + //columns[] = {0.0, 0.08}; + //canDrag=true; + //arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + // arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + //idcLeft = -1; + //idcRight = -1; + }; + + class QuikViewLog: InjuryList { + idc = 215; + //style = 16; + //type = 102; + //rows=1; + colorBackground[] = {0, 0, 0, 0}; + x = "21.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "(19.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + + //columns[] = {0.0, 0.08}; + //canDrag=true; + //arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + // arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + drawSideArrows = 0; + //idcLeft = -1; + //idcRight = -1; + }; + + class selectTriageStatus: ACE_gui_buttonBase { + idc = 2001; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard);); + }; + class selectTriageStatusNone: selectTriageStatus { + idc = 2002; + x = 0; + y = 0; + w = 0; + h = 0; + text = ECSTRING(Medical,Triage_Status_None); + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),0)] call FUNC(setTriageStatus);); + }; + + class selectTriageStatusMinor: selectTriageStatus { + idc = 2003; + x = 0; + y = 0; + w = 0; + h = 0; + text = ECSTRING(Medical,Triage_Status_Minor); + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0.5,0,0.9)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),1)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDelayed: selectTriageStatus { + idc = 2004; + x = 0; + y = 0; + w = 0; + h = 0; + text = ECSTRING(Medical,Triage_Status_Delayed); + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),2)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusImmediate: selectTriageStatus { + idc = 2005; + x = 0; + y = 0; + w = 0; + h = 0; + text = ECSTRING(Medical,Triage_Status_Immediate); + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureOver = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(1,0.2,0.2,0.9)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),3)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDeceased: selectTriageStatus { + idc = 2006; + x = 0; + y = 0; + w = 0; + h = 0; + text = ECSTRING(Medical,Triage_Status_Deceased); + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),4)] call FUNC(setTriageStatus);); + }; + }; +}; diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index 49f7a0e65c..ee16870fe0 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -37,7 +37,7 @@ class CfgVehicles { displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMapFill); scope = 2; - isGlobal = 1; + isGlobal = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa)); functionPriority = 0; class Arguments { @@ -46,9 +46,9 @@ class CfgVehicles { description = CSTRING(MapDataAvailable_Description); typeName = "NUMBER"; class values { - class None {name = CSTRING(None); value = MAP_DETAIL_SAT; default = 1;}; - class Side {name = CSTRING(Side); value = MAP_DETAIL_TOPOROADS;}; - class Unique {name = CSTRING(Unique); value = MAP_DETAIL_NONE;}; + class Full {name = CSTRING(MapFill_Full); value = MAP_DETAIL_SAT; default = 1;}; + class Roads {name = CSTRING(MapFill_OnlyRoads); value = MAP_DETAIL_TOPOROADS;}; + class Disabled {name = CSTRING(MapFill_None); value = MAP_DETAIL_NONE;}; }; }; }; diff --git a/addons/microdagr/readme.md b/addons/microdagr/README.md similarity index 81% rename from addons/microdagr/readme.md rename to addons/microdagr/README.md index f2dc25a656..d7bcf01b40 100644 --- a/addons/microdagr/readme.md +++ b/addons/microdagr/README.md @@ -1,7 +1,7 @@ ace_microdagr =============== -Adds a microDAGR infentry GPS device. +Adds a MicroDAGR infantry GPS device. Press home to open. Then home again to toggle an interactive version. Press CTRL+Home to close. Info/Compass/Minimap modes are selectable by the bottom buttons. Tap the top bar to open the menu and access Mark/Waypoints/Connect To/Settings modes. Tap the minimap button again to toggle map modes (if available). @@ -9,13 +9,14 @@ Enter waypoints from the menu or double tapping on the minimap. Can interface with the `ace_vector`. Hold Azimuth+Range and release (see page 14 of vector's manual) #### Items Added: - `ACE_microDAGR` + ## For Mission Makers: #### Modules: -* MicroDAGR Map Fill - Controls the amount of map data avaialbe for the minimap. Can limit to just roads/topographical or disable entirely. +- MicroDAGR Map Fill - Controls the amount of map data available for the minimap. Can limit to just roads/topographical or disable entirely. + ## Maintainers diff --git a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf index 0822bdf310..86ace87b3e 100644 --- a/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf +++ b/addons/microdagr/functions/fnc_appMarkKeypadEntry.sqf @@ -6,7 +6,7 @@ * 0: String version of Keypad entry ["ok","del","1",...] * * Return Value: - * Nothing + * None * * Example: * ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry @@ -16,15 +16,12 @@ #include "script_component.hpp" private ["_display", "_editText", "_actualPos"]; -PARAMS_1(_keypadButton); + +params ["_keypadButton"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {}; diff --git a/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf b/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf index 1cf81963f5..589ec096fb 100644 --- a/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf +++ b/addons/microdagr/functions/fnc_appMenuButtonConnectRangefinder.sqf @@ -3,18 +3,18 @@ * Handles the "Connect To" button from the menu application * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder + * call ace_microdagr_fnc_appMenuButtonConnectRangefinder * * Public: No */ #include "script_component.hpp" -GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2}; +GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2); GVAR(rangeFinderPositionASL) = []; [APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode); diff --git a/addons/microdagr/functions/fnc_appSettingsLBClick.sqf b/addons/microdagr/functions/fnc_appSettingsLBClick.sqf index bc6779c10a..9e808559b2 100644 --- a/addons/microdagr/functions/fnc_appSettingsLBClick.sqf +++ b/addons/microdagr/functions/fnc_appSettingsLBClick.sqf @@ -7,7 +7,7 @@ * 1: Index * * Return Value: - * Nothing + * None * * Example: * [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick @@ -17,7 +17,7 @@ #include "script_component.hpp" disableSerialization; -PARAMS_2(_control,_itemClicked); +params ["", "_itemClicked"]; switch (_itemClicked) do { case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)}; diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf index 1acd936370..956e24c5ba 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonDeleteWP.sqf @@ -3,13 +3,13 @@ * Handles clicking the delete button from the waypoint application * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP + * call ace_microdagr_fnc_appWaypointsButtonDeleteWP * * Public: No */ @@ -18,12 +18,8 @@ private ["_display", "_wpIndex"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; _wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS); diff --git a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf index 881c0b3b5d..d2b3b0e20c 100644 --- a/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf +++ b/addons/microdagr/functions/fnc_appWaypointsButtonSetWP.sqf @@ -6,10 +6,10 @@ * The "SetWP" button * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_appWaypointsButtonSetWP + * [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP * * Public: No */ @@ -18,7 +18,7 @@ private ["_wpListBox", "_newWpIndex", "_waypoints"]; disableSerialization; -PARAMS_1(_wpButton); +params ["_wpButton"]; _wpListBox = (ctrlParent _wpButton) displayCtrl 144501; _newWpIndex = lbCurSel _wpListBox; diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index 9e54f927e0..70e8989031 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -6,32 +6,31 @@ * The display mode to test showing * * Return Value: - * Nothing + * None * * Example: - * [mode] call ace_microdagr_fnc_canShow + * [1] call ace_microdagr_fnc_canShow * * Public: No */ #include "script_component.hpp" - -PARAMS_1(_showType); +params ["_showType"]; private ["_returnValue"]; _returnValue = false; -switch (_showType) do { -case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close -case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide - -case (DISPLAY_MODE_DIALOG): { - _returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; +_returnValue = switch (_showType) do { + case (DISPLAY_MODE_CLOSED): { true }; //Can always close + case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide + case (DISPLAY_MODE_DIALOG): { + ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)} }; -case (DISPLAY_MODE_DISPLAY): { + case (DISPLAY_MODE_DISPLAY): { //Can't have minimap up while zoomed in - _returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; + (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)} }; + default { false }; }; _returnValue diff --git a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf index c383d0a95e..f99ec78354 100644 --- a/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceAddWaypoint.sqf @@ -8,7 +8,7 @@ * 1: Waypoint Position ASL * * Return Value: - * Nothing + * None * * Example: * ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint @@ -17,10 +17,11 @@ */ #include "script_component.hpp" -PARAMS_2(_waypointName,_waypointPosASL); - private "_waypoints"; +params ["_waypointName","_waypointPosASL"]; -_waypoints = ace_player getVariable [QGVAR(waypoints), []]; + + +_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; _waypoints pushBack [_waypointName, _waypointPosASL]; -ace_player setVariable [QGVAR(waypoints), _waypoints]; +ACE_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf index 62ca5a222a..d3681466b4 100644 --- a/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf +++ b/addons/microdagr/functions/fnc_deviceDeleteWaypoint.sqf @@ -7,7 +7,7 @@ * 0: Waypoint Index * * Return Value: - * Nothing + * None * * Example: * ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint @@ -16,13 +16,12 @@ */ #include "script_component.hpp" -PARAMS_1(_wpIndex); - private "_waypoints"; +params ["_wpIndex"]; -_waypoints = ace_player getVariable [QGVAR(waypoints), []]; +_waypoints = ACE_player getVariable [QGVAR(waypoints), []]; if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");}; _waypoints deleteAt _wpIndex; -ace_player setVariable [QGVAR(waypoints), _waypoints]; +ACE_player setVariable [QGVAR(waypoints), _waypoints]; diff --git a/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf b/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf index f90ecb06be..da3484ceb0 100644 --- a/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf +++ b/addons/microdagr/functions/fnc_deviceGetWaypoints.sqf @@ -4,7 +4,7 @@ * Device saving not implemented yet, just save to player object * * Arguments: - * Nothing + * None * * Return Value: * Waypoints @@ -16,4 +16,4 @@ */ #include "script_component.hpp" -(ace_player getVariable [QGVAR(waypoints), []]) +(ACE_player getVariable [QGVAR(waypoints), []]) diff --git a/addons/microdagr/functions/fnc_dialogClosedEH.sqf b/addons/microdagr/functions/fnc_dialogClosedEH.sqf index 0a7e5e5115..5180734644 100644 --- a/addons/microdagr/functions/fnc_dialogClosedEH.sqf +++ b/addons/microdagr/functions/fnc_dialogClosedEH.sqf @@ -3,13 +3,13 @@ * Handles the dialog closeing, switches back to display mode * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * [] call ace_microdagr_fnc_dialogClosedEH + * call ace_microdagr_fnc_dialogClosedEH * * Public: No */ diff --git a/addons/microdagr/functions/fnc_mapButtonDownEH.sqf b/addons/microdagr/functions/fnc_mapButtonDownEH.sqf index e7d2618160..566f08dc66 100644 --- a/addons/microdagr/functions/fnc_mapButtonDownEH.sqf +++ b/addons/microdagr/functions/fnc_mapButtonDownEH.sqf @@ -10,7 +10,7 @@ * 3: MousePosY * * Return Value: - * Nothing + * None * * Example: * [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +params ["", "_mouseButton"]; //Only handle RMB if (_mouseButton != 1) exitWith {}; diff --git a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf index 21a164ff2e..2226011215 100644 --- a/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf +++ b/addons/microdagr/functions/fnc_mapDoubleTapEH.sqf @@ -9,7 +9,7 @@ * 3: MousePosY * * Return Value: - * Nothing + * None * * Example: * [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -PARAMS_4(_theMap,_mouseButton,_xPos,_yPos); +params ["_theMap", "_mouseButton", "_xPos", "_yPos"]; private ["_worldPos"]; @@ -26,7 +26,7 @@ private ["_worldPos"]; if (_mouseButton != 0) exitWith {}; _worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos]; -_worldPos set [2, (getTerrainHeightASL _worldPos)]; +_worldPos pushBack (getTerrainHeightASL _worldPos); GVAR(newWaypointPosition) = _worldPos; [APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode); diff --git a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf index 644064d069..a74255601c 100644 --- a/addons/microdagr/functions/fnc_mapOnDrawEH.sqf +++ b/addons/microdagr/functions/fnc_mapOnDrawEH.sqf @@ -6,7 +6,7 @@ * 0: The Map * * Return Value: - * Nothing + * None * * Example: * [compassMap] call ace_microdagr_fnc_mapOnDrawEH @@ -15,10 +15,10 @@ */ #include "script_component.hpp" -PARAMS_1(_theMap); - private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"]; +params ["_theMap"]; + _mapSize = (ctrlPosition _theMap) select 3; _waypoints = [] call FUNC(deviceGetWaypoints); @@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then { _theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS]; ctrlMapAnimCommit _theMap; _size = 412 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ]; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ]; if (GVAR(currentWaypoint) != -1) then { @@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then { }; }; if ((count _targetPos) == 3) then { - _relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo; + _relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo; _theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ]; }; }; } else { //Map Mode: if (GVAR(mapAutoTrackPosition)) then { - _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)]; + _theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)]; ctrlMapAnimCommit _theMap; }; _size = 48 * _mapSize; - _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ]; + _theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ]; if (GVAR(settingShowAllWaypointsOnMap)) then { _size = 32 * _mapSize; { - EXPLODE_2_PVT(_x,_wpName,_wpPos); + _x params ["_wpName", "_wpPos"]; _alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5}; _theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ]; } forEach _waypoints; diff --git a/addons/microdagr/functions/fnc_modeMapButtons.sqf b/addons/microdagr/functions/fnc_modeMapButtons.sqf index 5de4bf9ca7..a0d74bec49 100644 --- a/addons/microdagr/functions/fnc_modeMapButtons.sqf +++ b/addons/microdagr/functions/fnc_modeMapButtons.sqf @@ -6,7 +6,7 @@ * 0: String of the map button pressed * * Return Value: - * Nothing + * None * * Example: * ["autotrack"] call ace_microdagr_fnc_modeMapButtons @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_mode); +params ["_mode"]; [-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom diff --git a/addons/microdagr/functions/fnc_moduleMapFill.sqf b/addons/microdagr/functions/fnc_moduleMapFill.sqf index d07b0bc518..03089a4ff4 100644 --- a/addons/microdagr/functions/fnc_moduleMapFill.sqf +++ b/addons/microdagr/functions/fnc_moduleMapFill.sqf @@ -4,23 +4,18 @@ * * Arguments: * 0: logic - * 1: synced units-not used - * 2: Module Activated * * Return Value: - * Nothing + * None * * Example: - * [module, [], true] call ace_microdagr_fnc_moduleMapFill + * [module] call ace_microdagr_fnc_moduleMapFill * * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedUnits,_activated); +if !(isServer) exitWith {}; +params ["_logic"]; -if (!_activated) exitWith {WARNING("Module Placed but not active");}; - -if (isServer) then { - [_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule); -}; +[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule); diff --git a/addons/microdagr/functions/fnc_openDisplay.sqf b/addons/microdagr/functions/fnc_openDisplay.sqf index b4cec0fe46..aa2db94827 100644 --- a/addons/microdagr/functions/fnc_openDisplay.sqf +++ b/addons/microdagr/functions/fnc_openDisplay.sqf @@ -6,7 +6,7 @@ * 0: Display Mode to show the microDAGR in * * Return Value: - * Nothing + * None * * Example: * [1] call ace_microdagr_fnc_openDisplay @@ -15,9 +15,9 @@ */ #include "script_component.hpp" -private ["_oldShowMode", "_args", "_pfID", "_player"]; +private ["_oldShowMode", "_args", "_player"]; -DEFAULT_PARAM(0,_newDisplayShowMode,-1); +params [["_newDisplayShowMode", -1, [-1]]]; _oldShowMode = GVAR(currentShowMode); if (_newDisplayShowMode == -1) then { @@ -30,11 +30,10 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] c if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN}; - //On first-startup if (GVAR(currentApplicationPage) == APP_MODE_NULL) then { GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY; - GVAR(mapPosition) = getPos ace_player; + GVAR(mapPosition) = getPos ACE_player; }; if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then { @@ -74,14 +73,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M //Start a pfeh to update display and handle hiding display [{ - PARAMS_2(_args,_pfID); - EXPLODE_1_PVT(_args,_player); - if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then { + params ["_args", "_idPFH"]; + _args params ["_player"]; + if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then { //Close Display if still open: if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then { [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); }; - [_pfID] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; } else { if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then { //If display is hidden, and we can show, then swithc modes: @@ -96,5 +95,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M }; }; }; - }, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler; + }, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf index 154dfff94a..8b2c6672a8 100644 --- a/addons/microdagr/functions/fnc_recieveRangefinderData.sqf +++ b/addons/microdagr/functions/fnc_recieveRangefinderData.sqf @@ -8,7 +8,7 @@ * 2: Inclination (Degrees) * * Return Value: - * Nothing + * None * * Example: * [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData @@ -19,7 +19,7 @@ private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"]; -PARAMS_3(_slopeDistance,_azimuth,_inclination); +params ["_slopeDistance", "_azimuth", "_inclination"]; if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected" if (_slopeDistance < 0) exitWith {}; //Bad Data @@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance; _targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance]; //This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different -_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset; +_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset; GVAR(rangeFinderPositionASL) = _targetPosASL; diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index 64a5cab991..7cbec9f242 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -7,7 +7,7 @@ * 0: New Mode * * Return Value: - * Nothing + * None * * Example: * [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode @@ -16,24 +16,21 @@ */ #include "script_component.hpp" -private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"]; +private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"]; -PARAMS_1(_newMode); +params ["_newMode"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; if (GVAR(currentApplicationPage) == 2) then { - _theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS}; + _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture)); _mapCtrlPos = ctrlPosition _theMap; - _mapSize = _mapCtrlPos select 3; - _centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)]; + + _mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"]; + _centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)]; GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos; GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index 3c042fdff3..dba6b54f18 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -3,10 +3,10 @@ * Changes the "application page" shown on the microDAGR * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_microdagr_fnc_showApplicationPage @@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; //TopBar diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 910f422c75..826ea55e6c 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -3,10 +3,10 @@ * Updates the display (several times a second) called from the pfeh * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: * [] call ace_microdagr_fnc_updateDisplay @@ -15,15 +15,11 @@ */ #include "script_component.hpp" -private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"]; +private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"]; disableSerialization; -_display = displayNull; -if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { - _display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]); -} else { - _display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]); -}; +_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull]; + if (isNull _display) exitWith {ERROR("No Display");}; //Fade "shell" at night @@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): { (_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText; //Elevation: - _numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude); + _numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; _aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"}; (_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText; //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText; //Speed: - (_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];; + (_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];; if (GVAR(currentWaypoint) == -1) then { @@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): { }; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo; + _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; _numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude); _aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber; @@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): { case (APP_MODE_COMPASS): { //Heading: _compassAngleText = if (GVAR(settingUseMils)) then { - [(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber; + [(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber; } else { - ([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 + ([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; (_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText; //Speed: - _SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];; + _SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];; (_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText; if (GVAR(currentWaypoint) == -1) then { @@ -126,8 +122,6 @@ case (APP_MODE_COMPASS): { (_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText ""; (_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText ""; } else { - _playerPos2d = (getPosASL ace_player) select [0,2]; - _targetPosName = ""; _targetPosLocationASL = []; @@ -147,13 +141,13 @@ case (APP_MODE_COMPASS): { _rangeText = "---"; if (!(_targetPosLocationASL isEqualTo [])) then { - _bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo; + _bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo; _bearingText = if (GVAR(settingUseMils)) then { [(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber; } else { ([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8 }; - _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000; _rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)]; }; @@ -169,9 +163,9 @@ case (APP_MODE_WAYPOINTS): { lbClear _wpListBox; { - EXPLODE_2_PVT(_x,_wpName,_wpPos); + _x params ["_wpName", "_wpPos"]; _wpListBox lbAdd _wpName; - _2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000; + _2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000; _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])]; } forEach _waypoints; diff --git a/addons/microdagr/gui_controls.hpp b/addons/microdagr/gui_controls.hpp index 50e9083ed6..270a3325bd 100644 --- a/addons/microdagr/gui_controls.hpp +++ b/addons/microdagr/gui_controls.hpp @@ -77,14 +77,8 @@ class controlsBackground { sizeExLevel = 0; sizeEx = H_PART(1); - ptsPerSquareSea = 5; - ptsPerSquareTxt = 20; - ptsPerSquareRoad = 0.01; + ptsPerSquareRoad = 0.75; ptsPerSquareObj = 2000; //don't show buildings - ptsPerSquareCLn = 100; - ptsPerSquareCost = 200; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; showCountourInterval = 0; @@ -116,14 +110,7 @@ class controlsBackground { onMouseButtonDblClick = QUOTE(_this call FUNC(mapDoubleTapEH)); onMouseButtonDown = QUOTE(_this call FUNC(mapButtonDownEH)); - // ptsPerSquareSea = 5; - // ptsPerSquareTxt = 20; - // ptsPerSquareRoad = 0.01; ptsPerSquareObj = 9; - // ptsPerSquareCLn = 100; - // ptsPerSquareCost = 200; - // ptsPerSquareFor = 9; - // ptsPerSquareForEdge = 9; maxSatelliteAlpha = 0.5; @@ -711,14 +698,18 @@ class controls { y = Y_PART(2); w = W_PART(24.6); h = H_PART(19); - onLBDblClick = QUOTE(_this call FUNC(appSettingsLBClick)); + // onLBDblClick = QUOTE(_this call FUNC(appSettingsLBClick)); + onLBSelChanged = QUOTE(_this call FUNC(appSettingsLBClick)); sizeEx = H_PART(1.5); sizeEx2 = H_PART(1.5); rowHeight = H_PART(1.75); itemSpacing = 0.001; colorText[] = {0.75,0.75,0.75,1}; + colorTextRight[] = {0.75,0.75,0.75,1}; colorSelect[] = {0.75,0.75,0.75,1}; colorSelect2[] = {0.75,0.75,0.75,1}; + colorSelectRight[] = {0.75,0.75,0.75,1}; + colorSelect2Right[] = {0.75,0.75,0.75,1}; colorBackground[] = {0.05,0.05,0.05,1}; colorSelectBackground[] = {0.05,0.05,0.05,1}; colorSelectBackground2[] = {0.05,0.05,0.05,1}; diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index a636ffa4de..d3a955580a 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -283,7 +283,7 @@ Configurar MicroDAGR Настроить MicroDAGR Konfigurovat MicroDAGR - Konfiguruj MicroDAGR + Otwórz MicroDAGR Configurer MicroDAGR MicroDAGR konfigurálása ConfiguraMicroDAGR @@ -325,7 +325,7 @@ Kolik informací je načteno do MicroDAGR? Quanta informação é preenchida no mapa do MicroDAGR - + Full Satellite + Buildings Pełna satelitarna + budynki Satelite completo + Edificios @@ -333,7 +333,7 @@ Satelit + Budovy Satélite completo + Edifícios - + Topographical + Roads Topograficzna + drogi Topografico + Carreteras @@ -341,7 +341,7 @@ Topografické + Cesty Topográfico + Estradas - + None (Cannot use map view) Żadna (wyłącza ekran mapy) Nada (No se puede el mapa) @@ -358,4 +358,4 @@ Controla quantos dados são preenchidos nos itens microDAGR. Menos dados restringe a visualização de mapa para mostrar menos informações no minimapa<br/>Fonte: MicroDAGR.pbo - + \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_handleHandoff.sqf b/addons/missileguidance/functions/fnc_handleHandoff.sqf index 017a9c0160..7145bc0038 100644 --- a/addons/missileguidance/functions/fnc_handleHandoff.sqf +++ b/addons/missileguidance/functions/fnc_handleHandoff.sqf @@ -3,4 +3,4 @@ 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 +[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 1eb791a058..7fc77fdd56 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -101,12 +101,12 @@ _args = [_this, // _guidingUnit = ACE_player; // // if(local _guidingUnit) then { -// [FUNC(guidancePFH), 0, _args ] call cba_fnc_addPerFrameHandler; +// [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; + [FUNC(guidancePFH), 0, _args ] call CBA_fnc_addPerFrameHandler; //}; diff --git a/addons/missionmodules/README.md b/addons/missionmodules/README.md new file mode 100644 index 0000000000..0b8950d3fe --- /dev/null +++ b/addons/missionmodules/README.md @@ -0,0 +1,11 @@ +ace_missionmodules +=========== + +Adds mission modules. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index 9b4c46ec10..70ef644384 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -117,7 +117,7 @@ if (_activated && local _logic) then { }; }; }; - }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, ACE_time] ] call cba_fnc_addPerFrameHandler; + }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, ACE_time] ] call CBA_fnc_addPerFrameHandler; }; true; diff --git a/addons/mk6mortar/README.md b/addons/mk6mortar/README.md index 84c7a6e984..3e5109f38f 100644 --- a/addons/mk6mortar/README.md +++ b/addons/mk6mortar/README.md @@ -1,7 +1,8 @@ ace_mk6mortar ========== -Tweaks the mk6 mortar from Arma3 +Tweaks the Nk6 Mortar system. + ## Maintainers diff --git a/addons/modules/README.md b/addons/modules/README.md new file mode 100644 index 0000000000..b13743b981 --- /dev/null +++ b/addons/modules/README.md @@ -0,0 +1,11 @@ +ace_modules +=========== + +Provides framework for module handling. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/mx2a/README.md b/addons/mx2a/README.md index cbaf9add1b..f03edf1849 100644 --- a/addons/mx2a/README.md +++ b/addons/mx2a/README.md @@ -3,8 +3,9 @@ ace_mx2a Adds the MX-2A thermal imaging device. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/nametags/ACE_Settings.hpp b/addons/nametags/ACE_Settings.hpp index e976c4adc8..354d5748bf 100644 --- a/addons/nametags/ACE_Settings.hpp +++ b/addons/nametags/ACE_Settings.hpp @@ -4,6 +4,7 @@ class ACE_Settings { typeName = "COLOR"; isClientSettable = 1; displayName = CSTRING(DefaultNametagColor); + category = CSTRING(Module_DisplayName); }; class GVAR(showPlayerNames) { value = 1; @@ -11,30 +12,35 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(ShowPlayerNames); description = CSTRING(ShowPlayerNames_Desc); - values[] = {CSTRING(Disabled), CSTRING(Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; + values[] = {ECSTRING(common,Disabled), ECSTRING(common,Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; + category = CSTRING(Module_DisplayName); }; class GVAR(showPlayerRanks) { value = 1; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowPlayerRanks); + category = CSTRING(Module_DisplayName); }; class GVAR(showVehicleCrewInfo) { value = 1; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowVehicleCrewInfo); + category = CSTRING(Module_DisplayName); }; class GVAR(showNamesForAI) { value = 0; typeName = "BOOL"; isClientSettable = 1; displayName = CSTRING(ShowNamesForAI); + category = CSTRING(Module_DisplayName); }; class GVAR(showCursorTagForVehicles) { value = 0; typeName = "BOOL"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(showSoundWaves) { value = 1; @@ -42,17 +48,20 @@ class ACE_Settings { isClientSettable = 1; displayName = CSTRING(ShowSoundWaves); description = CSTRING(ShowSoundWaves_Desc); - values[] = {CSTRING(Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; + values[] = {ECSTRING(common,Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; + category = CSTRING(Module_DisplayName); }; class GVAR(playerNamesViewDistance) { value = 5; typeName = "SCALAR"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(playerNamesMaxAlpha) { value = 0.8; typeName = "SCALAR"; isClientSettable = 0; + category = CSTRING(Module_DisplayName); }; class GVAR(tagSize) { value = 2; @@ -61,5 +70,6 @@ class ACE_Settings { displayName = CSTRING(TagSize_Name); description = CSTRING(TagSize_Description); values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + category = CSTRING(Module_DisplayName); }; }; diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index 6c0c148e47..f6e28095b4 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -16,7 +16,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { @@ -54,7 +54,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { @@ -74,7 +74,7 @@ class CfgVehicles { class values { class DoNotForce { default = 1; - name = CSTRING(DoNotForce); + name = ECSTRING(common,DoNotForce); value = -1; }; class ForceHide { diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index efc634be6c..b828d70005 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -66,8 +66,8 @@ GVAR(showNamesTime) = -10; // Change settings accordingly when they are changed ["SettingChanged", { - PARAMS_1(_name); - if (_name == QGVAR(showPlayerNames)) then { + params ["_name"]; + if (_name == QGVAR(showPlayerNames)) then { call FUNC(updateSettings); }; }] call EFUNC(common,addEventHandler); diff --git a/addons/nametags/functions/fnc_canShow.sqf b/addons/nametags/functions/fnc_canShow.sqf index b53f50c93e..5bccc8f91d 100644 --- a/addons/nametags/functions/fnc_canShow.sqf +++ b/addons/nametags/functions/fnc_canShow.sqf @@ -10,16 +10,12 @@ * Can show Crew Info * * Example: - * call ace_nametags_fnc_doShow + * call ace_nametags_fnc_canShow * * Public: No */ #include "script_component.hpp" -private ["_player"]; - -_player = ACE_player; - -vehicle _player != _player && +((vehicle ACE_player) != ACE_player) && {GVAR(ShowCrewInfo)} && -{!(vehicle _player isKindOf "ParachuteBase")}; +{!(vehicle ACE_player isKindOf "ParachuteBase")}; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index 021a4e2a0b..7c98be16ed 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -13,26 +13,26 @@ * None * * Example: - * [ACE_player, _target, _alpha, _distance * 0.026, _icon] call ace_nametags_fnc_drawNameTagIcon + * [ACE_player, bob, 0.5, height, ICON_NAME_SPEAK] call ace_nametags_fnc_drawNameTagIcon * * Public: No */ #include "script_component.hpp" -PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType); - -private ["_position", "_color", "_name", "_rank", "_size", "_icon", "_scale"]; +params ["_player", "_target", "_alpha", "_heightOffset", "_iconType"]; if (_iconType == ICON_NONE) exitWith {}; //Don't waste time if not visable +private ["_position", "_color", "_name", "_size", "_icon", "_scale"]; + //Set Icon: _icon = ""; _size = 0; -if ((_iconType == ICON_NAME_SPEAK) || (_iconType == ICON_SPEAK)) then { +if (_iconType in [ICON_NAME_SPEAK, ICON_SPEAK]) then { _icon = QUOTE(PATHTOF(UI\soundwave)) + str (floor (random 10)) + ".paa"; _size = 1; - _alpha = _alpha max 0.6;//Boost alpha when speaking + _alpha = (_alpha max 0.2) + 0.2;//Boost alpha when speaking } else { if (_iconType == ICON_NAME_RANK) then { _icon = format["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa",(toLower(rank _target))]; @@ -50,7 +50,7 @@ _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { }; //Set Color: -if !(group _target == group _player) then { +if ((group _target) != (group _player)) then { _color = +GVAR(defaultNametagColor); //Make a copy, then multiply both alpha values (allows client to decrease alpha in settings) _color set [3, (_color select 3) * _alpha]; } else { @@ -58,7 +58,7 @@ if !(group _target == group _player) then { }; // Convert position to ASLW (expected by drawIcon3D) and add height offsets -_position = _target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .35)]); +_position = _target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .3)]); _scale = [0.333, 0.5, 0.666, 0.83333, 1] select GVAR(tagSize); diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf index 6d83b0f573..b0e0b1ff34 100644 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ b/addons/nametags/functions/fnc_getVehicleData.sqf @@ -22,7 +22,7 @@ private ["_type", "_varName", "_data", "_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"]; -PARAMS_1(_type); +params ["_type"]; _varName = format ["ACE_CrewInfo_Cache_%1", _type]; _data = + (uiNamespace getVariable _varName); diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 897d223930..9299611d3b 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -19,7 +19,7 @@ if (isServer) then { //If someone disconnects while speaking, reset their variable addMissionEventHandler ["HandleDisconnect", { - PARAMS_1(_disconnectedPlayer); + params ["_disconnectedPlayer"]; if (_disconnectedPlayer getVariable [QGVAR(isSpeakingInGame), false]) then { _disconnectedPlayer setVariable [QGVAR(isSpeakingInGame), false, true]; }; @@ -30,7 +30,7 @@ if (!hasInterface) exitWith {}; ["playerChanged", { //When player changes, make sure to reset old unit's variable - PARAMS_2(_newUnit,_oldUnit); + params ["", "_oldUnit"]; if ((!isNull _oldUnit) && {_oldUnit getVariable [QGVAR(isSpeakingInGame), false]}) then { _oldUnit setVariable [QGVAR(isSpeakingInGame), false, true]; }; @@ -40,14 +40,14 @@ if (!hasInterface) exitWith {}; if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { diag_log text format ["[ACE_nametags] - ACRE Detected"]; DFUNC(isSpeaking) = { - PARAMS_1(_unit); - (([_unit] call acre_api_fnc_isSpeaking) || ([ACE_player] call acre_api_fnc_isBroadcasting)) && {!(_unit getVariable ["ACE_isUnconscious", false])} + params ["_unit"]; + (([_unit] call acre_api_fnc_isSpeaking) || {[ACE_player] call acre_api_fnc_isBroadcasting}) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { if (isClass (configFile >> "cfgPatches" >> "task_force_radio")) then { diag_log text format ["[ACE_nametags] - TFR Detected"]; DFUNC(isSpeaking) = { - PARAMS_1(_unit); + params ["_unit"]; (_unit getVariable ["tf_isSpeaking", false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; } else { @@ -64,7 +64,7 @@ if (isClass (configFile >> "cfgPatches" >> "acre_api")) then { } , 0.1, []] call CBA_fnc_addPerFrameHandler; DFUNC(isSpeaking) = { - PARAMS_1(_unit); + params ["_unit"]; (_unit getVariable [QGVAR(isSpeakingInGame), false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} }; }; diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index 7a6d2fa3c8..1b209cb32a 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -1,6 +1,5 @@ /* * Author: esteldunedain - * * Initializes the name tags module. * * Arguments: @@ -14,7 +13,7 @@ if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 43996e17b2..bbf608b75a 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -17,8 +17,8 @@ private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target", "_targetEyePosASL", "_ambientBrightness", "_maxDistance"]; -//don't show nametags in spectator -if ((isNull ACE_player) || {!alive ACE_player}) exitWith {}; +//don't show nametags in spectator or if RscDisplayMPInterrupt is open +if ((isNull ACE_player) || {!alive ACE_player} || {!isNull (findDisplay 49)}) exitWith {}; _ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, 0.4] select ((currentVisionMode ace_player) != 0))) min 1) max 0; _maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance); @@ -63,6 +63,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { {GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { _distance = ACE_player distance _target; + if (_distance > (_maxDistance + 5)) exitWith {}; _alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax; _icon = ICON_NONE; if (GVAR(showSoundWaves) == 2) then { //icon will be drawn below, so only show name here @@ -116,5 +117,6 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; - } forEach _targets; + nil + } count _targets; }; diff --git a/addons/nametags/functions/fnc_setText.sqf b/addons/nametags/functions/fnc_setText.sqf index 33112c31d0..842c765de1 100644 --- a/addons/nametags/functions/fnc_setText.sqf +++ b/addons/nametags/functions/fnc_setText.sqf @@ -17,7 +17,7 @@ #define TextIDC 11123 -PARAMS_1(_text); +params ["_text"]; private["_ctrl"]; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index e811b3447c..a0048c4076 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -149,14 +149,6 @@ Zobrazit jména a hodnosti pro spřátelené AI jednotky? Výchozí: Nevynucovat Mostra o nome e patente para unidades IA aliadas? Padrão: Não forçar - - Do Not Force - Nie wymuszaj - No forzar - Nicht erzwingen - Nevynucovat - Não forçar - Force Hide Wymuś ukrycie @@ -213,22 +205,6 @@ Tento modul umožňuje si přizpůsobit nastavení a vzdálenost jmenovky. Este módulo permite que você personalize as configurações e distâncias de etiquetas de nome. - - Disabled - Wyłączone - Desactivado - Deaktiviert - Zakázáno - Desativado - - - Enabled - Włączone - Activado - Aktiviert - Povoleno - Ativado - Only on Cursor Tylko pod kursorem diff --git a/addons/noidle/README.md b/addons/noidle/README.md new file mode 100644 index 0000000000..4ea313bd57 --- /dev/null +++ b/addons/noidle/README.md @@ -0,0 +1,11 @@ +ace_noidle +=========== + +Removes idle animations. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/addons/norearm/README.md b/addons/norearm/README.md new file mode 100644 index 0000000000..f0035e5749 --- /dev/null +++ b/addons/norearm/README.md @@ -0,0 +1,11 @@ +ace_norearm +=========== + +Removes rearm action. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/addons/optics/CfgEventHandlers.hpp b/addons/optics/CfgEventHandlers.hpp index 6c6e824b16..68962af2c4 100644 --- a/addons/optics/CfgEventHandlers.hpp +++ b/addons/optics/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_FILE(XEH_preInit)); diff --git a/addons/optics/CfgJointRails.hpp b/addons/optics/CfgJointRails.hpp new file mode 100644 index 0000000000..86c962afe5 --- /dev/null +++ b/addons/optics/CfgJointRails.hpp @@ -0,0 +1,15 @@ +class asdg_OpticRail; +class asdg_OpticRail1913: asdg_OpticRail { + class compatibleItems { + ACE_optic_Hamr_2D = 1; + ACE_optic_Hamr_PIP = 1; + ACE_optic_Arco_2D = 1; + ACE_optic_Arco_PIP = 1; + ACE_optic_MRCO_2D = 1; + ACE_optic_MRCO_PIP = 1; + ACE_optic_SOS_2D = 1; + ACE_optic_SOS_PIP = 1; + ACE_optic_LRPS_2D = 1; + ACE_optic_LRPS_PIP = 1; + }; +}; diff --git a/addons/optics/CfgOpticsEffect.hpp b/addons/optics/CfgOpticsEffect.hpp index a1bf62d6e3..8638277732 100644 --- a/addons/optics/CfgOpticsEffect.hpp +++ b/addons/optics/CfgOpticsEffect.hpp @@ -1,4 +1,3 @@ - class CfgOpticsEffect { class ACE_OpticsRadBlur1 { type = "radialblur"; diff --git a/addons/optics/CfgPreloadTextures.hpp b/addons/optics/CfgPreloadTextures.hpp index 57fa2cabf8..1354f91e18 100644 --- a/addons/optics/CfgPreloadTextures.hpp +++ b/addons/optics/CfgPreloadTextures.hpp @@ -1,4 +1,3 @@ - #define MACRO_PRELOAD \ GVAR(BodyDay) = "*"; \ GVAR(BodyNight) = "*"; \ diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index b7d2005d77..3bbd6b62bc 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -1,4 +1,3 @@ - class RscOpticsValue; class RscMapControl; class RscText; @@ -111,7 +110,7 @@ class RscInGameUI { idc = 1713011; x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; colorBackground[] = {0,0,0,1}; - }; + }; }; class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { diff --git a/addons/optics/CfgVehicles.hpp b/addons/optics/CfgVehicles.hpp index 92abeac04f..eda9a3d930 100644 --- a/addons/optics/CfgVehicles.hpp +++ b/addons/optics/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CfgVehicles { class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 11fdb1f427..1be66d3aa2 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -1,18 +1,17 @@ - class CfgWeapons { class ItemCore; class InventoryOpticsItem_Base_F; 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 + modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees 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..? + minRange = 500; //500 = seem almost never use it..? minRangeProbab = 0.001; midRange = 1000; midRangeProbab = 0.01; diff --git a/addons/optics/README.md b/addons/optics/README.md index 2d7281cee7..a5224267b7 100644 --- a/addons/optics/README.md +++ b/addons/optics/README.md @@ -1,7 +1,7 @@ ace_optics =============== -Adds animated 2D optics. Some of them use picture in picture. +Adds animated 2D and PiP (picture-in-picture) optics. ## Maintainers diff --git a/addons/optics/config.cpp b/addons/optics/config.cpp index 224410cdec..79f71842ee 100644 --- a/addons/optics/config.cpp +++ b/addons/optics/config.cpp @@ -30,5 +30,6 @@ class CfgPatches { #include "CfgRscTitles.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" +#include "CfgJointRails.hpp" #include "CfgPreloadTextures.hpp" diff --git a/addons/optionsmenu/CfgEventHandlers.hpp b/addons/optionsmenu/CfgEventHandlers.hpp index b97829836e..917a0acbd7 100644 --- a/addons/optionsmenu/CfgEventHandlers.hpp +++ b/addons/optionsmenu/CfgEventHandlers.hpp @@ -1,5 +1,10 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE(call COMPILE_FILE(XEH_preInit)); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; }; diff --git a/addons/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf new file mode 100644 index 0000000000..a981c34e0b --- /dev/null +++ b/addons/optionsmenu/XEH_postInit.sqf @@ -0,0 +1,11 @@ + +#include "script_component.hpp" + +["SettingsInitialized", { + GVAR(categories) pushback ""; //Ensure All Catagories is at top + { + if !(_x select 8 in GVAR(categories)) then { + GVAR(categories) pushback (_x select 8); + }; + }foreach EGVAR(common,settings); +}] call EFUNC(common,addEventHandler); diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index e35784560a..21f64c4f46 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -10,16 +10,19 @@ PREP(onSliderPosChanged); PREP(onServerSaveInputField); PREP(onServerSettingsMenuOpen); PREP(onServerListBoxShowSelectionChanged); +PREP(onCategorySelectChanged); PREP(resetSettings); PREP(serverResetSettings); PREP(settingsMenuUpdateKeyView); PREP(settingsMenuUpdateList); PREP(serverSettingsMenuUpdateKeyView); PREP(serverSettingsMenuUpdateList); +PREP(onServerCategorySelectChanged); PREP(updateSetting); PREP(exportSettings); PREP(toggleIncludeClientSettings); PREP(moduleAllowConfigExport); +PREP(stringEscape); GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; @@ -29,5 +32,7 @@ GVAR(ClientSettingsExportIncluded) = false; GVAR(serverSideOptions) = []; GVAR(serverSideColors) = []; GVAR(serverSideValues) = []; +GVAR(categories) = []; +GVAR(currentCategorySelection) = 0; ADDON = true; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index fa76b8752a..172a95808e 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" -private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"]; +private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry", "_formatedValue"]; { /*_settingData = [ @@ -40,25 +40,39 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localize if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then { _value = missionNamespace getvariable [_name, _defaultValue]; - if (_typeName == "STRING") then { // I dont think we have string values, but just in case - _value = format['"%1"', _value]; - }; - if (_typeName == "BOOL") then { - _value = if (typeName _value == "BOOL" && {_value}) then {1} else {0}; + _formatedValue = switch (toLower _typeName) do { + case ("scalar"): { + format['value = %1;', _value]; + }; + case ("string"): { + format['value = "%1";', _value]; + }; + case ("bool"): { + if (typeName _value != "BOOL") then {ERROR("weird bool typename??");}; + _value = if (((typeName _value) == "BOOL") && {_value}) then {1} else {0}; + format ['value = %1;', _value]; + }; + case ("color"): { + _value params [["_r",1], ["_b",0], ["_g",1], ["_a",1]]; + format ["value[] = {%1, %2, %3, %4};", _r, _b, _g, _a]; + }; + default { + ERROR("unknown typeName"); + "" + }; + }; _compiledConfigEntry = format [" class %1 { - value = %2; + %2 typeName = %3; force = 1; -};", _name, _value, format['"%1"', _typeName]]; +};", _name, _formatedValue, format['"%1"', _typeName]]; "ace_clipboard" callExtension _compiledConfigEntry; }; } forEach EGVAR(common,settings); - "ace_clipboard" callExtension "--COMPLETE--"; +"ace_clipboard" callExtension "--COMPLETE--"; [LSTRING(settingsExported)] call EFUNC(common,displayTextStructured); - - diff --git a/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf new file mode 100644 index 0000000000..3129e32bef --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onCategorySelectChanged.sqf @@ -0,0 +1,27 @@ +/* + * Author: Glowbal + * Changes which category is selected + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onCategorySelectChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlComboBox"]; + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; + +_ctrlComboBox = (_settingsMenu displayCtrl 14); +GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; + +[true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 1543a2c8d5..b122d0da0e 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -18,24 +18,28 @@ private ["_settingIndex", "_rightDropDownIndex"]; -_settingIndex = lbCurSel 200; //Index of left list _rightDropDownIndex = lbCurSel 400; //Index of right drop down - if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; +if (_settingIndex == -1) exitWith {}; + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { - _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; - [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; + [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); }; [false] call FUNC(settingsMenuUpdateList); - }; + }; case (MENU_TAB_SERVER_OPTIONS): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideOptions)))) then { - _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; - [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + _settingIndex = (GVAR(serverSideOptions) select _settingIndex) select 0; + [MENU_TAB_SERVER_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); }; [false] call FUNC(serverSettingsMenuUpdateList); - }; + }; }; diff --git a/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf new file mode 100644 index 0000000000..d134cda993 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onServerCategorySelectChanged.sqf @@ -0,0 +1,26 @@ +/* + * Author: Glowbal + * Changes which category is selected + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onCategorySelectChanged + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlComboBox"]; +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; + +_ctrlComboBox = (_settingsMenu displayCtrl 14); +GVAR(currentCategorySelection) = lbCurSel _ctrlComboBox; + +[true] call FUNC(serverSettingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf index b8eb630f85..fde370426f 100644 --- a/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSaveInputField.sqf @@ -18,9 +18,13 @@ private ["_settingIndex", "_inputText", "_setting", "_settingName", "_convertedValue"]; -_settingIndex = lbCurSel 200; //Index of left list _inputText = ctrlText 414; //Index of right drop down +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; + switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_VALUES): { if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(serverSideValues)))) then { @@ -29,7 +33,10 @@ switch (GVAR(optionMenu_openTab)) do { _settingName = _setting select 0; _convertedValue = switch (toUpper (_setting select 1)) do { - case "STRING": {format ['"%1"', _inputText]}; + case "STRING": { + ctrlSetText [414, _inputText call FUNC(stringEscape)]; + format ['%1', _inputText call FUNC(stringEscape)]; + }; case "ARRAY": {format [call compile "[%1]", _inputText]}; case "SCALAR": {parseNumber _inputText;}; default {throw "Error"}; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index 4f96438042..6c0cb56519 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -65,3 +65,14 @@ if (GVAR(ClientSettingsExportIncluded)) then { } else { (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(inClientSettings)); }; + + +lbClear (_menu displayCtrl 14); +{ + if (_x == "") then { + _x = localize (LSTRING(category_all)); + }; + (_menu displayCtrl 14) lbAdd _x; +} forEach GVAR(categories); + +(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index 050abcf295..c71a26a6e7 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -52,3 +52,15 @@ if (GVAR(serverConfigGeneration) == 0) then { (_menu displayCtrl 1102) ctrlEnable false; (_menu displayCtrl 1102) ctrlShow false; }; + +lbClear (_menu displayCtrl 14); +{ + if (_x == "") then { + _x = localize LSTRING(category_all); + }; + (_menu displayCtrl 14) lbAdd _x; +} forEach GVAR(categories); + +(_menu displayCtrl 14) lbSetCurSel GVAR(currentCategorySelection); //All Catagoies + + diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index b69d8bd734..7df198cc5f 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -18,7 +18,11 @@ private ["_newColor", "_settingIndex"]; -_settingIndex = lbCurSel 200; +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; +if (_settingIndex == -1) exitWith {}; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_COLORS): { diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index 07fc43cdfc..8d6c3958c6 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -30,8 +30,8 @@ private ["_name", "_default", "_lastSelected"]; [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); -_lastSelected = lbCurSel 200; +_lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lnbSetCurSelRow [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf index 434e622818..d9f6a4ad96 100644 --- a/addons/optionsmenu/functions/fnc_serverResetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_serverResetSettings.sqf @@ -36,7 +36,7 @@ private ["_name", "_default", "_lastSelected"]; [MENU_TAB_SERVER_VALUES, _name, _default] call FUNC(updateSetting); } forEach GVAR(serverSideVakyes); -_lastSelected = lbCurSel 200; +_lastSelected = lnbCurSelRow 200; [GVAR(optionMenu_openTab)] call FUNC(onserverListBoxShowSelectionChanged); if (_lastSelected != -1) then { lbSetCurSel [200, _lastSelected]; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 9daee053bb..87532aaf86 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -16,11 +16,10 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; +private ["_settingsMenu", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor", "_expectedType"]; disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; -_ctrlList = _settingsMenu displayCtrl 200; _collection = switch (GVAR(optionMenu_openTab)) do { case MENU_TAB_SERVER_OPTIONS: {GVAR(serverSideOptions)}; @@ -29,15 +28,12 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -if (count _collection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; - }; +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; - if (_settingIndex < 0) then { - _settingIndex = 0; - }; +if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { _setting = _collection select _settingIndex; _entryName = _setting select 0; @@ -52,12 +48,12 @@ if (count _collection > 0) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { _possibleValues = _setting select 5; - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize LSTRING(Disabled))]; - lbAdd [400, (localize LSTRING(Enabled))]; + lbAdd [400, (localize ELSTRING(common,No))]; + lbAdd [400, (localize ELSTRING(common,Yes))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; @@ -66,14 +62,14 @@ if (count _collection > 0) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_SERVER_COLORS): { - _currentColor = _setting select 8; + _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; }; case (MENU_TAB_SERVER_VALUES): { // TODO implement - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools _expectedType = switch (_setting select 1) do { diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index f3e393bbfd..fc745c37be 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -16,63 +16,77 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; +private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; -lbclear _ctrlList; +lnbClear _ctrlList; + +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); + +_added = 0; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _settingName = if ((_x select 3) != "") then { + (_x select 3); + } else { + (_x select 0); + }; + + _settingsValue = _x select 9; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; - } else { - (_x select 5) select _settingsValue; - }; - - _ctrlList lbadd (_settingsText); }foreach GVAR(serverSideOptions); }; case (MENU_TAB_SERVER_COLORS): { { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _color = +(_x select 9); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _settingName = if ((_x select 3) != "") then { + (_x select 3); + } else { + (_x select 0); + }; + + _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; + _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; }foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { - if ((_x select 3) != "") then { - _ctrlList lbadd (_x select 3); - } else { - _ctrlList lbadd (_x select 0); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _settingName = if ((_x select 3) != "") then { + (_x select 3); + } else { + (_x select 0); + }; + _settingsValue = _x select 9; + if (typeName _settingsValue != "STRING") then { + _settingsValue = format["%1", _settingsValue]; + }; + _added = _ctrlList lnbAddRow [_settingName, _settingsValue]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - _settingsValue = _x select 8; - if (typeName _settingsValue != "STRINg") then { - _settingsValue = format["%1", _settingsValue]; - }; - _ctrlList lbadd (_settingsValue); }foreach GVAR(serverSideValues); }; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 3777093ccd..64f45121e5 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -28,15 +28,12 @@ _collection = switch (GVAR(optionMenu_openTab)) do { default {[]}; }; -if (count _collection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; - }; +_settingIndex = -1; +if (((lnbCurSelRow 200) >= 0) && {(lnbCurSelRow 200) < ((lnbSize 200) select 0)}) then { + _settingIndex = lnbValue [200, [(lnbCurSelRow 200), 0]]; +}; - if (_settingIndex < 0) then { - _settingIndex = 0; - }; +if ((_settingIndex >= 0) && {_settingIndex <= (count _collection)}) then { _setting = _collection select _settingIndex; _entryName = _setting select 0; @@ -51,13 +48,13 @@ if (count _collection > 0) then { switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { _possibleValues = _setting select 5; - _settingsValue = _setting select 8; + _settingsValue = _setting select 9; // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize LSTRING(Disabled))]; - lbAdd [400, (localize LSTRING(Enabled))]; + lbAdd [400, (localize ELSTRING(common,No))]; + lbAdd [400, (localize ELSTRING(common,Yes))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; @@ -66,7 +63,7 @@ if (count _collection > 0) then { (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; }; case (MENU_TAB_COLORS): { - _currentColor = _setting select 8; + _currentColor = _setting select 9; { sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; } forEach [410, 411, 412, 413]; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index fdd9128ca3..96a45a1b83 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -16,42 +16,49 @@ #include "script_component.hpp" -private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue"]; +private ["_settingName", "_added", "_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView", "_settingsValue", "_selectedCategory"]; DEFAULT_PARAM(0,_updateKeyView,true); disableSerialization; _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; -lbclear _ctrlList; +lnbClear _ctrlList; + +_selectedCategory = GVAR(categories) select GVAR(currentCategorySelection); switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { { - _ctrlList lbadd (_x select 3); + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _settingName = (_x select 3); + _settingsValue = _x select 9; - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; - } else { - (_x select 5) select _settingsValue; + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize ELSTRING(common,No)), (localize ELSTRING(common,Yes))] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + _added = _ctrlList lnbAddRow [_settingName, _settingsText]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; }; - - _ctrlList lbadd (_settingsText); - }foreach GVAR(clientSideOptions); + } foreach GVAR(clientSideOptions); }; case (MENU_TAB_COLORS): { - { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + { + if (_selectedCategory == "" || {_selectedCategory == (_x select 8)}) then { + _color = +(_x select 9); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _settingName = (_x select 3); + + _added = _ctrlList lnbAddRow [_settingName, _settingsColor]; + _ctrlList lnbSetColor [[_added, 1], (_x select 9)]; + _ctrlList lnbSetValue [[_added, 0], _forEachIndex]; + }; }foreach GVAR(clientSideColors); }; }; diff --git a/addons/optionsmenu/functions/fnc_stringEscape.sqf b/addons/optionsmenu/functions/fnc_stringEscape.sqf new file mode 100644 index 0000000000..1493f76445 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_stringEscape.sqf @@ -0,0 +1,59 @@ +/* + * Author: Glowbal + * Parse the string for quotation marks, so it can be used for config export. + * + * Arguments: + * 0: string + * + * Return Value: + * parsed string + * + * Example: + * [] call ACE_optionsmenu_fnc_stringEscape + * + * Public: No + */ + +private ["_str", "_array", "_maxIndex", "_isEven"]; +_str = _this; + +_isEven = { + params ["_array", "_index"]; + private [ "_count"]; + _count = 0; + { + if (_forEachIndex <= _index && {_x == 39}) then { + _count = _count + 1; + }; + }foreach _array; + + _count %2 == 0; +}; + +// reg: 34 +// single: 39 +_array = toArray _str; +{ + if (_x == 34) then { + _array set [_foreachIndex, 39]; + }; +}foreach _array; + +_maxIndex = count _array; +for "_i" from 0 to _maxIndex /* step +1 */ do { + if (((_i + 1) < _maxIndex - 1) && {_array select _i == 39 && (_array select (_i + 1)) == 39}) then { + if ([_array, _i] call _isEven) then { + _array deleteAt _i; + _i = _i - 1; + _maxIndex = _maxIndex - 1; + }; + }; +}; + +{ + if (_x == 34) then { + _array set [_foreachIndex, 39]; + }; +}foreach _array; + +toString _array; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index 3fe1682614..25fa06c604 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -32,9 +32,9 @@ switch (_type) do { _newValue = [false, true] select _newValue; }; - if !((_x select 8) isEqualTo _newValue) then { + if !((_x select 9) isEqualTo _newValue) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; } ; }; @@ -42,9 +42,9 @@ switch (_type) do { }; case (MENU_TAB_COLORS): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(clientSideColors); }; @@ -56,9 +56,9 @@ switch (_type) do { _newValue = [false, true] select _newValue; }; - if !((_x select 8) isEqualTo _newValue) then { + if !((_x select 9) isEqualTo _newValue) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; } ; }; @@ -66,17 +66,17 @@ switch (_type) do { }; case (MENU_TAB_SERVER_COLORS): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(serverSideColors); }; case (MENU_TAB_SERVER_VALUES): { { - if (((_x select 0) == _name) && {!((_x select 8) isEqualTo _newValue)}) then { + if (((_x select 0) == _name) && {!((_x select 9) isEqualTo _newValue)}) then { _changed = true; - _x set [8, _newValue]; + _x set [9, _newValue]; }; } foreach GVAR(serverSideValues); }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 665db1f17a..cd65eb966d 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -1,9 +1,3 @@ -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;); - #define SIZEX (((safezoneW / safezoneH) min 1.2)) #define SIZEY (SIZEX / 1.2) #define X_ORIGINAL(num) (num * (SIZEX / 40) + (safezoneX + (safezoneW - SIZEX)/2)) @@ -21,6 +15,12 @@ class ACE_settingsMenu { #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 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;); + class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; @@ -77,10 +77,20 @@ class ACE_settingsMenu { idc = 13; x = X_PART(2); y = Y_PART(3.4); - w = W_PART(30); + w = W_PART(15); h = H_PART(1); text = ""; }; + class categorySelection: ACE_gui_comboBoxBase { + idc = 14; + x = X_PART(14); + y = Y_PART(3.4); + w = W_PART(9); + h = H_PART(1); + text = ""; + onLBSelChanged = QUOTE( call FUNC(onCategorySelectChanged)); + SizeEx = H_PART(0.9); + }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; text = CSTRING(TabOptions); @@ -246,7 +256,7 @@ class ACE_settingsMenu { idc = 1102; text = CSTRING(OpenExport); x = X_PART(18); - action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {closeDialog 0; createDialog 'ACE_serverSettingsMenu';}); }; class action_debug: actionClose { idc = 1102; @@ -291,6 +301,16 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { h = H_PART(1); text = ""; }; + class categorySelection: ACE_gui_comboBoxBase { + idc = 14; + x = X_PART(14); + y = Y_PART(3.4); + w = W_PART(9); + h = H_PART(1); + text = ""; + onLBSelChanged = QUOTE( call FUNC(onServerCategorySelectChanged)); + SizeEx = H_PART(0.9); + }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; text = CSTRING(TabOptions); diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 376935297e..f368ef79b4 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -73,30 +73,6 @@ Valori Valores - - Yes - Ja - Si - Tak - Ano - Oui - Да - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - Нет - Nem - Não - No - Setting: Nastavení: @@ -127,7 +103,7 @@ Abrir menú de exportación Открыть меню экспорта Otevřít exportovací menu - Otwórz menu eksportowania + Eksport ustawień Ouvrir le menu d'exportation Exportálási menü megnyitása Apri menù esportazione @@ -199,7 +175,7 @@ Incluir configuración de cliente Включить настройки клиента Zahrnout nastavení klienta - Zawrzyj ustawienia klienta + Zaw. ustaw. klienta Inclure paramètres client Kliens-beállítások melléklése Includi i parametri del client @@ -243,7 +219,7 @@ Allow Config Export [ACE] - Pozwól na eksport ustawień [ACE] + Pozwól na eksport ustawień [ACE] Permitir exportar configuración Erlaube Config-Export [ACE] Povolit export natavení [ACE] @@ -331,7 +307,7 @@ Debug To Clipboard - Debuguj do schowka + Debug do schowka Depurar al portapapeles Debug do schránky Debug in die Zwischenablage @@ -345,11 +321,13 @@ Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage. Envia informação de depuração para RPT e área de transferência. - + Headbug Fix + Fix Headbug - + Resets your animation state. + Resetuje aktualną animację. ACE News @@ -367,5 +345,13 @@ Pokazuj wiadomości ACE w menu głównym Zobrazit novinky v hlavním menu + + All Categories + Wszystkie kategorie + + + Logistics + Logistyka + - + \ No newline at end of file diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 1249cac690..fd3081f7eb 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -43,7 +43,7 @@ _fnc_stopCurrentBurst = { _ammo = _unit ammo _weapon; if (_ammo > 0) then { _unit setAmmo [_weapon, 0]; - [_fnc_stopCurrentBurst, 0, [_unit, _weapon, _ammo, diag_frameno]] call cba_fnc_addPerFrameHandler; + [_fnc_stopCurrentBurst, 0, [_unit, _weapon, _ammo, diag_frameno]] call CBA_fnc_addPerFrameHandler; }; // only display the hint once, after you try to shoot an already jammed weapon diff --git a/addons/overpressure/README.md b/addons/overpressure/README.md index 3d3f242e40..fce4db7d3f 100644 --- a/addons/overpressure/README.md +++ b/addons/overpressure/README.md @@ -1,7 +1,7 @@ ace_overpressure ============= -Adds backblast to AT launchers and overpressure zones to tank cannons. +Adds backblast area to AT launchers and overpressure zones to tank cannons. ## Maintainers diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 3de7bf66b6..aefadf2e63 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -6,7 +6,6 @@ class CfgVehicles { }; class TransportBackpacks { MACRO_ADDBACKPACK(ACE_NonSteerableParachute,4); - MACRO_ADDBACKPACK(ACE_ReserveParachute,4); }; }; @@ -93,7 +92,7 @@ class CfgVehicles { class ACE_ReserveParachute: ACE_NonSteerableParachute { author = ECSTRING(common,ACETeam); displayName = CSTRING(ReserveParachute); - scope = 2; + scope = 1; mass = 70; ParachuteClass = "NonSteerable_Parachute_F"; ace_reserveParachute = ""; diff --git a/addons/parachute/README.md b/addons/parachute/README.md index fcf1a36333..3dd2608152 100644 --- a/addons/parachute/README.md +++ b/addons/parachute/README.md @@ -3,6 +3,7 @@ ace_parachute Improves parachutes and adds an altimeter. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index 42f6baa89b..46dd21b99c 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -36,7 +36,7 @@ GVAR(PFH) = false; ["playerVehicleChanged",{ if (!GVAR(PFH) && {(vehicle ACE_player) isKindOf "ParachuteBase"}) then { GVAR(PFH) = true; - [FUNC(onEachFrame), 0.1, []] call CALLSTACK(cba_fnc_addPerFrameHandler); + [FUNC(onEachFrame), 0.1, []] call CALLSTACK(CBA_fnc_addPerFrameHandler); }; }] call EFUNC(common,addEventHandler); diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 895a6e1793..7a90a1f12c 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -24,4 +24,4 @@ _unit setVariable [QGVAR(chuteIsCut), false, true]; ((_this select 0) select 1) playActionNow "Crouch"; [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); }; -}, 1, [ACE_time,_unit]] call CALLSTACK(cba_fnc_addPerFrameHandler); +}, 1, [ACE_time,_unit]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 9960e3f727..28909f19cd 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -49,4 +49,4 @@ GVAR(AltimeterActive) = true; (_this select 0) set [2, _height]; (_this select 0) set [3, _curTime]; -}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), ACE_time]] call CALLSTACK(cba_fnc_addPerFrameHandler); +}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), ACE_time]] call CALLSTACK(CBA_fnc_addPerFrameHandler); diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index b9ccad48a4..8a4b2d766c 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -52,10 +52,12 @@ Cut Parachute Fallschirm abschneiden + Odetnij spadochron Reserve Parachute Reserve Fallschirm + Spadochron awaryjny - + \ No newline at end of file diff --git a/addons/ragdolls/README.md b/addons/ragdolls/README.md index b90ba9e5c9..86739775c3 100644 --- a/addons/ragdolls/README.md +++ b/addons/ragdolls/README.md @@ -1,7 +1,7 @@ ace_ragdolls ============ -Tweaks the ragdoll behaviour to be more resposive to bullet impacts and explosions. +Tweaks the ragdoll behaviour to be more responsive to bullet impacts and explosions. ## Maintainers diff --git a/addons/rangecard/README.md b/addons/rangecard/README.md index c96e151869..94169a3075 100644 --- a/addons/rangecard/README.md +++ b/addons/rangecard/README.md @@ -1,10 +1,11 @@ ace_rangecards =============== -Adds range cards +Adds range cards. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml index bda93bcab3..7e93df20d5 100644 --- a/addons/rangecard/stringtable.xml +++ b/addons/rangecard/stringtable.xml @@ -8,6 +8,7 @@ Vzdálenostní tabulka Entfernungsspinne Tabela de distâncias + Table de tir 50 METER increments -- MRAD/MRAD (reticle/turrets) @@ -16,6 +17,7 @@ Přidat 50 METRŮ -- MRAD/MRAD (síťka/věže) 50-Meter-Schritte MRAD/MRAD (Fadenkreuz/Geschützturm) Incrementos de 50 METROS - MRAD/MRAD (retícula/torres) + Intervalle 50 mètres -- millième/millième (réticule/tambours) Open Range Card @@ -24,6 +26,7 @@ Otevřít vzdálenostní tabulku Öffne Entfernungsspinne Abrir tabela de distâncias + Afficher table de tir Open Range Card Copy @@ -32,6 +35,7 @@ Otevřít kopii vzdálenostní tabulky Öffne Kopie der Entfernungsspinne Abrir cópia da tabela de distâncias + Afficher table de tir copiée Open Range Card @@ -40,6 +44,7 @@ Otevřít vzdálenostní tabulku Öffne Entfernungsspinne Abrir tabela de distäncias + Afficher table de tir Open Range Card Copy @@ -48,6 +53,7 @@ Otevřít kopii vzdálenostní tabulky Öffne Kopie der Entfernungsspinne Abrir cópia da tabela de distâncias + Afficher table de tir copiée Copy Range Card @@ -56,6 +62,7 @@ Kopírovat vzdálenostní tabulku Kopiere Entfernungsspinne Copiar tabela de distäncias + Copier table de tir - + \ No newline at end of file diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index aef52578e2..c3288815dd 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -633,4 +633,12 @@ class CfgVehicles { class Weapon_MMG_02_sand_F: Weapon_Base_F { displayName = CSTRING(MMG_02_sand); };*/ + + //attachments + + class Item_Base_F; + + class Item_acc_flashlight: Item_Base_F { + displayName="UTG Defender 126"; + }; }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 0a83239047..83534a1083 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -1,4 +1,4 @@ - +class Mode_SemiAuto; class Mode_FullAuto; class CfgWeapons { @@ -510,14 +510,14 @@ class CfgWeapons { class player: player {}; }; - class cannon_105mm: cannon_120mm { + class cannon_105mm: CannonCore { displayName = "M68"; - class player: player { + class player: Mode_SemiAuto { displayName = "M68"; }; }; - class cannon_125mm: cannon_120mm { + class cannon_125mm: CannonCore { displayName = "2A46"; }; @@ -568,4 +568,12 @@ class CfgWeapons { displayName = "L21A1 RARDEN"; }; }; + + //attachments + + class Itemcore; + + class acc_flashlight: ItemCore { + displayName = "UTG Defender 126"; + }; }; diff --git a/addons/realisticnames/README.md b/addons/realisticnames/README.md index 145ec16a61..6cd05351f6 100644 --- a/addons/realisticnames/README.md +++ b/addons/realisticnames/README.md @@ -1,7 +1,7 @@ ace_realisticnames ================== -Changes the names of various weapons and vehicles to those of their RL counterparts. +Changes the names of various weapons and vehicles to those of their real life counterparts. ## Maintainers diff --git a/addons/recoil/README.md b/addons/recoil/README.md new file mode 100644 index 0000000000..0c81cde34a --- /dev/null +++ b/addons/recoil/README.md @@ -0,0 +1,11 @@ +ace_recoil +=========== + +Tweaks weapon recoils and adds camera shake. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/addons/reloadlaunchers/README.md b/addons/reloadlaunchers/README.md new file mode 100644 index 0000000000..2b6357200b --- /dev/null +++ b/addons/reloadlaunchers/README.md @@ -0,0 +1,11 @@ +ace_reloadlaunchers +=========== + +Add the ability to reload someone else's launcher. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) diff --git a/addons/reloadlaunchers/config.cpp b/addons/reloadlaunchers/config.cpp index 3a66b39719..6a04f6339a 100644 --- a/addons/reloadlaunchers/config.cpp +++ b/addons/reloadlaunchers/config.cpp @@ -6,8 +6,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; - author[] = {""}; - authorUrl = ""; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; VERSION_CONFIG; }; }; diff --git a/addons/repair/$PBOPREFIX$ b/addons/repair/$PBOPREFIX$ new file mode 100644 index 0000000000..d8fbd51195 --- /dev/null +++ b/addons/repair/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\repair \ No newline at end of file diff --git a/addons/repair/ACE_Repair.hpp b/addons/repair/ACE_Repair.hpp new file mode 100644 index 0000000000..219945003d --- /dev/null +++ b/addons/repair/ACE_Repair.hpp @@ -0,0 +1,70 @@ +class ACE_Repair { + class Actions { + class ReplaceWheel { + displayName = CSTRING(ReplaceWheel); + displayNameProgress = CSTRING(ReplacingWheel); + + locations[] = {"All"}; + requiredEngineer = QGVAR(engineerSetting_Wheel); + repairingTime = 10; + repairingTimeSelfCoef = 1; + items[] = {"ToolKit"}; + condition = QUOTE(call FUNC(canReplaceWheel)); + itemConsumed = 0; + + callbackSuccess = QUOTE(call FUNC(doReplaceWheel)); + callbackFailure = ""; + callbackProgress = ""; + + animationCaller = "Acts_carFixingWheel"; + animationCallerProne = "Acts_carFixingWheel"; + animationCallerSelf = "Acts_carFixingWheel"; + animationCallerSelfProne = "Acts_carFixingWheel"; + litter[] = {}; + }; + class RemoveWheel: ReplaceWheel { + displayName = CSTRING(RemoveWheel); + displayNameProgress = CSTRING(RemovingWheel); + condition = QUOTE(call FUNC(canRemove)); + callbackSuccess = QUOTE(call FUNC(doRemoveWheel)); + }; + class MiscRepair: ReplaceWheel { + displayName = CSTRING(Repairing); // let's make empty string an auto generated string + displayNameProgress = CSTRING(RepairingHitPoint); + condition = QUOTE(call FUNC(canMiscRepair)); + requiredEngineer = 0; + repairingTime = 15; + callbackSuccess = QUOTE(call FUNC(doRepair)); + }; + class RepairTrack: MiscRepair { + displayName = CSTRING(Repairing); + displayNameProgress = CSTRING(RepairingHitPoint); + condition = QUOTE(call FUNC(canRepairTrack)); + callbackSuccess = QUOTE(call FUNC(doRepairTrack)); + requiredEngineer = QGVAR(engineerSetting_Wheel); + }; + class RemoveTrack: MiscRepair { + displayName = CSTRING(RemoveTrack); + displayNameProgress = CSTRING(RemovingTrack); + condition = QUOTE(call FUNC(canRemove)); + callbackSuccess = QUOTE(call FUNC(doRemoveTrack)); + requiredEngineer = QGVAR(engineerSetting_Wheel); + }; + class ReplaceTrack: RemoveTrack { + displayName = CSTRING(ReplaceTrack); + displayNameProgress = CSTRING(ReplacingTrack); + condition = QUOTE(call FUNC(canReplaceTrack)); + callbackSuccess = QUOTE(call FUNC(doReplaceTrack)); + requiredEngineer = QGVAR(engineerSetting_Wheel); + }; + class FullRepair: MiscRepair { + displayName = CSTRING(fullRepair); + displayNameProgress = CSTRING(fullyRepairing); + requiredEngineer = QGVAR(engineerSetting_fullRepair); + repairLocations[] = {QGVAR(fullRepairLocation)}; + repairingTime = 30; + condition = "damage _target > 0"; + callbackSuccess = QUOTE(call FUNC(doFullRepair)); + }; + }; +}; diff --git a/addons/repair/ACE_Settings.hpp b/addons/repair/ACE_Settings.hpp new file mode 100644 index 0000000000..48d3a9c0c6 --- /dev/null +++ b/addons/repair/ACE_Settings.hpp @@ -0,0 +1,64 @@ +class ACE_Settings { + class GVAR(DisplayTextOnRepair) { + displayName = CSTRING(SettingDisplayTextName); + description = CSTRING(SettingDisplayTextDesc); + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(engineerSetting_Repair) { + displayName = CSTRING(enginerSetting_Repair_name); + description = CSTRING(enginerSetting_Repair_description); + typeName = "SCALAR"; + value = 1; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(engineerSetting_Wheel) { + displayName = CSTRING(enginerSetting_Wheel_name); + description = CSTRING(enginerSetting_Wheel_description); + typeName = "SCALAR"; + value = 0; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(repairDamageThreshold) { + displayName = CSTRING(repairDamageThreshold_name); + description = CSTRING(repairDamageThreshold_description); + typeName = "SCALAR"; + value = 0.6; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(repairDamageThreshold_Engineer) { + displayName = CSTRING(repairDamageThreshold_Engineer_name); + description = CSTRING(repairDamageThreshold_Engineer_description); + typeName = "SCALAR"; + value = 0.4; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(consumeItem_ToolKit) { + displayName = CSTRING(consumeItem_ToolKit_name); + description = CSTRING(consumeItem_ToolKit_description); + typeName = "SCALAR"; + value = 1; + values[] = {ECSTRING(common,No), ECSTRING(common,Yes)}; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(fullRepairLocation) { + displayName = CSTRING(fullRepairLocation); + description = CSTRING(fullRepairLocation_description); + typeName = "SCALAR"; + value = 2; + values[] = {CSTRING(useAnywhere), CSTRING(repairVehicleOnly), CSTRING(repairFacilityOnly), CSTRING(vehicleAndFacility), ECSTRING(common,Disabled)}; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; + class GVAR(engineerSetting_fullRepair) { + displayName = CSTRING(engineerSetting_fullRepair_name); + description = CSTRING(engineerSetting_fullRepair_description); + typeName = "SCALAR"; + value = 3; + values[] = {CSTRING(engineerSetting_anyone), CSTRING(engineerSetting_EngineerOnly), CSTRING(engineerSetting_RepairSpecialistOnly)}; + category = ECSTRING(OptionsMenu,CategoryLogistics); + }; +}; diff --git a/addons/repair/CfgActions.hpp b/addons/repair/CfgActions.hpp new file mode 100644 index 0000000000..5dbd0ca7a6 --- /dev/null +++ b/addons/repair/CfgActions.hpp @@ -0,0 +1,9 @@ +class CfgActions { + class None; + class Repair: None { + show = 0; + }; + class RepairVehicle: None { + show = 0; + }; +}; diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp new file mode 100644 index 0000000000..08ec6bad15 --- /dev/null +++ b/addons/repair/CfgEventHandlers.hpp @@ -0,0 +1,43 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Init_EventHandlers { + class Car { + class ADDON { + init = QUOTE(_this call DFUNC(addRepairActions)); + }; + }; + + class Tank { + class ADDON { + init = QUOTE(_this call DFUNC(addRepairActions)); + }; + }; + + class Helicopter { + class ADDON { + init = QUOTE(_this call DFUNC(addRepairActions)); + }; + }; + + class Plane { + class ADDON { + init = QUOTE(_this call DFUNC(addRepairActions)); + }; + }; + + class Ship_F { + class ADDON { + init = QUOTE(_this call DFUNC(addRepairActions)); + }; + }; +}; diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp new file mode 100644 index 0000000000..47459f532d --- /dev/null +++ b/addons/repair/CfgVehicles.hpp @@ -0,0 +1,352 @@ +#define MACRO_REPAIRVEHICLE \ + class ACE_Actions { \ + class ACE_MainActions { \ + class GVAR(Repair) { \ + displayName = CSTRING(Repair); \ + condition = "true"; \ + statement = ""; \ + runOnHover = 1; \ + showDisabled = 0; \ + priority = 2; \ + icon = "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; \ + distance = 4; \ + }; \ + }; \ + }; + +class CfgVehicles { + class ACE_Module; + class ACE_moduleRepairSettings: ACE_Module { + scope = 2; + displayName = CSTRING(moduleName); + icon = QUOTE(PATHTOF(ui\Icon_Module_Repair_ca.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleRepairSettings); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = ECSTRING(Common,ACETeam); + class Arguments { + class engineerSetting_Repair { + displayName = CSTRING(enginerSetting_Repair_name); + description = CSTRING(enginerSetting_Repair_description); + typeName = "NUMBER"; + class values { + class anyone { name = CSTRING(engineerSetting_anyone); value = 0; }; + class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; default = 1; }; + class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; }; + }; + }; + class engineerSetting_Wheel { + displayName = CSTRING(enginerSetting_Wheel_name); + description = CSTRING(enginerSetting_Wheel_description); + typeName = "NUMBER"; + class values { + class anyone { name = CSTRING(engineerSetting_anyone); value = 0; default = 1; }; + class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; }; + class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; }; + }; + }; + class repairDamageThreshold { + displayName = CSTRING(repairDamageThreshold_name); + description = CSTRING(repairDamageThreshold_description); + typeName = "NUMBER"; + defaultValue = 0.6; + }; + class repairDamageThreshold_Engineer { + displayName = CSTRING(repairDamageThreshold_Engineer_name); + description = CSTRING(repairDamageThreshold_Engineer_description); + typeName = "NUMBER"; + defaultValue = 0.4; + }; + class consumeItem_ToolKit { + displayName = CSTRING(consumeItem_ToolKit_name); + description = CSTRING(consumeItem_ToolKit_description); + typeName = "NUMBER"; + class values { + class keep { name = ECSTRING(common,No); value = 0; default = 1; }; + class remove { name = ECSTRING(common,Yes); value = 1; }; + }; + }; + class fullRepairLocation { + displayName = CSTRING(fullRepairLocation); + description = CSTRING(fullRepairLocation_description); + typeName = "NUMBER"; + class values { + class anywhere { name = CSTRING(useAnywhere); value = 0; }; + class vehicle { name = CSTRING(repairVehicleOnly); value = 1; }; + class facility { name = CSTRING(repairFacilityOnly); value = 2; default = 1; }; + class vehicleAndFacility { name = CSTRING(vehicleAndFacility); value = 3; }; + class disabled { name = ECSTRING(common,Disabled); value = 4;}; + }; + }; + class engineerSetting_fullRepair { + displayName = CSTRING(engineerSetting_fullRepair_name); + description = CSTRING(engineerSetting_fullRepair_description); + typeName = "NUMBER"; + class values { + class anyone { name = CSTRING(engineerSetting_anyone); value = 0; }; + class Engineer { name = CSTRING(engineerSetting_EngineerOnly); value = 1; }; + class Special { name = CSTRING(engineerSetting_RepairSpecialistOnly); value = 2; default = 1;}; + }; + }; + }; + class ModuleDescription { + description = CSTRING(moduleDescription); + sync[] = {}; + }; + }; + + class Module_F; + class ACE_moduleAssignEngineerRoles: Module_F { + scope = 2; + displayName = CSTRING(AssignEngineerRole_Module_DisplayName); + icon = QUOTE(PATHTOF(ui\Icon_Module_Repair_ca.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleAssignEngineer); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class EnableList { + displayName = CSTRING(AssignEngineerRole_EnableList_DisplayName); + description = CSTRING(AssignEngineerRole_EnableList_Description); + defaultValue = ""; + typeName = "STRING"; + }; + class role { + displayName = CSTRING(AssignEngineerRole_role_DisplayName); + description = CSTRING(AssignEngineerRole_role_Description); + typeName = "NUMBER"; + class values { + class none { + name = CSTRING(AssignEngineerRole_role_none); + value = 0; + }; + class medic { + name = CSTRING(AssignEngineerRole_role_engineer); + value = 1; + default = 1; + }; + class doctor { + name = CSTRING(AssignEngineerRole_role_specialist); + value = 2; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(AssignEngineerRole_Module_Description); + sync[] = {}; + }; + }; + class ACE_moduleAssignRepairVehicle: Module_F { + scope = 2; + displayName = CSTRING(AssignRepairVehicle_Module_DisplayName); + icon = QUOTE(PATHTOF(ui\Icon_Module_Repair_ca.paa)); + category = "ACE_Logistics"; + function = QFUNC(moduleAssignRepairVehicle); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = ECSTRING(common,ACETeam); + class Arguments { + class EnableList { + displayName = CSTRING(AssignRepairVehicle_EnableList_DisplayName); + description = CSTRING(AssignRepairVehicle_EnableList_Description); + defaultValue = ""; + typeName = "STRING"; + }; + class role { + displayName = CSTRING(AssignRepairVehicle_role_DisplayName); + description = CSTRING(AssignRepairVehicle_role_Description); + typeName = "NUMBER"; + class values { + class none { + name = ECSTRING(common,No); + value = 0; + }; + class isVehicle { + name = ECSTRING(common,Yes); + value = 1; + default = 1; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(AssignRepairVehicle_Module_Description); + sync[] = {}; + }; + }; + class ACE_moduleAssignRepairFacility: ACE_moduleAssignRepairVehicle { + displayName = CSTRING(AssignRepairFacility_Module_DisplayName); + function = QFUNC(moduleAssignRepairFacility); + class Arguments { + class EnableList { + displayName = CSTRING(AssignRepairFacility_EnableList_DisplayName); + description = CSTRING(AssignRepairFacility_EnableList_Description); + defaultValue = ""; + typeName = "STRING"; + }; + class role { + displayName = CSTRING(AssignRepairFacility_role_DisplayName); + description = CSTRING(AssignRepairFacility_role_Description); + typeName = "NUMBER"; + class values { + class none { + name = ECSTRING(common,No); + value = 0; + }; + class isFacility { + name = ECSTRING(common,Yes); + value = 1; + default = 1; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(AssignRepairFacility_Module_Description); + sync[] = {}; + }; + }; + + + class LandVehicle; + class Car: LandVehicle { + MACRO_REPAIRVEHICLE + class ACE_Cargo { + class Cargo { + class ACE_Wheel { + type = "ACE_Wheel"; + amount = 1; + }; + }; + }; + }; + + class Tank: LandVehicle { + MACRO_REPAIRVEHICLE + }; + + class Air; + class Helicopter: Air { + MACRO_REPAIRVEHICLE + }; + + class Plane: Air { + MACRO_REPAIRVEHICLE + }; + + class Ship; + class Ship_F: Ship { + MACRO_REPAIRVEHICLE + }; + + class thingX; + class ACE_RepairItem_Base: thingX { + XEH_ENABLED; + icon = "iconObject_circle"; + mapSize = 0.7; + accuracy = 0.2; + vehicleClass = "ACE_Logistics_Items"; + destrType = "DesturctNo"; + }; + + class ACE_Track: ACE_RepairItem_Base { + EGVAR(cargo,size) = 2; + EGVAR(cargo,canLoad) = 1; + author = "Hawkins"; + scope = 2; + model = QUOTE(PATHTOF(data\ace_track.p3d)); + displayName = CSTRING(SpareTrack); + }; + + class ACE_Wheel: ACE_RepairItem_Base { + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; + author = "Hawkins"; + scope = 2; + model = QUOTE(PATHTOF(data\ace_wheel.p3d)); + displayName = CSTRING(SpareWheel); + picture = QUOTE(PATHTOF(ui\tire_ca.paa)); + }; + + // disable vanilla repair + // "getNumber (_x >> ""transportRepair"") > 0" configClasses (configFile >> "CfgVehicles") + + class Slingload_01_Base_F; + class B_Slingload_01_Repair_F: Slingload_01_Base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class Helicopter_Base_H; + class Heli_Transport_04_base_F: Helicopter_Base_H { + GVAR(hitpointGroups[]) = { {"HitEngine", {"HitEngine1", "HitEngine2"}}, {"Glass_1_hitpoint", {"Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"}} }; + }; + class O_Heli_Transport_04_repair_F: Heli_Transport_04_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class Pod_Heli_Transport_04_base_F; + class Land_Pod_Heli_Transport_04_repair_F: Pod_Heli_Transport_04_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class B_APC_Tracked_01_base_F; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class Car_F; + class Offroad_01_base_F: Car_F { + GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} }; + }; + class Offroad_01_repair_base_F: Offroad_01_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class MRAP_01_base_F: Car_F { + GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6"}} }; + }; + + class B_Truck_01_mover_F; + class B_Truck_01_Repair_F: B_Truck_01_mover_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class B_Truck_01_fuel_F: B_Truck_01_mover_F { // the fuel hemet apparently can repair. GJ BI + transportRepair = 0; + }; + + class Truck_02_base_F; + class Truck_02_box_base_F: Truck_02_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class Truck_02_engineeral_base_F: Truck_02_box_base_F { + GVAR(canRepair) = 0; + }; + + class Truck_03_base_F; + class O_Truck_03_repair_F: Truck_03_base_F { + GVAR(canRepair) = 1; + transportRepair = 0; + }; + + class Quadbike_01_base_F; + class B_Quadbike_01_F: Quadbike_01_base_F { + GVAR(hitpointPositions[]) = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; + }; +}; diff --git a/addons/repair/README.md b/addons/repair/README.md new file mode 100644 index 0000000000..180ae38128 --- /dev/null +++ b/addons/repair/README.md @@ -0,0 +1,12 @@ +ace_repair +=========== + +Adds repair system. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/repair/XEH_postInit.sqf b/addons/repair/XEH_postInit.sqf new file mode 100644 index 0000000000..44ca157b0c --- /dev/null +++ b/addons/repair/XEH_postInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +["setVehicleDamage", {_this call FUNC(setDamage)}] call EFUNC(common,addEventHandler); +["setVehicleHitPointDamage", {_this call FUNC(setHitPointDamage)}] call EFUNC(common,addEventHandler); + +// wheels +["setWheelHitPointDamage", {(_this select 0) setHitPointDamage [_this select 1, _this select 2]}] call EFUNC(common,addEventHandler); diff --git a/addons/repair/XEH_preInit.sqf b/addons/repair/XEH_preInit.sqf new file mode 100644 index 0000000000..8d2f1d8497 --- /dev/null +++ b/addons/repair/XEH_preInit.sqf @@ -0,0 +1,41 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addRepairActions); +PREP(canMiscRepair); +PREP(canRemove); +PREP(canRepair); +PREP(canRepairTrack); +PREP(canReplaceTrack); +PREP(canReplaceWheel); +PREP(doFullRepair); +PREP(doRemoveTrack); +PREP(doRemoveWheel); +PREP(doRepair); +PREP(doRepairTrack); +PREP(doReplaceTrack); +PREP(doReplaceWheel); +PREP(getHitPointString); +PREP(getPostRepairDamage); +PREP(getWheelHitPointsWithSelections); +PREP(hasItems); +PREP(isEngineer); +PREP(isInRepairFacility); +PREP(isNearRepairVehicle); +PREP(isRepairVehicle); +PREP(moduleAssignEngineer); +PREP(moduleAssignRepairVehicle); +PREP(moduleAssignRepairFacility); +PREP(moduleRepairSettings); +PREP(normalizeHitPoints); +PREP(repair); +PREP(repair_failure); +PREP(repair_success); +PREP(setDamage); +PREP(setHitPointDamage); +PREP(spawnObject); +PREP(useItem); +PREP(useItems); + +ADDON = true; diff --git a/addons/repair/config.cpp b/addons/repair/config.cpp new file mode 100644 index 0000000000..c7015f4650 --- /dev/null +++ b/addons/repair/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Wheel", "ACE_Track"}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"commy2", "Glowbal"}; + authorUrl = "https://ace3mod.com"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Repair.hpp" +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgActions.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/repair/data/ace_track.p3d b/addons/repair/data/ace_track.p3d new file mode 100644 index 0000000000..988499c32b Binary files /dev/null and b/addons/repair/data/ace_track.p3d differ diff --git a/addons/repair/data/ace_wheel.p3d b/addons/repair/data/ace_wheel.p3d new file mode 100644 index 0000000000..c24f804b4f Binary files /dev/null and b/addons/repair/data/ace_wheel.p3d differ diff --git a/addons/repair/data/trailObjects.rvmat b/addons/repair/data/trailObjects.rvmat new file mode 100644 index 0000000000..8692493699 --- /dev/null +++ b/addons/repair/data/trailObjects.rvmat @@ -0,0 +1,100 @@ +#define _ARMA_ + +class StageTI +{ + texture = "a3\data_f\default_ti_ca.paa"; +}; +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,0}; +specular[] = {0.0099999998,0.0099999998,0.0099999998,0.0099999998}; +specularPower = 500; +surfaceInfo="a3\data_f\penetration\metal.bisurf"; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 +{ + texture = "z\ace\addons\repair\data\trailObjects_nohq.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage2 +{ + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage3 +{ + texture = "#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage4 +{ + texture = "#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage5 +{ + texture = "#(argb,8,8,3)color(0,0.6,1,1,SMDI)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage6 +{ + texture = "#(ai,64,64,1)fresnelGlass(2)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage7 +{ + useWorldEnvMap = "true"; + texture = "a3\data_f\env_land_ca.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; diff --git a/addons/repair/data/trailObjects_co.paa b/addons/repair/data/trailObjects_co.paa new file mode 100644 index 0000000000..25f2c4c1c0 Binary files /dev/null and b/addons/repair/data/trailObjects_co.paa differ diff --git a/addons/repair/data/trailObjects_nohq.paa b/addons/repair/data/trailObjects_nohq.paa new file mode 100644 index 0000000000..fc10e94aea Binary files /dev/null and b/addons/repair/data/trailObjects_nohq.paa differ diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf new file mode 100644 index 0000000000..b76f027bb0 --- /dev/null +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -0,0 +1,178 @@ +/* + * Author: commy2 + * Checks if the vehicles class already has the actions initialized, otherwise add all available repair options. Calleed from init EH. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [vehicle] call ace_repair_fnc_addRepairActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params", _vehicle); + +private ["_type", "_initializedClasses"]; + +_type = typeOf _vehicle; + +_initializedClasses = GETMVAR(GVAR(initializedClasses),[]); + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; + +// get all hitpoints and selections +([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitPoints", "_hitPointsSelections"]; + +// get hitpoints of wheels with their selections +([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitPointSelections"]; + + +private ["_hitPointsAddedNames", "_hitPointsAddedStrings", "_hitPointsAddedAmount"]; +_hitPointsAddedNames = []; +_hitPointsAddedStrings = []; +_hitPointsAddedAmount = []; + +// add repair events to this vehicle class +{ + if (_x in _wheelHitPoints) then { + // add wheel repair action + + private ["_icon", "_selection"]; + + _icon = QUOTE(PATHTOF(ui\tire_ca.paa)); + _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; + // textDefault = ""; + _selection = _wheelHitPointSelections select (_wheelHitPoints find _x); + + private ["_name", "_text", "_condition", "_statement"]; + + // remove wheel action + _name = format ["Remove_%1", _x]; + _text = localize LSTRING(RemoveWheel); + + _condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)}; + _statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)}; + + private "_action"; + _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); + [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + + // replace wheel action + _name = format ["Replace_%1", _x]; + _text = localize LSTRING(ReplaceWheel); + + _condition = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(canRepair)}; + _statement = {[_this select 1, _this select 0, _this select 2 select 0, "ReplaceWheel"] call DFUNC(repair)}; + + _action = [_name, _text, _icon, _statement, _condition, {}, [_x], _selection, 2] call EFUNC(interact_menu,createAction); + [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + + } else { + // exit if the hitpoint is in the blacklist, e.g. glasses + if (_x in IGNORED_HITPOINTS) exitWith {}; + + private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"]; + + // Get hitpoint groups if available + _hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups); + _inHitpointSubGroup = false; + if (isArray _hitpointGroupConfig) then { + // Set variable if current hitpoint is in a sub-group (to be excluded from adding action) + _currentHitpoint = _x; + { + { + if (_x == _currentHitpoint) exitWith { + _inHitpointSubGroup = true; + }; + } forEach (_x select 1); + } forEach (getArray _hitpointGroupConfig); + }; + + // Exit if current hitpoint is in sub-group (only main hitpoints get actions) + if (_inHitpointSubGroup) exitWith {}; + + // exit if the hitpoint is virtual + if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {}; + + // add misc repair action + private ["_name", "_icon", "_selection", "_condition", "_statement"]; + + _name = format ["Repair_%1", _x]; + + // Find localized string and track those added for numerization + ([_x, "%1", _x, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"]; + _hitPointsAddedNames = _trackArray select 0; + _hitPointsAddedStrings = _trackArray select 1; + _hitPointsAddedAmount = _trackArray select 2; + + _icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa"; + + _selection = ""; + + // Get custom position if available + _customSelectionsConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointPositions); + if (isArray _customSelectionsConfig) then { + // Loop through custom hitpoint positions array + _currentHitpoint = _x; + { + _x params ["_hitpoint", "_position"]; + // Exit with supplied custom position when same hitpoint name found or print RPT error if it's invalid + if (_hitpoint == _currentHitpoint) exitWith { + if (typeName _position == "ARRAY") exitWith { + _selection = _position; // Position in model space + }; + if (typeName _position == "STRING") exitWith { + _selection = _vehicle selectionPosition _position; // Selection name + }; + diag_log text format ["[ACE] ERROR: Invalid custom position %1 of hitpoint %2 in vehicle %3", _position, _hitpoint, _vehicle]; + }; + } forEach (getArray _customSelectionsConfig); + }; + + // If position still empty (not a position array or selection name) try extracting from model + if (typeName _selection == "STRING" && {_selection == ""}) then { + _selection = _vehicle selectionPosition (_hitPointsSelections select (_hitPoints find _x)); + }; + + _condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; + _statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; + + if (_x in TRACK_HITPOINTS) then { + if (_x == "HitLTrack") then { + _selection = [-1.75, 0, -1.75]; + } else { + _selection = [1.75, 0, -1.75]; + }; + private "_action"; + _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "RepairTrack"], _selection, 4] call EFUNC(interact_menu,createAction); + [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + } else { + private "_action"; + _action = [_name, _text, _icon, _statement, _condition, {}, [_x, "MiscRepair"], _selection, 4] call EFUNC(interact_menu,createAction); + // Put inside main actions if no other position was found above + if (_selection isEqualTo [0, 0, 0]) then { + [_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); + } else { + [_type, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + }; + }; + }; +} forEach _hitPoints; + +private ["_action", "_condition", "_statement"]; + +_condition = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(canRepair)}; +_statement = {[_this select 1, _this select 0, _this select 2 select 0, _this select 2 select 1] call DFUNC(repair)}; +_action = [QGVAR(fullRepair), localize LSTRING(fullRepair), "A3\ui_f\data\igui\cfg\actions\repair_ca.paa", _statement, _condition, {}, ["", "fullRepair"], "", 4] call EFUNC(interact_menu,createAction); +[_type, 0, ["ACE_MainActions", QGVAR(Repair)], _action] call EFUNC(interact_menu,addActionToClass); +// set class as initialized +_initializedClasses pushBack _type; + +SETMVAR(GVAR(initializedClasses),_initializedClasses); diff --git a/addons/repair/functions/fnc_canMiscRepair.sqf b/addons/repair/functions/fnc_canMiscRepair.sqf new file mode 100644 index 0000000000..c60e59c840 --- /dev/null +++ b/addons/repair/functions/fnc_canMiscRepair.sqf @@ -0,0 +1,54 @@ +/* + * Author: Jonpas + * Check if misc repair action can be done, called from callbackSuccess. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * Can Misc Repair + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair + * + * Public: No + */ +#include "script_component.hpp" + +private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"]; +params ["_caller", "_target", "_hitPoint"]; + +// Get hitpoint groups if available +_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups); +_hitpointGroup = []; +if (isArray _hitpointGroupConfig) then { + // Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group + { + // Exit using found hitpoint group if this hitpoint is leader of any + if (_x select 0 == _hitPoint) exitWith { + _hitpointGroup = _x select 1; + }; + } forEach (getArray _hitpointGroupConfig); +}; + +// Add current hitpoint to the group +_hitpointGroup pushBack _hitPoint; + +// Get post repair damage +_postRepairDamage = [_caller] call FUNC(getPostRepairDamage); + +// Return true if damage can be repaired on any hitpoint in the group, else false +_return = false; +{ + if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith { + _return = true; + }; +} forEach _hitpointGroup; + +if (typeOf _target == "B_MRAP_01_F") then { + diag_log format ["%1 - %2", _hitPoint, _hitpointGroup]; +}; + +_return diff --git a/addons/repair/functions/fnc_canRemove.sqf b/addons/repair/functions/fnc_canRemove.sqf new file mode 100644 index 0000000000..9fa657a2bb --- /dev/null +++ b/addons/repair/functions/fnc_canRemove.sqf @@ -0,0 +1,23 @@ +/* + * Author: commy2 + * Check if the unit can remove given wheel/track of the vehicle. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * Can Remove + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_canRemove + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target", "_hitPoint"]; +TRACE_3("params",_unit,_target,_hitPoint); + +alive _target && {_target getHitPointDamage _hitPoint < 1} diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf new file mode 100644 index 0000000000..bb44a3dcd4 --- /dev/null +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -0,0 +1,94 @@ +/* + * Author: Glowbal + * Check if the repair action can be performed. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Repair Action Classname + * + * Return Value: + * Can Repair + * + * Example: + * ["something", player] call ace_repair_fnc_canRepair + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_caller", "_target", "_hitPoint", "_className"]; +TRACE_4("params",_caller,_target,_hitPoint,_className); + +private ["_config", "_engineerRequired", "_items", "_locations", "_return", "_condition", "_vehicleStateCondition"]; + +_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +if !(isClass _config) exitwith {false}; // or go for a default? +if(isEngineOn _target) exitwith {false}; + +_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { + getNumber (_config >> "requiredEngineer"); +} else { + // Check for required class + if (isText (_config >> "requiredEngineer")) exitwith { + missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; + }; + 0; +}; +if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; + +_items = getArray (_config >> "items"); +if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; + +_return = true; +if (getText (_config >> "condition") != "") then { + _condition = getText (_config >> "condition"); + if (isnil _condition) then { + _condition = compile _condition; + } else { + _condition = missionNamespace getVariable _condition; + }; + if (typeName _condition == "BOOL") then { + _return = _condition; + } else { + _return = [_caller, _target, _hitPoint, _className] call _condition; + }; +}; + +if (!_return) exitwith {false}; + +_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { + missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] +} else { + getNumber(_config >> "vehicleStateCondition") +}; +// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; + +_locations = getArray (_config >> "repairLocations"); +if ("All" in _locations) exitwith {true}; + +private ["_repairFacility", "_repairVeh"]; +_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; +_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; + +{ + if (_x == "field") exitwith {_return = true;}; + if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; + if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; + if !(isnil _x) exitwith { + private "_val"; + _val = missionNamespace getVariable _x; + if (typeName _val == "SCALAR") then { + _return = switch (_val) do { + case 0: {true}; //useAnywhere + case 1: {call _repairVeh}; //repairVehicleOnly + case 2: {call _repairFacility}; //repairFacilityOnly + case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility + default {false}; //Disabled + }; + }; + }; +} forEach _locations; + +_return && alive _target; diff --git a/addons/repair/functions/fnc_canRepairTrack.sqf b/addons/repair/functions/fnc_canRepairTrack.sqf new file mode 100644 index 0000000000..34165068d7 --- /dev/null +++ b/addons/repair/functions/fnc_canRepairTrack.sqf @@ -0,0 +1,41 @@ +/* + * Author: commy2 + * Check if the unit can replace given wheel of the vehicle. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_canRepairTrack + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target", "_hitPoint", ["_wheel",false]]; +TRACE_4("params",_unit,_target,_hitPoint,_wheel); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + +if (typeName _wheel == "OBJECT") then { + // not near interpret as objNull + if !(_wheel in nearestObjects [_unit, ["ACE_Track"], 5]) then { + _wheel = objNull; + }; +} else { + _wheel = objNull; + + { + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _wheel = _x; + }; + } forEach nearestObjects [_unit, ["ACE_Track"], 5]; +}; + +if (isNull _wheel || damage _wheel >= 1) exitWith {false}; + +alive _target && {_target getHitPointDamage _hitPoint > 0} diff --git a/addons/repair/functions/fnc_canReplaceTrack.sqf b/addons/repair/functions/fnc_canReplaceTrack.sqf new file mode 100644 index 0000000000..94a62a5289 --- /dev/null +++ b/addons/repair/functions/fnc_canReplaceTrack.sqf @@ -0,0 +1,42 @@ +/* + * Author: commy2 + * Check if the unit can replace given wheel of the vehicle. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Track / (default: false) + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_canReplaceTrack + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target", "_hitPoint", ["_track", false]]; +TRACE_4("params",_unit,_target,_hitPoint,_track); +// TODO [_unit, _track] call EFUNC(common,claim); on start of action + +if (typeName _track == "OBJECT") then { + // not near interpret as objNull + if !(_track in nearestObjects [_unit, ["ACE_Track"], 5]) then { + _track = objNull; + }; +} else { + _track = objNull; + + { + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _track = _x; + }; + } forEach nearestObjects [_unit, ["ACE_Track"], 5]; +}; + +if (isNull _track) exitWith {false}; + +alive _target && {_target getHitPointDamage _hitPoint >= 1} diff --git a/addons/repair/functions/fnc_canReplaceWheel.sqf b/addons/repair/functions/fnc_canReplaceWheel.sqf new file mode 100644 index 0000000000..9497504370 --- /dev/null +++ b/addons/repair/functions/fnc_canReplaceWheel.sqf @@ -0,0 +1,48 @@ +/* + * Author: commy2 + * Check if the unit can replace given wheel of the vehicle. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Wheel / (default: false) + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_canReplaceWheel + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_target", "_hitPoint", ["_wheel", false]]; +TRACE_4("params",_unit,_target,_hitPoint,_wheel); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +//if !([_unit, _target, _hitpoint, "ReplaceWheel"] call FUNC(canRepair)) exitwith {false}; + +//if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +//if !([_unit, GVAR(engineerSetting_Wheel)] call FUNC(isEngineer)) exitWith {false}; + +// check for a near wheel +if (typeName _wheel == "OBJECT") then { + // not near interpret as objNull + if !(_wheel in nearestObjects [_unit, ["ACE_Wheel"], 5]) then { + _wheel = objNull; + }; +} else { + _wheel = objNull; + + { + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _wheel = _x; + }; + } forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; +}; + +if (isNull _wheel) exitWith {false}; + +alive _target && {_target getHitPointDamage _hitPoint >= 1} diff --git a/addons/repair/functions/fnc_doFullRepair.sqf b/addons/repair/functions/fnc_doFullRepair.sqf new file mode 100644 index 0000000000..6beec4c4c7 --- /dev/null +++ b/addons/repair/functions/fnc_doFullRepair.sqf @@ -0,0 +1,23 @@ +/* + * Author: Glowbal + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doFullRepair + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint"]; +TRACE_3("params",_unit,_vehicle,_hitPoint); + +_vehicle setDamage 0; diff --git a/addons/repair/functions/fnc_doRemoveTrack.sqf b/addons/repair/functions/fnc_doRemoveTrack.sqf new file mode 100644 index 0000000000..68755658ca --- /dev/null +++ b/addons/repair/functions/fnc_doRemoveTrack.sqf @@ -0,0 +1,44 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRemoveTrack + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint"]; +TRACE_3("params",_unit,_vehicle,_hitPoint); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +// get current hitpoint damage +private "_hitPointDamage"; +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; + +// can't remove destroyed or already removed wheel +if (_hitPointDamage >= 1) exitWith {}; + +// don't die by spawning / moving the wheel +["fixCollision", _unit] call EFUNC(common,localEvent); + +// spawn wheel +private "_wheel"; +_wheel = ["ACE_Track", getPosASL _unit] call FUNC(spawnObject); +_wheel setdamage _hitPointDamage; + +// raise event to set the new hitpoint damage +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + [localize LSTRING(RemovedTrack)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_doRemoveWheel.sqf b/addons/repair/functions/fnc_doRemoveWheel.sqf new file mode 100644 index 0000000000..0ffeb7ad23 --- /dev/null +++ b/addons/repair/functions/fnc_doRemoveWheel.sqf @@ -0,0 +1,44 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRemoveWheel + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint"]; +TRACE_3("params",_unit,_vehicle,_hitPoint); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action +// get current hitpoint damage +private "_hitPointDamage"; +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; + +// can't remove destroyed or already removed wheel +if (_hitPointDamage >= 1) exitWith {}; + +// don't die by spawning / moving the wheel +["fixCollision", _unit] call EFUNC(common,localEvent); + +// spawn wheel +private "_wheel"; +_wheel = ["ACE_Wheel", getPosASL _unit] call FUNC(spawnObject); +_wheel setdamage _hitPointDamage; + +// raise event to set the new hitpoint damage +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, 1]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + [localize LSTRING(RemovedWheel)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_doRepair.sqf b/addons/repair/functions/fnc_doRepair.sqf new file mode 100644 index 0000000000..1cf3f77bca --- /dev/null +++ b/addons/repair/functions/fnc_doRepair.sqf @@ -0,0 +1,66 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_doRepair + * + * Public: No + */ +#include "script_component.hpp" + +private ["_hitPointDamage", "_text", "_hitpointGroup"]; +params ["_unit", "_vehicle", "_hitPoint"]; +TRACE_3("params",_unit,_vehicle,_hitPoint); + +// get current hitpoint damage +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; + +_hitPointDamage = _hitPointDamage - 0.5; +// don't use negative values for damage +_hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage)); + +// raise event to set the new hitpoint damage +["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); + +// Get hitpoint groups if available +_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups); +_hitpointGroup = []; +if (isArray _hitpointGroupConfig) then { + // Retrieve group if current hitpoint is leader of any + { + if (_x select 0 == _hitPoint) exitWith { + ([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"]; + // Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error + { + if (_x in _hitpoints) then { + ["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent); + } else { + diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle]; + }; + + } forEach (_x select 1); + }; + } forEach (getArray _hitpointGroupConfig); +}; + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + private ["_textLocalized", "_textDefault"]; + + // Find localized string + _textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)); + _textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0)); + ([_hitPoint, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"]; + + // Display text + [_text] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_doRepairTrack.sqf b/addons/repair/functions/fnc_doRepairTrack.sqf new file mode 100644 index 0000000000..4803518e3d --- /dev/null +++ b/addons/repair/functions/fnc_doRepairTrack.sqf @@ -0,0 +1,53 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Repair Action Classname + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doRepairTrack + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint", "_classname"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + +private ["_hitPointDamage", "_newDamage", "_wheel"]; + +_wheel = objNull; + +{ + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _wheel = _x; + }; +} forEach nearestObjects [_unit, ["ACE_Track"], 5]; +if (isNull _wheel) exitwith {}; + +// get current hitpoint damage + +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; +_newDamage = (1 - (damage _wheel)) / 4; // require 4 tracks to fully replace one side + +// can't replace a destroyed wheel +if ((damage _wheel) >= 1) exitWith {}; +// don't die by spawning / moving the wheel +_hitPointDamage = (_hitPointDamage - _newDamage) min 0; +deleteVehicle _wheel; + +// raise event to set the new hitpoint damage +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + [LSTRING(ReplacedTrack)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_doReplaceTrack.sqf b/addons/repair/functions/fnc_doReplaceTrack.sqf new file mode 100644 index 0000000000..13e53b3f3a --- /dev/null +++ b/addons/repair/functions/fnc_doReplaceTrack.sqf @@ -0,0 +1,56 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Repair Action Classname + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceTrack + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint", "_classname"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + +private["_hitPointDamage", "_wheel"]; + +_wheel = objNull; + +{ + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _wheel = _x; + }; +} forEach nearestObjects [_unit, ["ACE_Track"], 5]; +if (isNull _wheel) exitwith {}; + +// get current hitpoint damage +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; + +// can't replace not destroyed wheel +if (_hitPointDamage < 1) exitWith {}; + +// don't die by spawning / moving the wheel +_hitPointDamage = damage _wheel; + +// can't replace a destroyed wheel +if (_hitPointDamage >= 1) exitWith {}; + +deleteVehicle _wheel; + +// raise event to set the new hitpoint damage +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + [LSTRING(ReplacedTrack)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_doReplaceWheel.sqf b/addons/repair/functions/fnc_doReplaceWheel.sqf new file mode 100644 index 0000000000..62db39aa6d --- /dev/null +++ b/addons/repair/functions/fnc_doReplaceWheel.sqf @@ -0,0 +1,56 @@ +/* + * Author: commy2 + * Called by repair action / progress bar. Raise events to set the new hitpoint damage. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 2: Selected hitpoint + * 3: Repair Action Classname + * + * Return Value: + * None + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_doReplaceWheel + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit", "_vehicle", "_hitPoint", "_classname"]; +TRACE_4("params",_unit,_vehicle,_hitPoint,_classname); +// TODO [_unit, _wheel] call EFUNC(common,claim); on start of action + +private ["_hitPointDamage", "_wheel"]; + +_wheel = objNull; + +{ + if ([_unit, _x, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith { + _wheel = _x; + }; +} forEach nearestObjects [_unit, ["ACE_Wheel"], 5]; +if (isNull _wheel) exitwith {}; + +// get current hitpoint damage +_hitPointDamage = _vehicle getHitPointDamage _hitPoint; + +// can't replace not destroyed wheel +if (_hitPointDamage < 1) exitWith {}; + +// don't die by spawning / moving the wheel +_hitPointDamage = damage _wheel; + +// can't replace a destroyed wheel +if (_hitPointDamage >= 1) exitWith {}; + +deleteVehicle _wheel; + +// raise event to set the new hitpoint damage +["setWheelHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent); + +// display text message if enabled +if (GVAR(DisplayTextOnRepair)) then { + [LSTRING(ReplacedWheel)] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/repair/functions/fnc_getHitPointString.sqf b/addons/repair/functions/fnc_getHitPointString.sqf new file mode 100644 index 0000000000..1358e99595 --- /dev/null +++ b/addons/repair/functions/fnc_getHitPointString.sqf @@ -0,0 +1,89 @@ +/* + * Author: Jonpas + * Finds the localized string of the given hitpoint name or uses default text if none found. + * + * Arguments: + * 0: Hitpoint + * 1: Localized Text + * 2: Default Text + * 3: Track Added Hitpoints (default: false) + * + * Return Value: + * 0: Text + * 1: Added Hitpoint (default: []) + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_getHitPointString + * + * Public: No + */ +#include "script_component.hpp" + +private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"]; +params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]]; + +_track = if (count _trackArray > 0) then {true} else {false}; +_trackNames = []; +_trackStrings = []; +_trackAmount = []; + +if (_track) then { + _trackNames = _trackArray select 0; + _trackStrings = _trackArray select 1; + _trackAmount = _trackArray select 2; +}; + +// Prepare first part of the string from stringtable +_text = LSTRING(Hit); + +// Remove "Hit" from hitpoint name if one exists +_toFind = if (_hitPoint find "Hit" == 0) then { + [_hitPoint, 3] call CBA_fnc_substr +} else { + _hitPoint +}; + +// Loop through always shorter part of the hitpoint name to find the string from stringtable +for "_i" from 0 to (count _hitPoint) do { + if (_track) then { + // Loop through already added hitpoints and save index + _trackIndex = -1; + { + if (_x == _toFind) exitWith { + _trackIndex = _forEachIndex; + }; + } forEach _trackNames; + + // Use already added hitpoint if one found above and numerize + if (_trackIndex != -1) exitWith { + _text = localize (_trackStrings select _trackIndex) + " " + str(_trackAmount select _trackIndex); + _trackAmount set [_trackIndex, (_trackAmount select _trackIndex) + 1]; // Set amount + TRACE_2("Same hitpoint found",_toFind,_trackNames); + }; + }; + + + // Localize if localization found + _combinedString = _text + _toFind; + if (isLocalized _combinedString) exitWith { + _text = format [_textLocalized, localize _combinedString]; + TRACE_1("Hitpoint localized",_toFind); + + if (_track) then { + // Add hitpoint to the list + _trackNames pushBack _toFind; + _trackStrings pushBack _combinedString; + _trackAmount pushBack 2; + }; + }; + + // Cut off one character + _toFind = [_toFind, 0, count _toFind - 1] call CBA_fnc_substr; +}; + +// Don't display part name if no string is found in stringtable +if (_text == LSTRING(Hit)) then { + _text = _textDefault; +}; + +[_text, [_trackNames, _trackStrings, _trackAmount]] diff --git a/addons/repair/functions/fnc_getPostRepairDamage.sqf b/addons/repair/functions/fnc_getPostRepairDamage.sqf new file mode 100644 index 0000000000..797f7a4f22 --- /dev/null +++ b/addons/repair/functions/fnc_getPostRepairDamage.sqf @@ -0,0 +1,26 @@ +/* + * Author: commy2 + * Returns the damage threshold based on settings and unit type. + * + * Arguments: + * 0: Unit that does the repairing + * + * Return Value: + * 0: Rpair Damage Threshold + * + * Example: + * [unit] call ace_repair_fnc_getPostRepairDamage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_unit"]; +TRACE_1("params",_unit); +// TODO when near repair station, full repair? + +if (([_unit] call FUNC(isInRepairFacility) || {[_unit] call FUNC(isNearRepairVehicle)})) exitwith {0}; + +if ([_unit, GVAR(engineerSetting_Repair) + 1] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold_Engineer)}; +if ([_unit, GVAR(engineerSetting_Repair)] call FUNC(isEngineer)) exitWith {GVAR(repairDamageThreshold)}; +0.3; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf new file mode 100644 index 0000000000..182c6f54f0 --- /dev/null +++ b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -0,0 +1,82 @@ +/* + * Author: commy2 + * Returns the wheel hitpoints and their selections. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * 0: Wheel hitpoints + * 1: Wheel hitpoint selections in model coordinates + * + * Example: + * [unit, vehicle, "hitpoint"] call ace_repair_fnc_getWheelHitPointsWithSelections + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params",_vehicle); + +// get the vehicles wheel config +private "_wheels"; +_wheels = configfile >> "CfgVehicles" >> typeOf _vehicle >> "Wheels"; + +// exit with nothing if the vehicle has no wheels class +if !(isClass _wheels) exitWith {[[],[]]}; + +// get all wheels and read selections from config +private ["_selections", "_bones"]; + +_wheels = "true" configClasses _wheels; + +_selections = []; +_bones = []; +{ + _selections pushBack getText (_x >> "center"); + + private "_bone"; + _bone = getText (_x >> "boneName"); + + _bone = toArray _bone; + _bone resize count "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. + _bone = toString _bone; + + _bones pushBack _bone; +} forEach _wheels; + +// get hitpoints with their fire geometry selections +private ["_hitPointsWithSelections", "_hitPoints", "_hitPointSelections"]; + +_hitPointsWithSelections = [_vehicle] call EFUNC(common,getHitPointsWithSelections); + +_hitPoints = _hitPointsWithSelections select 0; +_hitPointSelections = _hitPointsWithSelections select 1; + +// assign hitpoints to correct wheel selection by comparing bone name and fire geometry selection +private ["_wheelHitPoints", "_wheelHitPointSelections"]; + +_wheelHitPoints = []; +_wheelHitPointSelections = []; +{ + private "_bone"; + _bone = _x; + + private "_index"; + + _index = -1; + { + if (_bone != "" && {_x find _bone == 0}) exitWith { // same as above. Requirement for physx. + _index = _forEachIndex; + }; + } forEach _hitPointSelections; + + if (_index != -1) then { + _wheelHitPoints pushBack (_hitPoints select _index); + _wheelHitPointSelections pushBack (_selections select _forEachIndex); + }; + +} forEach _bones; + +[_wheelHitPoints, _wheelHitPointSelections] diff --git a/addons/repair/functions/fnc_hasItems.sqf b/addons/repair/functions/fnc_hasItems.sqf new file mode 100644 index 0000000000..2f070c8bb6 --- /dev/null +++ b/addons/repair/functions/fnc_hasItems.sqf @@ -0,0 +1,34 @@ +/* + * Author: Glowbal + * Check if the engineer has all items. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Items required + * + * Return Value: + * Has Items + * + * Example: + * [engineer, [items]] call ace_repair_fnc_hasItems + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_items"]; +TRACE_2("params",_unit,_items); + +private ["_return"]; + +_return = true; +{ + if (typeName _x == "ARRAY" && {({[_unit, _x] call EFUNC(common,hasItem)} count _x == 0)}) exitwith { + _return = false; + }; + if (typeName _x == "STRING" && {!([_unit, _x] call EFUNC(common,hasItem))}) exitwith { + _return = false; + }; +} forEach _items; + +_return; diff --git a/addons/repair/functions/fnc_isEngineer.sqf b/addons/repair/functions/fnc_isEngineer.sqf new file mode 100644 index 0000000000..9d6af3a1ff --- /dev/null +++ b/addons/repair/functions/fnc_isEngineer.sqf @@ -0,0 +1,29 @@ +/* + * Author: Glowbal, KoffeinFlummi, commy2 + * Check if a unit is any engineer class. + * + * Arguments: + * 0: Unit + * 1: Class (default: 1) + * + * Return Value: + * Is Engineer Class + * + * Example: + * [unit, 1] call ace_repair_fnc_isEngineer + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", ["_engineerN", 1]]; +TRACE_2("params",_unit,_engineerN); + +private ["_class"]; +_class = _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer")]; + +// This if statement is here for copmatability with the common variant of isEngineer, which requires a bool. +// We cannot move this function to common because we require the GVAR(engineerSetting_Repair), which only makes sense to include in the repair module. +if (typeName _class == "BOOL") then {_class = 1}; + +_class >= (_engineerN min GVAR(engineerSetting_Repair)); diff --git a/addons/repair/functions/fnc_isInRepairFacility.sqf b/addons/repair/functions/fnc_isInRepairFacility.sqf new file mode 100644 index 0000000000..0c062ff0b3 --- /dev/null +++ b/addons/repair/functions/fnc_isInRepairFacility.sqf @@ -0,0 +1,42 @@ +/* + * Author: Glowbal + * Checks if a unit is in a repair facility. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Is inside a repair facility + * + * Example: + * [unit] call ace_repair_fnc_isInRepairFacility + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_object"]; +TRACE_1("params",_object); + +private ["_position","_objects","_isInBuilding","_repairFacility"]; + +_position = getPosASL _object; +_isInBuilding = false; +_repairFacility = []; + +_objects = (lineIntersectsWith [_object modelToWorldVisual [0, 0, (_position select 2)], _object modelToWorldVisual [0, 0, (_position select 2) +10], _object]); +{ + if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { + _isInBuilding = true; + }; +} forEach _objects; + +if (!_isInBuilding) then { + _objects = position _object nearObjects 7.5; + { + if (((typeOf _x) in _repairFacility) || (_x getVariable ["ACE_isRepairFacility",0]) > 0) exitwith { + _isInBuilding = true; + }; + } forEach _objects; +}; +_isInBuilding; diff --git a/addons/repair/functions/fnc_isNearRepairVehicle.sqf b/addons/repair/functions/fnc_isNearRepairVehicle.sqf new file mode 100644 index 0000000000..677f489a88 --- /dev/null +++ b/addons/repair/functions/fnc_isNearRepairVehicle.sqf @@ -0,0 +1,30 @@ +/* + * Author: KoffeinFlummi + * Checks if a unit is near an engineering vehicle. + * + * Arguments: + * 0: Unit + * + * Return Value: + * Is near engineering vehicle + * + * Example: + * [unit] call ace_repair_fnc_isNearRepairVehicle + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit"]; +TRACE_1("params",_unit); + +private ["_nearObjects", "_return"]; + +_nearObjects = nearestObjects [_unit, ["Air","LandVehicle"], 20]; + +_return = false; +{ + if ([_x] call FUNC(isRepairVehicle)) exitwith {_return = true;}; +} forEach _nearObjects; + +_return; diff --git a/addons/repair/functions/fnc_isRepairVehicle.sqf b/addons/repair/functions/fnc_isRepairVehicle.sqf new file mode 100644 index 0000000000..121bda0fe3 --- /dev/null +++ b/addons/repair/functions/fnc_isRepairVehicle.sqf @@ -0,0 +1,23 @@ +/* + * Author: Glowbal + * Check if vehicle is a engineering vehicle. + * + * Arguments: + * 0: Vehicle + * + * ReturnValue: + * Is engineering vehicle + * + * Example: + * [vehicle] call ace_repair_fnc_isRepairVehicle + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params",_vehicle); + +if (_vehicle isKindOf "CAManBase") exitwith {false}; + +((_vehicle getVariable ["ACE_isRepairVehicle", getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(canRepair))]) > 0); diff --git a/addons/repair/functions/fnc_moduleAssignEngineer.sqf b/addons/repair/functions/fnc_moduleAssignEngineer.sqf new file mode 100644 index 0000000000..9fb9ed8431 --- /dev/null +++ b/addons/repair/functions/fnc_moduleAssignEngineer.sqf @@ -0,0 +1,31 @@ +/* + * Author: Glowbal + * Assign an engineer role to a unit. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_repair_fnc_moduleAssignEngineer" + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; + +if (!isNull _logic) then { + private ["_list", "_setting"]; + _list = _logic getVariable ["EnableList",""]; + _setting = _logic getVariable ["role",0]; + + [_list, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList); + }; + +true diff --git a/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf new file mode 100644 index 0000000000..00cb847866 --- /dev/null +++ b/addons/repair/functions/fnc_moduleAssignRepairFacility.sqf @@ -0,0 +1,31 @@ +/* + * Author: Glowbal + * Assign a repair facility. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_repair_fnc_moduleAssignRepairFacility" + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; + +if (!isNull _logic) then { + private ["_list", "_setting"]; + _list = _logic getVariable ["EnableList",""]; + _setting = _logic getVariable ["role",0]; + + [_list, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList); + }; + +true diff --git a/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf new file mode 100644 index 0000000000..69d2a2c52f --- /dev/null +++ b/addons/repair/functions/fnc_moduleAssignRepairVehicle.sqf @@ -0,0 +1,31 @@ +/* + * Author: Glowbal + * Assign a repair vehicle. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_repair_fnc_moduleAssignRepairVehicle" + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; + +if (!isNull _logic) then { + private ["_list", "_setting"]; + _list = _logic getVariable ["EnableList",""]; + _setting = _logic getVariable ["role",0]; + + [_list, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); + [synchronizedObjects _logic, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList); + }; + +true diff --git a/addons/repair/functions/fnc_moduleRepairSettings.sqf b/addons/repair/functions/fnc_moduleRepairSettings.sqf new file mode 100644 index 0000000000..3b97d2f168 --- /dev/null +++ b/addons/repair/functions/fnc_moduleRepairSettings.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * Adjusts repair damage settings. + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Example: + * function = "ace_repair_fnc_moduleRepairSettings" + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; + +if (!isServer) exitWith {}; + +[_logic, QGVAR(engineerSetting_Repair), "engineerSetting_Repair"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(engineerSetting_Wheel), "engineerSetting_Wheel"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(consumeItem_ToolKit), "consumeItem_ToolKit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(repairDamageThreshold), "repairDamageThreshold"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(repairDamageThreshold_Engineer), "repairDamageThreshold_Engineer"] call EFUNC(common,readSettingFromModule); + + +[_logic, QGVAR(fullRepairLocation), "fullRepairLocation"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(engineerSetting_fullRepair), "engineerSetting_fullRepair"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Repair Module Initialized."; diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf new file mode 100644 index 0000000000..88c72f4de8 --- /dev/null +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -0,0 +1,48 @@ +/* + * Author: commy2 + * Used to normalize dependant hitpoints. May overwrite some global variables that are named like hitpoints or "Total" though... + * + * Arguments: + * 0: Local Vehicle + * + * Return Value: + * None + * + * Example: + * [vehicle] call ace_repair_fnc_normalizeHitPoints + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle"]; +TRACE_1("params",_vehicle); + +// Can't execute all commands if the vehicle isn't local, exit if that's so +if !(local _vehicle) exitWith {}; + +private ["_hitPoints", "_config", "_dependentHitPoints", "_dependentHitPointScripts", "_damage"]; + +_hitPoints = [_vehicle] call EFUNC(common,getHitPoints); +_config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints"; + +// define global variables. Needed to parse the depends config entries. Also find dependent hitpoints. + +_dependentHitPoints = []; +_dependentHitPointScripts = []; + +Total = damage _vehicle; + +{ + missionNamespace setVariable [_x, _vehicle getHitPointDamage _x]; + if (isText (_config >> _x >> "depends")) then { + _dependentHitPoints pushBack _x; + _dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends"); + }; +} forEach _hitPoints; + +// apply normalized damage to all dependand hitpoints +{ + _damage = call (_dependentHitPointScripts select _forEachIndex); + _vehicle setHitPointDamage [_x, _damage]; +} forEach _dependentHitPoints; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf new file mode 100644 index 0000000000..8fa7f498bd --- /dev/null +++ b/addons/repair/functions/fnc_repair.sqf @@ -0,0 +1,201 @@ +/* + * Author: Glowbal, KoffeinFlummi + * Starts the repair process. + * + * Arguments: + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 3: Repair Action Classname + * + * Return Value: + * Succesful Repair Started + * + * Example: + * [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_repair + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_caller", "_target", "_hitPoint", "_className"]; +TRACE_4("params",_calller,_target,_hitPoint,_className); + +private["_callbackProgress", "_callerAnim", "_calller", "_condition", "_config", "_consumeItems", "_displayText", "_engineerRequired", "_iconDisplayed", "_items", "_locations", "_repairTime", "_repairTimeConfig", "_return", "_usersOfItems", "_vehicleStateCondition", "_wpn"]; + +_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); +if !(isClass _config) exitwith {false}; // or go for a default? + +_engineerRequired = if (isNumber (_config >> "requiredEngineer")) then { + getNumber (_config >> "requiredEngineer"); +} else { + // Check for required class + if (isText (_config >> "requiredEngineer")) exitwith { + missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0]; + }; + 0; +}; +if !([_caller, _engineerRequired] call FUNC(isEngineer)) exitwith {false}; +if (isEngineOn _target) exitwith {false}; +_items = getArray (_config >> "items"); +if (count _items > 0 && {!([_caller, _items] call FUNC(hasItems))}) exitwith {false}; + +_return = true; +if (getText (_config >> "condition") != "") then { + _condition = getText (_config >> "condition"); + if (isnil _condition) then { + _condition = compile _condition; + } else { + _condition = missionNamespace getVariable _condition; + }; + if (typeName _condition == "BOOL") then { + _return = _condition; + } else { + _return = [_caller, _target, _hitPoint, _className] call _condition; + }; +}; +if (!_return) exitwith {false}; + +_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then { + missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0] +} else { + getNumber(_config >> "vehicleStateCondition") +}; +// if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; + +_locations = getArray (_config >> "repairLocations"); +if ("All" in _locations) exitwith {true}; + +private ["_repairFacility", "_repairVeh"]; +_repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; +_repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; + +{ + if (_x == "field") exitwith {_return = true;}; + if (_x == "RepairFacility" && _repairFacility) exitwith {_return = true;}; + if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;}; + if !(isnil _x) exitwith { + private "_val"; + _val = missionNamespace getVariable _x; + if (typeName _val == "SCALAR") then { + _return = switch (_val) do { + case 0: {true}; //useAnywhere + case 1: {call _repairVeh}; //repairVehicleOnly + case 2: {call _repairFacility}; //repairFacilityOnly + case 3: {(call _repairFacility) || {call _repairVeh}}; //vehicleAndFacility + default {false}; //Disabled + }; + }; + }; +} forEach _locations; + +if !(_return && alive _target) exitwith {false}; + +_consumeItems = if (isNumber (_config >> "itemConsumed")) then { + getNumber (_config >> "itemConsumed"); +} else { + // Check for required class + if (isText (_config >> "itemConsumed")) exitwith { + missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0]; + }; + 0; +}; + +_usersOfItems = []; +if (_consumeItems > 0) then { + _usersOfItems = ([_caller, _target, _items] call FUNC(useItems)) select 1; +}; + +// Parse the config for the progress callback +_callbackProgress = getText (_config >> "callbackProgress"); +if (_callbackProgress == "") then { + _callbackProgress = "true"; +}; +if (isNil _callbackProgress) then { + _callbackProgress = compile _callbackProgress; +} else { + _callbackProgress = missionNamespace getVariable _callbackProgress; +}; + + +// Player Animation +_callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); +_caller setvariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; + +// Cannot use secondairy weapon for animation +if (currentWeapon _caller == secondaryWeapon _caller) then { + _caller selectWeapon (primaryWeapon _caller); +}; + +_wpn = ["non", "rfl", "pst"] select (1 + ([primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _caller))); +_callerAnim = [_callerAnim, "[wpn]", _wpn] call CBA_fnc_replace; +if (vehicle _caller == _caller && {_callerAnim != ""}) then { + if (primaryWeapon _caller == "") then { + _caller addWeapon "ACE_FakePrimaryWeapon"; + }; + if (currentWeapon _caller == "") then { + _caller selectWeapon (primaryWeapon _caller); // unit always has a primary weapon here + }; + + if (stance _caller == "STAND") then { + _caller setvariable [QGVAR(repairPrevAnimCaller), "amovpknlmstpsraswrfldnon"]; + } else { + _caller setvariable [QGVAR(repairPrevAnimCaller), animationState _caller]; + }; + [_caller, _callerAnim] call EFUNC(common,doAnimation); +}; + +//Get repair time +_repairTime = if (isNumber (_config >> "repairingTime")) then { + getNumber (_config >> "repairingTime"); +} else { + if (isText (_config >> "repairingTime")) exitwith { + _repairTimeConfig = getText(_config >> "repairingTime"); + if (isnil _repairTimeConfig) then { + _repairTimeConfig = compile _repairTimeConfig; + } else { + _repairTimeConfig = missionNamespace getVariable _repairTimeConfig; + }; + if (typeName _repairTimeConfig == "SCALAR") exitwith { + _repairTimeConfig; + }; + [_caller, _target, _hitPoint, _className] call _repairTimeConfig; + }; + 0; +}; + +private ["_processText"]; +// Find localized string +_processText = getText (_config >> "displayNameProgress"); +([_hitPoint, _processText, _processText] call FUNC(getHitPointString)) params ["_text"]; + +// Start repair +[ + _repairTime, + [_caller, _target, _hitPoint, _className, _items, _usersOfItems], + DFUNC(repair_success), + DFUNC(repair_failure), + _text, + _callbackProgress, + [] +] call EFUNC(common,progressBar); + +// Display Icon +_iconDisplayed = getText (_config >> "actionIconPath"); +if (_iconDisplayed != "") then { + [QGVAR(repairActionIcon), true, _iconDisplayed, [1,1,1,1], getNumber(_config >> "actionIconDisplayTime")] call EFUNC(common,displayIcon); +}; + +// handle display of text/hints +_displayText = ""; +if (_target != _caller) then { + _displayText = getText(_config >> "displayTextOther"); +} else { + _displayText = getText(_config >> "displayTextSelf"); +}; + +if (_displayText != "") then { + ["displayTextStructured", [_caller], [[_displayText, [_caller] call EFUNC(common,getName), [_target] call EFUNC(common,getName)], 1.5, _caller]] call EFUNC(common,targetEvent); +}; + +true; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf new file mode 100644 index 0000000000..6e27ab07a7 --- /dev/null +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -0,0 +1,61 @@ +/* + * Author: KoffeinFlummi, Glowbal + * Callback when repair fails. + * + * Arguments: + * 0: Arguments + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 3: Repair Action Classname + * 4: None + * 5: Items available + * + * Return Value: + * None + * + * Example: + * [[unit, vehicle, "hitpoint", "classname", nil, [items]]] call ace_repair_fnc_repair_failure + * + * Public: No + */ +#include "script_component.hpp" + +params ["_args"]; +_args params ["_caller", "_target","_selectionName","_className","","_usersOfItems"]; +TRACE_5("params",_caller,_target,_selectionName,_className,_usersOfItems); + +private ["_config","_callback", "_usersOfItems", "_weaponSelect"]; + +if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { + _caller removeWeapon "ACE_FakePrimaryWeapon"; +}; +if (vehicle _caller == _caller) then { + [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); +}; +_caller setvariable [QGVAR(repairPrevAnimCaller), nil]; + +_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); +if (_weaponSelect != "") then { + _caller selectWeapon _weaponSelect; +} else { + _caller action ["SwitchWeapon", _caller, _caller, 99]; +}; + +{ + (_x select 0) addItem (_x select 1); +} forEach _usersOfItems; + +// Record specific callback +_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); + +_callback = getText (_config >> "callbackFailure"); +if (isNil _callback) then { + _callback = compile _callback; +} else { + _callback = missionNamespace getVariable _callback; +}; + +_args call _callback; + +// _args call FUNC(createLitter); diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf new file mode 100644 index 0000000000..ccad93663f --- /dev/null +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -0,0 +1,54 @@ +/* + * Author: KoffeinFlummi, Glowbal + * Callback when repair completes. + * + * Arguments: + * 0: Arguments + * 0: Unit that does the repairing + * 1: Vehicle to repair + * 3: Repair Action Classname + * + * Return Value: + * None + * + * Example: + * [[unit, vehicle, "hitpoint", "classname"]] call ace_repair_fnc_repair_success + * + * Public: No + */ +#include "script_component.hpp" + +params ["_args"]; +_args params ["_caller", "_target","_selectionName","_className"]; +TRACE_4("params",_caller,_target,_selectionName,_className); + +private ["_config","_callback", "_weaponSelect"]; + +if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { + _caller removeWeapon "ACE_FakePrimaryWeapon"; +}; +if (vehicle _caller == _caller) then { + [_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation); +}; +_caller setvariable [QGVAR(repairPrevAnimCaller), nil]; + +_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); +if (_weaponSelect != "") then { + _caller selectWeapon _weaponSelect; +} else { + _caller action ["SwitchWeapon", _caller, _caller, 99]; +}; + +// Record specific callback +_config = (ConfigFile >> "ACE_Repair" >> "Actions" >> _className); + +_callback = getText (_config >> "callbackSuccess"); +if (isNil _callback) then { + _callback = compile _callback; +} else { + _callback = missionNamespace getVariable _callback; +}; +_args call _callback; + +// _args call FUNC(createLitter); diff --git a/addons/repair/functions/fnc_setDamage.sqf b/addons/repair/functions/fnc_setDamage.sqf new file mode 100644 index 0000000000..410a9b0396 --- /dev/null +++ b/addons/repair/functions/fnc_setDamage.sqf @@ -0,0 +1,45 @@ +/* + * Author: commy2 + * Sets the structural damage of a vehicle without altering the hitPoints, requires local vehicle. + * + * Arguments: + * 0: Local Vehicle to Damage + * 1: Total Damage + * + * Return Value: + * None + * + * Example: + * [vehicle, 0.5] call ace_repair_fnc_setDamage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle", "_damage"]; +TRACE_2("params",_vehicle,_damage); + +// can't execute all commands if the vehicle isn't local. exit here. +if !(local _vehicle) exitWith {}; + +// save array with damage values of all hitpoints +private ["_hitPoints", "_hitPointDamages"]; + +_hitPoints = [_vehicle] call EFUNC(common,getHitpoints); + +_hitPointDamages = []; + +{ + _hitPointDamages set [_forEachIndex, _vehicle getHitPointDamage _x]; +} forEach _hitPoints; + +// set damage of the vehicle +_vehicle setDamage _damage; + +// restore original hitpoint damage values +{ + _vehicle setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; +} forEach _hitPoints; + +// normalize hitpoints +[_vehicle] call FUNC(normalizeHitPoints); diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf new file mode 100644 index 0000000000..a8b4cd347b --- /dev/null +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -0,0 +1,86 @@ +/* + * Author: commy2 + * Set the hitpoint damage and change the structural damage acordingly, requires local vehicle. + * + * Arguments: + * 0: Local Vehicle to Damage + * 1: Selected hitpoint + * 2: Total Damage + * + * Return Value: + * None + * + * Example: + * [vehicle, "hitpoint", 0.5] call ace_repair_fnc_setHitPointDamage + * + * Public: No + */ +#include "script_component.hpp" + +params ["_vehicle", "_hitPoint", "_hitPointDamage"]; +TRACE_3("params",_vehicle,_hitPoint,_hitPointDamage); + +// can't execute all commands if the vehicle isn't local. exit here. +if !(local _vehicle) exitWith {}; + +// get all valid hitpoints +private ["_hitPoints", "_hitPointsWithSelections"]; + +_hitPoints = [_vehicle] call EFUNC(common,getHitpoints); +_hitPointsWithSelections = [_vehicle] call EFUNC(common,getHitpointsWithSelections) select 0; + +// exit if the hitpoint is not valid +if !(_hitPoint in _hitPoints) exitWith {systemChat format["NOT A VALID HITPOINT: %1",_hitpoint]}; + +// save array with damage values of all hitpoints +private "_hitPointDamages"; +_hitPointDamages = []; + +{ + _hitPointDamages set [_forEachIndex, (_vehicle getHitPointDamage _x)]; +} forEach _hitPoints; + +// save structural damage and sum of hitpoint damages +private ["_damageOld", "_hitPointDamageSumOld"]; + +_damageOld = damage _vehicle; + +_hitPointDamageSumOld = 0; +{ + if (!(_x in IGNORED_HITPOINTS) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { + _hitPointDamageSumOld = _hitPointDamageSumOld + (_hitPointDamages select (_hitPoints find _x)); + }; +} forEach _hitPointsWithSelections; + +// set new damage in array +_hitPointDamages set [_hitPoints find _hitPoint, _hitPointDamage]; + +// save sum of new hitpoint damages +private "_hitPointDamageSumNew"; + +_hitPointDamageSumNew = 0; +{ + if (!(_x in IGNORED_HITPOINTS) && {!isText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "HitPoints" >> _x >> "depends")}) then { + _hitPointDamageSumNew = _hitPointDamageSumNew + (_hitPointDamages select (_hitPoints find _x)); + }; +} forEach _hitPointsWithSelections; + +// calculate new strctural damage +private "_damageNew"; +_damageNew = _hitPointDamageSumNew / count _hitPoints; + +if (_hitPointDamageSumOld > 0) then { + _damageNew = _damageOld * (_hitPointDamageSumNew / _hitPointDamageSumOld); +}; + +// set new structural damage value +_vehicle setDamage _damageNew; + +// set the new damage for that hit point + +{ + _vehicle setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; +} forEach _hitPoints; + +// normalize hitpoints +// [_vehicle] call FUNC(normalizeHitPoints); diff --git a/addons/repair/functions/fnc_spawnObject.sqf b/addons/repair/functions/fnc_spawnObject.sqf new file mode 100644 index 0000000000..1ea4b7363a --- /dev/null +++ b/addons/repair/functions/fnc_spawnObject.sqf @@ -0,0 +1,32 @@ +/* + * Author: commy2 + * Spawns an object of specified string, at specified position with specified damage taken. + * + * Arguments: + * 0: Item classname + * 1: Position + * 2: Damage + * + * Return Value: + * None + * + * Example: + * ["classname", [0, 0, 0], 1] call ace_repair_fnc_spawnObject + * + * Public: No + */ +#include "script_component.hpp" + +params ["_item", "_position", ["_damage", 0]]; +TRACE_3("params",_item,_position,_damage); + +// randomized end position +_position = _position vectorAdd [1 - random 2, 1 - random 2, 0]; + +_item = createVehicle [_item, _position, [], 0, "NONE"]; +_item setPosASL _position; + +["fixCollision", _item] call EFUNC(common,localEvent); +["fixPosition", _item] call EFUNC(common,localEvent); + +_item setDamage _damage; diff --git a/addons/repair/functions/fnc_useItem.sqf b/addons/repair/functions/fnc_useItem.sqf new file mode 100644 index 0000000000..218a7a1ee4 --- /dev/null +++ b/addons/repair/functions/fnc_useItem.sqf @@ -0,0 +1,26 @@ +/* + * Author: Glowbal + * Use Equipment if any is available. + * + * Arguments: + * 0: Unit + * 2: Item classname + * + * ReturnValue: + * None + * + * Example: + * [unit, "classname"] call ace_repair_fnc_useItem + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_item"]; +TRACE_2("params",_unit,_item); + +if ([_unit, _item] call EFUNC(common,hasItem)) exitwith { + [[_unit, _item], QUOTE(EFUNC(common,useItem)), _unit] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [true, _unit]; +}; +[false, objNull]; diff --git a/addons/repair/functions/fnc_useItems.sqf b/addons/repair/functions/fnc_useItems.sqf new file mode 100644 index 0000000000..f8aa176018 --- /dev/null +++ b/addons/repair/functions/fnc_useItems.sqf @@ -0,0 +1,41 @@ +/* + * Author: Glowbal + * Use Equipment items if any is available. + * + * Arguments: + * 0: Unit + * 1: Item classnames + * + * ReturnValue: + * None + * + * Example: + * [unit, ["classname1", "classname2"]] call ace_repair_fnc_useItems + * + * Public: Yes + */ +#include "script_component.hpp" + +params ["_unit", "_items"]; +TRACE_2("params",_unit,_items); + +private ["_itemUsedInfo", "_itemsUsedBy"]; + +_itemsUsedBy = []; +{ + // handle a one of type use item + if (typeName _x == "ARRAY") then { + { + _itemUsedInfo = [_unit, _x] call FUNC(useItem); + if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + } forEach _x; + }; + + // handle required item + if (typeName _x == "STRING") then { + _itemUsedInfo = [_unit, _x] call FUNC(useItem); + if (_itemUsedInfo select 0) exitwith { _itemsUsedBy pushback [(_itemUsedInfo select 1), _x]}; + }; +} forEach _items; + +[count _items == count _itemsUsedBy, _itemsUsedBy]; diff --git a/addons/repair/functions/script_component.hpp b/addons/repair/functions/script_component.hpp new file mode 100644 index 0000000000..80a7b2eb74 --- /dev/null +++ b/addons/repair/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\repair\script_component.hpp" diff --git a/addons/repair/script_component.hpp b/addons/repair/script_component.hpp new file mode 100644 index 0000000000..89983dd0e8 --- /dev/null +++ b/addons/repair/script_component.hpp @@ -0,0 +1,16 @@ +#define COMPONENT repair +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_REPAIR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_REPAIR + #define DEBUG_SETTINGS DEBUG_SETTINGS_REPAIR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + + +#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"] +#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"] diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml new file mode 100644 index 0000000000..09759344f8 --- /dev/null +++ b/addons/repair/stringtable.xml @@ -0,0 +1,660 @@ + + + + + + Spare Track + Ersatzkette + Cadena de repuesto + Chenille de réserve + Zapasowa gąsienica + Náhradní pásy + Lagarta Reserva + Cingolo di scorta + Pót lánctalp + Запасная гусеница + + + Spare Wheel + Ersatzreifen + Rueda de repuesto + Roue de secours + Zapasowe koło + Náhradní Kolo + Roda Reserva + Ruota di scorta + Pótkerék + Запасное колесо + + + Change Wheel + Reifen wechseln + Cambiar rueda + Changer Roue + Wymień koło + Vyměňit kolo + Trocar Roda + Sostituisci la ruota + Kerék cseréje + Поменять колесо + + + Replacing Wheel ... + Ersetze Reifen ... + Wymienianie koła ... + + + Wheel replaced + Reifen ersetzt + Koło zostało wymienione + + + Remove Wheel + Reifen entfernen + Quitar rueda + Démonter Roue + Zdejmij koło + Odstranit Kolo + Remover Roda + Rimuovi la ruota + Kerék leszerelése + Снять колесо + + + Removing Wheel ... + Entferne Reifen ... + Zdejmowanie koła ... + + + Wheel removed + Reifen entfernt + Koło zostało zdjęte + + + Change Track + Wymień gąsienicę + + + Replacing Track ... + Wymienianie gąsienicy ... + + + Track replaced + Gąsienica została wymieniona + + + Remove Track + Zdejmij gąsienicę + + + Removing Track ... + Zdejmowanie gąsienicy ... + + + Track removed + Gąsienica została zdjęta + + + Full Repair + Pełna naprawa + + + Repairing Vehicle ... + Naprawianie pojazdu ... + + + Full Repair Locations + Lokaliz. pełnej naprawy + + + At what locations can a vehicle be fully repaired? + W jakich miejscach pojazd może zostać w pełni naprawiony? + + + Allow Full Repair + Zezwól na pełną naprawę + + + Who can perform a full repair on a vehicle? + Kto może przeprowadzić pełną naprawę pojazdu? + + + Repair >> + Reparieren >> + Reparación >> + Réparer >> + Napraw >> + Opravit >> + Reparar >> + Ripara >> + Szerelés >> + Ремонт >> + + + Display text on repair + Wyświetl tekst przy naprawie + + + Display a notification whenever you repair a vehicle + Pokaż informację, kiedy wykonujesz czynności związane z naprawą pojazdu. + + + Repairing ... + Reparieren ... + Reparando ... + Réparation ... + Naprawianie... + Opravuji ... + Reparando ... + Sto riparando ... + javítása ... + Ремонтируем ... + + + Repairing %1 ... + Reparieren %1 ... + Reparando %1 ... + Réparation %1 ... + Naprawianie %1... + Opravuji %1 ... + Reparando %1 ... + Sto riparando %1 ... + %1 javítása ... + Ремонтируем %1 ... + + + Repaired %1 + %1 repariert + Reparado %1 + %1 réparé(e) + Naprawiono %1 + Opraveno - %1 + Reparado %1 + %1 Riparata/o + %1 megjavítva + %1 отремонтирован + + + Fully repaired part + Bauteil vollständig repariert + W pełni naprawiono część + + + Partially repaired %1 + Bauteil teilweise repariert + Częściowo naprawiono: %1 + + + Fully repaired %1 + %1 vollständig repariert + W pełni naprawiono: %1 + + + Partially repaired %1 + %1 teilweise repariert + Częściowo naprawiono: %1 + + + Body + Karosserie + Carrocería + Blindage + Karoseria + Karoserie + Carroceria + Carrozzeria + Test + Кузов + + + Hull + Wanne + Casco + Caisse + Kadłub + Trup + Chassi + Scafo + Test + Корпус + + + Engine + Motor + Motor + Moteur + Silnik + Motor + Motor + Motore + Motor + Двигатель + + + Left Horizontal Stabilizer + + + Right Horizontal Stabilizer + + + Vertical Stabilizer + + + Fuel Tank + Tank + Depósito + Réservoir + Zbiornik paliwa + Palivová nádrž + Tanque de Combustível + Serbatoio + Üzemanyagtank + Топливный бак + + + Transmission + + + Gear + + + Starter + + + Tail + + + Pilot Tube + + + Static Port + + + Ammo + + + Turret + Turm + Torreta + Tourelle + Wieżyczka + Věž + Torre + Torretta + Lövegtorony + Башню + + + Gun + Kanone + Cañón + Canon + Działo + Kanón + Canhão + Cannone + Ágyú + Пушку + + + Missiles + + + Left Track + Linke Kette + Cadena izquierda + Chenille gauche + Lewa gąsienica + Levý Pás + Lagarta Esquerda + Cingolo sinistro + Bal lánctalp + Левую гусеницу + + + Right Track + Rechte Kette + Cadena derecha + Chenille droite + Prawa gąsienica + Pravý Pás + Lagarta Direita + Cingolo destro + Jobb lánctalp + Правую гусеницу + + + Left Front Wheel + Linkes Vorderrad + Rueda frontal izquierda + Roue avant-gauche + Przednie lewe koło + Levé přední Kolo + Roda Dianteira Esquerda + Ruota frontale sinistra + Bal első kerék + Левое переднее колесо + + + Right Front Wheel + Rechtes Vorderrad + Rueda frontal derecha + Roue avant-droite + Przednie prawe koło + Pravé přední Kolo + Roda Dianteira Direita + Ruota frontale destra + Jobb első kerék + Правое переднее колесо + + + Second Left Front Wheel + Zweites linkes Vorderrad + Segunda rueda frontal izquierda + Deuxième roue avant-gauche + Drugie przednie lewe koło + Druhé Levé přední Kolo + Segunda Roda Dianteira Esquerda + Seconda ruota frontale sinistra + Második bal első kerék + Второе переднее левое колесо + + + Second Right Front Wheel + Zweites rechtes Vorderrad + Segunda rueda frontal derecha + Deuxième roue avant-droite + Drugie przednie prawe koło + Druhé Pravé přední Kolo + Segunda Roda Dianteira Direita + Seconda ruota frontale destra + Második jobb hátsó kerék + Второе правое переднее колесо + + + Left Middle Wheel + Linkes mittleres Rad + Rueda central izquierda + Roue centre-gauche + Środkowe lewe koło + Levé prostřední Kolo + Roda Intermediária Esquerda + Ruota centrale sinistra + Bal középső kerék + Левое среднее колесо + + + Right Middle Wheel + Rechtes mittleres Rad + Rueda central derecha + Roue centre-droite + Środkowe prawe koło + Pravé prostřední Kolo + Roda Intermediária Direita + Ruota centrale destra + Jobb középső kerék + Правое среднее колесо + + + Left Rear Wheel + Linkes Hinterrad + Rueda trasera izquierda + Roue arrière-gauche + Tylnie lewe koło + Levé zadní Kolo + Roda Traseira Esquerda + Ruota posteriore sinistra + Bal hátsó kerék + Левое заднее колесо + + + Right Rear Wheel + Rechtes Hinterrad + Rueda trasera derecha + Roue arrière-droite + Tylnie prawe koło + Pravé zadní Kolo + Roda Traseira Direita + Ruota posteriore destra + Jobb hátsó kerék + Правое заднее колесо + + + Avionics + Avionik + Aviónica + Avionique + Awionika + Elektronika + Aviônica + Avionica + Avionika + Авионику + + + Main Rotor + Hauptrotor + Rotor principal + Rotor principal + Główny rotor + Hlavní Rotor + Rotor Principal + Rotore principale + Főrotor + Несущий винт + + + Tail Rotor + Heckrotor + Rotor de cola + Rotor anticouple + Tylni rotor + Zadní Rotor + Rotor de Cauda + Rotore di coda + Farokrotor + Рулевой винт + + + Winch + Seilwinde + Wyciągarka + + + Glass (right) + Scheibe (rechts) + Ventana (derecha) + Vitre (droite) + Szyba (prawa) + Sklo (pravé) + Vidro (à direita) + Vetro destro + Jobb szélvédő + Стекло (справа) + + + Glass (left) + Scheibe (links) + Ventana (izquierda) + Vitre (gauche) + Szyba (lewa) + Sklo (pravé) + Vidro (à esquerda) + Vetro sinistro + Bal szélvédő + Стекло (слава) + + + Glass + Scheibe + Ventana + Vitre + Szyba + Sklo + Vidro + Vetro + Üveg + Стекло + + + Repair Settings + Ustawienia naprawy + + + Provides a repair system for all types of vehicles. + Dostarcza rozbudowany system naprawy dla wszystkich typów pojazdów. + + + Anyone + Ktokolwiek + + + Engineer only + Tylko mechanicy + + + Repair Specialist only + Tylko inżynierowie + + + Allow Wheel + Wymiana kół + + + Who can remove and replace wheels? + Kto może zdejmować i zmieniać koła? + + + Allow Repair + Możliwość naprawy + + + Who can perform repair actions? + Kto może wykonywać czynności związane z naprawą pojazdów? + + + Repair Threshold + Próg naprawy + + + What is the maximum damage that can be repaired with a toolkit? + Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przy pomocy narzędzi? + + + Repair Threshold (Engineer) + Próg naprawy (mechanik) + + + What is the maximum damage that can be repaired by an engineer? + Jaki jest maksymalny poziom uszkodzeń jaki może zostać naprawiony przez mechanika? + + + Remove toolkit on use + Usuń narzędzia po użyciu + + + Should the toolkit be removed on usage? + Czy zestaw naprawczy powinien zostać usunięty po jego użyciu? + + + Anywhere + Wszędzie + + + Repair Vehicle only + Przy pojazdach naprawczych + + + Repair Facility only + Przy budynkach naprawczych + + + Repair Facility or Vehicle + Przy budynkach i pojazdach naprawczych + + + Assign Engineer + Przydziel inżyniera + + + List + Lista + + + List of unit names that will be classified as engineer, separated by commas. + Lista nazw jednostek, które są sklasyfikowane jako inżynierowie, oddzielone przecinkami. + + + Is Engineer + Poziom wyszkolenia + + + Select the engineering skill level of the unit + Wybierz biegłość w dziedzinie naprawy danej jednostki + + + None + Żadny + + + Engineer + Mechanik + + + Specialist + Inżynier + + + Assign one or multiple units as an engineer + Przydziel klasę inżyniera do jednej lub kilku jednostek + + + Assign Repair Vehicle + Przydziel pojazd naprawczy + + + List + Lista + + + List of vehicles that will be classified as repair vehicle, separated by commas. + Lista nazw pojazdów, które są sklasyfikowane jako pojazdy naprawcze, oddzielone przecinkami. + + + Is Repair Vehicle + Jest poj. naprawczym + + + Is the vehicle classified as a repair vehicle? + Czy pojazd jest zklasyfikowany jako pojazd naprawczy? + + + Assign one or multiple vehicles as a repair vehicle + Przydziel klasę pojazdu naprawczego do jednego lub kilku pojazdów. + + + Assign Repair Facility + Przydziel budynek naprawczy + + + List + Lista + + + List of objects that will be classified as repair Facility, separated by commas. + Lista nazw budynków, które są sklasyfikowane jako budynki naprawcze, oddzielone przecinkami. + + + Is Repair Facility + Jest bud. naprawczym + + + Is the object classified as a repair Facility? + Czy budynek jest zklasyfikowany jako budynek naprawczy? + + + Assign one or multiple objects as a repair Facility + Przydziel klasę budynku naprawczego do jednego lub kilku budynków. + + + diff --git a/addons/repair/ui/Icon_Module_Repair_ca.paa b/addons/repair/ui/Icon_Module_Repair_ca.paa new file mode 100644 index 0000000000..11b0f896d6 Binary files /dev/null and b/addons/repair/ui/Icon_Module_Repair_ca.paa differ diff --git a/addons/repair/ui/tire_ca.paa b/addons/repair/ui/tire_ca.paa new file mode 100644 index 0000000000..93ceb6bb6c Binary files /dev/null and b/addons/repair/ui/tire_ca.paa differ diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 285c560a6c..7e55c1d8e2 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -1,16 +1,16 @@ /* - Name: ACE_Respawn_fnc_removeBody - + Name: ACE_Respawn_fnc_restoreGear + Author(s): bux578 - + Description: Restores previously saved gear - + Parameters: 0: OBJECT - unit - 1: ARRAY - Array containing all gear - + 1: ARRAY - Array containing all gear (result of ACE_common_fnc_getAllGear) + Returns: VOID */ @@ -19,7 +19,15 @@ 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"]; +private ["_unit", "_allGear", "_headgear", "_goggles", +"_uniform", "_uniformitems", +"_vest", "_vestitems", +"_backpack", "_backpackitems", "_backpa", +"_primaryweapon", "_primaryweaponitems", "_primaryweaponmagazine", +"_secondaryweapon", "_secondaryweaponitems", "_secondaryweaponmagazine", +"_handgunweapon", "_handgunweaponitems", "_handgunweaponmagazine", +"_assigneditems", "_binocular", +"_activeWeaponAndMuzzle", "_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; // remove all starting gear of a player @@ -51,6 +59,7 @@ _handgunweaponitems = _allGear select 15; _handgunweaponmagazine = _allGear select 16; _assigneditems = _allGear select 17; _binocular = _allGear select 18; +_activeWeaponAndMuzzle = _allGear select 19; // start restoring the items @@ -69,16 +78,16 @@ if (_goggles != "") then { { _unit addItemToUniform _x; -}forEach _uniformitems; +} forEach _uniformitems; { _unit addItemToVest _x; -}forEach _vestitems; +} forEach _vestitems; private "_flagRemoveDummyBag"; _flagRemoveDummyBag = false; -if(format["%1", _backpack] != "") then { +if (format["%1", _backpack] != "") then { _unit addBackpack _backpack; _backpa = unitBackpack _unit; @@ -158,7 +167,36 @@ _assignedItems = _assignedItems - [_binocular]; _unit addWeapon _binocular; +// reload Laserdesignator +// we assume that if the unit had a Laserdesignator it probably had batteries for it if ("Laserdesignator" in assignedItems _unit) then { _unit selectWeapon "Laserdesignator"; - if (currentMagazine _unit == "") then {_unit addMagazine "Laserbatteries";}; + + if (currentMagazine _unit == "") then { + _unit addMagazine "Laserbatteries"; + }; +}; + +// restore the last active weapon, muzzle and weaponMode +_activeWeapon = _activeWeaponAndMuzzle select 0; +_activeMuzzle = _activeWeaponAndMuzzle select 1; +_activeWeaponMode = _activeWeaponAndMuzzle select 2; + +if (_activeMuzzle != "" and _activeMuzzle != _activeWeapon) then { + _unit selectWeapon _activeMuzzle; +} else { + if (_activeWeapon != "") then { + _unit selectWeapon _activeWeapon; + }; +}; + +if (currentWeapon _unit != "") then { + private ["_index"]; + _index = 0; + while { + _index < 100 && {currentWeaponMode _unit != _activeWeaponMode} + } do { + _unit action ["SwitchWeapon", _unit, _unit, _index]; + _index = _index + 1; + }; }; diff --git a/addons/safemode/XEH_preInit.sqf b/addons/safemode/XEH_preInit.sqf index 6bedb35134..e6eb91b8bd 100644 --- a/addons/safemode/XEH_preInit.sqf +++ b/addons/safemode/XEH_preInit.sqf @@ -2,7 +2,6 @@ ADDON = false; -PREP(firstMode); PREP(lockSafety); PREP(playChangeFiremodeSound); PREP(setSafeModeVisual); diff --git a/addons/safemode/functions/fnc_firstMode.sqf b/addons/safemode/functions/fnc_firstMode.sqf deleted file mode 100644 index d10da3f896..0000000000 --- a/addons/safemode/functions/fnc_firstMode.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -PARAMS_1(_weapon); - -private ["_mode"]; -_mode = getArray (configFile >> "CfgWeapons" >> _weapon >> "modes") select 0; - -[_mode, _weapon] select (_mode == "this") diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 42a8ef89fb..54fa254716 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -1,12 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * Put weapon on safety, or take it off safety if safety is already put on. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: Muzzle + * + * Return Value: + * None + * + * Example: + * [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call ace_safemode_fnc_lockSafety + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_unit,_weapon,_muzzle); - // don't immediately switch back if (inputAction "nextWeapon" > 0) exitWith {}; -private ["_safedWeapons"]; +private ["_safedWeapons", "_condition", "_statement", "_id", "_picture"]; + +params ["_unit", "_weapon", "_muzzle"]; + _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) exitWith { @@ -18,15 +35,14 @@ _safedWeapons pushBack _weapon; _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (_unit getVariable [QGVAR(actionID), -1] == -1) then { - private ["_condition", "_statement", "_id"]; - _condition = { + params ["", "_caller"]; if ( - [_this select 1] call EFUNC(common,canUseWeapon) + [_caller] call EFUNC(common,canUseWeapon) && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { + if (currentMuzzle _caller in (_caller getVariable [QGVAR(safedWeapons), []])) then { if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + [_this select 1, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); false }; true @@ -44,7 +60,8 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then { }; _statement = { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + params ["", "_caller"]; + [_caller, currentWeapon _caller, currentMuzzle _caller] call FUNC(unlockSafety); }; //_id = [_unit, format ["%1", localize LSTRING(TakeOffSafety)], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); @@ -54,12 +71,11 @@ if (_unit getVariable [QGVAR(actionID), -1] == -1) then { }; if ((typeName _muzzle) == (typeName "")) then { - _unit selectWeapon _muzzle;//_weapon + _unit selectWeapon _muzzle; //_weapon }; // play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); -private "_picture"; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 754a02005c..3fa29f3d88 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,9 +1,25 @@ -// by commy2 +/* + * Author: commy2 + * Play weapon firemode change sound. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_playChangeFiremodeSound + * + * Public: No + */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +private ["_sound", "_position"]; + +params ["_unit", "_weapon"]; -private ["_sound"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (count _sound == 0) exitWith { @@ -15,13 +31,8 @@ if ({(toLower (_sound select 0) find _x == (count toArray (_sound select 0) - co _sound set [0, (_sound select 0) + ".wss"]; }; -// add default volume, pitch and distance -if (count _sound < 2) then {_sound pushBack 1}; -if (count _sound < 3) then {_sound pushBack 1}; -if (count _sound < 4) then {_sound pushBack 0}; - -private "_position"; _position = _unit modelToWorldVisual (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; -playSound3D [_sound select 0, objNull, false, _position, _sound select 1, _sound select 2, _sound select 3]; +_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; +playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index cb8c679855..43f4bc79b6 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,17 +1,31 @@ -// by commy2 +/* + * Author: commy2 + * Show firemode indicator, representing safety lock + * + * Arguments: + * 0: Show firemode + * + * Return Value: + * None + * + * Example: + * [true] call ace_safemode_fnc_setSafeModeVisual + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_show); +private ["_control", "_config"]; + +params ["_show"]; disableSerialization; -private ["_control"]; _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; if (isNull _control) exitWith {}; if (_show) then { - private "_config"; _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 2b4f00a4a9..35fdb0dee5 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,9 +1,26 @@ -// by commy2 +/* + * Author: commy2 + * Take weapon of safety lock. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: Muzzle + * + * Return Value: + * None + * + * Example: + * [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call ace_safemode_fnc_unlockSafety + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_unit,_weapon,_muzzle); +private ["_safedWeapons", "_id", "_picture"]; + +params ["_unit", "_weapon", "_muzzle"]; -private ["_safedWeapons"]; _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) then { @@ -12,7 +29,6 @@ if (_weapon in _safedWeapons) then { _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (count _safedWeapons == 0) then { - private "_id"; _id = _unit getVariable [QGVAR(actionID), -1]; //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); @@ -36,7 +52,8 @@ if (inputAction "nextWeapon" > 0) then { if (_x == "this") then { _modes pushBack _weapon; }; - } forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); + nil + } count getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); // select last mode _mode = _modes select (count _modes - 1); @@ -57,6 +74,5 @@ if (inputAction "nextWeapon" > 0) then { // player hud [true] call FUNC(setSafeModeVisual); -private "_picture"; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/sandbag/CfgVehicles.hpp b/addons/sandbag/CfgVehicles.hpp index 76a986bfbd..5a9b530062 100644 --- a/addons/sandbag/CfgVehicles.hpp +++ b/addons/sandbag/CfgVehicles.hpp @@ -5,7 +5,8 @@ class CfgVehicles { class ACE_Sandbags { displayName = CSTRING(DeploySandbag); condition = QUOTE(call FUNC(canDeploy)); - statement = QUOTE(call FUNC(deploy)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [])] call EFUNC(common,execNextFrame)); exceptions[] = {"isNotSwimming"}; showDisabled = 1; priority = 4; diff --git a/addons/sandbag/README.md b/addons/sandbag/README.md index 8c67ed9a6d..e1bd40eee5 100644 --- a/addons/sandbag/README.md +++ b/addons/sandbag/README.md @@ -1,10 +1,11 @@ ace_sandbag =============== -Stackable sandbags. +Adds stackable sandbags. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf index a55b9f9875..0c5fda5b4c 100644 --- a/addons/sandbag/functions/fnc_canDeploy.sqf +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -6,10 +6,10 @@ * None * * Return Value: - * can deploy? + * Can deploy * * Example: - * call ace_sandbag_fnc_canDeploy; + * [] call ace_sandbag_fnc_canDeploy * * Public: No */ @@ -22,6 +22,7 @@ if (ACE_player getVariable [QGVAR(usingSandbag), false]) exitWith { false }; if ((getPosATL ACE_player select 2) - (getPos ACE_player select 2) > 1E-5) exitWith { false }; private ["_surfaceClass", "_surfaceType"]; + _surfaceClass = ([surfaceType (position ACE_player), "#"] call CBA_fnc_split) select 1; _surfaceType = getText (configfile >> "CfgSurfaces" >> _surfaceClass >> "soundEnviron"); diff --git a/addons/sandbag/functions/fnc_carry.sqf b/addons/sandbag/functions/fnc_carry.sqf index f2ba3dff8a..84ab8c1883 100644 --- a/addons/sandbag/functions/fnc_carry.sqf +++ b/addons/sandbag/functions/fnc_carry.sqf @@ -10,39 +10,39 @@ * None * * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_carry; + * [_sandbag, _unit] call ace_sandbag_fnc_carry * * Public: No */ #include "script_component.hpp" -PARAMS_2(_sandbag,_unit); +params ["_sandbag", "_unit"]; _unit playActionNow "PutDown"; _unit setVariable [QGVAR(usingSandbag), true]; [{ - PARAMS_2(_sandbag,_unit); - + params ["_sandbag", "_unit"]; + GVAR(carrier) = ACE_player; - + [GVAR(carrier), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); - + deleteVehicle _sandbag; - - GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"]; + + GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) enableSimulationGlobal false; - + // Force physx update { _x setPosASL (getPosASL _x); - } forEach (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]); + } count (GVAR(carrier) nearObjects ["ACE_SandbagObject", 5]); GVAR(carryPFH) = [{ if (GVAR(carrier) != ACE_player) exitWith { call FUNC(drop); }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0])); + GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1e1121409b..5bb162e029 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deploy; + * [] call ace_sandbag_fnc_deploy * * Public: No */ @@ -21,14 +21,14 @@ GVAR(placer) = ACE_player; [GVAR(placer), "ACE_Sandbag", true] call EFUNC(common,setForceWalkStatus); -GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0,0,0], [], 0, "NONE"]; +GVAR(sandBag) = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; GVAR(sandBag) enableSimulationGlobal false; GVAR(deployPFH) = [{ if (GVAR(placer) != ACE_player) exitWith { call FUNC(deployCancel); }; - GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0,0,1] vectorDiff positionCameraToWorld [0,0,0])); + GVAR(sandBag) setPosASL ((eyePos ACE_player) vectorAdd (positionCameraToWorld [0, 0, 1] vectorDiff positionCameraToWorld [0, 0, 0])); GVAR(sandBag) setDir (GVAR(deployDirection) + getDir ACE_player); }, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index 65677ea887..bb7480a59e 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployCancel; + * [] call ace_sandbag_fnc_deployCancel * * Public: No */ diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 2cb297c51e..61264c15fe 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployConfirm; + * [] call ace_sandbag_fnc_deployConfirm * * Public: No */ @@ -36,16 +36,16 @@ GVAR(placer) setVariable [QGVAR(usingSandbag), true]; private ["_sandBag", "_position", "_direction"]; _position = getPosASL GVAR(sandBag); _direction = getDir GVAR(sandBag); - + deleteVehicle GVAR(sandBag); - - _sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"]; + + _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag enableSimulationGlobal true; _sandBag setPosASL _position; _sandBag setDir _direction; - + GVAR(placer) removeItem "ACE_Sandbag_empty"; - + GVAR(sandBag) = objNull; GVAR(placer) = objNull; }, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_drop.sqf b/addons/sandbag/functions/fnc_drop.sqf index 1ef61289bf..3ba825d423 100644 --- a/addons/sandbag/functions/fnc_drop.sqf +++ b/addons/sandbag/functions/fnc_drop.sqf @@ -9,7 +9,7 @@ * None * * Example: - * call ace_sandbag_fnc_deployCancel; + * [] call ace_sandbag_fnc_deployCancel * * Public: No */ @@ -34,14 +34,14 @@ GVAR(carrier) playActionNow "PutDown"; private ["_sandBag", "_position", "_direction"]; _position = getPosASL GVAR(sandBag); _direction = getDir GVAR(sandBag); - + deleteVehicle GVAR(sandBag); - - _sandBag = createVehicle ["ACE_SandbagObject", [0,0,0], [], 0, "NONE"]; + + _sandBag = createVehicle ["ACE_SandbagObject", [0, 0, 0], [], 0, "NONE"]; _sandBag enableSimulationGlobal true; _sandBag setPosASL _position; _sandBag setDir _direction; - + GVAR(sandBag) = objNull; GVAR(carrier) = objNull; }, [], 1.0, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_handleScrollWheel.sqf b/addons/sandbag/functions/fnc_handleScrollWheel.sqf index 2b831f5cdc..94697d7691 100644 --- a/addons/sandbag/functions/fnc_handleScrollWheel.sqf +++ b/addons/sandbag/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * handled * * Example: - * 1.2 call ace_sandbag_fnc_handleScrollWheel; + * [1.2] call ace_sandbag_fnc_handleScrollWheel * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(deployPFH) == -1) exitWith { false }; diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf index 360a18983a..dd0b93fd59 100644 --- a/addons/sandbag/functions/fnc_pickup.sqf +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -10,26 +10,26 @@ * None * * Example: - * [_sandbag, _unit] call ace_sandbag_fnc_pickup; + * [_sandbag, _unit] call ace_sandbag_fnc_pickup * * Public: No */ #include "script_component.hpp" -PARAMS_2(_sandbag,_unit); +params ["_sandbag", "_unit"]; _unit playActionNow "PutDown"; _unit setVariable [QGVAR(usingSandbag), true]; [{ - PARAMS_2(_sandbag,_unit); + params ["_sandbag", "_unit"]; _unit setVariable [QGVAR(usingSandbag), false]; deletevehicle _sandbag; - + // Force physx update { _x setPosASL (getPosASL _x); - } forEach (_unit nearObjects ["ACE_SandbagObject", 5]); - + } count (_unit nearObjects ["ACE_SandbagObject", 5]); + [_unit, "ACE_Sandbag_empty"] call EFUNC(common,addToInventory); }, [_sandbag, _unit], 1.5, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index ac03046803..42e0f17818 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -10,23 +10,26 @@ * Return value: * Did we adjust anything? * + * Example: + * [player, ELEVATION_UP, false] call ace_scopes_fnc_adjustScope + * * Public: No */ #include "script_component.hpp" -PARAMS_3(_unit,_turretAndDirection,_majorStep); +private ["_weaponIndex", "_zeroing", "_optic", "_opticConfig", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_adjustment"]; + +params ["_unit", "_turretAndDirection", "_majorStep"]; if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; -private ["_weaponIndex", "_zeroing", "_optic", "_verticalIncrement", "_horizontalIncrement", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; - _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; // [Windage, Elevation, Zero] + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; // [Windage, Elevation, Zero] }; if (isNil QGVAR(Optics)) then { @@ -34,18 +37,17 @@ if (isNil QGVAR(Optics)) then { }; _optic = GVAR(Optics) select _weaponIndex; -_verticalIncrement = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_VerticalIncrement"); -_horizontalIncrement = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_HorizontalIncrement"); -_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Vertical"); -_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Horizontal"); +_opticConfig = configFile >> "CfgWeapons" >> _optic; +_verticalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_VerticalIncrement"); +_horizontalIncrement = getNumber (_opticConfig >> "ACE_ScopeAdjust_HorizontalIncrement"); +_maxVertical = getArray (_opticConfig >> "ACE_ScopeAdjust_Vertical"); +_maxHorizontal = getArray (_opticConfig >> "ACE_ScopeAdjust_Horizontal"); if ((count _maxHorizontal < 2) || (count _maxVertical < 2)) exitWith {false}; if ((_verticalIncrement == 0) && (_horizontalIncrement == 0)) exitWith {false}; _zeroing = _adjustment select _weaponIndex; -_elevation = _zeroing select 0; -_windage = _zeroing select 1; -_zero = _zeroing select 2; +_zeroing params ["_elevation", "_windage", "_zero"]; switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; diff --git a/addons/scopes/functions/fnc_adjustZero.sqf b/addons/scopes/functions/fnc_adjustZero.sqf index 12e911b537..363407e090 100644 --- a/addons/scopes/functions/fnc_adjustZero.sqf +++ b/addons/scopes/functions/fnc_adjustZero.sqf @@ -8,29 +8,30 @@ * Return value: * true * + * Example: + * [player] call ace_scopes_fnc_adjustZero + * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); +private ["_weaponIndex", "_adjustment", "_zeroing"]; + +params ["_unit"]; 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}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; -_zeroing = _adjustment select _weaponIndex; -_elevation = _zeroing select 0; -_windage = _zeroing select 1; -_zero = _zeroing select 2; +_zeroing = _adjustment select _weaponIndex; +_zeroing params ["_elevation", "_windage", "_zero"]; _zero = round((_zero + _elevation) * 10) / 10; _elevation = 0; diff --git a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf index 4950fe9ece..fbd3e1b636 100644 --- a/addons/scopes/functions/fnc_applyScopeAdjustment.sqf +++ b/addons/scopes/functions/fnc_applyScopeAdjustment.sqf @@ -11,20 +11,23 @@ * Return value: * True * + * Example: + * [player, 1.3, 0.3, 0.1] call ace_scopes_fnc_applyScopeAdjustment + * * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_unit,_elevation,_windage,_zero); +private ["_adjustmentDifference", "_pitchBankYaw", "_adjustment", "_weaponIndex"]; -private ["_adjustmentDifference", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_adjustment", "_weaponIndex"]; +params ["_unit", "_elevation", "_windage", "_zero"]; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; _unit setVariable [QGVAR(Adjustment), _adjustment]; }; @@ -39,10 +42,11 @@ playSound (["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"] se if (cameraView == "GUNNER") then { // Convert adjustmentDifference from mils to degrees _adjustmentDifference = [_adjustmentDifference, {_this * 0.05625}] call EFUNC(common,map); - _pitchbankyaw = [_unit] call EFUNC(common,getPitchBankYaw); - _pitch = (_pitchbankyaw select 0) + (_adjustmentDifference select 0); - _bank = (_pitchbankyaw select 1); - _yaw = (_pitchbankyaw select 2) + (_adjustmentDifference select 1); + _adjustmentDifference params ["_elevationDifference", "_windageDifference"]; + _pitchBankYaw = [_unit] call EFUNC(common,getPitchBankYaw); + _pitchBankYaw params ["_pitch", "_bank", "_yaw"]; + _pitch = _pitch + _elevationDifference; + _yaw = _yaw + _windageDifference; [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw); } else { [] call FUNC(showZeroing); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index 619d82cf6e..36ea4ac793 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -8,17 +8,20 @@ * Return value: * Can we update the zero reference? * + * Example: + * [player] call ace_scopes_fnc_canAdjustZero + * * Public: No */ #include "script_component.hpp" -PARAMS_1(_unit); - private ["_weaponIndex", "_adjustment", "_elevation"]; +params ["_unit"]; + if (cameraView == "GUNNER") exitWith {false}; -if !(vehicle _unit == _unit) exitWith {false}; -if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; +if (vehicle _unit != _unit) exitWith {false}; +if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; @@ -26,7 +29,7 @@ if (_weaponIndex < 0) exitWith {false}; _adjustment = _unit getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; _elevation = (_adjustment select _weaponIndex) select 0; diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 020431c27b..bb9c37a1af 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and esteldunedain + * Author: KoffeinFlummi, esteldunedain * Adjusts the flight path of the bullet according to the zeroing * * Argument: @@ -18,11 +18,11 @@ */ #include "script_component.hpp" -private ["_unit", "_adjustment", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; -_unit = _this select 0; -_projectile = _this select 6; +private ["_adjustment", "_weaponIndex", "_zeroing", "_adjustment"]; -if !([_unit] call EFUNC(common,isPlayer)) exitWith {}; +params ["_unit", "", "", "", "", "", "_projectile"]; + +if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; _adjustment = _unit getVariable [QGVAR(Adjustment), []]; if (_adjustment isEqualTo []) exitWith {}; @@ -32,9 +32,10 @@ if (_weaponIndex < 0) exitWith {}; _zeroing = _adjustment select _weaponIndex; -if (_zeroing isEqualTo [0,0,0]) exitWith {}; +if (_zeroing isEqualTo [0, 0, 0]) exitWith {}; // Convert zeroing from mils to degrees _zeroing = _zeroing vectorMultiply 0.05625; +_zeroing params ["_elevation", "_windage", "_zero"]; -[_projectile, (_zeroing select 1), (_zeroing select 0) + (_zeroing select 2), 0] call EFUNC(common,changeProjectileDirection); +[_projectile, _windage, _elevation + _zero, 0] call EFUNC(common,changeProjectileDirection); diff --git a/addons/scopes/functions/fnc_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf index 289ed5e7bd..a80c5860e8 100644 --- a/addons/scopes/functions/fnc_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -10,21 +10,25 @@ * 1: Optic of secondary * 2: Optic of handgun * + * Example: + * [player] call ace_scopes_fnc_getOptics + * * Public: No */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_unit); +private "_optics"; -private ["_array"]; -_array = ["", "", ""]; +params ["_unit"]; -if !(_unit isKindOf "CAManBase") exitWith {_array}; +_optics = ["", "", ""]; + +if (!(_unit isKindOf "CAManBase")) exitWith {_optics}; { if (count _x >= 2) then { - _array set [_forEachIndex, _x select 2]; + _optics set [_forEachIndex, _x select 2]; }; } forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; -_array +_optics diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf index af4b347124..562bf731b4 100644 --- a/addons/scopes/functions/fnc_inventoryCheck.sqf +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and Commy2 + * Author: KoffeinFlummi, Commy2 * Check if weapon optics changed and reset zeroing if needed * * Arguments: @@ -8,18 +8,21 @@ * Return Value: * None * + * Example: + * [player] call ace_scopes_fnc_inventoryCheck + * * Public: No */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_player); - private ["_newOptics", "_adjustment"]; +params ["_player"]; + _adjustment = ACE_player getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; ACE_player setVariable [QGVAR(Adjustment), _adjustment]; [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); }; @@ -32,8 +35,8 @@ _newOptics = [_player] call FUNC(getOptics); { if (_newOptics select _forEachIndex != _x) then { // The optic for this weapon changed, set adjustment to zero - if !((_adjustment select _foreachindex) isEqualTo [0,0,0]) then { - _adjustment set [_forEachIndex, [0,0,0]]; + if (!((_adjustment select _foreachindex) isEqualTo [0, 0, 0])) then { + _adjustment set [_forEachIndex, [0, 0, 0]]; [ACE_player, QGVAR(Adjustment), _adjustment, 0.5] call EFUNC(common,setVariablePublic); }; }; diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index 7cefc68563..d3d4a38a9d 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi and esteldunedain + * Author: KoffeinFlummi, esteldunedain * Display the adjustment knobs, update their value and fade them out later * * Arguments: @@ -8,13 +8,16 @@ * Return Value: * None * + * Example: + * [] call ace_scopes_fnc_showZeroing + * * Public: No */ #include "script_component.hpp" -disableSerialization; +private ["_weaponIndex", "_adjustment", "_layer", "_display", "_zeroing", "_vertical", "_horizontal"]; -private ["_weaponIndex","_adjustment","_layer","_display","_zeroing","_vertical","_horizontal"]; +disableSerialization; _weaponIndex = [ACE_player, currentWeapon ACE_player] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; @@ -22,7 +25,7 @@ if (_weaponIndex < 0) exitWith {}; _adjustment = ACE_player getVariable QGVAR(Adjustment); if (isNil "_adjustment") then { // [Windage, Elevation, Zero] - _adjustment = [[0,0,0], [0,0,0], [0,0,0]]; + _adjustment = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]; }; // Display the adjustment knobs @@ -35,10 +38,11 @@ if (isNull _display) exitWith {}; // Update values _zeroing = _adjustment select _weaponIndex; +_zeroing params ["_elevation", "_windage"]; _vertical = _display displayCtrl 12; _horizontal = _display displayCtrl 13; -_vertical ctrlSetText (str (_zeroing select 0)); -_horizontal ctrlSetText (str (_zeroing select 1)); +_vertical ctrlSetText (str _elevation); +_horizontal ctrlSetText (str _windage); // Set the ACE_time when to hide the knobs GVAR(timeToHide) = ACE_diagTime + 3.0; @@ -47,14 +51,13 @@ if !(isNil QGVAR(fadePFH)) exitWith {}; // Launch a PFH to wait and fade out the knobs GVAR(fadePFH) = [{ - if (ACE_diagTime >= GVAR(timeToHide)) exitWith { private "_layer"; + params ["", "_pfhId"]; _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; _layer cutFadeOut 2; GVAR(fadePFH) = nil; - [_this select 1] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; - }, 0.1, []] call CBA_fnc_addPerFrameHandler diff --git a/addons/sitting/CfgMoves.hpp b/addons/sitting/CfgMoves.hpp new file mode 100644 index 0000000000..fc902032e2 --- /dev/null +++ b/addons/sitting/CfgMoves.hpp @@ -0,0 +1,105 @@ +// Enable visual head movement while free-looking +#define MACRO_ANIMATION \ + head = "headDefault"; + +class CfgMovesBasic; +class CfgMovesMaleSdr: CfgMovesBasic { + class States { + class HubSittingChairA_idle1; + class GVAR(HubSittingChairA_idle1): HubSittingChairA_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairA_idle2; + class GVAR(HubSittingChairA_idle2): HubSittingChairA_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairA_idle3; + class GVAR(HubSittingChairA_idle3): HubSittingChairA_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairA_move1; + class GVAR(HubSittingChairA_move1): HubSittingChairA_move1 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle1; + class GVAR(HubSittingChairB_idle1): HubSittingChairB_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle2; + class GVAR(HubSittingChairB_idle2): HubSittingChairB_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairB_idle3; + class GVAR(HubSittingChairB_idle3): HubSittingChairB_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairB_move1; + class GVAR(HubSittingChairB_move1): HubSittingChairB_move1 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle1; + class GVAR(HubSittingChairC_idle1): HubSittingChairC_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle2; + class GVAR(HubSittingChairC_idle2): HubSittingChairC_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairC_idle3; + class GVAR(HubSittingChairC_idle3): HubSittingChairC_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairC_move1; + class GVAR(HubSittingChairC_move1): HubSittingChairC_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle1; + class GVAR(HubSittingChairUA_idle1): HubSittingChairUA_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle2; + class GVAR(HubSittingChairUA_idle2): HubSittingChairUA_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUA_idle3; + class GVAR(HubSittingChairUA_idle3): HubSittingChairUA_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUA_move1; + class GVAR(HubSittingChairUA_move1): HubSittingChairUA_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle1; + class GVAR(HubSittingChairUB_idle1): HubSittingChairUB_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle2; + class GVAR(HubSittingChairUB_idle2): HubSittingChairUB_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUB_idle3; + class GVAR(HubSittingChairUB_idle3): HubSittingChairUB_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUB_move1; + class GVAR(HubSittingChairUB_move1): HubSittingChairUB_move1 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle1; + class GVAR(HubSittingChairUC_idle1): HubSittingChairUC_idle1 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle2; + class GVAR(HubSittingChairUC_idle2): HubSittingChairUC_idle2 { + MACRO_ANIMATION + }; + class HubSittingChairUC_idle3; + class GVAR(HubSittingChairUC_idle3): HubSittingChairUC_idle3 { + MACRO_ANIMATION + }; + class HubSittingChairUC_move1; + class GVAR(HubSittingChairUC_move1): HubSittingChairUC_move1 { + MACRO_ANIMATION + }; + }; +}; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp index ac690e2dcd..a156d5e87e 100644 --- a/addons/sitting/CfgVehicles.hpp +++ b/addons/sitting/CfgVehicles.hpp @@ -39,7 +39,7 @@ class CfgVehicles { class ACE_MainActions { \ displayName = ECSTRING(interaction,MainAction); \ selection = ""; \ - distance = 1.25; \ + distance = 1.5; \ condition = "true"; \ class GVAR(Sit) { \ displayName = CSTRING(Sit); \ diff --git a/addons/sitting/README.md b/addons/sitting/README.md index 41db2ce8ee..5237c7145e 100644 --- a/addons/sitting/README.md +++ b/addons/sitting/README.md @@ -1,10 +1,11 @@ ace_sitting =============== -The Sitting module introduces ability to sit on different chairs and toilets. +The Sitting module introduces ability to sit on chairs. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Jonpas] (https://github.com/jonpas) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/sitting/config.cpp b/addons/sitting/config.cpp index f12fa530fa..96d3edab7b 100644 --- a/addons/sitting/config.cpp +++ b/addons/sitting/config.cpp @@ -12,6 +12,7 @@ class CfgPatches { }; }; -#include "CfgEventHandlers.hpp" #include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMoves.hpp" #include "CfgVehicles.hpp" diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf index c34281e496..fef36b4bbd 100644 --- a/addons/sitting/functions/fnc_canSit.sqf +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -10,17 +10,16 @@ * Can Sit Down * * Example: - * [seat, player] call ace_sitting_fnc_canSit; + * [seat, player] call ace_sitting_fnc_canSit * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_seat,_player); +params ["_seat", "_player"]; // Sitting enabled, is seat object, not occupied and standing up (or not on a big slope) GVAR(enable) && {getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && -{isNil{_seat getVariable QGVAR(seatOccupied)}} && +{isNil {_seat getVariable QGVAR(seatOccupied)}} && {round (vectorUp _seat select 0) == 0 && {round (vectorUp _seat select 1) == 0} && {round (vectorUp _seat select 2) == 1}} diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf index 4549b9891b..c516485a82 100644 --- a/addons/sitting/functions/fnc_canStand.sqf +++ b/addons/sitting/functions/fnc_canStand.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Sitting -(_player getVariable [QGVAR(isSitting),false]) +(_player getVariable [QGVAR(isSitting), false]) diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf index c83d230a90..ca9a9ccfb1 100644 --- a/addons/sitting/functions/fnc_getRandomAnimation.sqf +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -9,40 +9,40 @@ * Random Animation * * Example: - * _animation = call ace_sitting_fnc_getRandomAnimation; + * _animation = call ace_sitting_fnc_getRandomAnimation * * Public: No */ #include "script_component.hpp" -private ["_animations"]; +private "_animations"; // Animations Pool _animations = [ - "HubSittingChairUA_idle1", - "HubSittingChairUA_idle2", - "HubSittingChairUA_idle3", - "HubSittingChairUA_move1", - "HubSittingChairUB_idle1", - "HubSittingChairUB_idle2", - "HubSittingChairUB_idle3", - "HubSittingChairUB_move1", - "HubSittingChairUC_idle1", - "HubSittingChairUC_idle2", - "HubSittingChairUC_idle3", - "HubSittingChairUC_move1", - "HubSittingChairA_idle1", - "HubSittingChairA_idle2", - "HubSittingChairA_idle3", - "HubSittingChairA_move1", - "HubSittingChairB_idle1", - "HubSittingChairB_idle2", - "HubSittingChairB_idle3", - "HubSittingChairB_move1", - "HubSittingChairC_idle1", - "HubSittingChairC_idle2", - "HubSittingChairC_idle3", - "HubSittingChairC_move1" + QGVAR(HubSittingChairA_idle1), + QGVAR(HubSittingChairA_idle2), + QGVAR(HubSittingChairA_idle3), + QGVAR(HubSittingChairA_move1), + QGVAR(HubSittingChairB_idle1), + QGVAR(HubSittingChairB_idle2), + QGVAR(HubSittingChairB_idle3), + QGVAR(HubSittingChairB_move1), + QGVAR(HubSittingChairC_idle1), + QGVAR(HubSittingChairC_idle2), + QGVAR(HubSittingChairC_idle3), + QGVAR(HubSittingChairC_move1), + QGVAR(HubSittingChairUA_idle1), + QGVAR(HubSittingChairUA_idle2), + QGVAR(HubSittingChairUA_idle3), + QGVAR(HubSittingChairUA_move1), + QGVAR(HubSittingChairUB_idle1), + QGVAR(HubSittingChairUB_idle2), + QGVAR(HubSittingChairUB_idle3), + QGVAR(HubSittingChairUB_move1), + QGVAR(HubSittingChairUC_idle1), + QGVAR(HubSittingChairUC_idle2), + QGVAR(HubSittingChairUC_idle3), + QGVAR(HubSittingChairUC_move1) ]; // Select random animation diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf index fb32635195..328675c172 100644 --- a/addons/sitting/functions/fnc_handleInterrupt.sqf +++ b/addons/sitting/functions/fnc_handleInterrupt.sqf @@ -9,13 +9,13 @@ * None * * Example: - * player call ace_sitting_fnc_handleInterrupt; + * player call ace_sitting_fnc_handleInterrupt * * Public: No */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if (_player getVariable [QGVAR(isSitting), false]) then { _player call FUNC(stand); diff --git a/addons/sitting/functions/fnc_hasChairMoved.sqf b/addons/sitting/functions/fnc_hasChairMoved.sqf index fe56438878..de3a38e0ce 100644 --- a/addons/sitting/functions/fnc_hasChairMoved.sqf +++ b/addons/sitting/functions/fnc_hasChairMoved.sqf @@ -10,18 +10,21 @@ * None * * Example: - * [seat, seatPos] call ace_sitting_fnc_hasChairMoved; + * [seat, seatPos] call ace_sitting_fnc_hasChairMoved * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_2(_seat,_seatPosOrig); +params ["_seat", "_seatPosOrig"]; TRACE_2("Chair position",_seatPosOrig,getPosASL _seat); +(getPosASL _seat) params ["_seatX", "_seatY", "_seatZ"]; +_seatPosOrig params ["_seatOrigX", "_seatOrigY", "_seatOrigZ"]; + // Check each coordinate due to possibility of tiny movements in simulation -(getPosASL _seat) select 0 < (_seatPosOrig select 0) - 0.01 || {(getPosASL _seat) select 0 > (_seatPosOrig select 0) + 0.01} || -{(getPosASL _seat) select 1 < (_seatPosOrig select 1) - 0.01 || {(getPosASL _seat) select 1 > (_seatPosOrig select 1) + 0.01}} || -{(getPosASL _seat) select 2 < (_seatPosOrig select 2) - 0.01 || {(getPosASL _seat) select 2 > (_seatPosOrig select 2) + 0.01}} +if (abs (_seatX - _seatOrigX) > 0.01) exitWith {true}; +if (abs (_seatY - _seatOrigY) > 0.01) exitWith {true}; +if (abs (_seatZ - _seatOrigZ) > 0.01) exitWith {true}; +false diff --git a/addons/sitting/functions/fnc_moduleInit.sqf b/addons/sitting/functions/fnc_moduleInit.sqf index 25da5be347..ae476317db 100644 --- a/addons/sitting/functions/fnc_moduleInit.sqf +++ b/addons/sitting/functions/fnc_moduleInit.sqf @@ -3,18 +3,22 @@ * Initializes the Sitting module. * * Arguments: - * Whatever the module provides. + * 0: The module logic + * 1: Units + * 2: Activated * * Return Value: * None + * + * Public: No */ #include "script_component.hpp" if !(isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; -if !(_activated) exitWith {}; +if (!_activated) exitWith {}; [_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 6959bd4778..0c6825ed58 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -14,12 +14,11 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; -PARAMS_2(_seat,_player); +params ["_seat", "_player"]; // Set global variable for standing up GVAR(seat) = _seat; @@ -34,7 +33,8 @@ _sitPosition = getArray (_configFile >> QGVAR(sitPosition)); _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present // Get random animation and perform it (before moving player to ensure correct placement) -[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); +[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations +[_player, "", 1] call EFUNC(common,doAnimation); // Correctly applies animation's config values (such as disallow throwing of grenades, intercept keybinds... etc). // Set direction and position _player setDir _sitDirection; @@ -49,12 +49,13 @@ _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple peop _sitDirectionVisual = getDirVisual _player; // Needed for precision and issues with using above directly _seatPosOrig = getPosASL _seat; [{ - EXPLODE_5_PVT(_this select 0,_player,_sitDirectionVisual,_sitRotation,_seat,_seatPosOrig); - + params ["_args", "_pfhId"]; + _args params ["_player", "_sitDirectionVisual", "_sitRotation", "_seat", "_seatPosOrig"]; + // Remove PFH if not sitting any more if !(_player getVariable [QGVAR(isSitting), false]) exitWith { - [_this select 1] call cba_fnc_removePerFrameHandler; - TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting),false)]); + [_pfhId] call cba_fnc_removePerFrameHandler; + TRACE_1("Remove PFH",_player getVariable [ARR_2(QGVAR(isSitting), false)]); }; // Stand up if chair moves @@ -70,4 +71,4 @@ _seatPosOrig = getPosASL _seat; if (getDir _player < _sitDirectionVisual - _sitRotation) exitWith { _player setDir (_sitDirectionVisual - _sitRotation); }; -}, 0, [_player, _sitDirectionVisual, _sitRotation, _seat, _seatPosOrig]] call cba_fnc_addPerFrameHandler; +}, 0, [_player, _sitDirectionVisual, _sitRotation, _seat, _seatPosOrig]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf index df1ee6f169..978bcaf279 100644 --- a/addons/sitting/functions/fnc_stand.sqf +++ b/addons/sitting/functions/fnc_stand.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; // Restore animation [_player, "", 2] call EFUNC(common,doAnimation); diff --git a/addons/slideshow/CfgVehicles.hpp b/addons/slideshow/CfgVehicles.hpp index 7bb3b81713..7e82d48ffc 100644 --- a/addons/slideshow/CfgVehicles.hpp +++ b/addons/slideshow/CfgVehicles.hpp @@ -6,7 +6,7 @@ class CfgVehicles { displayName = CSTRING(DisplayName); function = QFUNC(moduleInit); scope = 2; - isGlobal = 0; // Server only + isGlobal = 1; isTriggerActivated = 0; isDisposable = 0; icon = QUOTE(PATHTOF(UI\Icon_Module_Slideshow_ca.paa)); diff --git a/addons/slideshow/README.md b/addons/slideshow/README.md index 58b22c1e17..627e1fe660 100644 --- a/addons/slideshow/README.md +++ b/addons/slideshow/README.md @@ -3,8 +3,9 @@ ace_slideshow Adds ability to have slide-shows on them and control them with a controller (another object). + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Jonpas] (https://github.com/jonpas) +- [Jonpas](https://github.com/jonpas) diff --git a/addons/slideshow/functions/fnc_addSlideActions.sqf b/addons/slideshow/functions/fnc_addSlideActions.sqf index 80e9b387af..1ebba306b4 100644 --- a/addons/slideshow/functions/fnc_addSlideActions.sqf +++ b/addons/slideshow/functions/fnc_addSlideActions.sqf @@ -10,19 +10,19 @@ * 4: Current Slideshow * * Return Value: - * None + * List of actions * * Example: * [[object], ["image"], ["name"], controller, 1] call ace_slideshow_fnc_addSlideActions * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_5(_objects,_images,_names,_controller,_currentSlideshow); +private "_actions"; + +params ["_objects", "_images", "_names", "_controller", "_currentSlideshow"]; -private ["_actions"]; _actions = []; { _actions pushBack @@ -32,10 +32,10 @@ _actions = []; _names select _forEachIndex, "", { - EXPLODE_2_PVT(_this select 2,_objects,_image); + (_this select 2) params ["_objects", "_image"]; { _x setObjectTextureGlobal [0, _image] - } forEach _objects; + } count _objects; }, {true}, {}, diff --git a/addons/slideshow/functions/fnc_autoTransition.sqf b/addons/slideshow/functions/fnc_autoTransition.sqf index 639a0fb70b..c8b03a707a 100644 --- a/addons/slideshow/functions/fnc_autoTransition.sqf +++ b/addons/slideshow/functions/fnc_autoTransition.sqf @@ -4,25 +4,23 @@ * * Arguments: * 0: Objects - * 1: Controller Objects - * 2: Image Paths - * 3: Action Names - * 4: Duration (0 disables automatic transitions) + * 1: Image Paths + * 2: State Variable Name + * 3: Duration (0 disables automatic transitions) * * Return Value: - * Parsed List + * None * * Example: - * [objects, controllers, images, actionNames, duration] call ace_slideshow_fnc_autoTransition + * [objects, images, "ace_slideshow_slideshow1", duration] call ace_slideshow_fnc_autoTransition * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_4(_objects,_images,_varString,_duration); +private "_currentSlide"; -private ["_currentSlide"]; +params ["_objects", "_images", "_varString", "_duration"]; // Get current slide number of this slideshow _currentSlide = missionNamespace getVariable [_varString, 0]; @@ -36,10 +34,8 @@ missionNamespace setVariable [_varString, _currentSlide]; // Set slide { _x setObjectTextureGlobal [0, _images select _currentSlide]; -} forEach _objects; +} count _objects; +// Log current slide and execute Next slide TRACE_4("Auto-transition",_images select _currentSlide,_currentSlide,count _images,_duration); - - -// Next slide [FUNC(autoTransition), [_objects, _images, _varString, _duration], _duration] call EFUNC(common,waitAndExecute); diff --git a/addons/slideshow/functions/fnc_createSlideshow.sqf b/addons/slideshow/functions/fnc_createSlideshow.sqf index debeac3340..665b954496 100644 --- a/addons/slideshow/functions/fnc_createSlideshow.sqf +++ b/addons/slideshow/functions/fnc_createSlideshow.sqf @@ -17,10 +17,11 @@ * * Public: Yes */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_5(_objects,_controllers,_images,_names,_duration); +private ["_currentSlideshow", "_actionsObject", "_actionsClass", "_mainAction", "_slidesAction", "_varString"]; + +params ["_objects", "_controllers", "_images", "_names", "_duration"]; // Verify data if (count _images != count _names || {count _images == 0} || {count _names == 0}) exitWith { @@ -30,7 +31,8 @@ if (count _images != count _names || {count _images == 0} || {count _names == 0} // Objects synced to the module { _objects pushBack _x; -} forEach (synchronizedObjects _logic); + nil +} count (synchronizedObjects _logic); // If no controllers use objects as controllers if (count _controllers == 0) then { @@ -39,36 +41,36 @@ if (count _controllers == 0) then { TRACE_4("Information",_objects,_controllers,_images,_names); -// Default images on whiteboards (first image) -{ - _x setObjectTextureGlobal [0, _images select 0]; -} forEach _objects; +if (isServer) then { + // Default images on whiteboards (first image) + { + _x setObjectTextureGlobal [0, _images select 0]; + } count _objects; + + // Number of slideshows (multiple modules support) + GVAR(slideshows) = GVAR(slideshows) + 1; +}; -// Number of slideshows (multiple modules support) -GVAR(slideshows) = GVAR(slideshows) + 1; -private ["_currentSlideshow"]; _currentSlideshow = GVAR(slideshows); // Local variable in case GVAR gets changed during execution of below code +// If interaction menu module is not present, set default duration value +if !(["ace_interact_menu"] call EFUNC(common,isModLoaded)) then { + _duration = 5; + diag_log text format ["[ACE]: Slideshow: Interaction Menu module not present, defaulting duration value to %1", _duration]; +}; + // Add interactions if automatic transitions are disabled, else setup automatic transitions if (_duration == 0) then { - private ["_actionsObject", "_actionsClass", "_mainAction", "_slidesAction"]; { - // Add MainAction if one does not already exist - _actionsObject = _x getVariable [QEGVAR(interact_menu,actions), []]; - _actionsClass = missionNamespace getVariable [format [QEGVAR(interact_menu,Act_%1), typeOf _x], []]; - if (count _actionsObject == 0 && {count _actionsClass == 0}) then { - _mainAction = ["ACE_MainActions", localize ELSTRING(interaction,MainAction), "", {}, {true}] call EFUNC(interact_menu,createAction); - [_x, 0, [], _mainAction] call EFUNC(interact_menu,addActionToObject); - TRACE_2("Adding ACE_MainActions",_actionsObject,_actionsClass); - }; - // Add Slides sub-action and populate with images _slidesAction = [QGVAR(Slides), localize LSTRING(Interaction), "", {}, {true}, {(_this select 2) call FUNC(addSlideActions)}, [_objects,_images,_names,_x,_currentSlideshow], [0,0,0], 2] call EFUNC(interact_menu,createAction); [_x, 0, ["ACE_MainActions"], _slidesAction] call EFUNC(interact_menu,addActionToObject); - } forEach _controllers; + nil + } count _controllers; } else { + if !(isServer) exitWith {}; + // Formatted GVAR string (multiple modules support) - private ["_varString"]; _varString = format [QGVAR(slideshow%1), _currentSlideshow]; TRACE_1("Current Slide",_varString); diff --git a/addons/slideshow/functions/fnc_makeList.sqf b/addons/slideshow/functions/fnc_makeList.sqf index 9ce4a723cc..6736fabbdb 100644 --- a/addons/slideshow/functions/fnc_makeList.sqf +++ b/addons/slideshow/functions/fnc_makeList.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: Text - * 1: Remove Whitespace + * 1: Trim Whitespace * 2: Check Nil * * Return Value: @@ -15,23 +15,23 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -PARAMS_3(_list,_removeWhitespace,_checkNil); +params ["_list", "_trimWhitespace", "_checkNil"]; -private ["_splittedList", "_listNoWhitespace", "_nilCheckPassedList"]; +private ["_splittedList", "_listTrimmedWhitespace", "_nilCheckPassedList"]; // Split using comma delimiter _splittedList = [_list, ","] call BIS_fnc_splitString; // Remove whitespace -_listNoWhitespace = []; -if (_removeWhitespace) then { +_listTrimmedWhitespace = []; +if (_trimWhitespace) then { { - _listNoWhitespace pushBack ([_x] call EFUNC(common,stringRemoveWhiteSpace)); - } forEach _splittedList; - _list = _listNoWhitespace; + _listTrimmedWhitespace pushBack ([_x] call CBA_fnc_trim); + nil + } count _splittedList; + _list = _listTrimmedWhitespace; }; // Check for object existence @@ -45,13 +45,13 @@ if (_checkNil) then { _nilCheckPassedList = _nilCheckPassedList + "," + _x; }; }; - } forEach _list; + } count _list; // Add Array characters and parse into array _list = "[" + _nilCheckPassedList + "]"; _list = [] call compile _list; }; -TRACE_4("Lists",_splittedList,_listNoWhitespace,_nilCheckPassedList,_list); +TRACE_4("Lists",_splittedList,_listTrimmedWhitespace,_nilCheckPassedList,_list); -_list +_list // return diff --git a/addons/slideshow/functions/fnc_moduleInit.sqf b/addons/slideshow/functions/fnc_moduleInit.sqf index 50de48693e..da1724dfcc 100644 --- a/addons/slideshow/functions/fnc_moduleInit.sqf +++ b/addons/slideshow/functions/fnc_moduleInit.sqf @@ -12,18 +12,16 @@ * * Public: No */ -//#define DEBUG_MODE_FULL #include "script_component.hpp" -if !(isServer) exitWith {}; - -PARAMS_3(_logic,_units,_activated); - -if !(_activated) exitWith {}; +// Exit on Headless Client +if (!hasInterface && !isDedicated) exitWith {}; private ["_objects", "_controllers", "_images", "_names", "_duration"]; -_logic = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +params [["_logic", objNull, [objNull]], "_units", "_activated"]; + +if !(_activated) exitWith {}; if (isNull _logic) exitWith {}; // Extract variables from logic diff --git a/addons/slideshow/stringtable.xml b/addons/slideshow/stringtable.xml index 63547c06e2..fa10700ffb 100644 --- a/addons/slideshow/stringtable.xml +++ b/addons/slideshow/stringtable.xml @@ -3,42 +3,55 @@ Slideshow + Pokaz slajdów This module allows you to set up slide-shows on different objects. One module per image list. Only objects with hiddenSelection 0 are supported. + Ten moduł pozwala skonfigurować pokaz slajdów na różnych obiektach. Jeden moduł na jedną liste slajdów. Tylko obiekty z hiddenSelection 0 są wspierane. Objects + Obiekty Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. Reference INFO for object support. + Nazwy obiektów (mogą to też być zsynchronizowane obiekty) na których pokaz slajdów zostanie pokazany, oddzielony przecinkiem jeżeli jest ich więcej niż 1. Sprawdź opis modułu aby dowiedzieć się jakie obiekty są wspierane przez moduł. Controllers + Kontroler Controller object names, separated by commas if multiple. + Nazwa obiektu - kontrolera, oddzielona przecinkami jeżeli jest ich więcej niż 1. Images + Obrazy List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). + Lista obrazów, które zostaną użyte do pokazu slajdów, oddzielone przecinkiem, z poprawnym pełnym formatem ścieżki do obrazka (np. slajdy\obrazek.paa). Interaction Names + Nazwy interakcji List of names that will be used for interaction entries, separated by commas, in order of images. + Lista nazw, które zostaną użyte do nazwania wpisów interakcji, oddzielone przecinkiem, w kolejności obrazów. Slide Duration + Czas trwania slajdów Duration of each slide. Default: 0 (Automatic Transitions Disabled) + Czas trwania poszczególnych slajdów. Domyślnie: 0 (Automatyczne przejścia wyłączone) Slides + Slajdy \ No newline at end of file diff --git a/addons/spottingscope/README.md b/addons/spottingscope/README.md index ea9f2b819d..a07b9c6c85 100644 --- a/addons/spottingscope/README.md +++ b/addons/spottingscope/README.md @@ -3,8 +3,9 @@ ace_spottingscope Adds a spotting scope. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/spottingscope/functions/fnc_pickup.sqf b/addons/spottingscope/functions/fnc_pickup.sqf index 3730068092..81c9bc10a5 100644 --- a/addons/spottingscope/functions/fnc_pickup.sqf +++ b/addons/spottingscope/functions/fnc_pickup.sqf @@ -1,30 +1,30 @@ /* * Author: Rocko, Ruthberg - * * Pick up spotting scope * * Arguments: * 0: spotting scope * 1: unit * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [spotting_scope, player] call ace_spottingscope_fnc_pickup + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_spottingScope,_unit); +params ["_spottingScope", "_unit"]; if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { _unit playMove "AmovPercMstpSrasWrflDnon_diary"; }; [{ - PARAMS_2(_spottingScope,_unit); - + params ["_spottingScope", "_unit"]; + [_unit, "ACE_SpottingScope"] call EFUNC(common,addToInventory); deleteVehicle _spottingScope; - }, [_spottingScope, _unit], 1, 0]call EFUNC(common,waitAndExecute); diff --git a/addons/spottingscope/functions/fnc_place.sqf b/addons/spottingscope/functions/fnc_place.sqf index 4967151748..09f756c109 100644 --- a/addons/spottingscope/functions/fnc_place.sqf +++ b/addons/spottingscope/functions/fnc_place.sqf @@ -1,21 +1,22 @@ /* * Author: Rocko, Ruthberg - * * Place down spotting scope * * Arguments: * 0: unit * 1: scope class * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [player, "ACE_SpottingScope"] call ace_spottingscope_fnc_place + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_scopeClass); +params ["_unit", "_scopeClass"]; _unit removeItem _scopeClass; @@ -24,18 +25,17 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { }; [{ - PARAMS_1(_unit); - + params ["_unit"]; + private ["_direction", "_position", "_spottingScope"]; _direction = getDir _unit; _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; - + _spottingScope = "ACE_SpottingScopeObject" createVehicle [0, 0, 0]; _spottingScope setDir _direction; _spottingScope setPosASL _position; if ((getPosATL _spottingScope select 2) - (getPos _spottingScope select 2) < 1E-5) then { - _spottingScope setVectorUp (surfaceNormal (position _spottingScope)); + _spottingScope setVectorUp (surfaceNormal (position _spottingScope)); }; _unit reveal _spottingScope; - }, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 7204e73d36..3a7b20601c 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -10,19 +10,18 @@ * None * * Example: - * [_unit, _sides] call FUNC(addMapFunction) + * [_unit, _sides] call ace_switchunits_fnc_addMapFunction * * Public: No */ - #include "script_component.hpp" -PARAMS_2(_unit,_sides); +params ["_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); }; - + }, [_unit, _sides]] call BIS_fnc_addStackedEventHandler; diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index e8efa2640f..03a94f81af 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -3,24 +3,25 @@ * Switches to a unit close to a clicked map position * * Arguments: - * 0: unit - * 1: sides > + * 0: Faction + * 0: unit + * 1: sides + * 1: Map Position * * Return Value: * None * * Example: - * [unit, _sides] call FUNC(handleMapClick) + * [[unit, _sides], [20, 30]] call ace_switchunits_fnc_handleMapClick * * Public: No */ - #include "script_component.hpp" -private ["_sides", "_pos", "_sideNearest"]; +private ["_sideNearest"]; -_sides = (_this select 0) select 1; -_pos = _this select 1; +params ["_faction", "_pos"]; +_faction params ["", "_sides"]; _sideNearest = []; @@ -28,7 +29,8 @@ _sideNearest = []; if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then { _sideNearest pushBack _x; }; -} forEach (nearestObjects [_pos, ["Man"], 15]); + nil +} count (nearestObjects [_pos, ["Man"], 15]); if (count _sideNearest > 0) then { [_sideNearest select 0] call FUNC(switchUnit); diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index 67669c071c..80388a9d2b 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -10,24 +10,21 @@ * None * * Example: - * [player, [west]] call FUNC(initPlayer) + * [player, [west]] call ace_switchunits_fnc_initPlayer * * Public: No */ - #include "script_component.hpp" -PARAMS_2(_playerUnit,_sides); +params ["_playerUnit", "_sides"]; if (vehicle _playerUnit == _playerUnit) then { - [_sides] call FUNC(markAiOnMap); _playerUnit setVariable [QGVAR(IsPlayerUnit), true]; _playerUnit allowDamage false; GVAR(OriginalUnit) = _playerUnit; - //GVAR(OriginalName) = [_playerUnit] call EFUNC(common,getName); GVAR(OriginalName) = name _playerUnit; GVAR(OriginalGroup) = group _playerUnit; diff --git a/addons/switchunits/functions/fnc_isValidAi.sqf b/addons/switchunits/functions/fnc_isValidAi.sqf index 61c2401da9..0b6a35c257 100644 --- a/addons/switchunits/functions/fnc_isValidAi.sqf +++ b/addons/switchunits/functions/fnc_isValidAi.sqf @@ -6,22 +6,19 @@ * 0: unit * * Return Value: - * Boolean + * Valid AI * * Example: - * [_unit] call FUNC(isValidAi) + * [_unit] call ace_switchunits_fnc_isValidAi * * Public: Yes */ - #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +params ["_unit"]; !([_unit] call EFUNC(common,isPlayer) || {_unit in playableUnits} -|| {vehicle _unit != _unit} -|| {_unit getVariable [QGVAR(IsPlayerUnit), false]} -|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) +|| {vehicle _unit != _unit} +|| {_unit getVariable [QGVAR(IsPlayerUnit), false]} +|| {_unit getVariable [QGVAR(IsPlayerControlled), false]}) // return diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf index 620b805cb9..db43c58f43 100644 --- a/addons/switchunits/functions/fnc_markAiOnMap.sqf +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -1,7 +1,7 @@ /* * Author: bux578 * Creates markers for AI units for given sides. - * Marks players in a different colour. + * Marks players in a different colour. * * Arguments: * 0: side @@ -10,28 +10,24 @@ * None * * Example: - * [[west, east]] call FUNC(markAiOnMap) + * [[west, east]] call ace_switchunits_fnc_markAiOnMap * * Public: No */ - #include "script_component.hpp" -private "_sidesToShow"; -_sidesToShow = _this select 0; +params ["_sidesToShow"]; GVAR(AllMarkerNames) = []; -DFUNC(pfhMarkAiOnMap) = { - private ["_args", "_sides"]; - _args = _this select 0; - _sides = _args select 0; - +[{ + params ["_args"]; + _args params ["_sides"]; // delete markers { - deleteMarkerLocal _x; - } forEach GVAR(AllMarkerNames); + deleteMarkerLocal _x; + } count GVAR(AllMarkerNames); // reset the array GVAR(AllMarkerNames) = []; @@ -48,7 +44,7 @@ DFUNC(pfhMarkAiOnMap) = { _marker = createMarkerLocal [_markerName, position _x]; _markerName setMarkerTypeLocal "mil_triangle"; _markerName setMarkerShapeLocal "ICON"; - _markerName setMarkerSizeLocal [0.5,0.7]; + _markerName setMarkerSizeLocal [0.5, 0.7]; _markerName setMarkerDirLocal getDir _x; // commy's one liner magic @@ -63,9 +59,8 @@ DFUNC(pfhMarkAiOnMap) = { }; GVAR(AllMarkerNames) pushBack _markerName; + nil }; - } forEach allUnits; + } count allUnits; }; -}; - -[FUNC(pfhMarkAiOnMap), 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler; +}, 1.5, [_sidesToShow]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_module.sqf b/addons/switchunits/functions/fnc_module.sqf index 9563dea71f..ec9164a866 100644 --- a/addons/switchunits/functions/fnc_module.sqf +++ b/addons/switchunits/functions/fnc_module.sqf @@ -15,12 +15,11 @@ * * Public: No */ - #include "script_component.hpp" if !(isServer) exitWith {}; -EXPLODE_3_PVT(_this,_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/switchunits/functions/fnc_nearestPlayers.sqf b/addons/switchunits/functions/fnc_nearestPlayers.sqf index 987c4e3528..64e347d7da 100644 --- a/addons/switchunits/functions/fnc_nearestPlayers.sqf +++ b/addons/switchunits/functions/fnc_nearestPlayers.sqf @@ -10,7 +10,7 @@ * Player units > * * Example: - * [[300,300,0], 100] call FUNC(nearestPlayers) + * [[300,300,0], 100] call ace_switchunits_fnc_nearestPlayers * * Public: Yes */ @@ -18,10 +18,7 @@ private ["_nearestPlayers"]; -PARAMS_2(_position,_radius); - -_position = _this select 0; -_radius = _this select 1; +params ["_position", "_radius"]; _nearestPlayers = []; diff --git a/addons/switchunits/functions/fnc_startSwitchUnits.sqf b/addons/switchunits/functions/fnc_startSwitchUnits.sqf index 7985bfa094..481b04d2cd 100644 --- a/addons/switchunits/functions/fnc_startSwitchUnits.sqf +++ b/addons/switchunits/functions/fnc_startSwitchUnits.sqf @@ -9,14 +9,14 @@ * None * * Example: - * [_player] call FUNC(startSwitchUnits) + * [_player] call ace_switchunits_fnc_startSwitchUnits * * Public: No */ #include "script_component.hpp" -PARAMS_1(_player); +params ["_player"]; if (GVAR(EnableSwitchUnits)) then { private "_sides"; diff --git a/addons/switchunits/functions/fnc_switchBack.sqf b/addons/switchunits/functions/fnc_switchBack.sqf index c9ca731427..c3cb99588a 100644 --- a/addons/switchunits/functions/fnc_switchBack.sqf +++ b/addons/switchunits/functions/fnc_switchBack.sqf @@ -10,20 +10,19 @@ * None * * Example: - * [_originalPlayerUnit, _currentUnit] call FUNC(switchBack) + * [_originalPlayerUnit, _currentUnit] call ace_switchunits_fnc_switchBack * * Public: Yes */ - #include "script_component.hpp" -PARAMS_1(_originalPlayerUnit); +params ["_originalPlayerUnit"]; [_originalPlayerUnit] joinSilent GVAR(OriginalGroup); -DFUNC(pfhSwitchBack) = { - PARAMS_2(_args,_pfID); - EXPLODE_2_PVT(_args,_originalPlayerUnit,_currentUnit); +[{ + params ["_args", "_pfhId"]; + _args params ["_originalPlayerUnit", "_currentUnit"]; if (local _originalPlayerUnit) exitWith { selectPlayer _originalPlayerUnit; @@ -33,8 +32,6 @@ DFUNC(pfhSwitchBack) = { _layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; _layer cuttext ["","plain"]; - [(_this select 1)] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; -}; - -[FUNC(pfhSwitchBack), 0.2, _this] call CBA_fnc_addPerFrameHandler; +}, 0.2, _this] call CBA_fnc_addPerFrameHandler; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index 1fbe8b9b28..793e72bb71 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -3,24 +3,21 @@ * Switches to the new given player unit * * Arguments: - * 0: current unit - * 1: the unit to switch to + * 0: the unit to switch to * * Return Value: * None * * Example: - * [_unit] call FUNC(switchUnit) + * [_unit] call ace_switchunits_fnc_switchUnit * * Public: Yes */ - - #include "script_component.hpp" private ["_nearestEnemyPlayers", "_allNearestPlayers", "_oldUnit", "_leave"]; -PARAMS_1(_unit); +params ["_unit"]; // don't switch to original player units if (!([_unit] call FUNC(isValidAi))) exitWith {}; @@ -29,14 +26,12 @@ if (!([_unit] call FUNC(isValidAi))) exitWith {}; _leave = false; if (GVAR(EnableSafeZone)) then { - _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers); _nearestEnemyPlayers = [_allNearestPlayers, {((side GVAR(OriginalGroup)) getFriend (side _this) < 0.6) && !(_this getVariable [QGVAR(IsPlayerControlled), false])}] call EFUNC(common,filter); if (count _nearestEnemyPlayers > 0) exitWith { _leave = true; }; - }; // exitWith doesn't exit past the "if(EnableSafeZone)" block @@ -49,21 +44,12 @@ if (_leave) exitWith { //[_unit] joinSilent group player; [[_unit, player], QUOTE({(_this select 0) setVariable [ARR_3(QUOTE(QGVAR(OriginalOwner)), owner (_this select 0), true)]; (_this select 0) setOwner owner (_this select 1)}), 1] call EFUNC(common,execRemoteFnc); -_oldUnit = player; - - -DFUNC(pfhSwitchUnit) = { - - private ["_args", "_unit", "_oldUnit", "_respawnEhId", "_oldOwner"]; - _args = _this select 0; - - _unit = _args select 0; - _oldUnit = _args select 1; - - +[{ + private ["_respawnEhId", "_oldOwner"]; + params ["_args", "_pfhId"]; + _args params ["_unit", "_oldUnit"]; if (local _unit) exitWith { - _oldUnit setVariable [QGVAR(IsPlayerControlled), false, true]; _oldUnit setVariable [QGVAR(PlayerControlledName), "", true]; @@ -90,9 +76,6 @@ DFUNC(pfhSwitchUnit) = { [localize LSTRING(SwitchedUnit)] call EFUNC(common,displayTextStructured); - [(_this select 1)] call cba_fnc_removePerFrameHandler; - + [_pfhId] call cba_fnc_removePerFrameHandler; }; -}; - -[FUNC(pfhSwitchUnit), 0.2, [_unit, _oldUnit]] call cba_fnc_addPerFrameHandler; +}, 0.2, [_unit, player]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp index bd66176e34..a1eda1a955 100644 --- a/addons/tacticalladder/CfgVehicles.hpp +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -82,7 +82,8 @@ class CfgVehicles { displayName = CSTRING(Position); distance = 4; condition = "true"; - statement = QUOTE([ARR_2(_target,_player)] call FUNC(positionTL)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(positionTL)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tacticalladder/README.md b/addons/tacticalladder/README.md index ff6b8ecad3..c4b84b1613 100644 --- a/addons/tacticalladder/README.md +++ b/addons/tacticalladder/README.md @@ -3,8 +3,9 @@ ace_tacticalladder Adds a packable tactical ladder. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/tacticalladder/data/ace_tacticalladder_pack.p3d b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d index e7b565ff11..5373648426 100644 Binary files a/addons/tacticalladder/data/ace_tacticalladder_pack.p3d and b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d differ diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 63a97d97e9..456d245832 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -9,7 +9,7 @@ * None * * Example: - * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy * * Public: No */ @@ -17,16 +17,16 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_1(_ladder); +params ["_ladder"]; detach _ladder; _ladder animate ["rotate", 0]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 93263c6aa0..764e5c73d8 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -6,16 +6,16 @@ * 0: ladder * * Return Value: - * Success? + * Success * * Example: - * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy; + * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy * * Public: No */ #include "script_component.hpp" -PARAMS_1(_ladder); +params ["_ladder"]; private ["_pos1", "_pos2"]; _pos1 = getPosASL GVAR(ladder); @@ -23,8 +23,8 @@ _pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) ca if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false }; call EFUNC(interaction,hideMouseHint); -[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); -[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); detach _ladder; GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf index 7ad135ca90..14c386dda1 100644 --- a/addons/tacticalladder/functions/fnc_deployTL.sqf +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -3,13 +3,13 @@ * Deploy tactical ladder * * Arguments: - * Nothing + * None * * Return Value: - * Nothing + * None * * Example: - * call ace_tacticalladder_fnc_deployTL; + * [] call ace_tacticalladder_fnc_deployTL * * Public: No */ diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf index d08cb6e208..6b5107b814 100644 --- a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * Handled * * Example: - * 1 call ace_tacticalladder_fnc_handleScrollWheel; + * [1] call ace_tacticalladder_fnc_handleScrollWheel; * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (isNull GVAR(ladder)) exitWith { false }; @@ -37,7 +37,7 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; GVAR(currentStep) = _currentStep - 1; - }; + }; }; } else { // Tilting @@ -45,4 +45,4 @@ if (GETMVAR(ACE_Modifier,0) == 0) then { GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; }; -true \ No newline at end of file +true diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf index c603f1feca..ad409f8870 100644 --- a/addons/tacticalladder/functions/fnc_pickupTL.sqf +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -7,10 +7,10 @@ * 1: unit * * Return Value: - * Success? + * Success * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL * * Public: No */ @@ -18,7 +18,7 @@ if ((backpack ACE_player) != "") exitWith { false }; -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; deleteVehicle _ladder; _unit addBackpack "ACE_TacticalLadder_Pack"; diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 103792c851..1035101556 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL; + * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL * * Public: No */ @@ -18,11 +18,11 @@ #define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] -PARAMS_2(_ladder,_unit); +params ["_ladder", "_unit"]; { _ladder animate [_x, 0]; -} forEach __ANIMS; +} count __ANIMS; _unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player @@ -30,7 +30,7 @@ _ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of playe _ladder animate ["rotate", 0]; { _ladder animate [_x, 1]; -} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) +} count ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) GVAR(ladder) = _ladder; GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling diff --git a/addons/testmissions/README.md b/addons/testmissions/README.md new file mode 100644 index 0000000000..e8737f0ab6 --- /dev/null +++ b/addons/testmissions/README.md @@ -0,0 +1,11 @@ +ace_testmissions +=========== + +Provides test missions. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- None diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp index a489e18704..2a689ba349 100644 --- a/addons/tripod/CfgVehicles.hpp +++ b/addons/tripod/CfgVehicles.hpp @@ -17,7 +17,7 @@ class CfgVehicles { class Item_Base_F; class ACE_Item_Tripod: Item_Base_F { - author[] = {"Rocko", "Scubaman3D"}; + author[] = {"Rocko", "Scubaman3D"}; scope = 2; scopeCurator = 2; displayName = CSTRING(DisplayName); @@ -76,7 +76,8 @@ class CfgVehicles { displayName = CSTRING(Adjust); distance = 5; condition = "true"; - statement = QUOTE(_target call FUNC(adjust)); + //wait a frame to handle "Do When releasing action menu key" option: + statement = QUOTE([ARR_2({_this call FUNC(adjust)}, [_target])] call EFUNC(common,execNextFrame)); showDisabled = 0; exceptions[] = {}; priority = 5; diff --git a/addons/tripod/README.md b/addons/tripod/README.md index 1f4282f1ab..beb6791b6d 100644 --- a/addons/tripod/README.md +++ b/addons/tripod/README.md @@ -3,8 +3,9 @@ ace_tripod Adds a packable tripod. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf index ce50d38cf0..1ba99cedbe 100644 --- a/addons/tripod/functions/fnc_adjust.sqf +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -1,37 +1,39 @@ /* * Author: Ruthberg - * * Adjust tripod height * * Arguments: * 0: tripod * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [tripod] call ace_tripod_fnc_adjust + * + * Public: No */ #include "script_component.hpp" -PARAMS_1(_tripod); +params ["_tripod"]; GVAR(adjuster) = ACE_player; GVAR(adjusting) = true; GVAR(adjustPFH) = [{ - EXPLODE_1_PVT(_this select 0,_tripod); - + params ["_args", "_pfhId"]; + _args params ["_tripod"]; + if (GVAR(adjuster) != ACE_player || !GVAR(adjusting)) exitWith { call EFUNC(interaction,hideMouseHint); [ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Adjust), -1]] call EFUNC(Common,removeActionEventHandler); - [_this select 1] call cba_fnc_removePerFrameHandler; + [_pfhId] call cba_fnc_removePerFrameHandler; }; - + { _tripod animate [_x, 1 - GVAR(height)]; - } foreach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; - + } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; + }, 0, [_tripod]] call CBA_fnc_addPerFrameHandler; [localize "STR_ACE_Tripod_Done", "", localize "STR_ACE_Tripod_ScrollAction"] call EFUNC(interaction,showMouseHint); diff --git a/addons/tripod/functions/fnc_handleScrollWheel.sqf b/addons/tripod/functions/fnc_handleScrollWheel.sqf index 7399bf0c2c..973a57dd2f 100644 --- a/addons/tripod/functions/fnc_handleScrollWheel.sqf +++ b/addons/tripod/functions/fnc_handleScrollWheel.sqf @@ -9,13 +9,13 @@ * handled * * Example: - * 1.2 call ace_tripod_fnc_handleScrollWheel; + * [1.2] call ace_tripod_fnc_handleScrollWheel; * * Public: No */ #include "script_component.hpp" -PARAMS_1(_scroll); +params ["_scroll"]; if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(adjustPFH) == -1) exitWith { false }; diff --git a/addons/tripod/functions/fnc_pickup.sqf b/addons/tripod/functions/fnc_pickup.sqf index f264eb1e2e..24fc26ea1d 100644 --- a/addons/tripod/functions/fnc_pickup.sqf +++ b/addons/tripod/functions/fnc_pickup.sqf @@ -1,30 +1,30 @@ /* * Author: Rocko, Ruthberg - * * Pick up tripod * * Arguments: * 0: tripod * 1: unit * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [tripod, player] call ace_tripod_fnc_pickup + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_tripod,_unit); +params ["_tripod", "_unit"]; if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { _unit playMove "AmovPercMstpSrasWrflDnon_diary"; }; [{ - PARAMS_2(_tripod,_unit); + params ["_tripod", "_unit"]; [_unit, "ACE_Tripod"] call EFUNC(common,addToInventory); deleteVehicle _tripod; - }, [_tripod, _unit], 1, 0]call EFUNC(common,waitAndExecute); diff --git a/addons/tripod/functions/fnc_place.sqf b/addons/tripod/functions/fnc_place.sqf index 5e9c783589..ce7f445885 100644 --- a/addons/tripod/functions/fnc_place.sqf +++ b/addons/tripod/functions/fnc_place.sqf @@ -1,21 +1,22 @@ /* * Author: Rocko, Ruthberg - * * Place down tripod * * Arguments: * 0: unit * 1: tripod class * - * Return Value: - * Nothing - * * Return value: * None + * + * Example: + * [player, "ACE_Tripod"] call ace_tripod_fnc_place + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_tripodClass); +params ["_unit", "_tripodClass"]; _unit removeItem _tripodClass; @@ -24,27 +25,29 @@ if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { }; [{ - PARAMS_1(_unit); - + params ["_unit"]; + private ["_direction", "_position", "_tripod"]; _direction = getDir _unit; _position = (getPosASL _unit) vectorAdd [0.8 * sin(_direction), 0.8 * cos(_direction), 0.02]; - + _tripod = "ACE_TripodObject" createVehicle [0, 0, 0]; { _tripod animate [_x, 1]; - } foreach ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; - + } count ["slide_down_tripod", "retract_leg_1", "retract_leg_2", "retract_leg_3"]; + [{ - EXPLODE_3_PVT(_this select 0,_tripod,_direction,_position); + params ["_args", "_pfhId"]; + _args params ["_tripod", "_direction", "_position"]; + if (_tripod animationPhase "slide_down_tripod" == 1) then { _tripod setDir _direction; _tripod setPosASL _position; if ((getPosATL _tripod select 2) - (getPos _tripod select 2) < 1E-5) then { - _tripod setVectorUp (surfaceNormal (position _tripod)); + _tripod setVectorUp (surfaceNormal (position _tripod)); }; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_pfhId] call CBA_fnc_removePerFrameHandler; }; }, 0, [_tripod, _direction, _position]] call CBA_fnc_addPerFrameHandler; - + }, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/ui/README.md b/addons/ui/README.md index f11027038f..c16d2c04e5 100644 --- a/addons/ui/README.md +++ b/addons/ui/README.md @@ -1,9 +1,11 @@ ace_ui ======= -Changes the chat contrast on the map to allow easier reading +Changes the chat contrast on the map to allow easier reading. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. +- [VKing](https://github.com/VKing6) diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp index e7ea4b32eb..d2f4d114e4 100644 --- a/addons/ui/config.cpp +++ b/addons/ui/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"VKing"}; - authorUrl = "https://github.com/ACEMod/"; + authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; }; }; diff --git a/addons/vehiclelock/readme.md b/addons/vehiclelock/README.md similarity index 76% rename from addons/vehiclelock/readme.md rename to addons/vehiclelock/README.md index 64ae01a99c..c31402c6e3 100644 --- a/addons/vehiclelock/readme.md +++ b/addons/vehiclelock/README.md @@ -5,11 +5,10 @@ Adds keys as an item, to lock and unlock vehicles. Primary target would be role play or TVT, but has uses in all game types, even co-ops (e.g.: DAC AI will steal unlocked vehicles) Two key modes (can be used together): -* Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) -* Custom keys (one key will only open a specific vehicle and nothing else) +- Simple Side based keys (e.g. "ACE_key_west" works on any [WEST] vehicle like the M-ATV//hunter) +- Custom keys (one key will only open a specific vehicle and nothing else) #### Items Added: - `ACE_key_lockpick` `ACE_key_master` `ACE_key_west` @@ -20,19 +19,21 @@ Two key modes (can be used together): #### Magazine added: `ACE_key_customKeyMagazine` (should never be manualy added, needs to be "programed" to work on a vehicle, see `ACE_VehicleLock_fnc_addKeyForVehicle`) + ## For Mission Makers: #### Modules: -* Vehicle Lock Setup - Settings for locking inventory of locked vehicles, default lockpick time, and initial vehicle lock state. -* Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Will NOT work for JIP units. +- Vehicle Lock Setup - Settings for locking inventory of locked vehicles, default lockpick time, and initial vehicle lock state. +- Vehicle Key Assign - Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Will NOT work for JIP units. #### Vehicle setVariables: -* `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys -* `ACE_vehicleLock_lockpickStrength` - NUMBER: secons, determines how long lockpicking with take, overrides ACE_VehicleLock_DefaultLockpickStrength +- `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allows indfor to use little-bird's with indp keys +- `ACE_vehicleLock_lockpickStrength` - NUMBER: secons, determines how long lockpicking with take, overrides ACE_VehicleLock_DefaultLockpickStrength #### Public Functions: `[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` - will add a `ACE_key_customKeyMagazine` to bob and program it to work on car1 + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index d683073286..073054648e 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -20,7 +20,10 @@ private ["_previousMags","_newMags","_keyMagazine","_keyName"]; -PARAMS_3(_unit,_veh,_useCustom); +if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_useCustom", false, [false]]]) exitWith { + ERROR("Input wrong type"); +}; +TRACE_3("params",_unit,_veh,_useCustom); if (isNull _unit) exitWith {ERROR("null unit");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf index 999f471ac3..eda75922c4 100644 --- a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf +++ b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf @@ -17,7 +17,8 @@ private ["_vehConfigSide","_vehSide","_returnValue"]; -PARAMS_1(_veh); +params ["_veh"]; +TRACE_1("params",_veh); if (isNull _veh) exitWith {ERROR("null vehicle"); "error"}; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index 5a2bc3f7bd..be23dc8dd9 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -16,26 +16,30 @@ */ #include "script_component.hpp" -PARAMS_1(_vehicle); - if (!isServer) exitWith {}; +params ["_vehicle"]; +TRACE_1("params",_vehicle); + [{ //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) if (GVAR(VehicleStartingLockState) == -1) exitWith {}; + private ["_lock"]; - PARAMS_1(_vehicle); + + params ["_vehicle"]; + if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { //set lock state (eliminates the ambigious 1-"Default" and 3-"Locked for Player" states) _lock = switch (GVAR(VehicleStartingLockState)) do { - case (0): {(locked _vehicle) in [2, 3]}; - case (1):{true}; - case (2):{false}; + case (0): { (locked _vehicle) in [2, 3] }; + case (1): { true }; + case (2): { false }; }; - if (((_lock) && {(locked _vehicle) != 2}) || {(!_lock) && {(locked _vehicle) != 0}}) then { + if ((_lock && {(locked _vehicle) != 2}) || {!_lock && {(locked _vehicle) != 0}}) then { TRACE_3("Setting Lock State",_lock,(typeOf _vehicle),_vehicle); ["VehicleLock_SetVehicleLock", [_vehicle], [_vehicle, _lock]] call EFUNC(common,targetEvent); }; }; //Delay call until mission start (so everyone has the eventHandler's installed) -}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute); +}, [_vehicle], 0.25] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index 779f4a363e..390104cefc 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -18,7 +18,8 @@ private ["_returnValue","_sideKeyName","_customKeys"]; -PARAMS_2(_unit,_veh); +params ["_unit", "_veh"]; +TRACE_2("params",_unit,_veh); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 613a7b35dc..f4837c742b 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -22,7 +22,8 @@ private ["_vehLockpickStrenth","_condition","_returnValue"]; -PARAMS_3(_unit,_veh,_funcType); +params ["_unit", "_veh", "_funcType"]; +TRACE_3("params",_unit,_veh,_funcType); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; @@ -41,25 +42,20 @@ if (_vehLockpickStrenth < 0) exitWith {false}; //Condition check for progressBar _condition = { - PARAMS_1(_args); - EXPLODE_2_PVT(_args,_unit,_veh); + params ["_args"]; + _args params ["_args", "_unit", "_veh"]; ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; if (!([[_unit, _veh]] call _condition)) exitWith {false}; -_returnValue = false; -switch (true) do { -case (_funcType == "canLockpick"): { - _returnValue = true; - }; -case (_funcType == "startLockpick"): { +_returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; +switch (_funcType) do { + case "startLockpick": { [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); - _returnValue = true; }; -case (_funcType == "finishLockpick"): { + case "finishLockpick": { ["VehicleLock_SetVehicleLock", [_veh], [_veh, false]] call EFUNC(common,targetEvent); - _returnValue = true; }; default { ERROR("bad function type"); diff --git a/addons/vehiclelock/functions/fnc_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index 510b8ec7be..9b2c3cf182 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -17,10 +17,12 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedUnits,_activated); +if (!isServer) exitWith {}; + +params ["_logic", "_syncedUnits", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if (!_activated) exitWith {WARNING("Vehicle Lock Init Module - placed but not active");}; -if (!isServer) exitWith {}; //Set the GVAR for default lockpick strength [_logic, QGVAR(DefaultLockpickStrength), "DefaultLockpickStrength"] call EFUNC(common,readSettingFromModule); diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index ede20e3196..27577e4dbe 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -17,14 +17,18 @@ */ #include "script_component.hpp" -PARAMS_3(_logic,_syncedObjects,_activated); +if (!isServer) exitWith {}; + +params ["_logic", "_syncedObjects", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; -if (!isServer) exitWith {}; [{ private ["_listOfVehicles"]; - PARAMS_1(_syncedObjects); + + params ["_syncedObjects"]; + _listOfVehicles = []; { if ((_x isKindOf "Car") || (_x isKindOf "Tank") || (_x isKindOf "Helicopter")) then { diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 8199f4b850..5db2cbebe0 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -16,7 +16,8 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_container); +params ["_unit", "_container"]; +TRACE_2("params",_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; diff --git a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf index 9d8a396e31..e959a705e0 100644 --- a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf +++ b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf @@ -18,7 +18,8 @@ private ["_currentKeys"]; -PARAMS_2(_veh,_key); +params ["_veh", "_key"]; +TRACE_2("params",_veh,_key); if (!isServer) exitWith {ERROR("only run on server");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index cb51cb27a8..d2290ef732 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -18,7 +18,8 @@ private ["_lockNumber"]; -PARAMS_2(_veh,_isLocked); +params ["_veh", "_isLocked"]; +TRACE_2("params",_veh,_isLocked); _lockNumber = if (_isLocked) then {2} else {0}; TRACE_2("Setting Lock State", _veh, _lockNumber); diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 7ddb07433a..151c02fd8a 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -1,10 +1,24 @@ -// by commy2 +/* + * Author: commy2 + * Toggle speed limiter for Driver in Vehicle. + * + * Arguments: + * 0: Driver + * 1: Vehicle + * + * Return Value: + * None + * + * Example: + * [player, car] call ace_vehicles_fnc_speedLimiter + * + * Public: No + */ #include "script_component.hpp" -private ["_driver", "_vehicle"]; +private "_maxSpeed"; -_driver = _this select 0; -_vehicle = _this select 1; +params ["_driver", "_vehicle"]; if (GETGVAR(isSpeedLimiter,false)) exitWith { [localize LSTRING(Off)] call EFUNC(common,displayTextStructured); @@ -16,19 +30,15 @@ if (GETGVAR(isSpeedLimiter,false)) exitWith { playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; -private "_maxSpeed"; _maxSpeed = speed _vehicle max 10; [{ - private ["_driver", "_vehicle", "_maxSpeed"]; - - _driver = _this select 0 select 0; - _vehicle = _this select 0 select 1; - _maxSpeed = _this select 0 select 2; + params ["_args", "_idPFH"]; + _args params ["_driver", "_vehicle", "_maxSpeed"]; if (!GVAR(isSpeedLimiter) || {_driver != driver _vehicle}) exitWith { GVAR(isSpeedLimiter) = false; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; private "_speed"; diff --git a/addons/vehicles/functions/fnc_startEngine.sqf b/addons/vehicles/functions/fnc_startEngine.sqf index 63afd78e2e..e2c171e018 100644 --- a/addons/vehicles/functions/fnc_startEngine.sqf +++ b/addons/vehicles/functions/fnc_startEngine.sqf @@ -1,23 +1,30 @@ -// by commy2 +/* + * Author: commy2 + * Delays engine start of vehicle. + * + * Arguments: + * 0: Vehicle + * 1: Is Engine on + * + * Return Value: + * None + * + * Example: + * [vehicle player, false] call ace_vehicle_fnc_startEngine + * + * Public: No + */ #include "script_component.hpp" -private ["_vehicle", "_isEngineOn"]; - -_vehicle = _this select 0; -_isEngineOn = _this select 1; +params ["_vehicle", "_isEngineOn"]; if (!_isEngineOn || {floor abs speed _vehicle > 0}) exitWith {}; [{ - private ["_vehicle", "_time", "_direction"]; + params ["_args", "_idPFH"]; + _args params ["_vehicle", "_time", "_direction"]; - _vehicle = _this select 0 select 0; - _time = _this select 0 select 1; - _direction = _this select 0 select 2; - - if (ACE_time > _time) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; + if (ACE_time > _time) exitWith { [_idPFH] call CBA_fnc_removePerFrameHandler; }; _vehicle setVelocity [0, 0, 0]; _vehicle setVectorDirAndUp _direction; diff --git a/addons/viewdistance/README.md b/addons/viewdistance/README.md new file mode 100644 index 0000000000..67860b1ad0 --- /dev/null +++ b/addons/viewdistance/README.md @@ -0,0 +1,11 @@ +ace_viewdistance +=========== + +Adds various View Distance settings and allows limiting maximum view distance that can be set by players. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Winter](https://github.com/Winter259) diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index 865e5527e5..a30befaa81 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -5,17 +5,10 @@ if (!hasInterface) exitWith {}; ["SettingsInitialized", { // if not enabled, then bugger off. if !(GVAR(enabled)) exitWith {}; - - // Force the view distance down to the limit. - if (viewDistance > GVAR(limitViewDistance)) then { - setViewDistance GVAR(limitViewDistance); - }; - - // Adapt view distance when the player is created or changed according to whether client is on foot or vehicle. - ["playerChanged",{ - [false] call FUNC(adaptViewDistance); - }] call EFUNC(common,addEventHandler); - + + // Limit on load + [false] call FUNC(adaptViewDistance); + // Set the EH which waits for any of the view distance settings to be changed, so that the effect is show immediately ["SettingChanged",{ if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || @@ -28,7 +21,8 @@ if (!hasInterface) exitWith {}; }] call EFUNC(common,addEventHandler); // Set the EH which waits for a vehicle change to automatically swap between On Foot/In Land Vehicle/In Air Vehicle + // Also run when SettingsInitialized runs (not guaranteed) ["playerVehicleChanged",{ [false] call FUNC(adaptViewDistance) }] call EFUNC(common,addEventHandler); -}] call EFUNC(common,addEventHandler); \ No newline at end of file +}] call EFUNC(common,addEventHandler); diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 2ef4b84ae6..ca03758df5 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_show_prompt); - private["_land_vehicle","_air_vehicle"]; +params ["_show_prompt"]; + if (!GVAR(enabled) || isNull ACE_player) exitWith {}; _land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 9060254c60..30dc4f8144 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -20,12 +20,13 @@ private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"]; -PARAMS_2(_index_requested,_show_prompt); +params ["_index_requested", "_show_prompt"]; _new_view_distance = [_index_requested] call FUNC(returnValue); // changes the setting index into an actual view distance value _object_view_distance_coeff = [GVAR(objectViewDistanceCoeff)] call FUNC(returnObjectCoeff); // changes the setting index into a coefficient. _view_distance_limit = GVAR(limitViewDistance); // Grab the limit +TRACE_2("Limit",_new_view_distance,_view_distance_limit); setViewDistance (_new_view_distance min _view_distance_limit); if (_object_view_distance_coeff > 0) then { diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 7569383d0c..912242f373 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -17,7 +17,7 @@ if (!isServer) exitWith {}; -PARAMS_3(_logic,_units,_activated); +params ["_logic", "_units", "_activated"]; if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; @@ -26,4 +26,4 @@ if (!_activated) exitWith { [_logic, QGVAR(enabled),"moduleViewDistanceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(limitViewDistance),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); -diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limitViewDistance)]; \ No newline at end of file +diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limitViewDistance)]; diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf index 145b8ae9e6..71a23d7b54 100644 --- a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -1,7 +1,7 @@ /* * Author: Winter * Returns the object view distance coefficient according to the given index - * + * * * Arguments: * 0: Object View Distance setting Index @@ -17,10 +17,10 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"]; + _return = switch (_index) do { case 0: {0.00}; // Off case 1: {0.20}; // Very Low @@ -31,4 +31,4 @@ _return = switch (_index) do { default {0.50}; // something broke if this returns }; -_return; \ No newline at end of file +_return; diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index fb449cf702..7e0c41f1be 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -17,12 +17,12 @@ #include "script_component.hpp" -PARAMS_1(_index); - private ["_return"]; +params ["_index"]; + _return = switch (_index) do { - case 0: {-1}; + case 0: {viewDistance}; // Video Settings option case 1: {500}; case 2: {1000}; case 3: {1500}; @@ -40,4 +40,5 @@ _return = switch (_index) do { default {1000}; }; -_return; \ No newline at end of file +TRACE_1("VD Index Return",_return); +_return diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf index f45ed0ea57..572a83edf1 100644 --- a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -1,21 +1,26 @@ /* * Author: esteldunedain - * * Count how many grenade magazines the unit has on the uniform and vest. * - * Argument: - * 0: Muzzle name + * Arguments: + * 0: Unit + * 1: Muzzle Class * - * Return value: - * 0: Number of magazines - * 1: First magazine name + * Return Value: + * 0: Number of magazines + * 1: First magazine name + * + * Example: + * [player, currentMuzzle player] call ace_weaponselect_fnc_countMagazinesForGrenadeMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index 81cb57d9f3..37956d2121 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -1,24 +1,28 @@ /* * Author: esteldunedain - * * Display a grenade type and quantity. * - * Argument: - * 0: magazine class - * 1: number of magazines + * Arguments: + * 0: magazine class + * 1: number of magazines * - * Return value: + * Return Value: * None + * + * Example: + * [currentMagazine player, 3] call ace_weaponselect_fnc_displayGrenadeTypeAndNumber + * + * Public: No */ #include "script_component.hpp" if !(GVAR(DisplayText)) exitwith {}; -PARAMS_2(_magazine,_numberofMagazines); - private ["_color", "_name", "_text", "_picture"]; -_color = [[1,0,0], [1,1,1]] select (_numberofMagazines > 0); +params ["_magazine", "_numberofMagazines"]; + +_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); diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf index 65d62826e5..2b2370260a 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * Find the next Grenade Magazine. + * + * Arguments: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return Value: + * Magazine classname + * + * Example: + * ["All"] call ace_weaponselect_fnc_findNextGrenadeMagazine + * + * Public: No + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMagazine"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf index 0491afa413..5aa096f44e 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf @@ -1,17 +1,29 @@ -// by commy2 +/* + * Author: commy2 + * Find the next Grenade Muzzle. + * + * Arguments: + * 0: Grenade Type ("All", "Frag", "NonFrag") + * + * Return Value: + * Class name of next throw muzzle + * + * Example: + * ["All"] call ace_weaponselect_fnc_findNextGrenadeMuzzle + * + * Public: No + */ #include "script_component.hpp" -private ["_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"]; -PARAMS_1(_type); //"All", "Frag" or "NonFrag" +params ["_type"]; _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; _magazines = magazines ACE_player; -private ["_start", "_index", "_nextMuzzle"]; - _start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); _index = _allMuzzles find _start; diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 37e2b1c873..20ef674dae 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -1,9 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Fire Vehicle Smoke Launcher. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * [vehicle player] call ace_weaponselect_fnc_fireSmokeLauncher + * + * Public: No + */ #include "script_component.hpp" private ["_turret", "_weapons"]; -PARAMS_1(_vehicle); +params ["_vehicle"]; _turret = [_vehicle] call EFUNC(common,getTurretCommander); diff --git a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf index 5e8c3f920f..aa89a13c98 100644 --- a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf +++ b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Returns the selected Grenade Muzzle. + * + * Arguments: + * None + * + * Return Value: + * Class name of selected throw muzzle + * + * Example: + * [] call ace_weaponselect_fnc_getSelectedGrenade + * + * Public: No + */ #include "script_component.hpp" [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag) diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 45e84d631d..c79f03c6f2 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,9 +1,24 @@ -// by commy2 +/* + * Author: commy2 + * Play the change firemode sound for specified weapon at units position. + * + * Arguments: + * 0: Unit + * 1: Weapon + * + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_playChangeFiremodeSound + * + * Public: No + */ #include "script_component.hpp" private ["_sound"]; -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); diff --git a/addons/weaponselect/functions/fnc_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf index a4cd743bfb..faddb4d869 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -1,17 +1,21 @@ /* * Author: commy2 - * * The unit will put its current weapon away. * - * Argument: - * 0: What unit should put the current weapon on back? (Object) + * Arguments: + * 0: Unit * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player] call ace_weaponselect_fnc_putWeaponAway + * + * Public: NO */ #include "script_component.hpp" -PARAMS_1(_unit); +params ["_unit"]; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index 69ea5cdf99..a68670184a 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -1,25 +1,28 @@ /* * Author: esteldunedain, commy2 - * * Cycle through all grenades. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeAll + * + * Public: No */ #include "script_component.hpp" private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); if (_nextMuzzle != "") then { - private ["_magazines", "_magazine", "_count", "_return"]; _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); reverse _magazines; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 91d0023e47..c221b6cc30 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -1,19 +1,23 @@ /* * Author: esteldunedain, commy2 - * * Cycle through frags. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeFrag + * + * Public: No */ #include "script_component.hpp" private ["_text", "_nextMuzzle"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index 28cc0e74d8..2f219989eb 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -1,19 +1,23 @@ /* * Author: esteldunedain, commy2 - * * Cycle through non explosive grenades. * - * Argument: + * Arguments: + * 0: Unit + * + * Return Value: * None * - * Return value: - * None + * Example: + * [player] call ace_weaponselect_fnc_selectGrenadeOther + * + * Public: No */ #include "script_component.hpp" private ["_nextMuzzle", "_text"]; -PARAMS_1(_unit); +params ["_unit"]; _nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index 012bf94898..815b8d28cf 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -1,17 +1,22 @@ /* * Author: commy2 - * * The player will select the specified weapon or will change to the next firing mode if the weapon was already selected. * - * Argument: - * 0: A weapon (String) + * Arguments: + * 0: Unit + * 1: Weapon * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_selectWeaponMode + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 67e63cd830..71c9cfc7b4 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -1,17 +1,22 @@ /* * Author: commy2 - * * The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle. * - * Argument: - * 0: A weapon (String) + * Arguments: + * 0: Unit + * 1: Weapon * - * Return value: - * None. + * Return Value: + * None + * + * Example: + * [player, currentWeapon player] call ace_weaponselect_fnc_selectWeaponMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_weapon); +params ["_unit", "_weapon"]; if (_weapon == "") exitWith {}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 9507c23a30..9695079da5 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -1,7 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Select weapon for unit in vehicle. + * + * Arguments: + * 0: Unit + * 1: Vehicle + * 2: Weapon index + * + * Return Value: + * None + * + * Example: + * [player, vehicle player, 1] call ace_weaponselect_fnc_selectWeaponVehicle + * + * Public: No + */ #include "script_component.hpp" -PARAMS_3(_unit,_vehicle,_index); +params ["_unit", "_vehicle", "_index"]; private "_turret"; _turret = [_unit] call EFUNC(common,getTurretIndex); diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf index 4bf970fab1..ce7ec55393 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -1,21 +1,25 @@ /* * Author: esteldunedain - * * Select the next grenade muzzle to throw. * - * Argument: - * muzzle name + * Arguments: + * 0: Unit + * 1: Muzzlename * - * Return value: + * Return Value: * None * + * Example: + * [player, currentMuzzle player] call ace_weaponselect_fnc_setNextGrenadeMuzzle + * + * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_muzzle); - private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; +params ["_unit", "_muzzle"]; + _uniformMags = getMagazineCargo uniformContainer _unit; _vestMags = getMagazineCargo vestContainer _unit; _backpackMags = getMagazineCargo backpackContainer _unit; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index ab06fd5b5d..2cdc8e63dc 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -1,11 +1,27 @@ -// by commy2 +/* + * Author: commy2 + * Display Grenade information on grenade throw. + * + * Arguments: + * 0: unit - Object the event handler is assigned to + * 1: weapon - Fired weapon + * 2: muzzle - Muzzle that was used + * 3: mode - Current mode of the fired weapon + * 4: ammo - Ammo used + * 5: magazine - magazine name which was used + * 6: projectile - Object of the projectile that was shot + * + * Return Value: + * None + * + * Example: + * [_unit, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] call ace_weaponselect_fnc_throwGrenade + * + * Public: No + */ #include "script_component.hpp" -private ["_unit","_weapon","_magazine"]; - -_unit = _this select 0; -_weapon = _this select 1; -_magazine = _this select 5; +params ["_unit", "_weapon", "", "", "", "_magazine"]; if (_weapon != "Throw") exitWith {}; diff --git a/addons/weather/ACE_Settings.hpp b/addons/weather/ACE_Settings.hpp index d4b5a716cf..d3b9b1fd2e 100644 --- a/addons/weather/ACE_Settings.hpp +++ b/addons/weather/ACE_Settings.hpp @@ -1,37 +1,37 @@ class ACE_Settings { class GVAR(enableServerController) { - displayName = "Weather propagation"; - description = "Enables sever side weather propagation"; + displayName = CSTRING(enableServerController_DisplayName); + description = CSTRING(enableServerController_Description); typeName = "BOOL"; value = 1; }; class GVAR(useACEWeather) { - displayName = "ACE Weather"; - description = "Overrides the default weather (editor, mission settings) with ACE weather (map based)"; + displayName = CSTRING(useACEWeather_DisplayName); + description = CSTRING(useACEWeather_Description); typeName = "BOOL"; value = 1; }; class GVAR(syncRain) { - displayName = "Sync Rain"; - description = "Synchronizes rain"; + displayName = CSTRING(syncRain_DisplayName); + description = CSTRING(syncRain_Description); typeName = "BOOL"; value = 1; }; class GVAR(syncWind) { - displayName = "Sync Wind"; - description = "Synchronizes wind"; + displayName = CSTRING(syncWind_DisplayName); + description = CSTRING(syncWind_Description); typeName = "BOOL"; value = 1; }; class GVAR(syncMisc) { - displayName = "Sync Misc"; - description = "Synchronizes lightnings, rainbow, fog, ..."; + displayName = CSTRING(syncMisc_DisplayName); + description = CSTRING(syncMisc_Description); typeName = "BOOL"; value = 1; }; class GVAR(serverUpdateInterval) { - displayName = "Update Interval"; - description = "Defines the interval (seconds) between weather updates"; + displayName = CSTRING(serverUpdateInterval_DisplayName); + description = CSTRING(serverUpdateInterval_Description); typeName = "SCALAR"; value = 60; }; diff --git a/addons/weather/README.md b/addons/weather/README.md index a2b719fc11..da83f62fd2 100644 --- a/addons/weather/README.md +++ b/addons/weather/README.md @@ -4,6 +4,7 @@ ace_weather This module simulates realistic weather effects, according to the geographical location of the map, the date and time. It also ensures that all players experience the same weather effects. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index 5704212b79..aa733afa5d 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -9,4 +9,4 @@ GVAR(rain_current_range) = -1+(random 2); // Wind call FUNC(initWind); -[FUNC(serverController), GVAR(serverUpdateInterval)] call cba_fnc_addPerFrameHandler; +[FUNC(serverController), GVAR(serverUpdateInterval)] call CBA_fnc_addPerFrameHandler; diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index e81463f41a..44a5b0696c 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -47,7 +47,7 @@ GVAR(WindInfo) = true; }; if (_windSpeed > 0.2) then { - _playerDir = getDir ACE_player; + _playerDir = (ACE_player call CBA_fnc_headDir) select 0; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); _windIndex = round(((_playerDir - _windDir + 360) % 360) / 30); _windIndex = _windIndex % 12; diff --git a/addons/winddeflection/ACE_Settings.hpp b/addons/winddeflection/ACE_Settings.hpp index 0a0cac6b34..2d6d7dfb3f 100644 --- a/addons/winddeflection/ACE_Settings.hpp +++ b/addons/winddeflection/ACE_Settings.hpp @@ -1,25 +1,25 @@ class ACE_Settings { class GVAR(enabled) { - displayName = "Wind Deflection"; - description = "Enables wind deflection"; + displayName = CSTRING(deflectionModule_DisplayName); + description = CSTRING(deflectionModule_Description); typeName = "BOOL"; value = 1; }; class GVAR(vehicleEnabled) { - displayName = "Vehicle Enabled"; - description = "Enables wind deflection for static/vehicle gunners"; + displayName = CSTRING(vehicleEnabled_DisplayName); + description = CSTRING(vehicleEnabled_Description); typeName = "BOOL"; value = 1; }; class GVAR(simulationInterval) { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = CSTRING(simulationInterval_DisplayName); + description = CSTRING(simulationInterval_Description); typeName = "SCALAR"; value = 0.05; }; class GVAR(simulationRadius) { - displayName = "Simulation Radius"; - description = "Defines the radius around the player (in meters) at which projectiles are wind deflected"; + displayName = CSTRING(simulationRadius_DisplayName); + description = CSTRING(simulationRadius_Description); typeName = "SCALAR"; value = 3000; }; diff --git a/addons/winddeflection/README.md b/addons/winddeflection/README.md index c2908a6f85..926b957715 100644 --- a/addons/winddeflection/README.md +++ b/addons/winddeflection/README.md @@ -3,9 +3,10 @@ ace_winddeflection Wind deflection for projectiles/bullets. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. - [Glowbal](https://github.com/Glowbal) -- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/winddeflection/config.cpp b/addons/winddeflection/config.cpp index 82a51a4b73..df2b55d221 100644 --- a/addons/winddeflection/config.cpp +++ b/addons/winddeflection/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredAddons[] = {"ace_weather"}; versionDesc = "ACE Wind Deflection"; author[] = {ECSTRING(common,ACETeam), "Glowbal", "Ruthberg"}; - authorUrl = "http://csemod.com"; + authorUrl = "http://ace3mod.com/"; VERSION_CONFIG; }; }; @@ -23,4 +23,4 @@ class CfgAddons { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" diff --git a/addons/winddeflection/functions/fnc_handleFired.sqf b/addons/winddeflection/functions/fnc_handleFired.sqf index d3f9da8153..6c668a8033 100644 --- a/addons/winddeflection/functions/fnc_handleFired.sqf +++ b/addons/winddeflection/functions/fnc_handleFired.sqf @@ -21,9 +21,7 @@ */ #include "script_component.hpp" -private ["_unit", "_bullet"]; -_unit = _this select 0; -_bullet = _this select 6; +params ["_unit", "", "", "", "_ammo", "", "_bullet"]; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false] && (_bullet isKindOf "BulletBase") && (_unit isKindOf "Man")) exitWith {false}; @@ -34,6 +32,6 @@ if (!((_bullet isKindOf "BulletBase") || (_bullet isKindOf "GrenadeBase"))) exit if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {false}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {false}; -GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> (_this select 4) >> "airFriction")]; +GVAR(trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; true; \ No newline at end of file diff --git a/addons/winddeflection/functions/fnc_initModuleSettings.sqf b/addons/winddeflection/functions/fnc_initModuleSettings.sqf index 40be14a2b2..037ce15c47 100644 --- a/addons/winddeflection/functions/fnc_initModuleSettings.sqf +++ b/addons/winddeflection/functions/fnc_initModuleSettings.sqf @@ -15,10 +15,7 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 23d0be6b79..baff39516d 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -18,11 +18,12 @@ [{ // BEGIN_COUNTER(pfeh); - private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_lastTime", "_trueSpeed", "_trueVelocity"]; + private["_accel", "_accelRef", "_bulletSpeed", "_bulletVelocity", "_deleted", "_deltaT", "_drag", "_dragRef", "_isWind", "_trueSpeed", "_trueVelocity"]; - _lastTime = (_this select 0) select 0; + params ["_args"]; + _args params ["_lastTime"]; _deltaT = ACE_time - _lastTime; - (_this select 0) set [0, ACE_time]; + _args set [0, ACE_time]; _deleted = 0; _isWind = (vectorMagnitude ACE_wind > 0); diff --git a/addons/yardage450/README.md b/addons/yardage450/README.md index 6301233fe4..991c4f8a22 100644 --- a/addons/yardage450/README.md +++ b/addons/yardage450/README.md @@ -3,8 +3,9 @@ ace_yardage450 Adds the Bushnell Yardage Pro Sport 450 Laser Rangefinder. + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [Ruthberg] (http://github.com/Ulteq) +- [Ruthberg](http://github.com/Ulteq) diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp index 388e3c42cb..6488a23e4e 100644 --- a/addons/zeus/ACE_Settings.hpp +++ b/addons/zeus/ACE_Settings.hpp @@ -20,4 +20,10 @@ class ACE_Settings { value = 0; values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(revealMines_partial), CSTRING(revealMines_full)}; }; + class GVAR(autoAddObjects) { + displayName = CSTRING(AddObjectsToCurator); + description = CSTRING(AddObjectsToCurator_desc); + value = 0; + typeName = "BOOL"; + }; }; diff --git a/addons/zeus/CfgEventHandlers.hpp b/addons/zeus/CfgEventHandlers.hpp index f0a9f14d91..57d6a1afd0 100644 --- a/addons/zeus/CfgEventHandlers.hpp +++ b/addons/zeus/CfgEventHandlers.hpp @@ -4,3 +4,11 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + +class Extended_InitPost_EventHandlers { + class AllVehicles { + class ADDON { + serverInit = QUOTE(call FUNC(addObjectToCurator)); + }; + }; +}; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 77273c60b7..e110970ae3 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -115,4 +115,34 @@ class CfgVehicles { sync[] = {}; }; }; + class GVAR(moduleSetMedic): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedic_displayName); + function = QFUNC(moduleSetMedic); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; + class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedicalVehicle_displayName); + function = QFUNC(moduleSetMedicalVehicle); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; + class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedicalFacility_displayName); + function = QFUNC(moduleSetMedicalFacility); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; }; diff --git a/addons/zeus/README.md b/addons/zeus/README.md index b99edb66bb..35e7da1cdd 100644 --- a/addons/zeus/README.md +++ b/addons/zeus/README.md @@ -1,15 +1,16 @@ ace_zeus ========== -Provides control over various aspects of zeus: +Provides control over various aspects of Zeus: - Ascension messages - Eagle - Wind sounds - Ordnance radio messages - Mine markers + ## Maintainers The people responsible for merging changes to this component or answering potential questions. -- [SilentSpike] (http://github.com/SilentSpike) +- [SilentSpike](http://github.com/SilentSpike) diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 1b2ac19263..5aee98c3f3 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -2,12 +2,16 @@ ADDON = false; +PREP(addObjectToCurator); PREP(bi_moduleCurator); PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); PREP(handleZeusUnitAssigned); PREP(moduleCaptive); +PREP(moduleSetMedic); +PREP(moduleSetMedicalVehicle); +PREP(moduleSetMedicalFacility); PREP(moduleSurrender); PREP(moduleUnconscious); PREP(moduleZeusSettings); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 7505f2770e..810ce17396 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -19,7 +19,10 @@ class CfgPatches { }; class GVAR(medical): ADDON { units[] = { - QGVAR(moduleUnconscious) + QGVAR(moduleUnconscious), + QGVAR(moduleSetMedic), + QGVAR(moduleSetMedicalVehicle), + QGVAR(moduleSetMedicalFacility) }; }; }; diff --git a/addons/zeus/functions/fnc_addObjectToCurator.sqf b/addons/zeus/functions/fnc_addObjectToCurator.sqf new file mode 100644 index 0000000000..be814266ab --- /dev/null +++ b/addons/zeus/functions/fnc_addObjectToCurator.sqf @@ -0,0 +1,24 @@ +/* + * Author: Glowbal + * Adds an object to curator upon spawn + * + * Arguments: + * Object + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +if (!isServer) exitwith {}; + +params ["_object"]; + +if (!(_object getvariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitwith {}; + +{ + _x addCuratorEditableObjects [[_object], true]; +}foreach allCurators; diff --git a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf index e5433bad27..65663e65fd 100644 --- a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf +++ b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf @@ -19,11 +19,11 @@ #include "script_component.hpp" -private ["_logic","_removeAddons","_numCfgs","_cfg","_requiredAddon"]; +private ["_removeAddons", "_numCfgs", "_cfg", "_requiredAddon"]; if !(isClass (configFile >> "ACE_Curator")) exitWith { ERROR("The ACE_Curator class does not exist") }; -_logic = _this select 0; +params ["_logic"]; _removeAddons = []; _numCfgs = count (configFile >> "ACE_Curator"); diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 43879a2a59..8273c8ba6f 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -3,20 +3,20 @@ * Flips the capture state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); -private ["_mouseOver","_unit","_captive"]; +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_captive"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf new file mode 100644 index 0000000000..661e33f907 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -0,0 +1,52 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_medicN"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = effectivecommander (_mouseOver select 1); + + if !(_unit isKindOf "CAManBase") then { + [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + if (_medicN < 1) then { + _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf new file mode 100644 index 0000000000..22826108e7 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -0,0 +1,51 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = (_mouseOver select 1); + + if (_unit isKindOf "Man" || {!(_unit isKindOf "Building")}) then { + [LSTRING(OnlyStructures)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then { + _unit setvariable [QEGVAR(medical,isMedicalFacility), true, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf new file mode 100644 index 0000000000..9e5e788461 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -0,0 +1,52 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_medicN"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = (_mouseOver select 1); + + if (_unit isKindOf "Man" || {_unit isKindOf "Building"}) then { + [LSTRING(OnlyVehicles)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + if (_medicN < 1) then { + _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index 30ec8d8d35..95f35593a5 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -3,20 +3,20 @@ * Flips the surrender state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); -private ["_mouseOver","_unit","_surrendering"]; +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_surrendering"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index 401fef2aa4..d9f9031cee 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -3,20 +3,20 @@ * Flips the unconscious state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -PARAMS_3(_logic,_units,_activated); -private ["_mouseOver","_unit","_conscious"]; +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_conscious"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 3a582f7196..0b9c0f8dd8 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -15,10 +15,7 @@ #include "script_component.hpp" -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +params ["_logic", "_units", "_activated"]; if !(_activated) exitWith {}; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 7c70978aa4..42bf72d3d1 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -137,6 +137,18 @@ Bewusstlosigkeit umschalten Alternar inconsciência + + Assign Medic + Przydziel medyka + + + Assign Medical Vehicle + Przydziel pojazd medyczny + + + Assign Medical Facility + Przydziel budynek medyczny + Unit must be alive Utiliser uniquement sur une unité vivante @@ -161,6 +173,14 @@ Si può usare solo su fanteria a piedi Usar somente em infantaria desmontada + + Unit must be a structure + Jednostka musi być budynkiem + + + Unit must be a vehicle + Jednostka musi być pojazdem + Unit must not be captive Jednostka nie może być więźniem @@ -189,5 +209,13 @@ Benötigt ein Addon, das nicht vorhanden ist Requer um addon que não está presente + + Add Objects to Curator + Dodaj obiekt do kuratora + + + Adds any spawned object to all curators in the mission + Dodaje każdy zespawnowany obiekt do wszystkich kuratorów podczas misji + - + \ No newline at end of file diff --git a/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa new file mode 100644 index 0000000000..60963046a7 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa differ diff --git a/documentation/development/arma-3-issues.md b/documentation/development/arma-3-issues.md index 4a3e9ea0fc..16f9988409 100644 --- a/documentation/development/arma-3-issues.md +++ b/documentation/development/arma-3-issues.md @@ -22,6 +22,7 @@ Keeping track of Arma 3 issues that need to be fixed. If you want to support us * [James2464: 0023725: All Environment Rocks Should Have PhysX LODs](http://feedback.arma3.com/view.php?id=23725) * [Jaynus: 0023679: Display event handler return values for mouse buttons should be respected](http://feedback.arma3.com/view.php?id=23679) * [Heisenberg: 0023741: Switching between optic modes of a sniper scope (AMS, DMS, MOS) will result in a blurred vision](http://feedback.arma3.com/view.php?id=23741) +* [AgentRev: 0022310: setObjectTextureGlobal causing "Cannot load texture" errors when used with valid mission files](http://feedback.arma3.com/view.php?id=22310) **Resolved:** diff --git a/documentation/development/coding-guidelines.md b/documentation/development/coding-guidelines.md index 1ab53046ec..a869911747 100644 --- a/documentation/development/coding-guidelines.md +++ b/documentation/development/coding-guidelines.md @@ -1,7 +1,7 @@ --- layout: wiki title: Coding Guidelines -description: +description: group: development parent: wiki order: 1 @@ -107,7 +107,7 @@ Every function should have a header of the following format: * Arguments: * 0: The first argument * 1: The second argument - * + * * Return Value: * The return value * @@ -124,26 +124,26 @@ Every function should have a header of the following format: ### 4.1 Module/PBO specific Macro Usage The family of `GVAR` macro's define global variable strings or constants for use within a module. Please use these to make sure we follow naming conventions across all modules and also prevent duplicate/overwriting between variables in different modules. The macro family expands as follows, for the example of the module 'balls': - -| Macros | is the same as | -| -------|---------| -| `GVAR(face)` | ace_balls_face | -|`QGVAR(face)` | ace_balls_face | + +| Macros | Expands to | +| -------|---------| +| `GVAR(face)` | ace_balls_face | +|`QGVAR(face)` | "ace_balls_face" | | `EGVAR(balls,face)` | ace_balls_face | | `EGVAR(leg,face)` | ace_leg_face | -| `QEGVAR(leg,face)` | ace_leg_face | +| `QEGVAR(leg,face)` | "ace_leg_face" | There also exists the FUNC family of Macros: -| Macros | is the same as | -| -------|---------| +| Macros | Expands to | +| -------|---------| |`FUNC(face)` | ace_balls_fnc_face or the call trace wrapper for that function.| |`EFUNC(balls,face)` | ace_balls_fnc_face or the call trace wrapper for that function.| |`EFUNC(leg,face) `| ace_leg_fnc_face or the call trace wrapper for that function.| |`DFUNC(face)` | ace_balls_fnc_face and will ALWAYS be the function global variable.| |`DEFUNC(leg,face)` | ace_leg_fnc_face and will ALWAYS be the function global variable.| -|`QFUNC(face)` | ace_balls_fnc_face | -|`QEFUNC(leg,face)` |ace_leg_fnc_face| +|`QFUNC(face)` | "ace_balls_fnc_face" | +|`QEFUNC(leg,face)` | "ace_leg_fnc_face" | The `FUNC` and `EFUNC` macros should NOT be used inside `QUOTE` macros if the intention is to get the function name or assumed to be the function variable due to call tracing (see below). If you need to 100% always be sure that you are getting the function name or variable use the `DFUNC` or `DEFUNC` macros. For example `QUOTE(FUNC(face)) == "ace_balls_fnc_face"` would be an illegal use of `FUNC` inside `QUOTE`. @@ -153,8 +153,8 @@ Using `FUNC` or `EFUNC` inside a `QUOTE` macro is fine if the intention is for i ACE3 implements a basic call tracing system that can dump the call stack on errors or wherever you want. To do this the `FUNC` macros in debug mode will expand out to include metadata about the call including line numbers and files. This functionality is automatic with the use of calls via `FUNC` and `EFUNC`, but any calls to other functions need to use the following macros: -| Macro | example | -| -------|---------| +| Macro | example | +| -------|---------| |`CALLSTACK(functionName)` | `[] call CALLSTACK(cba_fnc_someFunction)` | |`CALLSTACK_NAMED(function,functionName)` | `[] call CALLSTACK_NAMED(_anonymousFunction,'My anonymous function!')`| @@ -168,8 +168,8 @@ These macros will call these functions with the appropriate wrappers and enable #### 4.2.1 setVariable, getVariable family macros -| Macro | is the same as | -| -------|---------| +| Macro | Expands to | +| -------|---------| |`GETVAR(player,MyVarName,false)` | player getVariable ["MyVarName", false]| |`GETMVAR(MyVarName,objNull)` | missionNamespace getVariable ["MyVarName", objNull]| |`GETUVAR(MyVarName,displayNull)` | uiNamespace getVariable ["MyVarName", displayNull]| @@ -179,25 +179,25 @@ These macros will call these functions with the appropriate wrappers and enable #### 4.2.2 STRING family macros -Note that you need the strings in module stringtable.xml in the correct format +Note that you need the strings in module stringtable.xml in the correct format `STR_ACE__`
Example:
`STR_Balls_Banana`
Script strings: -| Macro | is the same as | -| -------|---------| +| Macro | Expands to | +| -------|---------| | `LSTRING(banana)` | "STR_ACE_balls_banana"| -| `ELSTRING(balls,banana)` | "STR_ACE_balls_banana"| +| `ELSTRING(balls,banana)` | "STR_ACE_balls_banana"| Config Strings (require `$` as first character): -| Macro | is the same as | -| -------|---------| -| `CSTRING(banana)` | "$STR_ACE_balls_banana" | -| `ECSTRING(balls,banana)` | "$STR_ACE_balls_banana" | +| Macro | Expands to | +| -------|---------| +| `CSTRING(banana)` | "$STR_ACE_balls_banana" | +| `ECSTRING(balls,banana)` | "$STR_ACE_balls_banana" | ## 5. Event Handlers @@ -206,8 +206,8 @@ Event handlers in ACE3 are implemented through our event system. They should be The commands are listed below. -| Even Handler | use | -| -------|---------| +| Even Handler | Use | +| -------|---------| |`[eventName, eventCodeBlock] call ace_common_fnc_addEventHandler` | adds an event handler with the event name and returns the event handler id.| | `[eventName, args] call ace_common_fnc_globalEvent` | calls an event with the listed args on all machines, the local machine, and the server. | |`[eventName, args] call ace_common_fnc_serverEvent` | calls an event just on the server computer (dedicated or self-hosted).| @@ -216,8 +216,8 @@ The commands are listed below. Events can be removed or cleared with the following commands. -| Even Handler | use | -| -------|---------| +| Even Handler | Use | +| -------|---------| |`[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.| @@ -243,8 +243,8 @@ if(HASH_HASKEY(_hash, "key")) then { A description of the above macros is below. -| Macro | use | -| -------|---------| +| Macro | Use | +| -------|---------| |`HASHCREATE` | used to create an empty hash.| | `HASH_SET(hash, key, val)` | will set the hash key to that value, a key can be anything, even objects. | |`HASH_GET(hash, key)` | will return the value of that key (or nil if it doesn't exist). | @@ -276,7 +276,7 @@ _anotherHash = HASHLIST_SELECT(_hashList, 0); // this should print "val: 1" player sideChat format["val: %1", HASH_GET(_anotherHash, "key1")]; -//Say we need to add a new key to the hashlist +//Say we need to add a new key to the hashlist //that we didn't initialize it with? We can simply //set a new key using the standard HASH_SET macro HASH_SET(_anotherHash, "anotherKey", "another value"); @@ -285,8 +285,8 @@ HASH_SET(_anotherHash, "anotherKey", "another value"); As you can see above working with hashlists are fairly simple, a more in depth explanation of the macros is below. -| Macro | use | -| -------|---------| +| Macro | Use | +| -------|---------| |`HASHLIST_CREATELIST(keys)` | creates a new hashlist with the default keys, pass [] for no default keys.| |`HASHLIST_CREATEHASH(hashlist)` | returns a blank hash template from a hashlist.| |`HASHLIST_PUSH(hashList, hash)` | pushes a new hash onto the end of the list.| diff --git a/documentation/feature/fcs.md b/documentation/feature/fcs.md index c66c5eb8e8..bf176179e5 100644 --- a/documentation/feature/fcs.md +++ b/documentation/feature/fcs.md @@ -2,8 +2,8 @@ layout: wiki title: FCS (Fire Control System) description: -group: feature category: equipment +group: feature parent: wiki --- @@ -31,8 +31,6 @@ Anti air cannons can now use airburst ammunition. It will explode on the FCS' ze - Tap Tab ↹ - The optic is now adjusted. -*NOTE: GBU guidance is **DISABLED** as of ACE3 3.0.1* - ## 3. Dependencies `ace_interaction` diff --git a/documentation/feature/finger.md b/documentation/feature/finger.md new file mode 100644 index 0000000000..3943980a97 --- /dev/null +++ b/documentation/feature/finger.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Finger +description: Finger pointing +group: feature +category: realism +parent: wiki +--- + +## 1. Overview +Allows players to point in a direction with their fingers, when they do so people around (4m by default) can see a big circle in the pointed direction. + + +## 2. Usage + +### 2.1 How to point things +- Press ⇧ Shift+` (QWERTY and AZERTY layouts) + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/interaction.md b/documentation/feature/interaction.md index b9f3ef4473..3916afede2 100644 --- a/documentation/feature/interaction.md +++ b/documentation/feature/interaction.md @@ -1,7 +1,7 @@ --- layout: wiki title: Interaction -description: +description: group: feature category: interaction parent: wiki @@ -9,9 +9,37 @@ parent: wiki ## 1. Overview -This provides interaction options between units. +This provides interaction options between units, vehicles, buildings and objects. +Some of the zeus actions are also available (while in zeus) in the interaction menu (remote control, group management). -## 2. Dependencies +## 2. Usage + +### 2.1 Opening the self interaction menu +- Press and hold Ctrl + ⊞ Win (ACE3 default). + +### 2.2 Opening the interaction menu +- Press and hold ⊞ Win (ACE3 default). + +### 2.3 Using the zeus interactions +- Units + - Select the unit(s). + - Open the interaction menu. + - Select `Units`. + - Select the stance (works for multiple units) or remote control. + +- Groups + - Select a group by clicking on the icon hovering above it's squad leader, to select multiple squads press and hold Ctrl. + - Open the interaction menu. + - Select `Groups`. + - From here you can select the speed / formation / behavior of all the units of the group(s). + +- Waypoints + - Select a waypoint by clicking on it, same as above press and hold Ctrl to select multiple. + - Open the interaction menu. + - Select `Waypoints`. + - From here you can modify the speed / formation / behavior of the units / groups that are moving to that waypoint. + +## 3. Dependencies `ace_interact_menu` diff --git a/documentation/feature/medical-system.md b/documentation/feature/medical-system.md index e8184c474e..4bc0ae1557 100644 --- a/documentation/feature/medical-system.md +++ b/documentation/feature/medical-system.md @@ -3,241 +3,290 @@ layout: wiki title: Medical System description: ACE provide users with a more realistic medical system and comes in both a basic and advanced version. Both versions have overlap but each have their own unique characteristics. group: feature +order: 4 category: realism parent: wiki --- +**Disclaimer:** The documentation for the medical system being extremely long it's highly advised to use the table of contents at the top right corner of the page. ## 1. Overview -ACE provide users with a more realistic medical system and comes in both a basic and advanced version. This page will detail the differences between both systems and what they do. It is split into two parts; basic and advanced. Both versions have overlap but each have their own unique characteristics. +ACE3 provides users with a more realistic medical system and comes in both a basic and an advanced version. This page will detail the differences between both systems and what they do as well as how to use them efficiently. +### 1.1 Basic medical +ACE3's basic medical system is quite a bit more complex than Arma 3's default system, but not really difficult to grasp. ACE3 basic medical is a mixture between the ACE2 and AGM medical systems. +All interactions in the medical system are done with the interaction menu. Non-medics can - by default - not perform all actions (Epinephrine and IVs) and their actions take more time as when performed by trained medics. -## 2. Basic Medical -ACE's basic medical system is quite a bit more complex than Arma's default system, but not really difficult to grasp. ACE basic medical is a mixture between the ACE2 and AGM medical systems. +### 1.2 Revive system +The revive system lets you bring downed units back up. +Upon receiving a deadly amount of damage a unit will fall unconscious for a determined amount of time. In that time a medic will need to treat them and give them epinephrine to bring them back up. -The four main elements that basic medical introduces are: +### 1.3 Advanced medical -* damage divided into different zones (head, body, left & right arm, left & right leg) -* bleeding -* unconsciousness -* pain - -All interactions in the medical system are done with the interaction menu. Non-medics can - by default - not perform all actions, and their actions take more time as when performed by trained medics. These actions are using epinephrine and blood IVs. - - -### 2.1 How it works - -When hit, units start to lose blood depending on the severity of their wounds. Once the level of blood falls below a certain threshold, the unit will fall unconscious and eventually die. Units will also fall unconscious when sustaining large amounts of damage at once. - -To stop the bleeding, the combat life saver needs to bandage every wounded limb. Unconscious units can be "woken up" with Epipens. Should a unit have lost a lot of blood, it might be necessary to replace the lost blood with a blood bag before being able to wake unconscious units up. - -Should a unit be in pain, materializing itself with a chromatic aberration screen effect, he can be given morphine. - -### 2.2 Basic medical system - recommended gear -* Soldier: - * 10 x Bandage (basic) - -* Medic: - * 15-25 x Bandage (basic) - * 6 x Blood IV (500ml) - * 10 x Morphine Autoinjector - * 10 x Epinephrine Autoinjector - -## 3. Advanced Medical -The advanced medical system provides a more complex and detailed medical simulation and is based off the CSE/CMS medical system. It focuses on a more realistic model for injuries and treatment, thus resulting in a more important and prominent role for combat medics, and a bigger incentive to not get shot. +The advanced medical system provides a more complex and detailed medical simulation and is based off the CSE CMS. It focuses on a more realistic model for injuries and treatments, thus resulting in a more important and prominent role for combat medics, and a bigger incentive to avoid getting shot. The system behind advanced medical is designed to attempt to mimic important parts of the human body, as well as react to any injuries sustained and treatments applied in a realistic manner. The available treatments and supplies in advanced medical are based off the Tactical Combat Casualty Care (TCCC) guidelines, which are the same guidelines used by real-life combat medics around the world. Besides the 4 elements introduced by basic medical, advanced introduces the following: -* More detailed wound system -* Accurate blood loss based upon sustained injuries -* Vitals, including heart rate and blood pressure -* Cardiac Arrest -* Various treatment methods such as CPR, different kinds of IVs and tourniquets -* A basic medication simulation +- More detailed wound system. +- Accurate blood loss based upon sustained injuries. +- Vitals, including heart rate and blood pressure. +- Cardiac Arrest. +- Various treatment methods such as CPR, different kinds of IVs and a working tourniquet. +- A basic medication simulation. + +## 2. Usage -### 3.1 How it works +### 2.1 Basic -Same as with basic, when hit an injury is sustained. Different though is that the type of injury and the severity of it are based upon how the damage was done and what caused it. This affects both blood loss and immediate consequences, such as being knocked out or being killed right away. When a player has sustained an injury, this will be indicated by flashing red of the screen; this means the player is bleeding. +When hit, units start to lose blood depending on the severity of their wounds. Once the level of blood falls below a certain threshold, the unit will fall unconscious and eventually die. Units will also fall unconscious when sustaining large amounts of damage at once or from high amounts of pain. -#### 3.1.1 Stopping bleeding -In order to stop the bleeding, all injuries on every bodypart requires treatment. This is done by either applying a tourniquet to legs or arms as a temporarly solution, or by using bandages to stop the bleeding as a more permament fix. +#### 2.1.1 Wounds, bandages and medications -#### 3.1.2 Vitals -While a unit is bleeding however, the blood volume decreases which will result in a change of vitals. Depending on the factors such as current blood volume, the blood loss rate, medication used, the blood pressure will start to drop. To counter this drop, also based upon the previously mentioned factors and others, the heart rate will adjust accordingly to attempt to keep blood pressure at safe levels. This means that for any patient it is required to keep an eye on the vitals. This is done through the interaction system by selecting check pulse or blood pressure on either the arms or head. -#### 3.1.3 Medication -To stabilize the vitals and to counter for example pain, a player/medic can use medication. Advanced medical has 3 different medications available: +##### 2.1.1.1 Wounds -* Atropine -* Morphine -* Epinephrine +It's pretty straightforward compared to advanced, you only have two types of wounds. -Atropine is a vagolytic and anticholinergic drug which in low dosages reduces heart rate but in high dosages increases it, countering effects of organophosphate poisoning (in NBC scenarios; anticholinesterase poisoning) and symptomatic bradycardia (in post-ROSC care and resuscitative medicine). +- Yellow: you need one bandage to heal it. +- Red: you need two bandages to heal it. -Morphine is used to alleviate large amounts of pain. Has an effect similar to Heroin due to its opiate properties. Must only ever be given once, and only when bleeding has been reduced to a minimum. Morphine must never be given to a casualty with a low heart rate, as it can stop the heart. It's effect lasts up to 15 minutes. +##### 2.1.1.2 Bandages -Epinephrine is used to increase heart rate and blood pressure and alleviate unconsciousness. Epinephrine is a synthetic form of Adrenaline, which is naturally produced in the body. It can also be applied to counter-act the effects of Atropine. Be careful though, as it may only be given once. +- All of them have the same effect. -_Epinephrine must never be given to a casualty with a high heart rate or blood pressure._ +##### 2.1.1.3 Tourniquet -#### 3.1.4 Types of wounds -Advanced medical system brings more different types of wounds, each with its own effects on patient. We distinguish minor, medium and large wound sizes. Below there is a list of those wounds: +- Serves no use in basic -* Abrasions (or scrapes) - * Also called scrapes, they occur when the skin is rubbed away by friction against another rough surface (e.g. rope burns and skinned knees). - * Sources: falling, ropeburn, vehicle crashes. - * Effects: pain - extremely light, bleeding - extremely slowly +##### 2.1.1.4 IVs -* Avulsions - * Occur when an entire structure or part of it is forcibly pulled away, such as the loss of a permanent tooth or an ear lobe. Explosions, gunshots, and animal bites may cause avulsions. - * Sources: explosions, vehicle crashes, grenades, artillery shells, bullets, backblast, bites. - * Effects: pain - extremely high, bleeding - extremely fast (depends on wound size). +IV | Effect +---------- | ---------- | +Saline | Serves no use in basic +Plasma | Serves no use in basic +Blood | Restores the blood of the patient -* Contusions - * Also called bruises, these are the result of a forceful trauma that injures an internal structure without breaking the skin. Blows to the chest, abdomen, or head with a blunt instrument (e.g. a football or a fist) can cause contusions. - * Sources: bullets, backblast, punches, vehicle crashes, falling. - * Effects: pain - light, no bleeding. +Use the appropriate amount depending on the situation (low / heavy loss of blood) (250, 500 or 1 000 mL) -* Crush wounds - * Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures. - * Sources: falling, vehicle crashes, punches. - * Effects: pain - light, bleeding - extremely slowly. -* Cut wounds - * Slicing wounds made with a sharp instrument, leaving even edges. They may be as minimal as a paper cut or as significant as a surgical incision. - * Sources: vehicle crashes, grenades, explosions, artillery shells, backblast, stabs - * Effects: pain - light, bleeding - speed depends on lenght and size of the woundę. +##### 2.1.1.5 Autoinjectors -* Lacerations - * Also called tears, these are separating wounds that produce ragged edges. They are produced by a tremendous force against the body, either from an internal source as in childbirth, or from an external source like a punch. - * Sources: vehicle crashes, punches - * Effects: pain - light, bleeding - slow to medium speed (depends on wound size). +Autoinjector | Effect +---------- | ---------- | +Morphine | Removes pain +Epinephrine | Wakes up the patient +Atropine | Serves no use in basic -* Velocity wounds - * They are caused by an object entering the body at a high speed, typically a bullet or small peices of shrapnel. - * Sources: bullets, grenades, explosions, artillery shells. - * Effects: pain - extremely high, bleeding - medium speed (depends on wound size). +#### 2.1.2 Treating the patient -* Puncture wounds - * Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. - * Sources: stabs, grenades. - * Effects: pain - light, bleeding - slowly. +- **Step 1:** Is the patient responsive? + - **Yes:** Ask him if he has wounds / he is in pain. + - **No:** Go to step 2. + + +- **Step 2:** Is the patient wounded? + - **Yes:** Treat the wounds and go to step 3. + - **No:** Skip this step. -We also distinguish different types of fractures (WIP/not implemented yet): -* Broken femur - * Description - * Sources: bullets, vehicle crashes, backblast, explosions, artillery shells, grenades. - * Effects: pain - extremely high, unable to stand until healed by medic. + +- **Step 3:** Is the patient in pain? + - **Yes:** Give him morphine. + - **No:** Skip this step. + -#### 3.1.5 Bandage types -Advanced medical system brings 4 different types of bandages and also properly working tourniquet. Below there is a list of all bandage types with effectiveness vs different wound types. Higher effectiveness bandages needs to be applied fewer times than ones with lower effectiveness. That depends on wound size. Applying bad type of bandage on given wound can yield wound opening after a while if not stiched fast enough. -All bandage types weights about 50 grams each. +- **Step 4:** Did the patient lose blood? + - **Yes:** Give blood via IV. + - **No:** Go to step 5. + - **No and patient responsive:** You're done. -* Bandage (basic) - * Abrasions - highest effectiveness - * Avulsions - lowest effectiveness - * Contusions - highest effectiveness - * Crush wounds - low effectiveness - * Cut wounds - very low effectiveness - * Lacerations - medium effectiveness - * Velocity wounds - lowest effectiveness - * Puncture wounds - low effectiveness -* Bandage (packing) - * Abrasions - highest effectiveness - * Avulsions - highest effectiveness - * Contusions - highest effectiveness - * Crush wounds - low effectiveness - * Cut wounds - lowest effectiveness - * Lacerations - lowest effectiveness - * Velocity wounds - highest effectiveness - * Puncture wounds - lowest effectiveness +- **Step 5** + - If at this point the patient is still not back on its feet it's time to use an epinephrine autoinjector. -* Bandage (elastic) - * Abrasions - highest effectiveness - * Avulsions - lowest effectiveness - * Contusions - highest effectiveness - * Crush wounds - highest effectiveness - * Cut wounds - highest effectiveness - * Lacerations - highest effectiveness - * Velocity wounds - low effectiveness - * Puncture wounds - high effectiveness +#### 2.1.3 Additional informations -* QuikClot - * Abrasions - medium effectiveness - * Avulsions - high effectiveness - * Contusions - medium effectiveness - * Crush wounds - medium effectiveness - * Cut wounds - medium effectiveness - * Lacerations - medium effectiveness - * Velocity wounds - high effectiveness - * Puncture wounds - high effectiveness +- If the revive system is in place your character will not die until the revive timer is at 0. Even if a tank shoots your ass off an epinephrine shot will bring you back up after your wounds are treated. (The timer is invisible and may vary from mission to mission, it also depends on the amount of lives remaining you have.) +- You can't do an overdose in basic. -* Tourniquet - * Can only be applied on limbs - * Stops bleeding from wounds - * Should be taken off as fast as possible and applied only to give medic time to bandage all the wounds - * If not taken off for a while it will cause pain to patient, can cause death that way +### 2.2 Advanced -#### 3.1.6 Transfuzions -In case of blood loss, blood could be replenished by three different types of IV: blood, plasma and saline. We distinguish 3 different sizes of IV bags: 250ml, 500ml and 1000ml. -Transfuzing 250ml of given IV takes about 1 minute to complete! +Same as with basic, when hit an injury is sustained. Different though is that the type of injury and the severity of it are based upon how the damage was done and what caused it. This affects both blood loss and immediate consequences, such as being knocked out or being killed right away. When a player has sustained an injury, this will be indicated by flashing red on the screen; this means the player is bleeding. -+#### 3.1.7 PAK and Surgical kit -Using Personal Aid Kit brings patient to the best possible health state. Depending on module options, PAK can be used only in specified situations, specified place and by specified person. -Surgical kit is used to stich bandaged wounds so they will never open again. Depending on module options, surgical kit can be used only in specified situations, specified place and by specified person. +#### 2.2.1 Wounds, bandages and medications -### 3.2 Advanced medical system - recommended gear + +##### 2.2.1.1 Abrasions (or scrapes) + +- They occur when the skin is rubbed away by friction against another rough surface (e.g. rope burns and skinned knees). +- Sources: falling, rope burn, vehicle crashes. +- Effects: pain - extremely light, bleeding - extremely slowly. + +##### 2.2.1.2 Avulsions + +- Occur when an entire structure or part of it is forcibly pulled away, such as the loss of a permanent tooth or an ear lobe. Explosions, gunshots, and animal bites may cause avulsions. +- Sources: explosions, vehicle crashes, grenades, artillery shells, bullets, backblast, bites. +- Effects: pain - extremely high, bleeding - extremely fast (depends on wound size). + +##### 2.2.1.3 Contusions + +- Also called bruises, these are the result of a forceful trauma that injures an internal structure without breaking the skin. Blows to the chest, abdomen, or head with a blunt instrument (e.g. a football or a fist) can cause contusions. +- Sources: bullets, backblast, punches, vehicle crashes, falling. +- Effects: pain - light, no bleeding. + +##### 2.2.1.4 Crush wounds + +- Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures. +- Sources: falling, vehicle crashes, punches. +- Effects: pain - light, bleeding - extremely slowly. + +##### 2.2.1.5 Cut wounds** + +- Slicing wounds made with a sharp instrument, leaving even edges. They may be as minimal as a paper cut or as significant as a surgical incision. +- Sources: vehicle crashes, grenades, explosions, artillery shells, backblast, stabs. +- Effects: pain - light, bleeding - speed depends on length and size of the wound. + + +##### 2.2.1.6 Lacerations (tears) + +- these are separating wounds that produce ragged edges. They are produced by a tremendous force against the body, either from an internal source or from an external source like a punch. +- Sources: vehicle crashes, punches. +- Effects: pain - light, bleeding - slow to medium speed (depends on wound size). + +##### 2.2.1.7 Velocity wound + +- They are caused by an object entering the body at a high speed, typically a bullet or small pieces of shrapnel. +- Sources: bullets, grenades, explosions, artillery shells. +- Effects: pain - extremely high, bleeding - medium speed (depends on wound size). + + +##### 2.2.1.8 Puncture wounds + +- Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. +- Sources: stabs, grenades. +- Effects: pain - light, bleeding - slowly. + +In order to stop the bleeding, all bleeding injuries on every body part requires treatment. This is done by either applying a tourniquet to legs or arms as a temporary solution, or by using bandages to stop the bleeding as a more permanent fix. + + +##### 2.2.1.9 Bandages effectiveness + +Bandage | Abrasions | Avulsions | Contusions | Crush wounds | Cut wounds | Lacerations | Velocity wounds | Puncture wounds| +---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ---------- | ------- | +Basic | `highest` | lowest | `highest` | low | very low | medium | lowest | low +Bandage (packing) | `highest` | `highest` | `highest` | low | lowest | lowest | `highest` | lowest +Bandage (elastic) | `highest` | lowest | `highest` | `highest` | `highest` | `highest` | low | high +QuikClot | medium | high | medium | medium | medium | medium | high | high + +##### 2.2.1.10 Tourniquet + +- Can only be applied on limbs. +- Stops bleeding from wounds. +- Should be taken off as fast as possible and applied only to give medic time to bandage all the wounds. +- If not taken off for a while it will cause pain to the patient. + +##### 2.2.1.11 IVs + +IV | Effect +---------- | ---------- | +Saline plasma and blood | All three restore the volume of liquid in the blood stream. as a result blood pressure is raised for all of them. + +Use the appropriate amount depending on the situation (heavy loss of blood, blood pressure too low) (250, 500 or 1 000 mL) + +##### 2.2.1.12 Autoinjectors + +Autoinjector | Effect +---------- | ---------- | +Morphine | lower the blood pressure and heart rate of the patient, also suppress pain +Epinephrine | raise the heart rate of the patient +Atropine | lower the heart rate of the patient + +##### 2.2.1.13 Surgical kit + +- Is only useful when advanced wounds (reopening) is enabled. +- Stitch a wound to stop it from reopening. +- It's use may be limited to a certain class and / or near a vehicle / facility. +- It's use can also be limited according to the condition of the patient, you might need to stabilize him first before using it. + +##### 2.2.1.14 PAK + +- Used to fully heal someone. (Removes any injury, restore vitals to a stable state and reset the medical history, clears all medication in the system.) +- It's use may be limited to a certain class and / or near a vehicle / facility. +- It's use can also be limited according to the condition of the patient, you might need to stabilize him first before using it. + +#### 2.2.2 Vitals + +##### 2.2.2.1 Blood pressure + + NOTE:the `systolic` blood pressure is the number on the left, the `diastolic` blood pressure is the number on the right. + +- Blood pressure is affected by the amount of blood lost as well as IVs and medication. + - **Non existent:** 0 - 20 `systolic`. + - **Low:** 20 - 100 `systolic`. + - **Normal:** 100 - 160 `systolic`. + - **High:** 160 and above `systolic`. + +##### 2.2.2.2 Heart rate + +- The heart rate (pulse) is affected by the amount of blood lost and medications. + - **Low:** 45 and below + - **Normal:** between 46 and 119 + - **High:** 120 and above -* Soldier: - * 4 x Bandage (basic) - * 3 x Bandage (elastic) - * 3 x Bandage (packing) - * 3 x QuikClot - * 1 x Morphine Autoinjector - * 1 x Tourniquet -* Combat First Responder (CFR): - * 10-15 x Bandage (basic) - * 15-20 x Bandage (elastic) - * 5-8 x Bandage (packing) - * 10-15 x QuikClot - * 3 x Tourniquet - * 4 x Saline IV (500ml) - * 5 x Morphine Autoinjector - * 5 x Epinephrine Autoinjector - * 8 x Atropine Autoinjector +##### 2.2.2.3 Cardiac arrest -* Medic: - * 10-15 x Bandage (basic) - * 15-20 x Bandage (elastic) - * 8 x Bandage (packing) - * 10-15 x QuikClot - * 5 x Tourniquet - * 6 x Saline IV (500ml) - * 8 x Morphine Autoinjector - * 8 x Epinephrine Autoinjector - * 12 x Atropine Autoinjector - * 1-3 x *Surgical kit* - * 1-3 x *Personal Aid Kit* +- A patient will enter cardiac arrest when:
+ - The heart rate is below 20. + - The heart rate is above 200. + - The systolic blood pressure is above 260. + - The diastolic blood pressure is below 40 and the heart rate is above 190. + - The systolic blood pressure is above 145 and the heart rate is above 150. -* Paramedic: - * 10-15 x Bandage (basic) - * 15-20 x Bandage (elastic) - * 8 x Bandage (packing) - * 10-15 x QuikClot - * 5 x Tourniquet - * 2 x Saline IV (500ml) - * 3 x Blood IV (1000ml) - Taken from vehicle inventory only when needed - * 3 x Plasma IV (1000ml) - Taken from vehicle inventory only when needed - * 8 x Morphine Autoinjector - * 8 x Epinephrine Autoinjector - * 12 x Atropine Autoinjector - * 1-3 x *Surgical kit* - * 1-3 x *Personal Aid Kit* -*medical item* - number of items that should be carried depends on module settings +#### 2.2.3 Treating the patient +This is a step by step guide, follow the steps from 1 to 6 in order unless stated otherwise. -## Dependencies -`ace_interaction`, `ace_modules`, `ace_apl` + +- **Step 1:** Is the patient responsive? + - **Yes:** Ask him if he has wounds / he is in pain and act accordingly. + - **No:** Go to step 2. + + +- **Step 2:** Does the patient have a pulse? + - **Yes:** Go to step 3. + - **No:** If you are alone provide CPR, if you have someone else get him to do CPR while you treat the patient's wounds. skip to step 3 or 4 depending on the situation. + + +- **Step 3:** Is the patient wounded? + - **Yes**: Treat the wounds. + - **No:** Skip this step. + + +- **Step 4:** Did the patient lose blood? + - **Yes:** Use IVs to restore the volume of liquid in the blood stream of the patient. + - **No:** Skip this step. + + +- **Step 5:** Is the patient in pain? + - **Yes and stable pulse:** Give him morphine. + - **Yes and unstable heart rate:** Stabilize the heart rate before administrating morphine. + - **No:** You're done. + + +- **Step 6:** is the patient awake now? + - **Yes:** You're done. + - **No:** Stabilize his pulse / make sure he isn't in pain or missing blood. + +Note that keeping the patient's vitals stable is very important while treating him. + +#### 2.2.4 Additional informations + +- As an infantryman you can use a tourniquet to stop a limb from bleeding, note that this is supposed to be a temporary solution and leaving the tourniquet more than 5 minutes will induce pain. +- Epinephrine should **NEVER** be used in case of cardiac arrest, it will only make the patient harder to treat afterwards or might outright kill him (remember epinephrine raises the blood pressure, a blood pressure too high is deadly). +- Pain is only suppressed and not removed by default. +- You don't have to take epinephrine after you take morphine, just wait until your pulse stabilizes by itself (Provided that you are in a stable condition). +- Giving too much morphine to a patient (more than one every 10 minutes) will put him in cardiac arrest because of a blood pressure / heart rate too low. + +## 3. Dependencies +`ace_interaction`, `ace_modules`, `ace_apl` \ No newline at end of file diff --git a/documentation/feature/parachute.md b/documentation/feature/parachute.md index c52da59abe..39f353f08b 100644 --- a/documentation/feature/parachute.md +++ b/documentation/feature/parachute.md @@ -3,6 +3,7 @@ layout: wiki title: Parachute description: Add an altimeter and a non-steerable parachute group: feature +category: equipment parent: wiki --- @@ -14,11 +15,11 @@ Removes the altitude and descend speed UI elements when free-falling and parachu ### 1.2 Non-steerable parachute Adds a non-steerable parachute variant for jet pilots. -### 1.3 Landing animation -Smoothens the parachute landing animation. +### 1.3 Parachute cutting and reserve parachutes +You are now able to cut parachutes and deploy a reserve one. -### 1.4 Reserve parachute -Adds a reserve parachute and the ability to cut the primary one. +### 1.4 Landing animation +Smoothens the parachute landing animation. ## 2. Usage @@ -26,6 +27,10 @@ Adds a reserve parachute and the ability to cut the primary one. - For this you need to have an `Altimeter Watch` in the watch slot. - Press O (Arma 3 default key bind `Watch`) to bring up the altimeter. +### 2.2 Cutting a parachute +- While falling with a parachute deployed open the self interaction menu Ctrl+⊞ Win (ACE3 default). +- Select `Cut Parachute` + ## 3. Dependencies `ace_common` diff --git a/documentation/feature/sitting.md b/documentation/feature/sitting.md new file mode 100644 index 0000000000..aee2ee859d --- /dev/null +++ b/documentation/feature/sitting.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Sitting +description: +group: feature +category: interaction +parent: wiki +--- + +## 1. Overview +Adds the ability to sit on chairs. + +## 2. Usage +Please note that to be able to use this function the sitting module need to be placed down (or set to 1 in the server config) + +### 2.1 How to sit / stand up +- Look at the chair and press the interaction key Ctrl+⊞ Win (ACE3 default). +- Select `Sit Down`. +- To stand up press the self interaction key ⊞ Win (ACE3 default) and select `Stand Up`. + +## 3. Dependencies +`ace_interaction` \ No newline at end of file diff --git a/documentation/feature/slideshow.md b/documentation/feature/slideshow.md new file mode 100644 index 0000000000..0ff2372064 --- /dev/null +++ b/documentation/feature/slideshow.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Slideshow +group: feature +category: interaction +parent: wiki +--- + +## 1. Overview +This adds the ability to have images shown on some objects and have other objects being used as remotes. +Please note that only objects with hiddenSelection 0 can be used to render images (whiteboard, TV, PC Screen being the most notable examples). + +## 2. Usage +Note that this sections is for users, for mission makers refer to [the entry in mission-tools](../missionmaker/mission-tools.html) +Also if no remotes are defined the "screen" object itself becomes the remote. + +### 2.1 Switching between images +- Look at the object used as a remote and use the interaction menu ⊞ Win (ACE3 default). +- Select the action that correspond to the image you want (the name of the action depends on the mission maker). + +## 3. Dependencies + +`ace_common` \ No newline at end of file diff --git a/documentation/feature/spectator.md b/documentation/feature/spectator.md index 438d731c3e..08919c369d 100644 --- a/documentation/feature/spectator.md +++ b/documentation/feature/spectator.md @@ -18,22 +18,61 @@ The ACE3 spectator system is designed to act as a flexible and easy to configure ### 1.1 Spectator System -The current iteration of the ACE3 spectator system only officially supports scenarios using [respawn type](https://community.bistudio.com/wiki/Arma_3_Respawn#Respawn_Types) 3 (or "BASE"). However there's nothing to stop its use alongside anything else, just be aware that it might not function entirely as expected. +By default, the ACE3 spectator system does nothing - meaning existing missions will behave exactly as before. There are two tools available to enable the spectator system in your missions: -By default, the ACE3 spectator system does nothing - meaning existing missions will behave exactly as before. The setting `ace_spectator_onDeath` can be used to automatically put players into spectator mode each time they die. +- An `"ace_spectator"` [respawn template](https://community.bistudio.com/wiki/Arma_3_Respawn) +- Public functions `ace_spectator_fnc_setSpectator` and `ace_spectator_fnc_stageSpectator` -For mission makers who seek a more advanced setup (such as multiple lives or wave respawning) the function `ace_spectator_fnc_setSpectator` is provided to transition players to/from spectator mode as desired: +With respawn template `"ace_spectator"` in effect players will enter spectator mode upon death and exit upon respawn. The template is compatible with all respawn types and allows you to take advantage of the vanilla framework's flexibility (combining templates, side specific templates, etc.). This makes for very simple combination of a wide variety of spectator and respawn setups. + +An example description.ext file using the respawn template: ``` - * Arguments: - * 0: Unit to put into spectator state - * 1: New spectator state - * - * Return Value: - * None - * - * Example: - * [player, true] call ace_spectator_fnc_setSpectator +respawn = 3; +respawnDelay = 180; +respawnTemplates[] = {"ace_spectator"}; +respawnTemplatesWest[] = {"ace_spectator","Counter","Wave"}; +``` + +For groups using custom respawn frameworks - or for missions where you want finer control over who, how and when players enter spectator - the two following functions are provided: + +`ace_spectator_fnc_setSpectator` + +``` +* Sets local client to the given spectator state (virtually) +* To physically handle a spectator see ace_spectator_fnc_stageSpectator +* +* Client will be able to communicate in ACRE/TFAR as appropriate +* The spectator interface will be opened/closed +* +* Arguments: +* 0: Spectator state of local client (default: true) +* +* Return Value: +* None +* +* Example: +* [true] call ace_spectator_fnc_setSpectator +``` + +`ace_spectator_fnc_stageSpectator` + +``` +* Sets target unit to the given spectator state (physically) +* To virtually handle a spectator see ace_spectator_fnc_setSpectator +* +* Units will be gathered at marker ace_spectator_respawn (or [0,0,0] by default) +* Upon unstage, units will be moved to the position they were in upon staging +* +* Arguments: +* 0: Unit to put into spectator stage (default: player) +* 1: Spectator stage (default: true) +* +* Return Value: +* None +* +* Example: +* [player, false] call ace_spectator_fnc_stageSpectator ``` ### 1.2 Spectatable Units @@ -43,10 +82,11 @@ Spectatable units are stored in an automatically maintained list (`ace_spectator - Unit filter - Unit whitelist/blacklist -The unit filter determines which units will automatically be used to populate the spectatable unit list. It's controlled by setting `ace_spectator_filterUnits` and there are three possible options: +The unit filter determines which units will automatically be used to populate the spectatable unit list. It's controlled by setting `ace_spectator_filterUnits` and there are four possible options: - **No units** -- **Player units** *(default)* +- **Player units** +- **Playable units** *(default)* - **All units** In cases where more specific control is required function `ace_spectator_fnc_updateUnits` can be used to whitelist units from the filter or blacklist them from the list (on the local client): @@ -166,7 +206,7 @@ The spectator camera has 8 manipulatable attributes: - **Camera zoom:** The zoom level of the free camera - **Camera speed:** The movement speed of the free camera -Function `ace_spectator_fnc_setCameraAttributes` can be used to change any of these attributes at ay point (including before spectator has ever opened): +Function `ace_spectator_fnc_setCameraAttributes` can be used to change any of these attributes at any point (including before spectator has ever opened): ``` * Arguments: @@ -209,30 +249,30 @@ Shortcuts are currently hardcoded in the ACE3 spectator system. Future versions - - H - Toggle help - - - M - Toggle map - 1 Toggle unit list 2 - Toggle toolbar + Toggle help 3 - Toggle compass + Toggle toolbar 4 + Toggle compass + + + 5 Toggle unit icons + + M + Toggle map + Backspace Toggle interface @@ -274,59 +314,26 @@ Shortcuts are currently hardcoded in the ACE3 spectator system. Future versions Z Camera down + + RMB + Pan camera + LMB - Camera dolly + Dolly camera - RMB - Camera pan and tilt + ⇧ Shift + Speed boost - Scrollwheel - Zoom +/- - - - Ctrl+Scrollwheel - Speed +/- - - - N - Next vision mode - - - Ctrl+N - Previous vision mode + F + Focus on unit -#### 2.1.3 Unit Camera Shortcuts - - - - - - - - - - - - - - - - - - - - - - -
ShortcutAction
Right arrowNext unit
Left arrowPrevious unit
RMBToggle gun camera
- -#### 2.1.4 General shortcuts +#### 2.1.3 Camera Attribute Shortcuts @@ -344,6 +351,46 @@ Shortcuts are currently hardcoded in the ACE3 spectator system. Future versions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Down arrow Previous camera
Right arrowNext unit
Left arrowPrevious unit
NNext vision mode
Ctrl+NPrevious vision mode
ScrollwheelAdjust zoom
Ctrl+ScrollwheelAdjust speed
Num-/Num+Increment zoom
Ctrl+Num-/Num+Increment speed
Alt+Num-Reset zoom
Alt+Num+Reset speed
@@ -361,14 +408,14 @@ The toolbar along the bottom of the screen displays various useful values. From - Unit name - Camera mode -- Camera zoom/Unit side +- Vision mode/Unit side - 24-hour Clock -- Vision mode/Unit depth +- Camera zoom/Unit depth - Camera/Unit speed #### 2.2.3 Map -The map overlay will show the current position of the free camera and all spectatable units. The unit icons are tied into the unit icon toggle shortcut. When spectating a unit the map will also show the icons of units it knows about. In free camera you can double click on the map to teleport the camera to the position of the mouse. +The map overlay will show the current position of the free camera and all spectatable units. In free camera you can alt-click on the map to teleport the camera to the position of the cursor. ## 3. Dependencies diff --git a/documentation/missionmaker/class-names.md b/documentation/missionmaker/class-names.md index a40ff22ceb..9866f20064 100644 --- a/documentation/missionmaker/class-names.md +++ b/documentation/missionmaker/class-names.md @@ -255,19 +255,33 @@ class name | in game name | type | ACE_SpareBarrel | Spare barrel | ACE_ItemCore | ## Parachute -`added in 3.0.0.3` +`last modified in 3.2.0` class name | in game name | type | ---------- | --------- | --------- ACE_Altimeter | Altimeter Watch | ACE_ItemCore | ACE_NonSteerableParachute | Non-Steerable Parachute | Backpack | +ACE_ReserveParachute | Reserve Parachute | Backpack | ## Rangecard +`added in 3.1.1` class name | in game name | type | ---------- | --------- | --------- ACE_RangeCard | rangecard | ACE_ItemCore | +## Respawn +`last modified in 3.2.0` + +class name | in game name | type | +---------- | --------- | --------- +ACE_Rallypoint_West | Rallypoint West | FlagCarrier | +ACE_Rallypoint_East | Rallypoint East | FlagCarrier | +ACE_Rallypoint_Independent | Rallypoint Independent | FlagCarrier | +ACE_Rallypoint_West_Base | Rallypoint West (Base) | FlagCarrier | +ACE_Rallypoint_East_Base | Rallypoint East (Base) | FlagCarrier | +ACE_Rallypoint_Independent_Base | Rallypoint Independent (Base) | FlagCarrier | + ## Vector `added in 3.0.0.3` diff --git a/documentation/missionmaker/mission-tools.md b/documentation/missionmaker/mission-tools.md index ead87303a6..eeb4c2be06 100644 --- a/documentation/missionmaker/mission-tools.md +++ b/documentation/missionmaker/mission-tools.md @@ -10,18 +10,19 @@ parent: wiki ## 1. ACE Rallypoints *Part of: ace_respawn* -"ACE rally points" is a two way teleport system between two positions. Usually this is used to transport units that have died during a mission back to the front line. The rally points are portrayed by flagpoles (West, East and Independant flagpoles are available) that have a "Base" and an "Exit" version. +"ACE Rallypoints" is a two way teleport system between two positions. Usually this is used to transport units that have died during a mission back to the front line. The rally points are portrayed by flagpoles (West, East and Independant flagpoles are available) that have a "Base" and an "Exit" version. They can be found in the editor under: "Empty" >> "ACE Respawn" **Classnames:** -* `ACE_Rallypoint_West`, `ACE_RallypointExit_West` -* `ACE_Rallypoint_East`, `ACE_RallypointExit_East` -* `ACE_Rallypoint_Independent`, `ACE_RallypointExit_Independent` +- `ACE_Rallypoint_West`, `ACE_Rallypoint_West_Base` +- `ACE_Rallypoint_East`, `ACE_Rallypoint_East_Base` +- `ACE_Rallypoint_Independent`, `ACE_Rallypoint_Independent_Base` Using the Interaction Menu on a rallypoint offers the ability to teleport from one flagpole to the other flagpole and vice versa. If you want to change the texture of the flag use this line: + ```c++ this setFlagTexture 'path\to\my\texture\my_awesome_clan_logo.paa'; ``` @@ -32,7 +33,7 @@ All units synced to the ["Rallypoint System" module](./modules.html#1.14-rallypo
Note:
-

It's important to mention that this doesn't work for player who join during a mission (JIP = Join in progress). That's something we can't change because that's the way Bohemia has implemented their module framework.

+

It's important to mention that this doesn't work for player who join during a mission (JIP = Join in progress). That's something we can't change because that's the way Bohemia Interactive has implemented their module framework.

To enable other units to move them add this to the unit's initialization code: @@ -57,4 +58,81 @@ this setVariable ["ACE_CanSwitchUnits", true]; ``` Once this player spawns, all controllable AI will be marked on his map and he'll be able to click on the map to switch to this unit. The initial unit will be prone to damage, but has no equipment and can't run. So it would be wise to hide or move this unit far from other players. -The [module settings](./modules.html#1.16-switchunits-system) define which side a player can control or how big the radius of the safe zone is. The safe zone is a circular zone around AI units that must be clear from players of an opposing side to be able to switch to. \ No newline at end of file +The [module settings](./modules.html#1.16-switchunits-system) define which side a player can control or how big the radius of the safe zone is. The safe zone is a circular zone around AI units that must be clear from players of an opposing side to be able to switch to. + +## 3. ACE Slideshow +*Part of: ace_slideshow* + +"ACE Slideshow" is a very powerful tool for mission makers and platoon leaders giving them the power to project images on some objects. +You will now learn how to set up everything for it to work properly. + +### 3.1 The module explained +Name | Explanation +---- | ----- +Objects | Name of the objects used as screens +Controllers | Name of the objects used as controllers +Images | Full path of the image from the mission folder/file or from an other mod (even BI PBOs work) +Interaction names | Name of your interactions +Slide duration | 0 (0 = disabled, number is in seconds) + +- Only objects with hiddenSelection 0 can be used as "screens". +- If you set a duration the remotes will be disabled. (If the remotes are disabled `ace_interaction` is not needed) +- You can have multiple sets of images on different screens, see the advanced slideshow below. +- It is advisable images resolution sizes are powers of 2 (eg. 512x512) to avoid graphical glitches in them. + +
+
Note:
+

Mission MUST be in a PBO format (not bare folder) when used on a dedicated server due to an [issue](http://feedback.arma3.com/view.php?id=22310) to prevent errors.

+
+ +### 3.2 Basic slideshow +*A set of 4 images that are swapped via a remote* + +Note that all names and interaction names are examples. + +- First place the slideshow module down. +- Place the object that will be used as a "screen" and give it the name `foo1` +- Place the object you want to use as a remote and name it `bar1` +- In your mission folder create a new folder called images and drop your banana images there. +- Place down the module and fill it as follows: + +Name | Written +---- | ----- +Objects | foo1 +Controllers | bar1 +Images | images\banana1.jpg,images\banana2.jpg,images\banana3.jpg,images\banana4.jpg +Interaction names | banana1,banana2,banana3,banana4 +Slide duration | 0 + +- Go in game and enjoy your bananas + +### 3.3 Multiple screens and remotes +*2 set of "screens" and remotes* + +- First place the slideshow module down. +- Place 2 objects that you want to use as "screens" and call them `foo1` and `foo2` +- Place 2 objects you want to use as remotes and call them `bar1` and `bar2` +- In your mission folder create a new folder called images and drop your banana images there. +- Place down 2 modules and fill them as follows: + +*Module 1* + +Name | Written +---- | ----- +Objects | foo1 +Controllers | bar1 +Images | images\banana1.jpg,images\banana2.jpg +Interaction names | banana1,banana2 +Slide duration | 0 + +*Module 2* + +Name | Written +---- | ----- +objects | foo2 +Controllers | bar2 +images | images\banana3.jpg,images\banana4.jpg +Interaction names | banana3,banana4 +Slide duration | 0 + +- You now have two set of "screens" with a remote each. \ No newline at end of file diff --git a/documentation/missionmaker/modules.md b/documentation/missionmaker/modules.md index d82fee478f..9ee9ee7e57 100644 --- a/documentation/missionmaker/modules.md +++ b/documentation/missionmaker/modules.md @@ -15,54 +15,29 @@ This module allows enabling and configuring advanced ballistic simulations. **Settings:** -1. **Advanced Ballistics (Boolean)**
-Enables advanced ballistics.
-`Default value: No` - -2. **Enabled For Snipers (Boolean)**
-Enables advanced ballistics for non local snipers (when using high power optics).
-`Default value: Yes` - -3. **Enabled For Group Members (Boolean)**
-Enables advanced ballistics for non local group members.
-`Default value: No` - -4. **Enabled For Everyone (Boolean)**
-Enables advanced ballistics for all non local players (enabling this feature may degrade performance during heavy firefights in multiplayer).
-`Default value: No` - -5. **Disabled In FullAuto Mode (Boolean)**
-Disables the advanced ballistics during full auto fire.
-`Default value: No` - -6. **Enable Ammo Temperature Simulation (Boolean)**
-Muzzle velocity varies with ammo temperature.
-`Default value: Yes` - -7. **Enable Barrel Length Simulation (Boolean)**
-Muzzle velocity varies with barrel length.
-`Default value: Yes` - -8. **Enable Bullet Trace Effect (Boolean)**
-Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics).
-`default value: Yes ` - -9. **Simulation Interval (Number)**
-Defines the interval between every calculation step.
-`Default value: 0.00` - -10. **Simulation Radius (Number)**
-Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles.
-`Default value: 3000` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Advanced Ballistics | Boolean | Enables advanced ballistics. | No +Enabled For Snipers | Boolean | Enables advanced ballistics for non local snipers (when using high power optics). | Yes +Enabled For Group Members | Boolean | Enables advanced ballistics for non local group members.| No +Enabled For Everyone | Boolean | Enables advanced ballistics for all non local players (enabling this feature may degrade performance during heavy firefights in multiplayer). | No +Disabled In FullAuto Mode | Boolean | Disables the advanced ballistics during full auto fire. | No +Enable Ammo Temperature Simulation | Boolean | Muzzle velocity varies with ammo temperature. | Yes +Enable Barrel Length Simulation | Boolean | Muzzle velocity varies with barrel length. | Yes +Enable Bullet Trace Effect | Boolean | Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics). | Yes +Simulation Interval | Number | Defines the interval between every calculation step. | 0.00 +Simulation Radius | Number | Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles. | 3000 ### 1.2 Allow Config Export *Part of: ace_Optionmenu* This modules allows to export all current ACE3 settings from the ACE3 Option menu to the clipboard and RPT file. -1. **Allow (Boolean)**
-Enables the "export" button in the ACE3 Option menu
-`Default value: Yes` +**Settings:** + +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Allow | Boolean | Enables the "export" button in the ACE3 Option menu. | Yes ### 1.3 BlueForceTracking *Part of: ace_map* @@ -71,12 +46,11 @@ When adding the "Blue Force Tracking" module to your mission it adds map markers **Settings:** -1. **Interval (Number)**
-How often the markers should be refreshed (in seconds).
-`Default value: 1` -2. **Hide AI Groups (Boolean)**
-Hide markers for "AI only" groups.
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +BFT Enable | Boolean | Enable blue force tracking | No +Interval | Number | How often the markers should be refreshed (in seconds). | 1 +Hide AI Groups | Boolean | Hide markers for "AI only" groups. | No ### 1.4 Captives settings *Part of: ace_captives* @@ -86,13 +60,10 @@ Very useful if you don't want your players to be able to restrict each others. **Settings:** -1. **Can handcuff own side (Boolean)**
-Determine if you are able to handcuff your own side or not.
-`Default value: Yes` - -2. **Allow surrendering (Boolean)**
-Determine if you are able to surrender or not when your weapon is holstered.
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Can handcuff own side | Boolean | Determine if you are able to handcuff your own side or not. | Yes +Allow surrendering | Boolean | Determine if you are able to surrender or not when your weapon is holstered. | Yes ### 1.5 Check PBOs *Part of: ace_common* @@ -105,15 +76,13 @@ If you are worried that players haven't updated ACE3 or other mods to the versio **Settings:** -1. **Action (Option)**
-What to do with people who do not have the right PBOs.
-`Default value: "Warn once"` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Action | Option | What to do with people who do not have the right PBOs. | "Warn once" +Check all addons | Boolean | Check all addons instead of only those of ACE3? | "No" -2. **Check all addons (Boolean)**
-Check all addons instead of only those of ACE3?
-`Default value: "No"` - -3. **Whitelist**
+ **Whitelist** + You can make a whitelist of addons that don't have to be on the server. If you want to use the "Check all addons" option of this module and allow the usage of client side modifications like Blastcore or JSRS, you have to list them here. The list must be in the following format: `["ADDON1","ADDON2",...]` where the addons are CfgPatches references to all PBOs of the optional mod. To figure these out, you can use the scripting command `activatedAddons` in the editor while those mods are enabled. @@ -132,7 +101,6 @@ Example 3: @JSRS + @Blastcore-A3:
[TBD, "warfxpe","blastcore_vep"] ``` - ### 1.6 Explosive System *Part of: ace_explosive* @@ -140,87 +108,87 @@ The "Explosive System" module lets you tweak the settings for the new explosive **Settings:** -1. **Require specialists? (Boolean)**
-Require explosive specialists to disable explosives.
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Require specialists? | Boolean | Require explosive specialists to disable explosives. | No +Punish non-specialists? | Boolean | Increase the time it takes to complete actions for non-specialists. | Yes +Explode on defusal? | Boolean | Enables certain explosives to explode on defusal? | Yes -2. **Punish non-specialists? (Boolean)**
-Increase the time it takes to complete actions for non-specialists.
-`Default value: Yes` +### 1.7 Finger settings +*Part of ace_finger* +This module allow you to tweak settings for finger pointing such as is if it's enabled or the distance people can see you finger things -### 1.7 Friendly Fire Messages +**Settings:** + +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Finger pointing enabled | Boolean | | Yes +Finger Max Range | Number | How far away players can finger each others (in meters) | 4 + +### 1.8 Friendly Fire Messages *Part of: ace_respawn* The "Friendly Fire Messages" module triggers a message when a player kills a friendly or civilian unit. This module isn't needed on servers with a low difficulty setting. - -### 1.8 Hearing +### 1.9 Hearing *Part of: ace_hearing* -Placing this modules allows you to disable combat deafness usually triggerd by loud explosions or heavy weapons in a players proximity. +Placing this modules allows you to disable combat deafness usually triggered by loud explosions or heavy weapons in a players proximity. **Settings:** -1. **Enable combat deafness? (Boolean)***
-Enable combat deafness?
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enable combat deafness? | Boolean | Enable combat deafness? | Yes - -### 1.9 Interaction System +### 1.10 Interaction System *Part of: ace_interaction* This module allows you to tweak if players should be able to use team management functions (e.g. "switch group", "become leader"). **Settings:** -1. **Enable Team Management (Boolean)**
-Should players be allowed to use the Team Management Menu?.
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enable Team Management | Boolean | Should players be allowed to use the Team Management Menu?. | Yes -### 1.10 Make Unit Surrender +### 1.11 LSD Vehicles +*part of ace_common* + +Any vehicle linked to this module will become a seizure inducing machine of doom, no, really. + +### 1.12 Make Unit Surrender *Part of: ace_captives* -Syncing units to that module sets them in the captive state with their arms behind their back. Usefull for e.g. hostage rescue missions. +Syncing units to that module sets them in the captive state with their arms behind their back. Useful for e.g. hostage rescue missions. - -### 1.11 Map +### 1.13 Map *Part of: ace_map* -ACE3 introdcues a bit more realism for the vanilla Arma 3 map and how it behaves. Some of these settings can be toggled by this module. +ACE3 introduces a bit more realism for the vanilla Arma 3 map and how it behaves. Some of these settings can be toggled by this module. **Settings:** -1. **Map illumination? (Boolean)**
-Calculate dynamic map illumination based on light conditions?.
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Map illumination? | Boolean | Calculate dynamic map illumination based on light conditions?. | Yes +Map shake? | Boolean | Make map shake when walking?. | Yes +Limit map zoom? | Boolean | Limit the amount of zoom available for the map?. | No +Show cursor coordinates? | Boolean | Show the grid coordinates on the mouse pointer?. | No -2. **Map shake? (Boolean)**
-Make map shake when walking?.
-`Default value: Yes` - -3. **Limit map zoom? (Boolean)**
-Limit the amount of zoom available for the map?.
-`Default value: No` - -4. **Show cursor coordinates? (Boolean)**
-Show the grid coordinates on the mouse pointer?.
-`Default value: No` - - -### 1.12 MicroDAGR Map Fill +### 1.14 MicroDAGR Map Fill *Part of: ace_microdagr* Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap. **Settings:** -1. **MicroDAGR Map Fill (Option)**
-How much map data is filled on MicroDAGR's.
-`Default value: "Full Satellite + Buildings"` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +MicroDAGR Map Fill | Option | How much map data is filled on MicroDAGR's. | "Full Satellite + Buildings" - -### 1.13 MK6 Settings +### 1.15 MK6 Settings *Part of: ace_mk6mortar* ACE3 now includes the first iteration of getting a less arcady point and click mortar experience. @@ -228,50 +196,31 @@ Placing this modules allows you to enable the increased realism in game. **Settings:** -1. **Air Resistance (Boolean)**
-For Player Shots, Model Air Resistance and Wind Effects.
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Air Resistance | Boolean | For Player Shots, Model Air Resistance and Wind Effects. | No +Allow MK6 Computer | Boolean | Show the Computer and Rangefinder (these **NEED** to be removed if you enable air resistance). | No +Allow MK6 Compass | Boolean | Show the MK6 Digital Compass. | Yes -2. **Allow MK6 Computer (Boolean)**
-Show the Computer and Rangefinder (these **NEED** to be removed if you enable air resistance).
-`Default value: No` - -3. **Allow MK6 Compass (Boolean)**
-Show the MK6 Digital Compass.
-`Default value: Yes` - -### 1.14 Name Tags +### 1.16 Name Tags *Part of: ace_nametags* This module allows you to tweak the settings for player names tags. **Settings:** -1. **Show player names (Option)**
-Let you choose when nametags appears.
-`Default value: "Do Not Force"` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Show player names | Option | Let you choose when nametags appears. | "Do Not Force" +layer Names View Distance | Number | Distance (in meters) at which player names are shown. | 5 +Show name tags for AI? | Option | Show the name and rank tags for friendly AI units, or by default allows players to choose it on their own. | "Do Not Force" +Show crew info? | Option | Show vehicle crew info, or by default allows players to choose it on their own. | "Do Not Force" +Show for Vehicles? | Boolean | Show cursor NameTag for vehicle commander (only if client has name tags enabled). | No -2. **Player Names View Distance (Number)**
-Distance (in meters) at which player names are shown.
-`Default value: 5` - -3. **Show name tags for AI? (Option)**
-Show the name and rank tags for friendly AI units, or by default allows players to choose it on their own.
-`Default value: "Do Not Force"` - -4. **Show crew info? (Option)**
-Show vehicle crew info, or by default allows players to choose it on their own.
-`Default value: "Do Not Force"` - -5. **Show for Vehicles? (Boolean)**
-Show cursor NameTag for vehicle commander (only if client has name tags enabled).
-`Default value: No` - - -### 1.15 Rallypoint System +### 1.17 Rallypoint System *Part of: ace_respawn* -This module enables Mission Makers to specificly enable units to move a rallypoint. Every unit that is synced with that module is able to move a rallypoint. +This module enables Mission Makers to specifically enable units to move a rallypoint. Every unit that is synced with that module is able to move a rallypoint.
Note:
@@ -280,129 +229,81 @@ This module enables Mission Makers to specificly enable units to move a rallypoi To enable JIP players to move rally points have a look at [ACE3 Rallypoints](./mission-tools.html#1.-ace-rallypoints). - -### 1.16 Respawn System +### 1.18 Respawn System *Part of: ace_respawn* The "Respawn System" module enables players to respawn with the gear they had before dying and to remove bodies of players after a configurable interval (in seconds). **Settings:** -1. **Save Gear? (Boolean)**
-Respawn with the gear a player had just before his death.
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Save Gear? | Boolean | Respawn with the gear a player had just before his death. | No -### 1.17 Spectator Settings -*Part of: ace_spectator* +### 1.19 Sitting +*part of ace_sitting* -Configure how the spectator system will operate by default. +This module is used to turn sitting on. **Settings:** -1. **Spectate on death (Boolean)**
-Enables spectator upon death.
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enable sitting | Boolean | | Yes -2. **Unit filter (Option)**
-Method of filtering spectatable units.
-`Default value: "Only players"` - -3. **Side filter (Option)**
-Method of filtering spectatable sides.
-`Default value: "Player side"` - -4. **Camera modes (Option)**
-Camera modes that can be used.
-`Default value: "All"` - -5. **Vision modes (Option)**
-Vision modes that can be used.
-`Default value: "All"` - -6. **Unit icons (Boolean)**
-Render icons above spectatable units.
-`Default value: Yes` - -### 1.18 SwitchUnits System +### 1.20 SwitchUnits System *Part of: ace_switchunits* The [SwitchUnits System](./mission-tools.html#2.-ace-switchunits) enables players to control certain AI units on the map. **Settings:** -1. **Switch To West? (Boolean)**
-Allow switching to west units?
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Switch To West? | Boolean | Allow switching to west units? | No +Switch To East? | Boolean | Allow switching to east units? | No +Switch To Independent? | Boolean | Allow switching to independent units? | No +Switch To Civilian? | Boolean | Allow switching to civilian units? | No +Enable Safe Zone? | Boolean | Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. | Yes +Safe Zone Radius | Number | The safe zone around players from a different team (in meters). | 200 -2. **Switch To East? (Boolean)**
-Allow switching to east units?
-`Default value: No` - -3. **Switch To Independent? (Boolean)**
-Allow switching to independent units?
-`Default value: No` - -4. **Switch To Civilian? (Boolean)**
-Allow switching to civilian units?
-`Default value: No` - -5. **Enable Safe Zone? (Boolean)**
-Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone.
-`Default value: Yes` - -6. **Safe Zone Radius (Number)**
-The safe zone around players from a different team (in meters)
-`Default value: 200` - - -### 1.19 Vehicle Lock +### 1.21 Vehicle Lock *Part of: ace_vehiclelock* These modules allow you to lock and unlock vehicles and their inventory using a key. Players don't receive a key automatically; for key names, see [Classnames Wiki](http://ace3mod.com/wiki/missionmaker/classnames.html#vehicle-lock). -#### 1.19.1 Vehicle Key Assign +#### 1.21.1 Vehicle Key Assign Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start. Example: `[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` - will add a key to bob and program it to work only on car1 -#### 1.19.2.1 Vehicle Lock Setup +#### 1.21.2.1 Vehicle Lock Setup Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states. **Settings:** -1. **Lock Vehicle Inventory? (Boolean)**
-Locks the inventory of locked vehicles
-`Default value: No` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Lock Vehicle Inventory? | Boolean | Locks the inventory of locked vehicles. | No +Vehicle Starting Lock State | Option | Set lock state for all vehicles (removes ambiguous lock states). | "As Is" +Default Lockpick Strength | Number | Default Time to lockpick (in seconds). | 10 -2. **Vehicle Starting Lock State (Option)**
-Set lock state for all vehicles (removes ambiguous lock states)
-`Default value: "As Is"` - -3. **Default Lockpick Strength (Number)**
-Default Time to lockpick (in seconds)
-`Default value: 10` - -#### 1.19.2.2 Vehicle setVariables +#### 1.21.2.2 Vehicle setVariables * `ACE_VehicleLock_lockSide` - SIDE: overrides a vehicle's side, allowing locking and unlocking using a different side's key. For example: Unlocking INDEP vehicles with a BLUFOR key. * `ACE_vehicleLock_lockpickStrength` - NUMBER: seconds, determines how long lockpicking with take, overrides the value set in the module for a specific vehicle of the mission maker's choice. - -### 1.20 View Distance Limiter +### 1.22 View Distance Limiter *Part of: ace_viewdistance* This module allows disabling the ACE3 View Distance feature as well as setting a view distance limit. **Settings:** -1. **Enable ACE viewdistance (Boolean)**
-Enables ACE viewdistance
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enable ACE viewdistance | Boolean | Enables ACE viewdistance. | Yes +View Distance Limit | Number | Sets the limit for how high clients can raise their view distance (<= 10 000) | 10000 -2. **View Distance Limit (Number)**
-Sets the limit for how high clients can raise their view distance (<= 10000) -`Default value: 10000` - - -### 1.21 Weather +### 1.23 Weather *Part of: ace_weather* This module allows you to customize the weather settings. @@ -414,40 +315,16 @@ This module allows you to customize the weather settings. **Settings:** -1. **Weather propagation (Boolean)**
-Enables sever side weather propagation.
-`Default value: Yes` -
-
Note:
-

This is responsible for synchronizing weather between all clients. Disabling it is not recommended.

-
+Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Weather propagation | Boolean | Enables sever side weather propagation.(This is responsible for synchronizing weather between all clients. Disabling it is **NOT** recommended). | Yes +ACE3 Weather | Boolean | Overrides the default weather with ACE3 weather (map based)(This can be disabled without affecting the weather propagation above. Useful if you prefer changing weather settings manually). | Yes +Sync Rain | Boolean | Synchronizes rain. | Yes +Sync Wind | Boolean | Synchronizes wind. | Yes +Sync Misc | Boolean | Synchronizes lightnings, rainbow, fog, ... | Yes +Update Interval | Number | Defines the interval (seconds) between weather updates. | 60 -2. **ACE3 Weather (Boolean)**
-Overrides the default weather with ACE3 weather (map based).
-`Default value: Yes` -
-
Note:
-

This can be disabled without affecting the weather propagation above. Useful if you prefer changing weather settings manually.

-
- -3. **Sync Rain (Boolean)**
-Synchronizes rain.
-`Default value: Yes` - -4. **Sync Wind (Boolean)**
-Synchronizes wind.
-`Default value: Yes` - -5. **Sync Misc (Boolean)**
-Synchronizes lightnings, rainbow, fog, ...
-`Default value: Yes` - -6. **Update Interval (Number)**
-Defines the interval (seconds) between weather updates.
-`Default value: 60` - - -### 1.22 Wind Deflection +### 1.24 Wind Deflection *Part of: ace_winddeflection* This module allows you to define when wind deflection is active. @@ -464,56 +341,27 @@ This module allows you to define when wind deflection is active. **Settings:** -1. **Wind Deflection (Boolean)**
-Enables wind deflection.
-`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Wind Deflection | Boolean | Enables wind deflection. | Yes +Vehicle Enabled | Boolean | Enables wind deflection for static/vehicle gunners. | Yes +Simulation Interval | Number | Defines the interval between every calculation step. | 0.05 +Simulation Radius | Number | Defines the radius around the player (in meters) at which projectiles are wind deflected. | 3000 -2. **Vehicle Enabled (Boolean)**
-Enables wind deflection for static/vehicle gunners.
-`Default value: Yes` - -3. **Simulation Interval (Number)**
-Defines the interval between every calculation step.
-`Default value: 0.05` - -4. **Simulation Radius (Number)**
-Defines the radius around the player (in meters) at which projectiles are wind deflected.
-`Default value: 3000` - -### 1.23 Zeus Settings +### 1.25 Zeus Settings *part of: ace_zeus* This module provides control over vanilla aspects of Zeus. **Settings:** -1. **Ascension Messages (Boolean)**
-Display global popup messages when a player is assigned as Zeus.
-`Default value: No` - -2. **Zeus Eagle (Boolean)**
-Spawn an eagle that follows the Zeus camera.
-`Default value: No` - -3. **Wind Sounds (Boolean)**
-Play wind sounds when Zeus remote controls a unit.
-`Default value: No` - -4. **Ordnance Warning (Boolean)**
-Play a radio warning when Zeus uses ordnance.
-`Default value: No` - -5. **Reveal Mines (Option)**
-Reveal mines to allies and place map markers.
-`Default value: "Disabled"` - -### 1.23 LSD Vehicles -*Part of: ace_core* - -And then there's the "LSD Vehicles" module … it does 'something' to all vehicles synced to that module. -
- -
+Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Ascension Messages | Boolean | Display global pop-up messages when a player is assigned as Zeus. | No +Zeus Eagle | Boolean | Spawn an eagle that follows the Zeus camera. | No +Wind Sounds | Boolean | Play wind sounds when Zeus remote controls a unit. | No +Ordnance Warning | Boolean | Play a radio warning when Zeus uses ordnance. | No +Reveal Mines | Option | Reveal mines to allies and place map markers. | "Disabled" ## 2. ACE3 Medical *Part of: ace_medical* @@ -524,58 +372,21 @@ This module allows to tweak all the medical settings used in ACE3 **Settings:** -1. **Medical Level (Option)**
-What is the medical simulation level?
-`Default value: "Basic"` - -2. **Medics setting (Option)**
-What is the level of detail preferred for medics?
-`Default value: "Normal"` - -3. **Enable Litter (Boolean)**
-Enable litter being created upon treatment.
-`Default value: "Yes"` - -4. **Life time of litter objects (Number)**
-How long should litter objects stay? In seconds. -1 is forever.
-`Default value: 1800` - -5. **Enable Screams (Boolean)**
-Enable screaming by injured units.
-`Default value: Yes` - -6. **Player Damage (Number)**
-What is the damage a player can take before being killed?
-`Default value: 1` - -7. **AI Damage (Number)**
-What is the damage an AI can take before being killed?
-`Default value: 1` - -8. **AI Unconsciousness (Option)**
-Allow AI to go unconscious.
-`Default value: "50/50"` - -9. **Remote controlled AI (Boolean)**
-Treats remote controlled units as AI not players ? -`Default value: Yes` - -10. **Prevent instant death (Boolean)**
-Have a unit move to unconscious instead of death.
-`Default value: No` - -11. **Bleeding coefficient (Number)**
-Coefficient to modify the bleeding speed.
-`Default value: 1` - -12. **Pain coefficient (Number)**
-Coefficient to modify the pain intensity.
-`Default value: 1` - -13. **Sync status (Boolean)**
-Keep unit status synced. Recommended on.
-`Default value: Yes` - +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Medical Level | Option | What is the medical simulation level? | "Basic" +Medics setting | Option | What is the level of detail preferred for medics? | "Basic" +Enable Litter | Boolean | Enable litter being created upon treatment. | "Yes" +Life time of litter objects | Number | How long should litter objects stay? In seconds. -1 is forever. | 1800 +Enable Screams | Boolean | Enable screaming by injured units. | Yes +Player Damage | Number | What is the damage a player can take before being killed? | 1 +AI Damage | Number | What is the damage an AI can take before being killed? | 1 +AI Unconsciousness | Option | Allow AI to go unconscious. | "50/50" +Remote controlled AI | Boolean | Treats remote controlled units as AI not players? | Yes +Prevent instant death | Boolean | Have a unit move to unconscious instead of death. | No +Bleeding coefficient | Number | Coefficient to modify the bleeding speed. | 1 +Pain coefficient | Number | Coefficient to modify the pain intensity. | 1 +Sync status | Boolean | Keep unit status synced. (Recommended on). | Yes ### 2.2 Advanced Medical Settings @@ -583,49 +394,19 @@ This module allows you to change the default Advanced Medical Settings, when [2. **Settings:** -1. **Enabled for (Option)**
-Select what units the advanced medical system will be enabled for.
-`Default value: "Players only"` - -2. **Enable Advanced wounds (Boolean)**
-Allow reopening of bandaged wounds?
-`Default value: No` - -3. **Vehicle Crashes (Boolean)**
-Do units take damage from a vehicle crash?
-`Default value: Yes` - -4. **Allow PAK (Option)**
-Who can use the PAK for full heal?
-`Default value: "Medics only"` - -5. **Remove PAK on use (Boolean)**
-Should PAK be removed on usage?
-`Default value: Yes` - -6. **Locations PAK (Option)**
-Where can the personal aid kit be used?
-`Default value: "Vehicles & facility"` - -7. **Allow Surgical kit (Option)**
-Who can use the surgical kit?
-`Default value: "Medics only"` - -8. **Remove Surgical kit (Boolean)**
-Should Surgical kit be removed on usage?
-`Default value: Yes` - -9. **Locations Surgical kit (Option)**
-Where can the Surgical kit be used?
-`Default value: "Vehicles & facility"` - -10. **Bloodstains (Boolean)**
-Bandaging removes bloodstains. -`Default value: No` - -11. **Pain supression (Boolean)**
-Pain is only temporarly supressed not removed. -`Default value: Yes` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enabled for | Option | Select what units the advanced medical system will be enabled for. | "Players only" +Enable Advanced wounds | Boolean | Allow reopening of bandaged wounds? | No +Vehicle Crashes | Boolean | Do units take damage from a vehicle crash? | Yes +Allow PAK | Option | Who can use the PAK for full heal? | "Medics only" +Remove PAK on use | Boolean | Should PAK be removed on usage? | Yes +Locations PAK | Option | Where can the personal aid kit be used? | "Vehicles & facility" +Allow Surgical kit | Option | Who can use the surgical kit? | "Medics only" +Remove Surgical kit | Boolean | Should Surgical kit be removed on usage? | Yes +Locations Surgical kit | Option | Where can the Surgical kit be used? | "Vehicles & facility" +Bloodstains | Boolean | Bandaging removes bloodstains. | No +Pain suppression | Boolean | Pain is only temporarily suppressed not removed. | Yes ### 2.3 Revive Settings @@ -633,18 +414,11 @@ This modules allows a mission maker to limit the amount of revives for units in **Settings:** -1. **Enable Revive (Option)**
-Enable a basic revive system
-`Default value: "disable"` - -2. **Max Revive time (Number)**
-Max amount of seconds a unit can spend in revive state
-`Default value: 120` - -3. **Max Revive lives (Number)**
-Max amount of lives a unit. 0 or -1 is disabled.
-`Default value: -1` - +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Enable Revive | Option | Enable a basic revive system. | "disabled" +Max Revive time | Number | Max amount of seconds a unit can spend in revive state | 120 +Max Revive lives | Number | Max amount of lives a unit. 0 or -1 is disabled. | -1 ### 2.4 Set Medic Class @@ -652,13 +426,10 @@ Using this module you can define which unit class is defined as a medic / doctor **Settings:** -1. **List (String)**
-List of unit names that will be classified as medic, separated by commas.
-`Default value: ""` - -2. **Is Medic (Boolean)**
-Medics allow for more advanced treatment in case of Advanced Medic roles enabled
-`Default value: "Regular medic"` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +List | String | List of unit names that will be classified as medic, separated by commas. | "" +Is Medic | Boolean | Medics allow for more advanced treatment in case of Advanced Medic roles enabled. | "Regular medic" ### 2.5 Set Medical Facility @@ -667,10 +438,9 @@ Defines an object as a medical facility. This allows for more advanced treatment **Settings:** -1. **Is Medical Facility (Boolean)**
-Registers an object as a medical facility.
-`Default value: Yes` - +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Is Medical Facility | Boolean | Registers an object as a medical facility. | Yes ### 2.6 Set Medical Vehicle @@ -678,14 +448,10 @@ Defines an object as a medical facility. This allows for more advanced treatment **Settings:** -1. **List (String)**
-List of vehicles that will be classified as medical vehicle, separated by commas.
-`Default value: ""` - -2. **Is Medical Vehicle (Boolean)**
-Whether or not the objects in the list will be a medical vehicle.
-`Default value: Yes` - +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +List | String | List of vehicles that will be classified as medical vehicle, separated by commas. | "" +Is Medical Vehicle | Boolean | Whether or not the objects in the list will be a medical vehicle. | Yes ## 3. ACE3 Mission Modules *Part of: ace_missionmodules* @@ -700,30 +466,27 @@ This module randomizes the time when the sound file is played and the position w **Settings:** -1. **Sounds (String)**
-Class names of the ambiance sounds played. Separated by ','. (Example: `radio_track_01, electricity_loop`).
-`Default value: ""` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Sounds | String | Class names of the ambiance sounds played. Separated by ','. (Example: `radio_track_01, electricity_loop`)| "" +Minimal Distance | Number | Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) (in meters) | 400 +Maximum Distance | Number | Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) (in meters) | 900 +Minimal Delay | Number | Minimal delay (in seconds) between sounds played | 10 +Maximum Delay | Number | Maximum delay (in seconds) between sounds played | 10 +Follow Players | Boolean | Follow players. If set to false, loop will play sounds only nearby logic position. | No +Volume | Number | The volume of the sounds played. | 1 -2. **Minimal Distance (Number)**
-Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) (in meters)
-`Default value: 400` +### 3.2 Slideshow +*part of ace_slideshow* -3. **Maximum Distance (Number)**
-Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) (in meters)
-`Default value: 900` +This module is the core of `ace_slideshow` for more informations about slideshow check [the mission-tools section](./mission-tools.html) -4. **Minimal Delay (Number)**
-Minimal delay (in seconds) between sounds played
-`Default value: 10` +**Settings:** -5. **Maximum Delay (Number)**
-Maximum delay (in seconds) between sounds played
-`Default value: 10` - -6. **Follow Players (Boolean)**
-Follow players. If set to false, loop will play sounds only nearby logic position.
-`Default value: No` - -7. **Volume (Number)**
-The volume of the sounds played
-`Default value: 1` +Name | Type | Description | Default value +---- | ---- | ---- | ---- | +Objects | String | Object names (can also be synchronized objects) slide-show will be displayed on, separated by commas if multiple. | "" +Controllers | String | Controller object names, separated by commas if multiple. | "" +Images | String | List of images that will be used for the slide-show, separated by commas, with full path correctly formatted (eg. images\image.paa). | "" +Interaction names | String | List of names that will be used for interaction entries, separated by commas, in order of images. | Number | | 0 "" +Slide Duration | Number | Duration of each slide (in seconds) (0 = automatic slides disabled) | 0 \ No newline at end of file diff --git a/documentation/user/getting-started.md b/documentation/user/getting-started.md deleted file mode 100644 index 6e18cdb278..0000000000 --- a/documentation/user/getting-started.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -layout: wiki -title: Getting started -description: Downloaded ACE3 and have no idea where to start? This page serves as a document to help new players get started with things like the medical system, or how to adjust your scope. -group: user -order: 0 -parent: wiki ---- - -Downloaded ACE3 and have no idea where to start? This page serves as a document to help new players and mission makers understand what's available to them. - -- You don't know where to begin your ACE3 journey? [**Check out ACE3 features**](http://ace3mod.com/wiki/feature/) - -- You are a mission maker but you don't know what ACE3 have to offer? [**We have some documentation for you**](http://ace3mod.com/wiki/missionmaker/) - -- Are you searching for ACE3 classnames ? [**Here they are**](http://ace3mod.com/wiki/missionmaker/classnames.html) \ No newline at end of file diff --git a/documentation/user/information-center.md b/documentation/user/information-center.md new file mode 100644 index 0000000000..b1a1e8e9f0 --- /dev/null +++ b/documentation/user/information-center.md @@ -0,0 +1,53 @@ +--- +layout: wiki +title: Information center +description: Downloaded ACE3 and have no idea where to start? This page serves as a document to help new players get started with things or get an answer to some of your questions. +group: user +order: 0 +parent: wiki +--- + +Downloaded ACE3 and have no idea where to start? This page serves as a starting point to help new players and mission makers understand what's available to them. + + +- You don't know where to begin your ACE3 journey? [**Check out ACE3 features**](http://ace3mod.com/wiki/feature/) + + +- You are a mission maker but you don't know what ACE3 has to offer? [**We have some documentation for you**](http://ace3mod.com/wiki/missionmaker/) + + +- Are you searching for ACE3 classnames ? [**Here they are**](http://ace3mod.com/wiki/missionmaker/classnames.html) + + +## 1. FAQ +### 1.1 Features +**Q:** Where is X feature?
+**A:** When it's done.
+ +**Q:** Feature X was in ACE2/AGM/CSE where is it?
+**A:** It's going to be ported at some point.
+ +**Q:** Why was my feature request closed on GitHub?
+**A:** Feature requests should initially be added to issue #414 for easy tracking.[HERE](https://github.com/acemod/ACE3/issues/414/) + +**Q:** I want to disable feature X how do I do it?
+**A:** Simply delete the PBO.(note that some features depends on others, check dependencies before deleting anything).
+ +### 1.2 Issues + +**Q:** Laser locking is broken, when are you going to fix it?
+**A:** Fun fact, it isn't, you need to come from the direction of the laser, (laser is pointing to the east, you come from the west) and you drop the GBU, it will then guide itself to the target. The reasoning behind that is that the vehicle or building laser designated would obstruct the laser and the GBU would then be unable to lock on it.
+ +**Q:** I take vanilla damage with ACE 3.1.1
+**A:** This has been fixed on ACE3 master and will be fixed in the next release, in the meantime Basic medical doesn't have that issue.
+ +**Q:** I'm having dll errors.
+**A:** Remove ACE3 from your Arma 3 folder and repeat the installation process (don't forget to re-download).
+ +### 1.3 Compatibility + +**Q:**(mod) doesn't have some ACE3 features.
+**A:**ACE3 isn't and can't be responsible for compatibility with every (mod), due it's size other (mod) authors are strongly encouraged to provide that from their side. Compatibility PBOs currently in ACE3 are there to kick-start and provide examples for (mod) authors.
+ +**Q:** ACE3 causes issues in (mod).
+**A:**If you've found an issue with ACE3 please make sure that ACE3 is really the cause of the problem. To do this try to reproduce the issue with using only @cba_a3 and @ACE3 on a newly created mission. ACE3 isn't and can't be responsible for all mod conflicts, due it's size other mod authors are strongly encouraged to provide that from their side.
\ No newline at end of file diff --git a/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png new file mode 100644 index 0000000000..0209ed8676 Binary files /dev/null and b/extras/assets/icons/Icon_Module_png/Icon_Module_Cargo_ca.png differ diff --git a/extras/assets/icons/png/Icon_Module/Icon_Module_Slideshow_ca.png b/extras/assets/icons/Icon_Module_png/Icon_Module_Slideshow_ca.png similarity index 100% rename from extras/assets/icons/png/Icon_Module/Icon_Module_Slideshow_ca.png rename to extras/assets/icons/Icon_Module_png/Icon_Module_Slideshow_ca.png diff --git a/mod.cpp b/mod.cpp index be7d499c7b..0f16ca182a 100644 --- a/mod.cpp +++ b/mod.cpp @@ -1,8 +1,8 @@ -name = "Advanced Combat Environment 3.2.0"; +name = "Advanced Combat Environment 3.2.1"; picture = "logo_ace3_ca.paa"; actionName = "GitHub"; action = "https://github.com/acemod/ACE3"; -description = "ACE3 - Version 3.2.0"; +description = "ACE3 - Version 3.2.1"; logo = "logo_ace3_ca.paa"; logoOver = "logo_ace3_ca.paa"; tooltip = "ACE3"; diff --git a/optionals/compat_asdg/$PBOPREFIX$ b/optionals/compat_asdg/$PBOPREFIX$ deleted file mode 100644 index 0ba5166c16..0000000000 --- a/optionals/compat_asdg/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\compat_asdg \ No newline at end of file diff --git a/optionals/compat_asdg/config.cpp b/optionals/compat_asdg/config.cpp deleted file mode 100644 index 40dae32051..0000000000 --- a/optionals/compat_asdg/config.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"asdg_jointrails","ace_laserpointer","ace_optics"}; - author[]={"OnkelDisMaster"}; - authorUrl = "http://2.xn--gebirgsjgerkompanie-nwb.de/"; - VERSION_CONFIG; - }; -}; - -class asdg_SlotInfo; -class asdg_FrontSideRail: asdg_SlotInfo { - class compatibleItems { - ACE_acc_pointer_red = 1; - ACE_acc_pointer_green = 1; - ACE_acc_pointer_green_IR = 1; - }; -}; - -class asdg_OpticRail; -class asdg_OpticRail1913: asdg_OpticRail { - class compatibleItems { - ACE_optic_Hamr_2D = 1; - ACE_optic_Hamr_PIP = 1; - ACE_optic_Arco_2D = 1; - ACE_optic_Arco_PIP = 1; - ACE_optic_MRCO_2D = 1; - ACE_optic_MRCO_PIP = 1; - ACE_optic_SOS_2D = 1; - ACE_optic_SOS_PIP = 1; - ACE_optic_LRPS_2D = 1; - ACE_optic_LRPS_PIP = 1; - }; -}; diff --git a/optionals/compat_asdg/script_component.hpp b/optionals/compat_asdg/script_component.hpp deleted file mode 100644 index e67bf3b9e4..0000000000 --- a/optionals/compat_asdg/script_component.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#define COMPONENT asdg_comp - -#include "\z\ace\addons\main\script_mod.hpp" - -#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_bwa3/$PBOPREFIX$ b/optionals/compat_bwa3/$PBOPREFIX$ deleted file mode 100644 index 7331009959..0000000000 --- a/optionals/compat_bwa3/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -z\ace\addons\compat_bwa3 \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgAmmo.hpp b/optionals/compat_bwa3/CfgAmmo.hpp deleted file mode 100644 index c19e00819a..0000000000 --- a/optionals/compat_bwa3/CfgAmmo.hpp +++ /dev/null @@ -1,142 +0,0 @@ -class CfgAmmo { - class B_9x21_Ball; - class B_556x45_Ball_Tracer_Red; - class B_762x51_Tracer_Red; - class B_127x99_Ball_Tracer_Red; - class GrenadeHand; - class BWA3_B_556x45_Ball: B_556x45_Ball_Tracer_Red { - ACE_caliber=5.69; - ACE_bulletLength=23.012; - ACE_bulletMass=4.0176; - ACE_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; - ACE_ballisticCoefficients[]={0.151}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; - ACE_barrelLengths[]={210.82, 238.76, 269.24, 299.72, 330.2, 360.68, 391.16, 419.1, 449.58, 480.06, 508.0, 609.6}; - }; - class BWA3_B_556x45_Ball_SD: BWA3_B_556x45_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_B_556x45_Ball_AP: BWA3_B_556x45_Ball { - ACE_caliber=5.69; - ACE_bulletLength=23.012; - ACE_bulletMass=4.5359237; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.310}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={820, 865, 880}; - ACE_barrelLengths[]={254.0, 393.7, 508.0}; - }; - class BWA3_B_762x51_Ball: B_762x51_Tracer_Red { - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_762x51_Ball_SD: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=34.036; - ACE_bulletMass=12.96; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.235}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={305, 325, 335, 340}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_762x51_Ball_AP: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=31.496; - ACE_bulletMass=8.22946157; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.359}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={875, 910, 930}; - ACE_barrelLengths[]={330.2, 406.4, 508.0}; - }; - class BWA3_B_762x51_Ball_LR: BWA3_B_762x51_Ball { - ACE_caliber=7.823; - ACE_bulletLength=31.496; - ACE_bulletMass=11.34; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.243}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={750, 780, 790, 794}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class BWA3_B_127x99_Ball: B_127x99_Ball_Tracer_Red { - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9256; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.670}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={900}; - ACE_barrelLengths[]={736.6}; - }; - class BWA3_B_127x99_Ball_SD: BWA3_B_127x99_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_B_127x99_Ball_AP: BWA3_B_127x99_Ball { - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9904; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.670}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={900}; - ACE_barrelLengths[]={736.6}; - }; - class BWA3_B_46x30_Ball: B_9x21_Ball { - ACE_caliber=4.902; - ACE_bulletLength=13.005; - ACE_bulletMass=2.0088; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.1455}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 720, 730, 740}; - ACE_barrelLengths[]={101.6, 177.8, 228.6, 304.8}; - }; - class BWA3_B_46x30_Ball_SD: BWA3_B_46x30_Ball { - // Reference? - ACE_ballisticCoefficients[]={}; - ACE_velocityBoundaries[]={}; - ACE_muzzleVelocities[]={}; - ACE_barrelLengths[]={}; - }; - class BWA3_G_DM51A1: GrenadeHand { - ace_frag_metal = 296; - ace_frag_charge = 180; - ace_frag_gurney_c = 2930; // Gurney velocity constant for PETN - ace_frag_gurney_k = 1/2; // shape factor for a cylinder - }; -}; \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgMagazines.hpp b/optionals/compat_bwa3/CfgMagazines.hpp deleted file mode 100644 index bf43af6426..0000000000 --- a/optionals/compat_bwa3/CfgMagazines.hpp +++ /dev/null @@ -1,9 +0,0 @@ -class CfgMagazines { - class CA_Magazine; - class BWA3_200Rnd_556x45: CA_Magazine { - ACE_isBelt = 1; - }; - class BWA3_120Rnd_762x51: CA_Magazine { - ACE_isBelt = 1; - }; -}; \ No newline at end of file diff --git a/optionals/compat_bwa3/CfgWeapons.hpp b/optionals/compat_bwa3/CfgWeapons.hpp deleted file mode 100644 index c0acea9912..0000000000 --- a/optionals/compat_bwa3/CfgWeapons.hpp +++ /dev/null @@ -1,173 +0,0 @@ -class CfgWeapons { - class Pistol_Base_F; - class Rifle_Base_F; - class Rifle_Long_Base_F; - class UGL_F; - class BWA3_P8: Pistol_Base_F { - ACE_barrelTwist=248.92; - ACE_barrelLength=108; - }; - class BWA3_MP7: Pistol_Base_F { - ACE_barrelTwist=160.02; - ACE_barrelLength=180; - }; - class BWA3_G36: Rifle_Base_F { - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class BWA3_G36K: BWA3_G36 { - ACE_barrelTwist=177.8; - ACE_barrelLength=318; - }; - class BWA3_G28_Standard: Rifle_Long_Base_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=421; - }; - class BWA3_G28_Assault: BWA3_G28_Standard { - ACE_barrelTwist=304.8; - ACE_barrelLength=421; - }; - class BWA3_G27: BWA3_G28_Standard { - ACE_barrelTwist=304.8; - ACE_barrelLength=406; - }; - class BWA3_G27_AG: BWA3_G27 { - class AG40: UGL_F { - magazines[] += { - "ACE_HuntIR_M203" - }; - }; - }; - class BWA3_MG4: Rifle_Long_Base_F { - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class BWA3_MG5: Rifle_Long_Base_F { - ACE_barrelTwist=304.8; - ACE_barrelLength=550; - }; - class BWA3_G82: Rifle_Long_Base_F { - ACE_barrelTwist=381.0; - ACE_barrelLength=736.7; - }; - class AG40: UGL_F { - magazines[] += { - "ACE_HuntIR_M203" - }; - }; - class optic_Hamr; - class InventoryOpticsItem_Base_F; - - class BWA3_optic_ZO4x30 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_ZO4x30_NSV : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_ZO4x30_IRV : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -10, 10 }; - ACE_ScopeAdjust_Horizontal[] = { -10, 10 }; - ACE_ScopeAdjust_VerticalIncrement = 0.2; - ACE_ScopeAdjust_HorizontalIncrement = 0.2; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 200 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_Shortdot : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { -0.1, 10.1 }; - ACE_ScopeAdjust_Horizontal[] = { -5.1, 5.1 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_20x50 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { 0, 26 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_20x50_NSV : BWA3_optic_20x50 { - ACE_ScopeAdjust_Vertical[] = { 0, 26 }; - ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_24x72 : optic_Hamr { - ACE_ScopeAdjust_Vertical[] = { 0, 16 }; - ACE_ScopeAdjust_Horizontal[] = { -7, 7 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - class BWA3_optic_24x72_NSV : BWA3_optic_20x50 { - ACE_ScopeAdjust_Vertical[] = { 0, 16 }; - ACE_ScopeAdjust_Horizontal[] = { -7, 7 }; - ACE_ScopeAdjust_VerticalIncrement = 0.1; - ACE_ScopeAdjust_HorizontalIncrement = 0.1; - class ItemInfo : InventoryOpticsItem_Base_F { - class OpticsModes { - class Scope { - discreteDistance[] = { 100 }; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; -}; diff --git a/optionals/compat_bwa3/config.cpp b/optionals/compat_bwa3/config.cpp deleted file mode 100644 index efdebaf616..0000000000 --- a/optionals/compat_bwa3/config.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"BWA3_Weapons"}; - author[]={"Ruthberg"}; - VERSION_CONFIG; - }; -}; - -#include "CfgAmmo.hpp" -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" diff --git a/optionals/compat_bwa3/script_component.hpp b/optionals/compat_bwa3/script_component.hpp deleted file mode 100644 index 86bb669119..0000000000 --- a/optionals/compat_bwa3/script_component.hpp +++ /dev/null @@ -1,5 +0,0 @@ -#define COMPONENT BWA3_Weapons_comp - -#include "\z\ace\addons\main\script_mod.hpp" - -#include "\z\ace\addons\main\script_macros.hpp" diff --git a/optionals/compat_cup/CfgAmmo.hpp b/optionals/compat_cup/CfgAmmo.hpp deleted file mode 100644 index f5ba34fc7e..0000000000 --- a/optionals/compat_cup/CfgAmmo.hpp +++ /dev/null @@ -1,434 +0,0 @@ -class CfgAmmo -{ - class BulletBase; - class B_762x51_Ball; - class B_127x99_Ball; - class CUP_B_545x39_Ball: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.42792; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={780, 880, 920}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Green: CUP_B_545x39_Ball { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Red: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_White: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_545x39_Ball_Tracer_Yellow: BulletBase { - airFriction=-0.0011204; - ACE_caliber=5.588; - ACE_bulletLength=21.59; - ACE_bulletMass=3.22704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.168}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x39_Ball: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.9704; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={650, 716, 750}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x39_Ball_Tracer_Green: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.5816; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={650, 716, 750}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class B_762x39mm_KLT: BulletBase { - airFriction=-0.00150173; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=7.5816; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={650, 716, 750}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_9x18_Ball: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Green: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Red: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_Tracer_Yellow: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x18_Ball_White_Tracer: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_9x19_Ball: BulletBase { - airFriction=-0.00205726; - ACE_caliber=9.017; - ACE_bulletLength=15.494; - ACE_bulletMass=8.0352; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.165}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={340, 370, 400}; - ACE_barrelLengths[]={101.6, 127.0, 228.6}; - }; - class CUP_B_762x51_noTracer: B_762x51_Ball { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_303_Ball: BulletBase { - airFriction=-0.00082199; - ACE_caliber=7.899; - ACE_bulletLength=31.166; - ACE_bulletMass=11.2752; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.499, 0.493, 0.48}; - ACE_velocityBoundaries[]={671, 549}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={748, 761, 765}; - ACE_barrelLengths[]={508.0, 609.6, 660.4}; - }; - class CUP_B_127x107_Ball_Green_Tracer: BulletBase { - airFriction=-0.00062618; - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.63}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={820}; - ACE_barrelLengths[]={728.98}; - }; - class CUP_B_127x108_Ball_Green_Tracer: BulletBase { - airFriction=-0.00062618; - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.63}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={820}; - ACE_barrelLengths[]={728.98}; - }; - class CUP_B_762x54_Ball_White_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.395}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 750, 798, 800}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Red_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.395}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 750, 798, 800}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Green_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.395}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 750, 798, 800}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x54_Ball_Yellow_Tracer: BulletBase { - airFriction=-0.00101742; - ACE_caliber=7.925; - ACE_bulletLength=28.956; - ACE_bulletMass=9.6552; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.395}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={680, 750, 798, 800}; - ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_9x39_SP5: BulletBase { - airFriction=-0.00075274; - ACE_caliber=9.246; - ACE_bulletLength=31.496; - ACE_bulletMass=16.2; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.275}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={280, 300, 320}; - ACE_barrelLengths[]={254.0, 414.02, 508.0}; - }; - class CUP_B_762x51_Tracer_Green: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_Red: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_Yellow: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class CUP_B_762x51_Tracer_White: BulletBase { - airFriction=-0.00099036; - ACE_caliber=7.823; - ACE_bulletLength=28.956; - ACE_bulletMass=9.4608; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.2}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={700, 800, 820, 833, 845}; - ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; - }; - class B_127x107_Ball: BulletBase { - ACE_caliber=12.979; - ACE_bulletLength=64.008; - ACE_bulletMass=48.276; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.63}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={820}; - ACE_barrelLengths[]={728.98}; - }; - class CUP_B_9x18_SD: BulletBase { - airFriction=-0.00180193; - ACE_caliber=9.271; - ACE_bulletLength=15.494; - ACE_bulletMass=6.00048; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.125}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={298, 330, 340}; - ACE_barrelLengths[]={96.52, 127.0, 228.6}; - }; - class CUP_B_765x17_Ball: BulletBase { - airFriction=-0.00173452; - ACE_caliber=7.938; - ACE_bulletLength=15.494; - ACE_bulletMass=4.212; - ACE_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; - ACE_ballisticCoefficients[]={0.118}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={282, 300, 320}; - ACE_barrelLengths[]={101.6, 127.0, 228.6}; - }; - class CUP_B_145x115_AP_Green_Tracer: BulletBase { - airFriction=-0.00059041; - ACE_caliber=14.884; - ACE_bulletLength=50.8; - ACE_bulletMass=65.448; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.620}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={1000}; - ACE_barrelLengths[]={1346.2}; - }; - class CUP_B_127x99_Ball_White_Tracer: B_127x99_Ball { - airFriction=-0.00057503; - ACE_caliber=12.954; - ACE_bulletLength=58.674; - ACE_bulletMass=41.9256; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.670}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ASM"; - ACE_dragModel=1; - ACE_muzzleVelocities[]={853}; - ACE_barrelLengths[]={736.6}; - }; - class CUP_B_86x70_Ball_noTracer: BulletBase { - airFriction=-0.0005788; - ACE_caliber=8.585; - ACE_bulletLength=39.573; - ACE_bulletMass=16.2; - ACE_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; - ACE_ballisticCoefficients[]={0.322}; - ACE_velocityBoundaries[]={}; - ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={880, 915, 925}; - ACE_barrelLengths[]={508.0, 660.4, 711.2}; - }; -}; \ No newline at end of file diff --git a/optionals/compat_cup/CfgMagazines.hpp b/optionals/compat_cup/CfgMagazines.hpp index 469476734c..b05b0c3efd 100644 --- a/optionals/compat_cup/CfgMagazines.hpp +++ b/optionals/compat_cup/CfgMagazines.hpp @@ -45,223 +45,4 @@ class CfgMagazines { modelSpecial = ""; mass = 0; }; - - class CA_Magazine; - class 30Rnd_556x45_Stanag; - class CUP_30Rnd_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Green_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Red_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_White_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_TE1_Yellow_Tracer_545x39_AK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_75Rnd_TE4_LRT4_Green_Tracer_545x39_RPK_M: CA_Magazine { - initSpeed = 880; - }; - class CUP_30Rnd_762x39_AK47_M: CA_Magazine { - initSpeed = 750; - }; - class CUP_64Rnd_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Green_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Red_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_White_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_64Rnd_Yellow_Tracer_9x19_Bizon_M: CA_Magazine { - initSpeed = 350; - }; - class CUP_5x_22_LR_17_HMR_M: CA_Magazine { - initSpeed = 830; - }; - class CUP_10x_303_M: CA_Magazine { - initSpeed = 765; - }; - class CUP_20Rnd_762x51_FNFAL_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_5Rnd_127x108_KSVK_M: CA_Magazine { - initSpeed = 820; - }; - class CUP_100Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_100Rnd_TE4_LRT4_Red_Tracer_762x51_Belt_M: CUP_100Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M { - initSpeed = 833; - }; - class CUP_200Rnd_TE4_LRT4_White_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_200Rnd_TE4_LRT4_Red_Tracer_762x51_Belt_M: CA_Magazine { - initSpeed = 833; - }; - class CUP_100Rnd_TE4_LRT4_762x54_PK_Tracer_Green_M: CA_Magazine { - initSpeed = 800; - }; - class CUP_10Rnd_762x54_SVD_M: CA_Magazine { - initSpeed = 800; - }; - class CUP_10Rnd_9x39_SP5_VSS_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_20Rnd_9x39_SP5_VSS_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_5Rnd_127x99_as50_M: CA_Magazine { - initSpeed = 900; - }; - class CUP_20Rnd_762x51_DMR: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_DMR: CUP_20Rnd_762x51_DMR { - initSpeed = 833; - }; - class CUP_20Rnd_762x51_B_SCAR: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_SCAR: CUP_20Rnd_762x51_B_SCAR { - initSpeed = 833; - }; - class CUP_20Rnd_762x51_B_M110: CA_Magazine { - initSpeed = 833; - }; - class CUP_5Rnd_762x51_M24: CA_Magazine { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Yellow_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Red_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_Green_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_20Rnd_TE1_White_Tracer_762x51_M110: CUP_20Rnd_762x51_B_M110 { - initSpeed = 833; - }; - class CUP_30Rnd_556x45_G36: 30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Red_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Green_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_30Rnd_TE1_Yellow_Tracer_556x45_G36: CUP_30Rnd_556x45_G36 { - initSpeed = 920; - }; - class CUP_100Rnd_556x45_BetaCMag: 30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Red_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Green_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_100Rnd_TE1_Yellow_Tracer_556x45_BetaCMag: CUP_100Rnd_556x45_BetaCMag { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Green_Tracer_556x45_M249: CA_Magazine { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Red_Tracer_556x45_M249: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE1_Red_Tracer_556x45_M249: CUP_200Rnd_TE4_Red_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Green_Tracer_556x45_M249: CA_Magazine { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Red_Tracer_556x45_M249: CUP_100Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_100Rnd_TE4_Yellow_Tracer_556x45_M249: CUP_100Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Green_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Green_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Red_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Red_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_200Rnd_TE4_Yellow_Tracer_556x45_L110A1: CUP_200Rnd_TE4_Yellow_Tracer_556x45_M249 { - initSpeed = 920; - }; - class CUP_30Rnd_556x45_Stanag: CA_Magazine { - initSpeed = 920; - }; - class CUP_20Rnd_556x45_Stanag: CUP_30Rnd_556x45_Stanag { - initSpeed = 920; - }; - class CUP_10Rnd_127x99_M107: CA_Magazine { - initSpeed = 900; - }; - class CUP_10Rnd_762x51_CZ750: CA_Magazine { - initSpeed = 833; - }; - class CUP_10Rnd_762x51_CZ750_Tracer: CUP_10Rnd_762x51_CZ750 { - initSpeed = 833; - }; - class CUP_50Rnd_UK59_762x54R_Tracer: CA_Magazine { - initSpeed = 800; - }; - class CUP_8Rnd_9x18_Makarov_M: CA_Magazine { - initSpeed = 300; - }; - class CUP_8Rnd_9x18_MakarovSD_M: CUP_8Rnd_9x18_Makarov_M { - initSpeed = 300; - }; - class CUP_6Rnd_45ACP_M: CA_Magazine { - initSpeed = 250; - }; - class CUP_17Rnd_9x19_glock17: CA_Magazine { - initSpeed = 370; - }; - class CUP_5Rnd_86x70_L115A1: CA_Magazine { - initSpeed = 915; - }; - class CUP_20Rnd_B_765x17_Ball_M: CA_Magazine { - initSpeed = 290; - }; - class CUP_30Rnd_9x19_MP5: CA_Magazine { - initSpeed = 400; - }; }; \ No newline at end of file diff --git a/optionals/compat_cup/CfgWeapons.hpp b/optionals/compat_cup/CfgWeapons.hpp index 76d442ee53..bbd49548da 100644 --- a/optionals/compat_cup/CfgWeapons.hpp +++ b/optionals/compat_cup/CfgWeapons.hpp @@ -1,432 +1,6 @@ class CfgWeapons { - class Pistol_Base_F; - class Rifle_Base_F; - class Rifle_Long_Base_F; class Launcher_Base_F; - class CUP_hgun_Colt1911 : Pistol_Base_F { - initSpeed=-1.04; - ACE_barrelTwist=406.4; - ACE_barrelLength=127.0; - }; - class CUP_sgun_AA12 : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=457.2; - }; - class CUP_arifle_AK_Base : Rifle_Base_F { - initSpeed=-0.95467; - ACE_barrelTwist=240.03; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AK107_Base : CUP_arifle_AK_Base { - initSpeed=-1.0; - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AKS_Base : CUP_arifle_AK_Base { - initSpeed=-0.95467; - ACE_barrelTwist=199.898; - ACE_barrelLength=414.02; - }; - class CUP_arifle_AKS74U : CUP_arifle_AK_Base { - initSpeed=-0.88636; - ACE_barrelTwist=160.02; - ACE_barrelLength=210.82; - }; - class CUP_arifle_AK74; - class CUP_arifle_RPK74 : CUP_arifle_AK74 { - initSpeed=-1.0; - ACE_barrelTwist=195.072; - ACE_barrelLength=589.28; - }; - class CUP_srifle_AS50 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=736.6; - }; - class CUP_srifle_AWM_Base : Rifle_Long_Base_F { - initSpeed=-1.00547; - ACE_barrelTwist=279.4; - ACE_barrelLength=685.8; - }; - class CUP_smg_bizon : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=231.14; - }; - class CUP_hgun_Compact : Pistol_Base_F { - initSpeed=-0.97778; - ACE_barrelTwist=248.92; - ACE_barrelLength=94.996; - }; - class CUP_srifle_CZ750 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=660.4; - }; - class CUP_arifle_CZ805_Base : Rifle_Base_F { - initSpeed=-0.87283; - ACE_barrelTwist=304.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_CZ805_A1 : CUP_arifle_CZ805_Base { - initSpeed=-0.93696; - ACE_barrelTwist=304.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_CZ805_A2 : CUP_arifle_CZ805_Base { - initSpeed=-0.87283; - ACE_barrelTwist=304.8; - ACE_barrelLength=276.86; - }; - class CUP_srifle_DMR : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_hgun_Duty : Pistol_Base_F { - initSpeed=-0.97778; - ACE_barrelTwist=248.92; - ACE_barrelLength=94.996; - }; - class CUP_arifle_FNFAL : Rifle_Base_F { - initSpeed=-0.98796; - ACE_barrelTwist=304.8; - ACE_barrelLength=533.4; - }; - class CUP_arifle_G36_Base; - class CUP_arifle_G36A : CUP_arifle_G36_Base { - initSpeed=-0.99357; - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class CUP_arifle_G36K : CUP_arifle_G36A { - initSpeed=-0.90761; - ACE_barrelTwist=177.8; - ACE_barrelLength=318; - }; - class CUP_arifle_G36C : Rifle_Base_F { - initSpeed=-0.81522; - ACE_barrelTwist=177.8; - ACE_barrelLength=228; - }; - class CUP_arifle_MG36 : CUP_arifle_G36C { - initSpeed=-0.99457; - ACE_barrelTwist=177.8; - ACE_barrelLength=480; - }; - class CUP_hgun_Glock17 : Pistol_Base_F { - initSpeed=-0.9595; - ACE_barrelTwist=248.92; - ACE_barrelLength=114.046; - }; - class CUP_srifle_CZ550 : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=599.999; - }; - class CUP_srifle_ksvk : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=457.2; - ACE_barrelLength=999.998; - }; - class CUP_lmg_L7A2 : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_arifle_L85A2_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=518.16; - }; - class CUP_arifle_L86A2_Base: Rifle_Base_F { - initSpeed=-0.97826; - ACE_barrelTwist=177.8; - ACE_barrelLength=646; - }; - class CUP_lmg_L110A1 : Rifle_Long_Base_F { - initSpeed=-0.93044; - ACE_barrelTwist=177.8; - ACE_barrelLength=347.98; - }; - class CUP_srifle_LeeEnfield : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=254.0; - ACE_barrelLength=640.08; - }; - class CUP_hgun_M9 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=248.92; - ACE_barrelLength=124.46; - }; - class CUP_srifle_M14 : Rifle_Base_F { - initSpeed=-0.99160; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_arifle_M16_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=355.6; - ACE_barrelLength=508.0; - }; - class CUP_arifle_M16A4_Base; - class CUP_arifle_M4_Base : CUP_arifle_M16A4_Base { - initSpeed=-0.94565; - ACE_barrelTwist=177.8; - ACE_barrelLength=368.3; - }; - class CUP_arifle_M4A1; - class CUP_srifle_Mk12SPR : CUP_arifle_M4A1 { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_srifle_M24_des : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=285.75; - ACE_barrelLength=609.6; - }; - class CUP_lmg_M60A4 : Rifle_Long_Base_F { - initSpeed=-0.96639; - ACE_barrelTwist=304.8; - ACE_barrelLength=431.8; - }; - class CUP_srifle_M107_Base : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=736.6; - }; - class CUP_srifle_M110 : Rifle_Base_F { - initSpeed=-0.98558; - ACE_barrelTwist=279.4; - ACE_barrelLength=508.0; - }; - class CUP_lmg_M240 : Rifle_Long_Base_F { - initSpeed=-1.00600; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_lmg_M249_para : Rifle_Long_Base_F { - initSpeed=-0.96739; - ACE_barrelTwist=177.8; - ACE_barrelLength=414.02; - }; - class CUP_lmg_M249 : Rifle_Long_Base_F { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_sgun_M1014 : Rifle_Base_F { - ACE_twistDirection=0; - ACE_barrelTwist=0.0; - ACE_barrelLength=469.9; - }; - class CUP_hgun_Makarov : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=93.472; - }; - class CUP_hgun_MicroUzi : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=248.92; - ACE_barrelLength=127.0; - }; - class CUP_lmg_Mk48_Base : Rifle_Long_Base_F { - initSpeed=-0.98558; - ACE_barrelTwist=304.8; - ACE_barrelLength=501.65; - }; - class CUP_smg_MP5SD6 : Rifle_Base_F { - initSpeed=-0.9375; - ACE_barrelTwist=254.0; - ACE_barrelLength=144.78; - }; - class CUP_smg_MP5A5 : CUP_smg_MP5SD6 { - initSpeed=-1.0; - ACE_barrelTwist=254.0; - ACE_barrelLength=226.06; - }; - class CUP_smg_EVO : Rifle_Base_F { - initSpeed=-0.975; - ACE_barrelTwist=254.0; - ACE_barrelLength=195.58; - }; - class CUP_hgun_PB6P9 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=104.14; - }; - class CUP_hgun_Phantom : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=246.38; - ACE_barrelLength=119.38; - }; - class CUP_lmg_PKM : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=645.16; - }; - class CUP_lmg_Pecheneg : CUP_lmg_PKM { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=657.86; - }; - class CUP_hgun_TaurusTracker455 : Pistol_Base_F { - initSpeed=-0.92; - ACE_barrelTwist=304.8; - ACE_barrelLength=101.6; - }; - class CUP_arifle_Sa58_base; - class CUP_arifle_Sa58P : CUP_arifle_Sa58_base { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_arifle_Sa58V : CUP_arifle_Sa58P { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_arifle_Sa58RIS1 : CUP_arifle_Sa58_base { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=391.16; - }; - class CUP_hgun_SA61 : Pistol_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=406.4; - ACE_barrelLength=114.3; - }; - class CUP_sgun_Saiga12K: Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=0.0; - ACE_twistDirection=0; - ACE_barrelLength=429.26; - }; - class CUP_arifle_SCAR_L_Base; - class CUP_arifle_Mk16_CQC : CUP_arifle_SCAR_L_Base { - initSpeed=-0.84783; - ACE_barrelTwist=177.8; - ACE_barrelLength=254.0; - }; - class CUP_arifle_Mk16_STD : CUP_arifle_SCAR_L_Base { - initSpeed=-0.93696; - ACE_barrelTwist=177.8; - ACE_barrelLength=355.6; - }; - class CUP_arifle_Mk16_SV : CUP_arifle_SCAR_L_Base { - initSpeed=-0.98696; - ACE_barrelTwist=177.8; - ACE_barrelLength=457.2; - }; - class CUP_arifle_Mk17_Base; - class CUP_arifle_Mk17_CQC : CUP_arifle_Mk17_Base { - initSpeed=-0.90144; - ACE_barrelTwist=304.8; - ACE_barrelLength=330.2; - }; - class CUP_arifle_Mk17_STD : CUP_arifle_Mk17_Base { - initSpeed=-0.96154; - ACE_barrelTwist=304.8; - ACE_barrelLength=406.4; - }; - class CUP_arifle_Mk20 : CUP_arifle_Mk17_Base { - initSpeed=-0.98558; - ACE_barrelTwist=304.8; - ACE_barrelLength=508.0; - }; - class CUP_srifle_SVD : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=238.76; - ACE_barrelLength=619.76; - }; - class CUP_lmg_UK59 : Rifle_Long_Base_F { - initSpeed=-0.9625; - ACE_barrelTwist=381.0; - ACE_barrelLength=551.18; - }; - class MGun; - class CUP_DSHKM_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=381.0; - ACE_barrelLength=1069.34; - }; - class CUP_KPVT_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=454.914; - ACE_barrelLength=1346.2; - }; - class CUP_M242_W; - class CUP_KPVB_W : CUP_M242_W { - initSpeed=-1.0; - ACE_barrelTwist=454.914; - ACE_barrelLength=1346.2; - }; - class MGunCore; - class CUP_M134 : MGunCore { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=558.8; - }; - class CUP_M240_veh_W : Rifle_Long_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=304.8; - ACE_barrelLength=629.92; - }; - class CUP_PKT_W : MGun { - initSpeed=-1.0; - ACE_barrelTwist=240.03; - ACE_barrelLength=722.122; - }; - class CUP_srifle_VSSVintorez : Rifle_Base_F { - initSpeed=-0.93334; - ACE_barrelTwist=210.82; - ACE_barrelLength=200.66; - }; - class CUP_arifle_XM8_Base : Rifle_Base_F { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine : CUP_arifle_XM8_Base { - initSpeed=-0.90760; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_xm8_sharpshooter : CUP_arifle_XM8_Base { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=508.0; - }; - class CUP_arifle_xm8_SAW : CUP_arifle_XM8_Base { - initSpeed=-1.0; - ACE_barrelTwist=177.8; - ACE_barrelLength=508.0; - }; - class CUP_arifle_XM8_Compact : CUP_arifle_XM8_Base { - initSpeed=-0.81522; - ACE_barrelTwist=177.8; - ACE_barrelLength=228.6; - }; - class CUP_arifle_XM8_Railed_Base : Rifle_Base_F { - initSpeed=-0.90760; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine_FG : CUP_arifle_XM8_Base { - initSpeed=-0.90870; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class CUP_arifle_XM8_Carbine_GL : CUP_arifle_XM8_Base { - initSpeed=-0.90870; - ACE_barrelTwist=177.8; - ACE_barrelLength=317.5; - }; - class ItemCore; class InventoryOpticsItem_Base_F; diff --git a/optionals/compat_cup/config.cpp b/optionals/compat_cup/config.cpp index d013c9034a..20ae5d6911 100644 --- a/optionals/compat_cup/config.cpp +++ b/optionals/compat_cup/config.cpp @@ -11,6 +11,5 @@ class CfgPatches { }; }; -#include "CfgAmmo.hpp" #include "CfgWeapons.hpp" #include "CfgMagazines.hpp" \ No newline at end of file diff --git a/tools/make.py b/tools/make.py index 8eb8950c7f..f8a4c80886 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 # vim: set fileencoding=utf-8 : # make.py @@ -30,7 +30,7 @@ ############################################################################### -__version__ = "0.4" +__version__ = "0.7" import sys @@ -49,6 +49,7 @@ import configparser import json import traceback import time +import timeit import re from tempfile import mkstemp @@ -58,7 +59,7 @@ if sys.platform == "win32": ######## GLOBALS ######### project = "@ace" -ACE_VERSION = "3.0.0" +project_version = "3.0.0" arma3tools_path = "" work_drive = "" module_root = "" @@ -116,6 +117,19 @@ def get_directory_hash(directory): #print_yellow("Hash Value for {} is {}".format(directory,retVal)) return directory_hash.hexdigest() +def Fract_Sec(s): + temp = float() + temp = float(s) / (60*60*24) + d = int(temp) + temp = (temp - d) * 24 + h = int(temp) + temp = (temp - h) * 60 + m = int(temp) + temp = (temp - m) * 60 + sec = temp + return d,h,m,sec + #endef Fract_Sec + # Copyright (c) André Burgaud # http://www.burgaud.com/bring-colors-to-the-windows-console-with-python/ if sys.platform == "win32": @@ -372,6 +386,7 @@ def copy_optionals_for_building(mod,pbos): if (os.path.isfile(sig_path)): #print("Moving {} for processing.".format(sig_path)) shutil.move(sig_path, os.path.join(release_dir, project, "addons", sigFile_name)) + except: print_error("Error in moving") raise @@ -435,6 +450,9 @@ def cleanup_optionals(mod): continue shutil.rmtree(destination) + except FileNotFoundError: + print_yellow("{} file not found".format(file_name)) + except: print_error("Cleaning Optionals Failed") raise @@ -541,9 +559,9 @@ def addon_restore(modulePath): return True -def get_ace_version(): - global ACE_VERSION - versionStamp = ACE_VERSION +def get_project_version(): + global project_version + versionStamp = project_version #do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048 try: @@ -568,16 +586,16 @@ def get_ace_version(): raise FileNotFoundError("File Not Found: {}".format(scriptModPath)) except Exception as e: - print_error("Get_Ace_Version error: {}".format(e)) + print_error("Get_project_version error: {}".format(e)) print_error("Check the integrity of the file: {}".format(scriptModPath)) - versionStamp = ACE_VERSION + versionStamp = project_version print_error("Resetting to the default version stamp: {}".format(versionStamp)) input("Press Enter to continue...") print("Resuming build...") print_yellow("{} VERSION set to {}".format(project.lstrip("@").upper(),versionStamp)) - ACE_VERSION = versionStamp - return ACE_VERSION + project_version = versionStamp + return project_version def replace_file(filePath, oldSubstring, newSubstring): @@ -595,7 +613,7 @@ def replace_file(filePath, oldSubstring, newSubstring): def set_version_in_files(): - newVersion = ACE_VERSION # MAJOR.MINOR.PATCH.BUILD + newVersion = project_version # MAJOR.MINOR.PATCH.BUILD newVersionShort = newVersion[:-2] # MAJOR.MINOR.PATCH # Regex patterns @@ -677,7 +695,7 @@ def restore_version_files(): def get_private_keyname(commitID,module="main"): global pbo_name_prefix - aceVersion = get_ace_version() + aceVersion = get_project_version() keyName = str("{prefix}{version}-{commit_id}".format(prefix=pbo_name_prefix,version=aceVersion,commit_id=commitID)) return keyName @@ -754,7 +772,7 @@ def main(argv): """Build an Arma addon suite in a directory from rules in a make.cfg file.""" print_blue("\nmake.py for Arma, modified for Advanced Combat Environment v{}".format(__version__)) - global ACE_VERSION + global project_version global arma3tools_path global work_drive global module_root @@ -840,7 +858,7 @@ See the make.cfg file for additional build options. argv.remove("release") else: make_release_zip = False - release_version = ACE_VERSION + release_version = project_version if "target" in argv: make_target = argv[argv.index("target") + 1] @@ -863,7 +881,7 @@ See the make.cfg file for additional build options. check_external = True else: check_external = False - + if "version" in argv: argv.remove("version") version_update = True @@ -897,7 +915,7 @@ See the make.cfg file for additional build options. # Project prefix (folder path) prefix = cfg.get(make_target, "prefix", fallback="") - + # Release archive prefix zipPrefix = cfg.get(make_target, "zipPrefix", fallback=project.lstrip("@").lower()) @@ -1418,5 +1436,8 @@ See the make.cfg file for additional build options. if __name__ == "__main__": + start_time = timeit.default_timer() main(sys.argv) + d,h,m,s = Fract_Sec(timeit.default_timer() - start_time) + print("\nTotal Program time elapsed: {0:2}h {1:2}m {2:4.5f}s".format(h,m,s)) input("Press Enter to continue...") diff --git a/tools/search_privates.py b/tools/search_privates.py index 37320214fc..207c6403e0 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -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.*|IGNORE_PRIVATE_WARNING.*') + srch = re.compile('params \[.*\]|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)) diff --git a/tools/search_unused_privates.py b/tools/search_unused_privates.py index b9bdd880ce..72a0dadcea 100644 --- a/tools/search_unused_privates.py +++ b/tools/search_unused_privates.py @@ -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.*|IGNORE_PRIVATE_WARNING.*') + srch = re.compile('params \[.*\]|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))