diff --git a/.gitignore b/.gitignore index f05646fb8a..f312ddb55e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ texHeaders.bin *.swp *.swo *.biprivatekey +Thumbs.db diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..388b1f114f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +branches: + only: + - master +language: python +python: + - "3.4" +before_script: + - pip install pygithub + - pip install pygithub3 +script: + - python3 tools/deploy.py +env: + global: + - secure: "KcJQbknBOdC5lA4nFGKPXVRVIGLDXDRzC8XkHuXJCE9pIR/wbxbkvx8fHKcC6SC9eHgzneC3+o4m4+CjIbVvIwDgslRbJ8Y59i90ncONmdoRx1HUYHwuYWVZm9HJFjCsIbrEqhSyyKS+PB3WZVOLbErtNHsgS8f43PTh5Ujg7Vg=" diff --git a/AUTHORS.txt b/AUTHORS.txt index 366664efbd..737bfb590b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -18,26 +18,37 @@ Kieran NouberNou PabstMirror Ruthberg +SilentSpike tpM ViperMaul VKing Walter Pearce # CONTRIBUTORS -11RDP-LoupVert [BIG]Bull +11RDP-LoupVert ACCtomeek +adam3adam Adanteh aeroson Aggr094 +alef +Aleksey EpMAK Yermakov Alganthe Anthariel +Asgar Serran +Bla1337 +BlackPixxel BlackQwar Brakoviejo Brisse +BullHorn Clon1998 Codingboy +Coren Crusty +Dharma Bellamkonda +Dimaslg eRazeri evromalarkey Falke75 @@ -47,49 +58,46 @@ Filip Basara FreeZbe geraldbolso1899 Ghost +Gianmarco Varriale (TeamNuke) GieNkoV gpgpgpgp Grzegorz -Gianmarco Varriale (TeamNuke) Hamburger SV Harakhti havena Hawkins -jokoho48 +jokoho482 ` Jonpas +Kavinsky Kllrt +legman Legolasindar "Viper" licht-im-Norden87 +Macusercom MarcBook meat Michail Nikolaev nic547 +nikolauska nomisum +OnkelDisMaster oscarmolinadev pokertour +Professor rakowozz +ramius86 Raspu86 Riccardo Petricca Robert Boklahánics -ramius86 +ruPaladin simon84 Sniperwolf572 +SzwedzikPL Tachi Toaster Tonic Tourorist Valentin Torikian -zGuba -Aleksey EpMAK Yermakov -ruPaladin -BlackPixxel -Asgar Serran -Kavinsky -Coren -OnkelDisMaster -Dimaslg VyMajoris(W-Cephei) -Bla1337 -nikolauska -adam3adam -Professor +Winter +zGuba diff --git a/README.md b/README.md index 4ed84011bf..72b1336b57 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,23 @@

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

diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 5aa9a66c0c..dd19f1d0d4 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/ace_break_line.dll b/ace_break_line.dll index 0379fd6f34..482486ddd3 100644 Binary files a/ace_break_line.dll and b/ace_break_line.dll differ diff --git a/ace_clipboard.dll b/ace_clipboard.dll index 4f77d63f1f..5b4ac1c537 100644 Binary files a/ace_clipboard.dll and b/ace_clipboard.dll differ diff --git a/ace_fcs.dll b/ace_fcs.dll index 4d8790b150..919a4d0e5b 100644 Binary files a/ace_fcs.dll and b/ace_fcs.dll differ diff --git a/ace_medical.dll b/ace_medical.dll new file mode 100644 index 0000000000..1f4f71d5ca Binary files /dev/null and b/ace_medical.dll differ diff --git a/ace_parse_imagepath.dll b/ace_parse_imagepath.dll new file mode 100644 index 0000000000..33264959a8 Binary files /dev/null and b/ace_parse_imagepath.dll differ diff --git a/addons/advanced_ballistics/$PBOPREFIX$ b/addons/advanced_ballistics/$PBOPREFIX$ new file mode 100644 index 0000000000..1ab65b7c32 --- /dev/null +++ b/addons/advanced_ballistics/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\advanced_ballistics \ No newline at end of file diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index 67bc51511e..757385deb3 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -5,23 +5,29 @@ class ACE_Settings { typeName = "BOOL"; value = 0; }; - class GVAR(alwaysSimulateForSnipers) { - displayName = "Always Enabled For Snipers"; - description = "Always enables advanced ballistics when high power optics are used"; + class GVAR(simulateForSnipers) { + displayName = "Enabled For Snipers"; + description = "Enables advanced ballistics for non local snipers (when using high power optics)"; typeName = "BOOL"; value = 1; }; - class GVAR(disabledInFullAutoMode) { - displayName = "Disabled In FullAuto Mode"; - description = "Disables the advanced ballistics during full auto fire"; + class GVAR(simulateForGroupMembers) { + displayName = "Enabled For Group Members"; + description = "Enables advanced ballistics for non local group members"; typeName = "BOOL"; value = 0; }; - class GVAR(onlyActiveForLocalPlayers) { - displayName = "Disabled For Non Local Players"; - description = "Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer)"; + 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)"; typeName = "BOOL"; - value = 1; + value = 0; + }; + class GVAR(disabledInFullAutoMode) { + displayName = "Disabled In FullAuto Mode"; + description = "Disables advanced ballistics during full auto fire"; + typeName = "BOOL"; + value = 0; }; /* // TODO: We currently do not have firedEHs on vehicles class GVAR(vehicleGunnerEnabled) { diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index fda4b9a8ff..27ccb2377b 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Advanced Ballistics"; + displayName = CSTRING(DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); @@ -12,29 +12,35 @@ class CfgVehicles { author = "Ruthberg"; class Arguments { class enabled { - displayName = "Advanced Ballistics"; - description = "Enables advanced ballistics"; + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); typeName = "BOOL"; defaultValue = 0; }; - class alwaysSimulateForSnipers { - displayName = "Always Enabled For Snipers"; - description = "Always enables advanced ballistics when high power optics are used"; + class simulateForSnipers { + displayName = CSTRING(simulateForSnipers_DisplayName); + description = CSTRING(simulateForSnipers_Description); typeName = "BOOL"; defaultValue = 1; }; + class simulateForGroupMembers { + displayName = CSTRING(simulateForGroupMembers_DisplayName); + description = CSTRING(simulateForGroupMembers_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class simulateForEveryone { + displayName = CSTRING(simulateForEveryone_DisplayName); + description = CSTRING(simulateForEveryone_Description); + typeName = "BOOL"; + defaultValue = 0; + }; class disabledInFullAutoMode { - displayName = "Disabled In FullAuto Mode"; - description = "Disables the advanced ballistics during full auto fire"; + displayName = CSTRING(disabledInFullAutoMod_DisplayName); + description = CSTRING(disabledInFullAutoMod_Description); typeName = "BOOL"; defaultValue = 0; }; - class onlyActiveForLocalPlayers { - displayName = "Disabled For Non Local Players"; - description = "Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer)"; - typeName = "BOOL"; - defaultValue = 1; - }; /* // TODO: We currently do not have firedEHs on vehicles class vehicleGunnerEnabled { displayName = "Enabled For Vehicle Gunners"; @@ -44,35 +50,38 @@ class CfgVehicles { }; */ class ammoTemperatureEnabled { - displayName = "Enable Ammo Temperature Simulation"; - description = "Muzzle velocity varies with ammo temperature"; + displayName = CSTRING(ammoTemperatureEnabled_DisplayName); + description = CSTRING(ammoTemperatureEnabled_Description); typeName = "BOOL"; defaultValue = 1; }; class barrelLengthInfluenceEnabled { - displayName = "Enable Barrel Length Simulation"; - description = "Muzzle velocity varies with barrel length"; + displayName = CSTRING(barrelLengthInfluenceEnabled_DisplayName); + description = CSTRING(barrelLengthInfluenceEnabled_Description); typeName = "BOOL"; defaultValue = 1; }; class 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"; defaultValue = 1; }; class simulationInterval { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = CSTRING(simulationInterval_DisplayName); + description = CSTRING(simulationInterval_Description); typeName = "NUMBER"; defaultValue = 0.0; }; class 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 = "NUMBER"; defaultValue = 3000; }; }; + class ModuleDescription { + description = CSTRING(Description); + }; }; -}; +}; \ No newline at end of file diff --git a/addons/advanced_ballistics/RscTitles.hpp b/addons/advanced_ballistics/RscTitles.hpp index b62af875d2..6deaf0a058 100644 --- a/addons/advanced_ballistics/RscTitles.hpp +++ b/addons/advanced_ballistics/RscTitles.hpp @@ -1,17 +1,13 @@ -class RscTitles -{ - class RscTurretDial - { +class RscTitles { + class RscTurretDial { idd=-1; onLoad="with uiNameSpace do { RscTurretDial = _this select 0 };"; movingEnable=0; duration=5; fadeIn="false"; fadeOut="false"; - class controls - { - class RscTurretDial - { + class controls { + class RscTurretDial { idc=132949; type=0; style=128; @@ -28,18 +24,15 @@ class RscTitles }; }; - class RscProtractor - { + class RscProtractor { idd=-1; onLoad="with uiNameSpace do { RscProtractor = _this select 0 };"; movingEnable=0; duration=60; fadeIn="false"; fadeOut="false"; - class controls - { - class RscProtractorBase - { + class controls { + class RscProtractorBase { idc=132950; type=0; style=48; @@ -54,8 +47,7 @@ class RscTitles sizeEx=0.027; text=""; }; - class RscProtractorMarker : RscProtractorBase - { + class RscProtractorMarker : RscProtractorBase { idc=132951; }; }; diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 8efdd6799b..b199acb9e5 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -4,24 +4,11 @@ GVAR(currentbulletID) = -1; -GVAR(bulletDatabase) = []; -GVAR(bulletDatabaseStartTime) = []; -GVAR(bulletDatabaseSpeed) = []; -GVAR(bulletDatabaseFrames) = []; -GVAR(bulletDatabaseLastFrame) = []; -GVAR(bulletDatabaseHDeflect) = []; -GVAR(bulletDatabaseSpinDrift) = []; -GVAR(bulletDatabaseOccupiedIndices) = []; -GVAR(bulletDatabaseFreeIndices) = []; - -GVAR(WindInfo) = false; -GVAR(WindInfoStart) = time; - GVAR(Protractor) = false; -GVAR(ProtractorStart) = time; +GVAR(ProtractorStart) = ACE_time; GVAR(currentGrid) = 0; -GVAR(INIT_MESSAGE_ENABLED) = false; +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 1d19a9c492..12018ad412 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -6,12 +6,12 @@ PREP(calculateAmmoTemperatureVelocityShift); PREP(calculateAtmosphericCorrection); PREP(calculateBarrelLengthVelocityShift); PREP(calculateRetardation); -PREP(calculateRoughnessLength); PREP(calculateStabilityFactor); -PREP(calculateWindSpeed); PREP(displayProtractor); PREP(handleFired); PREP(initializeTerrainExtension); PREP(initModuleSettings); +PREP(readAmmoDataFromConfig); +PREP(readWeaponDataFromConfig); ADDON = true; diff --git a/addons/advanced_ballistics/config.cpp b/addons/advanced_ballistics/config.cpp index 1a2187783b..3f974b18df 100644 --- a/addons/advanced_ballistics/config.cpp +++ b/addons/advanced_ballistics/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_ballistics", "ace_weather", "ace_modules"}; + requiredAddons[] = {"ace_ballistics", "ace_weather"}; author[] = {"Ruthberg"}; authorUrl = "https://github.com/ulteq"; VERSION_CONFIG; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index c92e679a66..28df9d1d97 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -4,7 +4,7 @@ * Calculates the ammo temperature induced muzzle velocity shift * * Arguments: - * 0: ammo - classname + * 0: muzzle velocity shift lookup table - m/s * 1: temperature - degrees celcius * * Return Value: @@ -15,17 +15,11 @@ */ #include "script_component.hpp" -private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; -_ammo = _this select 0; -_temperature = _this select 1; +private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; +_muzzleVelocityShiftTable = _this select 0; +_temperature = _this select 1; -_muzzleVelocityTable = []; - -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { - _muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); -}; - -if (count _muzzleVelocityTable != 11) exitWith { 0 }; +if (count _muzzleVelocityShiftTable != 11) exitWith { 0 }; _temperatureIndexA = floor((_temperature + 15) / 5); _temperatureIndexA = 0 max _temperatureIndexA; @@ -37,6 +31,6 @@ _temperatureIndexB = _temperatureIndexB min 10; _temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); -_muzzleVelocityShift = (_muzzleVelocityTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityTable select _temperatureIndexB) * _temperatureRatio; +_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio; _muzzleVelocityShift diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index b4cbd5bdc0..de037f49bc 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -4,9 +4,10 @@ * Calculates the muzzle velocity shift caused by different barrel lengths * * Arguments: - * 0: ammo - classname - * 0: weapon - classname - * 1: muzzle velocity - m/s + * 0: barrel length - mm + * 1: muzzle velocity lookup table - m/s + * 2: barrel length lookup table - mm + * 3: muzzle velocity - m/s * * Return Value: * 0: muzzle velocity shift - m/s @@ -16,25 +17,13 @@ */ #include "script_component.hpp" -private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; -_ammo = _this select 0; -_weapon = _this select 1; -_muzzleVelocity = _this select 2; - -_barrelLength = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelLength"); +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; if (_barrelLength == 0) exitWith { 0 }; - -_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"); -}; - 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 }; diff --git a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf index 81b71aeb3b..9b205c3ec2 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateStabilityFactor.sqf @@ -4,10 +4,10 @@ * Calculates the stability factor of a bullet * * Arguments: - * 0: caliber - inches - * 1: bullet length - inches - * 2: bullet mass - grains - * 3: barrel twist - inches + * 0: caliber - mm + * 1: bullet length - mm + * 2: bullet mass - grams + * 3: barrel twist - mm * 4: muzzle velocity shift - m/s * 5: temperature - degrees celcius * 6: barometric Pressure - hPA @@ -17,7 +17,8 @@ * * 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; @@ -31,15 +32,14 @@ _barometricPressure = _this select 6; _t = _barrelTwist / _caliber; _l = _bulletLength / _caliber; -_stabilityFactor = 30 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); +_stabilityFactor = 7587000 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); -_muzzleVelocity = _muzzleVelocity * 3.2808399; -if (_muzzleVelocity > 1120) then { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 2800) ^ (1/3); +if (_muzzleVelocity > 341.376) then { + _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 853.44) ^ (1/3); } else { - _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 1120) ^ (1/3); + _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 341.376) ^ (1/3); }; -_stabilityFactor = _stabilityFactor * (_temperature + 273) / (15 + 273) * 1013.25 / _barometricPressure; +_stabilityFactor = _stabilityFactor * KELVIN(_temperature) / KELVIN(15) * 1013.25 / _barometricPressure; _stabilityFactor diff --git a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf b/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf deleted file mode 100644 index e7b0a322e8..0000000000 --- a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Author: Ruthberg - * - * Calculates the true wind speed at a given world position - * - * Arguments: - * 0: _this - world position - * - * Return Value: - * 0: wind speed - m/s - * - * Public: No - */ -#include "script_component.hpp" - -private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; - -fnc_polar2vect = { - private ["_mag2D"]; - _mag2D = (_this select 0) * cos((_this select 2)); - [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; -}; - -_windSpeed = vectorMagnitude ACE_wind; -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - -// Wind gradient -if (_windSpeed > 0.05) then { - _height = (ASLToATL _this) select 2; - _height = 0 max _height min 20; - if (_height < 20) then { - _roughnessLength = _this call FUNC(calculateRoughnessLength); - _windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength); - }; -}; - -// Terrain effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - _windSpeed = _newWindSpeed; -}; - -// Obstacle effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; - _windSpeed = _newWindSpeed; -}; -_windSpeed = 0 max _windSpeed; - -_windSpeed diff --git a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf index 5fbdf2f12a..1a4c344b2e 100644 --- a/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf +++ b/addons/advanced_ballistics/functions/fnc_displayProtractor.sqf @@ -45,12 +45,12 @@ GVAR(Protractor) = true; 1 cutRsc ["RscProtractor", "PLAIN", 1, false]; - __ctrl1 ctrlSetScale 0.75; + __ctrl1 ctrlSetScale 1; __ctrl1 ctrlCommit 0; __ctrl1 ctrlSetText QUOTE(PATHTOF(UI\protractor.paa)); __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; - __ctrl2 ctrlSetScale 0.75; + __ctrl2 ctrlSetScale 1; __ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)]; __ctrl2 ctrlCommit 0; __ctrl2 ctrlSetText QUOTE(PATHTOF(UI\protractor_marker.paa)); diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index e63b1d7dfc..2c3488f92d 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; +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; @@ -35,32 +35,41 @@ if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; if (underwater _unit) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; -if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then { - if (GVAR(alwaysSimulateForSnipers)) then { - // The shooter is non local +if (!GVAR(simulateForEveryone) && !(local _unit)) then { + // The shooter is non local + _abort = true; + if (GVAR(simulateForSnipers)) then { if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { _opticsName = (primaryWeaponItems _unit) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper }; - } else { - _abort = true; + }; + if (GVAR(simulateForGroupMembers) && _abort) then { + _abort = (group ACE_player) != (group _unit); }; }; //if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles -if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; +if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; if (_abort || !(GVAR(extensionAvailable))) exitWith { - [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); + [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; -_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); +_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; +if (isNil {_AmmoCacheEntry}) then { + _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); +}; +_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; +if (isNil {_WeaponCacheEntry}) then { + _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); +}; _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + _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; @@ -69,8 +78,8 @@ if (GVAR(barrelLengthInfluenceEnabled)) then { }; if (GVAR(ammoTemperatureEnabled)) then { - _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); - _muzzleVelocityShift = [_ammo, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); + _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); + _muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; @@ -85,60 +94,27 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { _opticsName = (primaryWeaponItems ACE_player) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _bulletTraceVisible = _opticType == 2; }; }; }; -_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber"); -_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletLength"); -_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletMass"); -_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelTwist"); +_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 = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); + _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); }; -_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; - }; -}; - -_transonicStabilityCoef = 0.5; -if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { - _transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); -}; - -_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; - }; -}; -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"); -}; - 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), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(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), _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(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(ACE_time), ACE_time - floor(ACE_time)]; [{ private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; @@ -157,10 +133,10 @@ GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; [_this select 1] call cba_fnc_removePerFrameHandler; }; - if (_bulletTraceVisible && _bulletSpeed > 600) then { - drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; + 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,"","",""]; }; - 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(time), time - floor(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, floor(ACE_time), ACE_time - floor(ACE_time)]); }, GVAR(simulationInterval), [_bullet, _caliber, _bulletTraceVisible, GVAR(currentbulletID)]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf index ba7ea31a8f..186c0d0649 100644 --- a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf +++ b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf @@ -26,9 +26,10 @@ if !(_activated) exitWith {}; [_logic, QGVAR(ammoTemperatureEnabled), "ammoTemperatureEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(barrelLengthInfluenceEnabled), "barrelLengthInfluenceEnabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bulletTraceEnabled), "bulletTraceEnabled"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(onlyActiveForLocalPlayers), "onlyActiveForLocalPlayers"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(simulateForEveryone), "simulateForEveryone"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(disabledInFullAutoMode), "disabledInFullAutoMode"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(alwaysSimulateForSnipers), "alwaysSimulateForSnipers"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(simulateForSnipers), "simulateForSnipers"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(simulateForGroupMembers), "simulateForGroupMembers"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 3930526433..b2fc7ba084 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -18,11 +18,11 @@ if (!GVAR(extensionAvailable)) exitWith {}; private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCells", "_x", "_y", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"]; -_initStartTime = time; +_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(INIT_MESSAGE_ENABLED)) then { + if (GVAR(initMessageEnabled)) then { systemChat "AdvancedBallistics: Terrain already initialized"; }; }; @@ -40,8 +40,8 @@ GVAR(currentGrid) = 0; _initStartTime = _args select 2; if (GVAR(currentGrid) >= _gridCells) exitWith { - if (GVAR(INIT_MESSAGE_ENABLED)) then { - systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(time - _initStartTime)]; + if (GVAR(initMessageEnabled)) then { + systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; }; [_this select 1] call cba_fnc_removePerFrameHandler; }; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf new file mode 100644 index 0000000000..10e7e60df2 --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -0,0 +1,64 @@ +/* + * Author: Ruthberg + * + * Reads the ammo class config and updates the config cache + * + * Arguments: + * 0: ammo - classname + * + * Return Value: + * 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; +_ammo = _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"); +}; +_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; + }; +}; +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"); +}; + +_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; + +uiNamespace setVariable [format[QGVAR(%1), _ammo], _result]; + +_result diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf new file mode 100644 index 0000000000..8a1a29f7b0 --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -0,0 +1,34 @@ +/* + * Author: Ruthberg + * + * Reads the weapon class config and updates the config cache + * + * Arguments: + * 0: weapon - classname + * + * Return Value: + * 0: [_barrelTwist, _twistDirection, _barrelLength] + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; +_weapon = _this; + +_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "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; + }; +}; +_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); + +_result = [_barrelTwist, _twistDirection, _barrelLength]; + +uiNamespace setVariable [format[QGVAR(%1), _weapon], _result]; + +_result diff --git a/addons/advanced_ballistics/initKeybinds.sqf b/addons/advanced_ballistics/initKeybinds.sqf index cddf47877a..102107dadc 100644 --- a/addons/advanced_ballistics/initKeybinds.sqf +++ b/addons/advanced_ballistics/initKeybinds.sqf @@ -1,4 +1,4 @@ -["ACE3 Equipment", QGVAR(ProtractorKey), localize "STR_ACE_AdvancedBallistics_ProtractorKey", +["ACE3 Equipment", QGVAR(ProtractorKey), localize LSTRING(ProtractorKey), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/advanced_ballistics/script_component.hpp b/addons/advanced_ballistics/script_component.hpp index 3334bb3207..757330a5d0 100644 --- a/addons/advanced_ballistics/script_component.hpp +++ b/addons/advanced_ballistics/script_component.hpp @@ -21,6 +21,5 @@ #define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 #define STD_AIR_DENSITY_ICAO 1.22498 #define STD_AIR_DENSITY_ASM 1.20885 -#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h)) #define EXTENSION_REQUIRED_VERSION "1.0" diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 0de8071754..5c6dd58d6e 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -1,7 +1,7 @@  - - + + Show Wind Info Pokaż inf. o wietrze Mostra indicazioni del vento @@ -13,7 +13,7 @@ Zobrazit informace o větru Mostrar Informação do Vento - + Show Protractor Pokaż kątomierz Mostra il rapportatore @@ -25,5 +25,194 @@ Zobrazit úhloměr Mostrar Transferidor + + Advanced Ballistics + Zaawansowana balistyka + Balística avanzada + Erweiterte Ballistik + Pokročilá balistika + Balística avançada + + + Advanced Ballistics + Zaawansowana balistyka + Balística avanzada + Erweiterte Ballistik + Pokročilá balistika + Balística avançada + + + Enables advanced ballistics + Aktywuje zaawansowaną balistykę + Activa la balística avanzada + Aktiviert die erweiterte Ballistik + Aktivuje pokročilou balistiku + Ativa balística avançada + + + Enabled For Snipers + Activada para francotiradores + Akt. dla snajperów + Für Scharfschützen aktiviert + Povoleno pro odstřelovače + Ativar para caçadores + + + Enables advanced ballistics for non local snipers (when using high power optics) + Activa la balística avanzada para francotiradores no locales (cuando se usa una mira telescópica) + Aktywuje zaawansowaną balistykę dla nielokalnych snajperów (kiedy używają optyki) + Aktiviert die erweiterte Ballistik für nicht lokale Scharfschützen (bei Benutzung von Optiken mit starker Vergrößerung) + Aktivuje pokročilou balistiku pro nelokální odstřelovače (když používá výkonnou optiku) + Ativa balística avançada para caçadores não locais (quando usando miras telescópicas) + + + Enabled For Group Members + Activada para miembros de grupo + Akt. dla czł. grupy + Für Gruppenmitglieder aktiviert + Povoleno pro členy skupiny + Ativada para membros do grupo + + + Enables advanced ballistics for non local group members + Activada la balística avanzada para miembros de grupo no locales + Aktywuje zaawansowaną balistykę dla nielokalnych członków grupy + Aktiviert die erweiterte Ballistik für nicht lokale Gruppenmitglieder + Aktivuje pokročilou balistiku pro nelokální členy skupiny + Ativa balística avançada para membros de grupo não locais + + + Enabled For Everyone + Activada para todos + Akt. dla wszystkich + Für jeden aktiviert + Povoleno pro všechny + Ativada para todos + + + Enables advanced ballistics for all non local players (enabling this may degrade performance during heavy firefights in multiplayer) + Activada la balística avanzada para todos los jugadores no locales (activarlo puede degradar el rendimiento durante grandes tiroteos en multijugador). + Aktywuje zaawansowaną balistykę dla wszystkich nielokalnych graczy (aktywacja tej opcji może spodowować spory spadek wydajności podczas ciężkiej wymiany ognia) + Aktiviert die erweiterte Ballistik für alle nicht lokalen Spieler (das Aktivieren dieser Funktion kann zur Beeinträchtigung des Spielerlebnisses im Multiplayer führen) + Aktivovat pokročilou balistiku pro všechny nelokální hráče (aktivace této možnosti způsobuje pokles snímu za sekundu během těžké přestřelky v multiplayeru) + Ativa balística avançada para todos os jogadores não locais (ativando isso pode degradar a performance durante troca de tiros intensas no multiplayer) + + + Always Enabled For Group Members + Zawsze akt. dla czł. grupy + Siempre activada para miembros de grupo + Für Gruppenmitglieder immer aktiviert + Vždy povoleno pro členy skupiny + Sempre ativada para membros do grupo + + + Always enables advanced ballistics when a group member fires + Aktywuje zaawansowaną balistykę dla wszystkich członków grupy + Activada la balística avanzada siempre cuando miembros de grupo disparan + Aktiviert die erweiterte Ballistik immer, wenn ein Gruppenmitglied schießt + Aktivuje pokročilou balistiku pro členy skupiny + Sempre ative balística avançada quando um membro do grupo disparar + + + Disabled In FullAuto Mode + Wył. podczas ognia auto. + Desactivada en modo automático + Beim vollautomatischen Feuern deaktiviert + Zakázáno v automatickém režimu střelby + Desabilitar no modo automático + + + Disables the advanced ballistics during full auto fire + Dezaktywuje zaawansowaną balistykę podczas ognia automatycznego + Desactivada la balística avanzada durante el fuego automático + Deaktiviert die erweiterte Ballistik beim vollautomatischen Feuern + Zákáže pokročilou balistiku během střelby v režimu automat + Desabilitar a balística avançada durante fogo automático + + + Enable Ammo Temperature Simulation + Symulacja temp. amunicji + Activar simulación de temperatura de munición + Simulation der Munitionstemperatur aktivieren + Povolit simulaci teploty munice + Ativar simulação de temperatura de munição + + + Muzzle velocity varies with ammo temperature + Prędkość wylotowa pocisku jest zależna od temperatury amunicji + La velocidad de salida varía con la temperatura de la munición + Munitionstemperatur hat Einfluss auf die Mündungsgeschwindigkeit + Úsťová rychlost je závislá na teplotě munice + A velocidade de saída varia com a temperatura da munição + + + Enable Barrel Length Simulation + Symulacja długości lufy + Habilitar la simulación de longitud del cañón + Simulation der Lauflänge aktivieren + Povolit simulaci délky hlavně + Ativar a simulação de comprimento do cano + + + Muzzle velocity varies with barrel length + Prędkość wylotowa pocisku jest zależna od długości lufy + La velocidad de salidal varía con la longitud del cañón + Lauflänge beeinflusst Mündungsgeschwindigkeit + Úsťová rychlost je závislá na délce hlavně + A velocidade de saída caria com o comprimento do cano + + + Enable Bullet Trace Effect + Efekt smugi pocisku + Activar el efecto trazador de la bala + Geschossspureffekt aktivieren + Povolit efekt trasírek + Ativa efeito traçante de projétil + + + Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics) + Aktywuje efekt smugi pocisku dla pocisków wysokokalibrowych (widoczne tylko podczas patrzenia przez optykę) + Activa el efecto trazador de la balas de gran calibre (solo visible cuando se mira a través de una mira telescópica) + Aktiviere Geschossspureffekt für hohe Kaliber (bei Benutzung von Optiken mit starker Vergrößerung) + Aktivuje efekt trasírek z vysokokaliberních zbraní (viditelné pouze skrze výkonnou optiku) + Ativa o efeito traçante de projétil para projéteis de alto calibre (somente visível quando observado por miras telescópicas) + + + Simulation Interval + Interwał symulacji + Intervalo de simulación + Simulationsintervall + Interval simulace + Intervalo da simulação + + + Defines the interval between every calculation step + Określa interwał pomiędzy każdym krokiem kalkulacji + Define el intervalo entre cada cálculo + Legt das Intervall zwischen den Berechnungsschritten fest + Určuje interval mezi každým výpočtem + Define o intervalo entre cada cálculo + + + Simulation Radius + Zasięg symulacji + Radio de simulación + Simulationsradius + Rozsah simulace + Raio de simulação + + + Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles + Określa obszar naokoło gracza (w metrach), na którym zaawansowana balistyka jest aplikowana dla pocisków + Define el radio alrededor del jugador (en metros) en el cual se aplica la balística avanzada a los proyectiles + Gibt den Radius (in Metern) um den Spieler an, bei dem die erweiterte Ballistik auf Geschosse angewendet wird + Určuje oblast kolem hráče (v metrech), kde je pokročilá balistika použita na projektil + Define o raio ao redor do jogador (em metros) onde a balística avançada será aplicada aos projéteis + + + Moduł ten pozwala aktywować zaawansowaną balistykę biorącą przy obliczeniach trajektorii lotu pocisku pod uwagę takie rzeczy jak temperatura powietrza, ciśnienie atmosferyczne, wilgotność powietrza, siły Coriolisa i Eotvosa, grawitację a także broń z jakiej wykonywany jest strzał oraz rodzaj amunicji. Wszystko to sprowadza się na bardzo dokładne odwzorowanie balistyki. + Tento modul umožňuje aktivovat pokročilou balistiku, která vypočítává trajektorii kulky a bere do úvahy věci jako je teplota vzduchu, atmosférický tlak, vlhkost vzduchu, gravitaci, typ munice a zbraň, ze které je náboj vystřelen. To vše přispívá k velmi přesné balistice. + Este módulo permite que você ative cálculos de balística avançada, fazendo a trajetória do projétil levar em consideração coisas como temperatura do ar, pressão atmosférica, umidade, força de Coriolis, a gravidade, o modelo da arma no qual o disparo é realizado e o tipo de munição. Tudo isso acrescenta-se a um balística muito precisa. + \ No newline at end of file diff --git a/addons/ai/CfgAISkill.hpp b/addons/ai/CfgAISkill.hpp index dfa0299509..c01b5eb96e 100644 --- a/addons/ai/CfgAISkill.hpp +++ b/addons/ai/CfgAISkill.hpp @@ -21,7 +21,8 @@ class CfgAISkill { courage[] = {0,0, 1,0.7}; // {0,0,1,1}; endurance[] = {0,0, 1,0.7}; // {0,0,1,1}; general[] = {0,0, 1,0.9}; // {0,0,1,1}; - reloadSpeed[] = {0,0, 1,0.8}; // {0,0,1,1}; + // apparently breaks rapid firing in single fire mode for players + //reloadSpeed[] = {0,0, 1,0.8}; // {0,0,1,1}; spotDistance[] = {0,0, 1,0.9}; // {0,0.2,1,0.4}; spotTime[] = {0,0, 1,0.7}; // {0,0,1,0.7}; }; diff --git a/addons/ai/script_component.hpp b/addons/ai/script_component.hpp index 6097849c6b..7add51c06c 100644 --- a/addons/ai/script_component.hpp +++ b/addons/ai/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT ai -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_AI #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_AI #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp index 559b8dc2e1..9839149b3d 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -176,8 +176,8 @@ class CfgVehicles { }; class CargoRamp_Open: DoorL1_Open { userActionID = 52; - displayName = "$STR_ACE_Aircraft_OpenCargoRamp"; - textToolTip = "$STR_ACE_Aircraft_OpenCargoRamp"; + displayName = CSTRING(OpenCargoRamp); + textToolTip = CSTRING(OpenCargoRamp); position = "action_cargoramp"; radius = 3.0; condition = "this animationPhase ""cargoramp_open"" < 0.5 AND Alive(this)"; @@ -185,8 +185,8 @@ class CfgVehicles { }; class CargoRamp_Close: DoorL1_Close { userActionID = 55; - displayName = "$STR_ACE_Aircraft_CloseCargoRamp"; - textToolTip = "$STR_ACE_Aircraft_CloseCargoRamp"; + displayName = CSTRING(CloseCargoRamp); + textToolTip = CSTRING(CloseCargoRamp); position = "action_cargoramp"; radius = 3.0; condition = "this animationPhase ""cargoramp_open"" > 0.5 AND Alive(this)"; diff --git a/addons/aircraft/CfgWeapons.hpp b/addons/aircraft/CfgWeapons.hpp index dc84c9f04a..ac8a759bd3 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -29,7 +29,7 @@ class CfgWeapons { reloadTime = 0.1; }; class Burst: Mode_Burst { - displayName = "$STR_ACE_Aircraft_CMFlareLauncher_Burst_Name"; + displayName = CSTRING(CMFlareLauncher_Burst_Name); }; }; @@ -50,12 +50,12 @@ class CfgWeapons { }; class ACE_gatling_20mm_Comanche: gatling_20mm { - displayName = "$STR_ACE_Aircraft_gatling_20mm_Name"; + displayName = CSTRING(gatling_20mm_Name); class manual: manual { reloadTime = 0.04; dispersion = 0.006; - displayName = "$STR_ACE_Aircraft_gatling_20mm_Name"; + displayName = CSTRING(gatling_20mm_Name); }; class close: close { reloadTime = 0.04; diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 14ca7ef7cd..26a4605910 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -891,9 +891,12 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class OpticsIn { - class WideUnstabalized - { - opticsDisplayName = "WU"; + delete Narrow; + delete Medium; + delete Wide; + + class ACE_WideUnstabilized { + opticsDisplayName = "W NS"; initAngleX = 0; minAngleX = -35; maxAngleX = 10; @@ -910,8 +913,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Wide - { + class ACE_Wide: ACE_WideUnstabilized { opticsDisplayName = "W"; initAngleX = 0; minAngleX = -35; @@ -929,8 +931,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Medium: Wide - { + class ACE_Medium: ACE_Wide { opticsDisplayName = "M"; initFov = 0.093; minFov = 0.093; @@ -940,8 +941,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; - class Narrow: Wide - { + class ACE_Narrow: ACE_Wide { opticsDisplayName = "N"; initFov = 0.029; minFov = 0.029; @@ -952,8 +952,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; - class Narrower: Wide - { + class ACE_Narrower: ACE_Wide { opticsDisplayName = "Z"; initFov = 0.01; minFov = 0.01; diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 1dd01e08ab..e917ca7e9d 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -34,7 +34,7 @@ Otevřít nákladní prostor Rakodórámpa nyitása Открыть грузовой отсек - Apri la porta del cargo + Apri la rampa di carico Abrir porta de carga @@ -46,7 +46,7 @@ Zavřít nákladní prostor Rakodórámpa zárása Закрыть грузовой отсек - Chiudi la porta del cargo + Chiudi la rampa di carico Fechar porta de carga diff --git a/addons/apl/LWTS_optic.p3d b/addons/apl/LWTS_optic.p3d new file mode 100644 index 0000000000..874bd9051f Binary files /dev/null and b/addons/apl/LWTS_optic.p3d differ diff --git a/addons/apl/data/Jezek_kov.rvmat b/addons/apl/data/Jezek_kov.rvmat new file mode 100644 index 0000000000..d2133e6b5a --- /dev/null +++ b/addons/apl/data/Jezek_kov.rvmat @@ -0,0 +1,79 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={1.000000,1.000000,1.000000,1.000000}; +specularPower=83.900002; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 { + texture="z\ace\addons\apl\data\jezek_texture_NOHQ.tga"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform + { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 { + texture="z\ace\addons\apl\data\jezek_texture_SMDI.tga"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 { + texture="#(ai,32,128,1)fresnel(1.85,0.64)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 { + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/addons/apl/data/barbwire_a_co.paa b/addons/apl/data/barbwire_a_co.paa new file mode 100644 index 0000000000..1809c2c08e Binary files /dev/null and b/addons/apl/data/barbwire_a_co.paa differ diff --git a/addons/apl/data/barbwire_a_nohq.paa b/addons/apl/data/barbwire_a_nohq.paa new file mode 100644 index 0000000000..5612dc460a Binary files /dev/null and b/addons/apl/data/barbwire_a_nohq.paa differ diff --git a/addons/apl/data/barbwire_a_ns.rvmat b/addons/apl/data/barbwire_a_ns.rvmat new file mode 100644 index 0000000000..0a6ad7c316 --- /dev/null +++ b/addons/apl/data/barbwire_a_ns.rvmat @@ -0,0 +1,78 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={1.000000,1.000000,1.000000,0.000000}; +specularPower=16.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 { + texture="z\ace\addons\apl\data\BarbWire_A_NOHQ.tga"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 { + texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 { + texture="#(argb,8,8,3)color(1,1,1,1,AS)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 { + texture="#(argb,8,8,3)color(0,0,1,1,SMDI)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 { + texture="#(ai,32,128,1)fresnel(0.01,0.01)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage7 { + texture="#(argb,8,8,3)color(0,0,0,1,CO)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/addons/apl/data/default.rvmat b/addons/apl/data/default.rvmat new file mode 100644 index 0000000000..f70da1fcf0 --- /dev/null +++ b/addons/apl/data/default.rvmat @@ -0,0 +1,8 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0,0,0,0}; +specularPower=0; +PixelShaderID="Normal"; +VertexShaderID="Basic"; diff --git a/addons/apl/data/default_vehicle_ti_ca.paa b/addons/apl/data/default_vehicle_ti_ca.paa new file mode 100644 index 0000000000..53ca8a62b7 Binary files /dev/null and b/addons/apl/data/default_vehicle_ti_ca.paa differ diff --git a/addons/apl/data/glass_House.bisurf b/addons/apl/data/glass_House.bisurf new file mode 100644 index 0000000000..b8b91bb2a6 --- /dev/null +++ b/addons/apl/data/glass_House.bisurf @@ -0,0 +1,10 @@ +Density=2400; +rough=0; +dust=0; +bulletPenetrability=50; +soundEnviron=Empty; +isWater=false; +friction=0.1; +restitution=0.1; +impact = Hit_Glass; +soundHit = glass; \ No newline at end of file diff --git a/addons/apl/data/glass_house.rvmat b/addons/apl/data/glass_house.rvmat new file mode 100644 index 0000000000..004fd8c6e5 --- /dev/null +++ b/addons/apl/data/glass_house.rvmat @@ -0,0 +1 @@ +surfaceInfo="z\ace\addons\apl\data\glass_House.bisurf"; \ No newline at end of file diff --git a/addons/apl/data/jezek_texture_co.paa b/addons/apl/data/jezek_texture_co.paa new file mode 100644 index 0000000000..7b2e16d0e7 Binary files /dev/null and b/addons/apl/data/jezek_texture_co.paa differ diff --git a/addons/apl/data/jezek_texture_nohq.paa b/addons/apl/data/jezek_texture_nohq.paa new file mode 100644 index 0000000000..6a34328e5f Binary files /dev/null and b/addons/apl/data/jezek_texture_nohq.paa differ diff --git a/addons/apl/data/jezek_texture_smdi.paa b/addons/apl/data/jezek_texture_smdi.paa new file mode 100644 index 0000000000..415d98a09f Binary files /dev/null and b/addons/apl/data/jezek_texture_smdi.paa differ diff --git a/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa b/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa new file mode 100644 index 0000000000..a023628a55 Binary files /dev/null and b/addons/apl/data/metal4_weapons_vehicles_int_512_dt.paa differ diff --git a/addons/apl/data/optics_bg_blurred_round_ca.paa b/addons/apl/data/optics_bg_blurred_round_ca.paa new file mode 100644 index 0000000000..b449e342c1 Binary files /dev/null and b/addons/apl/data/optics_bg_blurred_round_ca.paa differ diff --git a/addons/apl/data/optics_bg_square_ca.paa b/addons/apl/data/optics_bg_square_ca.paa new file mode 100644 index 0000000000..43c9d97b3c Binary files /dev/null and b/addons/apl/data/optics_bg_square_ca.paa differ diff --git a/addons/apl/data/plastic.bisurf b/addons/apl/data/plastic.bisurf new file mode 100644 index 0000000000..84984886ec --- /dev/null +++ b/addons/apl/data/plastic.bisurf @@ -0,0 +1,10 @@ +Density=1380; +rough=0.1; +dust=0; +bulletPenetrability=150; +soundEnviron=Empty; +isWater=false; +friction=0.7; +restitution=0.3; +impact = default_Mat; +soundHit = plastic; \ No newline at end of file diff --git a/addons/apl/data/plastic.rvmat b/addons/apl/data/plastic.rvmat new file mode 100644 index 0000000000..6cf20f3d7f --- /dev/null +++ b/addons/apl/data/plastic.rvmat @@ -0,0 +1,4 @@ +surfaceInfo="z\ace\addons\apl\data\plastic.bisurf"; + +diffuse[]={0.5,0.5,1.0,1.000000}; +ambient[]={0.5,0.5,1.0,1.000000}; \ No newline at end of file diff --git a/addons/apl/data/plastic_512_dt.paa b/addons/apl/data/plastic_512_dt.paa new file mode 100644 index 0000000000..62c48c90a4 Binary files /dev/null and b/addons/apl/data/plastic_512_dt.paa differ diff --git a/addons/apl/data/plech.paa b/addons/apl/data/plech.paa new file mode 100644 index 0000000000..240e1ce03f Binary files /dev/null and b/addons/apl/data/plech.paa differ diff --git a/addons/apl/data/twis_m16_ca.paa b/addons/apl/data/twis_m16_ca.paa new file mode 100644 index 0000000000..784c3b791e Binary files /dev/null and b/addons/apl/data/twis_m16_ca.paa differ diff --git a/addons/apl/data/vehicle_destr1024_1024_mc.paa b/addons/apl/data/vehicle_destr1024_1024_mc.paa new file mode 100644 index 0000000000..68dfc1b977 Binary files /dev/null and b/addons/apl/data/vehicle_destr1024_1024_mc.paa differ diff --git a/addons/apl/data/vehicle_destr1024_1024_smdi.paa b/addons/apl/data/vehicle_destr1024_1024_smdi.paa new file mode 100644 index 0000000000..2a2cfc0357 Binary files /dev/null and b/addons/apl/data/vehicle_destr1024_1024_smdi.paa differ diff --git a/addons/apl/sounds/padak_let.wss b/addons/apl/sounds/padak_let.wss new file mode 100644 index 0000000000..19476becd8 Binary files /dev/null and b/addons/apl/sounds/padak_let.wss differ diff --git a/addons/atragmx/$PBOPREFIX$ b/addons/atragmx/$PBOPREFIX$ new file mode 100644 index 0000000000..c42e89e22d --- /dev/null +++ b/addons/atragmx/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\atragmx \ No newline at end of file diff --git a/addons/atragmx/CfgVehicles.hpp b/addons/atragmx/CfgVehicles.hpp index f015f0e0b9..65ef589d0f 100644 --- a/addons/atragmx/CfgVehicles.hpp +++ b/addons/atragmx/CfgVehicles.hpp @@ -4,13 +4,13 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class GVAR(open) { - displayName = "$STR_ACE_ATragMX_OpenATragMXDialog"; + displayName = CSTRING(OpenATragMXDialog); condition = QUOTE(call FUNC(can_show)); statement = QUOTE(call FUNC(create_dialog)); showDisabled = 0; priority = 2; icon = PATHTOF(UI\ATRAG_Icon.paa); - exceptions[] = {"notOnMap", "isNotInside"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; }; }; }; diff --git a/addons/atragmx/CfgWeapons.hpp b/addons/atragmx/CfgWeapons.hpp index 07d2fa4aee..42d1e56ae2 100644 --- a/addons/atragmx/CfgWeapons.hpp +++ b/addons/atragmx/CfgWeapons.hpp @@ -6,8 +6,8 @@ class CfgWeapons { class ACE_ATragMX: ACE_ItemCore { author = "Ruthberg"; scope = 2; - displayName = "$STR_ACE_ATragMX_Name"; - descriptionShort = "$STR_ACE_ATragMX_Description"; + displayName = CSTRING(Name); + descriptionShort = CSTRING(Description); model = PATHTOF(data\tdsrecon.p3d); picture = PATHTOF(UI\ATRAG_Icon.paa); icon = "iconObject_circle"; diff --git a/addons/atragmx/RscTitles.hpp b/addons/atragmx/RscTitles.hpp index 4ae08c20aa..97dad6e7b6 100644 --- a/addons/atragmx/RscTitles.hpp +++ b/addons/atragmx/RscTitles.hpp @@ -142,6 +142,7 @@ class ATragMX_Display { name="ATragMX_Display"; idd=-1; onLoad="uiNamespace setVariable ['ATragMX_Display', (_this select 0)]"; + onUnload=QUOTE(_this call FUNC(on_close_dialog)); movingEnable=1; controlsBackground[]={}; objects[]={}; @@ -151,7 +152,7 @@ class ATragMX_Display { type=0; font="TahomaB"; SizeEX=0.025; - idc=-1; + idc=720000; style=48; x=0.55*safezoneW+safezoneX-0.256; y=0.265*safezoneH+safezoneY-0.1; @@ -159,7 +160,7 @@ class ATragMX_Display { h=1.024*4/3; colorBackground[]={1,1,1,1}; colorText[]={1,1,1,1}; - text=PATHTOF(UI\atrag.paa); + text=PATHTOF(UI\atrag_d.paa); }; class POWER: ATragMX_RscButton { idc=-1; diff --git a/addons/atragmx/UI/ATRAG.paa b/addons/atragmx/UI/ATRAG_D.paa similarity index 100% rename from addons/atragmx/UI/ATRAG.paa rename to addons/atragmx/UI/ATRAG_D.paa diff --git a/addons/atragmx/UI/ATRAG_N.paa b/addons/atragmx/UI/ATRAG_N.paa new file mode 100644 index 0000000000..a588fdbc8b Binary files /dev/null and b/addons/atragmx/UI/ATRAG_N.paa differ diff --git a/addons/atragmx/XEH_postInit.sqf b/addons/atragmx/XEH_postInit.sqf index 7b0a2c9962..4b61a28551 100644 --- a/addons/atragmx/XEH_postInit.sqf +++ b/addons/atragmx/XEH_postInit.sqf @@ -6,39 +6,41 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == GVAR(gunList) = profileNamespace getVariable "ACE_ATragMX_gunList"; } else { // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Scope Click Unit, Scope Click Number, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Bullet Diameter, Rifle Twist, BC, Drag Model, Atmosphere Model - GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657, -0.0006400, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ], + GVAR(gunList) = [["12.7x108mm" , 820, 100, 0.0657485, -0.00063800, 3.81, 0, 2, 10, 120, 0, 0, 48.28, 12.7, 38.10, 0.630, 1, "ASM" ], - ["12.7x99mm AMAX" , 860, 100, 0.0612, -0.0003740, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], - ["12.7x99mm" , 900, 100, 0.0623, -0.0006000, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ], + ["12.7x99mm AMAX" , 860, 100, 0.0611565, -0.00036645, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 38.10, 1.050, 1, "ASM" ], + ["12.7x99mm" , 900, 100, 0.0582418, -0.00057503, 3.81, 0, 2, 10, 120, 0, 0, 41.92, 12.7, 38.10, 0.670, 1, "ASM" ], - ["12.7x54mm" , 300, 100, 0.3395, -0.0001400, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ], + ["12.7x54mm" , 300, 100, 0.3394630, -0.00019268, 3.81, 0, 2, 10, 120, 0, 0, 48.60, 12.7, 24.13, 1.050, 1, "ASM" ], - [".408 Chey Tac" , 910, 100, 0.0571, -0.0003950, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ], + [".408 Chey Tac" , 910, 100, 0.0569400, -0.00038944, 3.81, 0, 2, 10, 120, 0, 0, 27.15, 10.4, 33.02, 0.970, 1, "ASM" ], - ["9.3×64mm" , 870, 100, 0.0619, -0.0010600, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ], + ["9.3×64mm" , 870, 100, 0.0619295, -0.00108571, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 9.30, 35.56, 0.368, 1, "ASM" ], - [".338LM 250gr" , 880, 100, 0.0598, -0.0006060, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], - [".338LM 300gr" , 800, 100, 0.0677, -0.0005350, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], - [".338LM API526" , 880, 100, 0.0601, -0.0006730, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.290, 7, "ICAO"], + [".338LM 250gr" , 880, 100, 0.0598469, -0.00059133, 3.81, 0, 2, 10, 120, 0, 0, 16.20, 8.58, 25.40, 0.322, 7, "ICAO"], + [".338LM 300gr" , 800, 100, 0.0677343, -0.00052190, 3.81, 0, 2, 10, 120, 0, 0, 19.44, 8.58, 25.40, 0.381, 7, "ICAO"], + [".338LM API526" , 895, 100, 0.0588865, -0.00069611, 3.81, 0, 2, 10, 120, 0, 0, 16.39, 8.58, 25.40, 0.560, 1, "ASM" ], - [".300WM Mk248 Mod 0", 900, 100, 0.0584, -0.0008300, 3.81, 0, 2, 10, 120, 0, 0, 13.31, 7.80, 25.40, 0.268, 7, "ICAO"], - [".300WM Mk248 Mod 1", 867, 100, 0.0611, -0.0008150, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"], - [".300WM Berger OTM" , 853, 100, 0.0622, -0.0007600, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"], + [".300WM Mk248 Mod 0", 900, 100, 0.0584442, -0.00070530, 3.81, 0, 2, 10, 120, 0, 0, 13.31, 7.80, 25.40, 0.268, 7, "ICAO"], + [".300WM Mk248 Mod 1", 867, 100, 0.0610738, -0.00061188, 3.81, 0, 2, 10, 120, 0, 0, 14.26, 7.80, 25.40, 0.310, 7, "ICAO"], + [".300WM Berger OTM" , 853, 100, 0.0622179, -0.00053733, 3.81, 0, 2, 10, 120, 0, 0, 14.90, 7.80, 25.40, 0.368, 7, "ICAO"], - ["7.62x54mmR" , 800, 100, 0.0692, -0.0010230, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"], + ["7.62x54mmR" , 800, 100, 0.0691878, -0.00100023, 3.81, 0, 2, 10, 120, 0, 0, 9.849, 7.92, 24.13, 0.400, 1, "ICAO"], - ["7.62x51mm M80" , 810, 100, 0.0679, -0.0010350, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.200, 7, "ICAO"], - ["7.62x51mm M118LR" , 780, 100, 0.0710, -0.0008525, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], - ["7.62x51mm Mk319" , 910, 100, 0.0585, -0.0010300, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"], - ["7.62x51mm Subsonic", 320, 100, 0.3060, -0.0004910, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"], + ["7.62x51mm M80" , 810, 100, 0.0679374, -0.00100957, 3.81, 0, 2, 10, 120, 0, 0, 9.525, 7.82, 25.40, 0.200, 7, "ICAO"], + ["7.62x51mm M118LR" , 780, 100, 0.0710319, -0.00082828, 3.81, 0, 2, 10, 120, 0, 0, 11.34, 7.82, 25.40, 0.243, 7, "ICAO"], + ["7.62x51mm Mk319" , 910, 100, 0.0584524, -0.00102338, 3.81, 0, 2, 10, 120, 0, 0, 8.424, 7.82, 25.40, 0.377, 1, "ICAO"], + ["7.62x51mm M993" , 930, 100, 0.0570316, -0.00107148, 3.81, 0, 2, 10, 120, 0, 0, 8.230, 7.82, 25.40, 0.359, 1, "ICAO"], + ["7.62x51mm Subsonic", 320, 100, 0.3059680, -0.00049899, 3.81, 0, 2, 10, 120, 0, 0, 12.96, 7.82, 25.40, 0.235, 7, "ICAO"], - ["6.5x39mm" , 800, 100, 0.0683, -0.0007850, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"], - ["6.5x47mm Lapua" , 800, 100, 0.0682, -0.0007710, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"], - ["6.5mm Creedmor" , 840, 100, 0.0637, -0.0006510, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.317, 7, "ICAO"], + ["6.5x39mm" , 800, 100, 0.0683482, -0.00075308, 3.81, 0, 2, 10, 120, 0, 0, 7.970, 6.71, 22.86, 0.263, 7, "ICAO"], + ["6.5x47mm Lapua" , 800, 100, 0.0682221, -0.00067037, 3.81, 0, 2, 10, 120, 0, 0, 9.007, 6.71, 22.86, 0.290, 7, "ICAO"], + ["6.5mm Creedmor" , 840, 100, 0.0636501, -0.00060887, 3.81, 0, 2, 10, 120, 0, 0, 9.072, 6.71, 22.86, 0.317, 7, "ICAO"], - ["5.56x45mm M855" , 870, 100, 0.0626, -0.0012650, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ], - ["5.56x45mm Mk262" , 820, 100, 0.0671, -0.0011250, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ], - ["5.56x45mm Mk318" , 880, 100, 0.0616, -0.0011200, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ]]; + ["5.56x45mm M855" , 870, 100, 0.0626386, -0.00126466, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.151, 7, "ASM" ], + ["5.56x45mm Mk262" , 820, 100, 0.0671481, -0.00109563, 3.81, 0, 2, 10, 120, 0, 0, 4.990, 5.70, 17.78, 0.361, 1, "ASM" ], + ["5.56x45mm Mk318" , 880, 100, 0.0615937, -0.00123318, 3.81, 0, 2, 10, 120, 0, 0, 4.018, 5.70, 17.78, 0.307, 1, "ASM" ], + ["5.56x45mm M995" , 869, 100, 0.0626713, -0.00123272, 3.81, 0, 2, 10, 120, 0, 0, 4.536, 5.70, 17.78, 0.310, 1, "ASM" ]]; [] call FUNC(clear_user_data); profileNamespace setVariable ["ACE_ATragMX_gunList", GVAR(gunList)]; diff --git a/addons/atragmx/XEH_preInit.sqf b/addons/atragmx/XEH_preInit.sqf index 6ec288b9c7..0277de1c14 100644 --- a/addons/atragmx/XEH_preInit.sqf +++ b/addons/atragmx/XEH_preInit.sqf @@ -4,7 +4,6 @@ ADDON = false; PREP(add_new_gun); PREP(calculate_range_card); -PREP(calculate_scope_base_angle); PREP(calculate_solution); PREP(calculate_target_range_assist); PREP(calculate_target_solution); @@ -68,5 +67,6 @@ PREP(update_target_data); PREP(update_target_selection); PREP(update_unit_selection); PREP(update_zero_range); +PREP(on_close_dialog); ADDON = true; diff --git a/addons/atragmx/functions/fnc_calculate_range_card.sqf b/addons/atragmx/functions/fnc_calculate_range_card.sqf index cfaf7441f8..516138fcee 100644 --- a/addons/atragmx/functions/fnc_calculate_range_card.sqf +++ b/addons/atragmx/functions/fnc_calculate_range_card.sqf @@ -47,16 +47,16 @@ _temperature = GVAR(temperature); _barometricPressure = GVAR(barometricPressure); _relativeHumidity = GVAR(relativeHumidity); if (!GVAR(atmosphereModeTBH)) then { - _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; _relativeHumidity = 50; }; private ["_bulletLength", "_stabilityFactor"]; -_bulletLength = 1.8; +_bulletLength = 45.72; _stabilityFactor = 1.5; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { - _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + _stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); }; }; diff --git a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf b/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf deleted file mode 100644 index fbd191bb79..0000000000 --- a/addons/atragmx/functions/fnc_calculate_scope_base_angle.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Author: Ruthberg - * Calculates a new scope base angle - * - * Arguments: - * 0: Bullet mass - * 1: Bore height - * 2: air friction - * 3: muzzle velocity - * 4: zero range - * - * Return Value: - * scope base angle - * - * Example: - * call ace_atragmx_calculate_scope_base_angle - * - * Public: No - */ -#include "script_component.hpp" - -private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_zeroRange"]; -_bulletMass = _this select 0; -_boreHeight = _this select 1; -_airFriction = _this select 2; -_muzzleVelocity = _this select 3; -_zeroRange = _this select 4; - -private ["_scopeBaseAngle"]; -_scopeBaseAngle = 0; - -private ["_temperature", "_barometricPressure", "_relativeHumidity"]; -_temperature = 15; -_barometricPressure = 1013.25; -_relativeHumidity = 0; - -private ["_result"]; -_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, [0, 0], 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false, 1.5, 0, 0, 0] call FUNC(calculate_solution); - -_scopeBaseAngle + (_result select 0) / 60 diff --git a/addons/atragmx/functions/fnc_calculate_solution.sqf b/addons/atragmx/functions/fnc_calculate_solution.sqf index 2049398a9c..869ce8d098 100644 --- a/addons/atragmx/functions/fnc_calculate_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_solution.sqf @@ -37,7 +37,7 @@ * 8: Spin drift (MOA) * * Example: - * call ace_atragmx_calculate_target_range_assist + * call ace_atragmx_calculate_solution * * Public: No */ diff --git a/addons/atragmx/functions/fnc_calculate_target_solution.sqf b/addons/atragmx/functions/fnc_calculate_target_solution.sqf index 677c4bb793..b014da6a61 100644 --- a/addons/atragmx/functions/fnc_calculate_target_solution.sqf +++ b/addons/atragmx/functions/fnc_calculate_target_solution.sqf @@ -47,16 +47,16 @@ _temperature = GVAR(temperature); _barometricPressure = GVAR(barometricPressure); _relativeHumidity = GVAR(relativeHumidity); if (!GVAR(atmosphereModeTBH)) then { - _barometricPressure = 1013.25 * exp(-(_altitude) / 7990); + _barometricPressure = 1013.25 * (1 - (0.0065 * _altitude) / (273.15 + _temperature + 0.0065 * _altitude)) ^ 5.255754495; _relativeHumidity = 50; }; private ["_bulletLength", "_stabilityFactor"]; -_bulletLength = 1.8; +_bulletLength = 45.72; _stabilityFactor = 1.5; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { if (_bulletDiameter > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { - _stabilityFactor = [_bulletDiameter / 10 / 2.54, _bulletLength, _bulletMass * 15.4323584, _barrelTwist / 2.54, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); + _stabilityFactor = [_bulletDiameter, _bulletLength, _bulletMass, _barrelTwist * 10, _muzzleVelocity, _temperature, _barometricPressure] call EFUNC(advanced_ballistics,calculateStabilityFactor); }; }; diff --git a/addons/atragmx/functions/fnc_create_dialog.sqf b/addons/atragmx/functions/fnc_create_dialog.sqf index 09e413d535..df71f9beb9 100644 --- a/addons/atragmx/functions/fnc_create_dialog.sqf +++ b/addons/atragmx/functions/fnc_create_dialog.sqf @@ -15,7 +15,10 @@ */ #include "script_component.hpp" -//if (dialog) exitWith { false }; +#define __dsp (uiNamespace getVariable "ATragMX_Display") +#define __ctrlBackground (__dsp displayCtrl 720000) + +if (GVAR(active)) exitWith { false }; if (underwater ACE_player) exitWith { false }; if (!("ACE_ATragMX" in (uniformItems ACE_player)) && !("ACE_ATragMX" in (vestItems ACE_player))) exitWith { false }; @@ -47,4 +50,13 @@ GVAR(showTargetSpeedAssistTimer) call FUNC(show_target_speed_assist_timer); lbAdd [6000, _x select 0]; } forEach GVAR(gunList); +GVAR(active) = true; + +GVAR(DialogPFH) = [{ + if (!GVAR(active)) exitWith { + [_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; + true diff --git a/addons/atragmx/functions/fnc_init.sqf b/addons/atragmx/functions/fnc_init.sqf index e4fe1b67a4..30b17ebf90 100644 --- a/addons/atragmx/functions/fnc_init.sqf +++ b/addons/atragmx/functions/fnc_init.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +GVAR(active) = false; + GVAR(workingMemory) = +(GVAR(gunList) select 0); GVAR(scopeUnits) = ["MILs", "TMOA", "SMOA", "Clicks"]; diff --git a/addons/atragmx/functions/fnc_on_close_dialog.sqf b/addons/atragmx/functions/fnc_on_close_dialog.sqf new file mode 100644 index 0000000000..46cbbfc146 --- /dev/null +++ b/addons/atragmx/functions/fnc_on_close_dialog.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +uiNamespace setVariable ['ATragMX_Display', nil]; +GVAR(active) = false; +[GVAR(DialogPFH)] call cba_fnc_removePerFrameHandler; \ No newline at end of file diff --git a/addons/atragmx/functions/fnc_parse_input.sqf b/addons/atragmx/functions/fnc_parse_input.sqf index 2534c2a319..ce566416f4 100644 --- a/addons/atragmx/functions/fnc_parse_input.sqf +++ b/addons/atragmx/functions/fnc_parse_input.sqf @@ -59,7 +59,7 @@ if (GVAR(currentUnit) == 1) then { private ["_boreHeight", "_bulletMass", "_bulletDiameter", "_airFriction", "_rifleTwist", "_muzzleVelocity", "_zeroRange"]; _boreHeight = parseNumber(ctrlText 120000); _bulletMass = parseNumber(ctrlText 120010); -_bulletDiameter = parseNumber(ctrlText 120020); +_bulletDiameter = parseNumber(ctrlText 120020) * 10; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { _airFriction = 0.1 max parseNumber(ctrlText 120030) min 2; } else { @@ -71,7 +71,7 @@ _zeroRange = parseNumber (ctrlText 120060); if (GVAR(currentUnit) != 2) then { _boreHeight = _boreHeight * 2.54; _bulletMass = _bulletMass * 0.06479891; - _bulletDiameter = _bulletDiameter * 10 * 2.54; + _bulletDiameter = _bulletDiameter * 2.54; _rifleTwist = _rifleTwist * 2.54; _muzzleVelocity = _muzzleVelocity / 3.2808399; }; @@ -95,36 +95,6 @@ if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) t GVAR(workingMemory) set [1, _muzzleVelocity]; GVAR(workingMemory) set [2, _zeroRange]; -private ["_elevationCur", "_windageCur", "_clickSize", "_clickNumber", "_clickInterval"]; -_elevationCur = GVAR(workingMemory) select 10; -_windageCur = GVAR(workingMemory) select 11; - -switch (GVAR(currentScopeUnit)) do { - case 0: { - _elevationCur = _elevationCur * 3.38; - _windageCur = _windageCur * 3.38; - }; - case 2: { - _elevationCur = _elevationCur / 1.047; - _windageCur = _windageCur / 1.047; - }; - case 3: { - switch (GVAR(workingMemory) select 7) do { - case 0: { _clickSize = 1; }; - case 1: { _clickSize = 1 / 1.047; }; - case 2: { _clickSize = 3.38; }; - }; - _clickNumber = GVAR(workingMemory) select 8; - _clickInterval = _clickSize / _clickNumber; - - _elevationCur = Round(_elevationCur / _clickInterval); - _windageCur = Round(_windageCur / _clickInterval); - }; -}; - -GVAR(workingMemory) set [10, _elevationCur]; -GVAR(workingMemory) set [11, _windageCur]; - [] call FUNC(update_gun); [] call FUNC(update_gun_ammo_data); [] call FUNC(update_atmosphere); diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index 6e47461cf3..9bc5b7e34f 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -30,7 +30,7 @@ if !(ctrlVisible 9000) then { if (!(GVAR(speedAssistTimer))) exitWith { GVAR(speedAssistTimer) = true; - ctrlSetText [8006, Str(Round((time - _startTime) * 10) / 10)]; + ctrlSetText [8006, Str(Round((ACE_time - _startTime) * 10) / 10)]; [] call FUNC(calculate_target_speed_assist); @@ -40,7 +40,7 @@ if !(ctrlVisible 9000) then { [_this select 1] call cba_fnc_removePerFrameHandler; }; - ctrlSetText [9001, Str(Round((time - _startTime) * 10) / 10)]; + ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)]; - }, 0.1, [time]] call CBA_fnc_addPerFrameHandler; + }, 0.1, [ACE_time]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf index b11b214500..6332506006 100644 --- a/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf +++ b/addons/atragmx/functions/fnc_update_gun_ammo_data.sqf @@ -30,7 +30,7 @@ if (GVAR(currentUnit) != 2) then { if (GVAR(currentUnit) != 2) then { ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 / 2.54 * 1000) / 1000)]; } else { - ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) * 1000) / 1000)]; + ctrlSetText [120020, Str(Round((GVAR(workingMemory) select 13) / 10 * 1000) / 1000)]; }; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { ctrlSetText [120030, Str(Round((GVAR(workingMemory) select 15) * 1000) / 1000)]; diff --git a/addons/atragmx/functions/fnc_update_range_card.sqf b/addons/atragmx/functions/fnc_update_range_card.sqf index 7e19abc36e..d084754959 100644 --- a/addons/atragmx/functions/fnc_update_range_card.sqf +++ b/addons/atragmx/functions/fnc_update_range_card.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; +private ["_range", "_elevation", "_windage1", "_windage2", "_clickSize", "_clickNumber", "_clickInterval", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput", "_speedOfSound"]; _lastColumnOutput = ""; if (GVAR(showWind2) && GVAR(rangeCardCurrentColumn) == 0) then { @@ -32,6 +32,8 @@ if (GVAR(currentUnit) == 1) then { lnbClear 5007; +_speedOfSound = GVAR(temperature) call EFUNC(weather,calculateSpeedOfSound); + { _range = _x select 0; _elevation = _x select 1; @@ -72,7 +74,7 @@ lnbClear 5007; _windageOutput = Str(Round(_windage1 * 100) / 100); _rangeOutput = Str(_range); - if (_velocity < 340.29) then { + if (_velocity < _speedOfSound) then { _rangeOutput = _rangeOutput + "*"; }; diff --git a/addons/atragmx/initKeybinds.sqf b/addons/atragmx/initKeybinds.sqf index 796d7f9d97..51d2338292 100644 --- a/addons/atragmx/initKeybinds.sqf +++ b/addons/atragmx/initKeybinds.sqf @@ -1,11 +1,36 @@ -["ACE3 Equipment", QGVAR(ATragMXDialogKey), localize "STR_ACE_ATragMX_ATragMXDialogKey", +["ACE3 Equipment", QGVAR(ATragMXDialogKey), localize LSTRING(ATragMXDialogKey), { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (GVAR(active)) exitWith { + closeDialog 0; + false + }; // Statement [] call FUNC(create_dialog); false }, {false}, -[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) \ No newline at end of file +[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) + + +//Add deviceKey entry: +private ["_conditonCode", "_toggleCode", "_closeCode"]; +_conditonCode = { + [] call FUNC(can_show); +}; +_toggleCode = { + // Conditions: canInteract + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; + if (GVAR(active)) exitWith { + closeDialog 0; + }; + // Statement + [] call FUNC(create_dialog); +}; +_closeCode = { + if (GVAR(active)) exitWith { + closeDialog 0; + }; +}; +[(localize LSTRING(Name)), QUOTE(PATHTOF(UI\ATRAG_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/atragmx/script_component.hpp b/addons/atragmx/script_component.hpp index 090e82246d..8154ffa04b 100644 --- a/addons/atragmx/script_component.hpp +++ b/addons/atragmx/script_component.hpp @@ -11,4 +11,4 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.4 +#define ATRAGMX_PROFILE_NAMESPACE_VERSION 1.7 diff --git a/addons/attach/$PBOPREFIX$ b/addons/attach/$PBOPREFIX$ index 71a2f40af8..a647dc3672 100644 --- a/addons/attach/$PBOPREFIX$ +++ b/addons/attach/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\attach \ No newline at end of file +z\ace\addons\attach \ No newline at end of file diff --git a/addons/attach/CfgVehicles.hpp b/addons/attach/CfgVehicles.hpp index ce9b1a7413..daf91a43df 100644 --- a/addons/attach/CfgVehicles.hpp +++ b/addons/attach/CfgVehicles.hpp @@ -3,7 +3,7 @@ class ACE_Actions { \ class ACE_MainActions { \ class GVAR(AttachVehicle) { \ - displayName = "$STR_ACE_Attach_AttachDetach"; \ + displayName = CSTRING(AttachDetach); \ condition = QUOTE(_this call FUNC(canAttach)); \ insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); \ exceptions[] = {}; \ @@ -13,7 +13,7 @@ distance = 4.5; \ }; \ class GVAR(DetachVehicle) { \ - displayName = "$STR_ACE_Attach_Detach"; \ + displayName = CSTRING(Detach); \ condition = QUOTE(_this call FUNC(canDetach)); \ statement = QUOTE(_this call FUNC(detach) ); \ exceptions[] = {}; \ @@ -54,7 +54,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class GVAR(Attach) { - displayName = "$STR_ACE_Attach_AttachDetach"; + displayName = CSTRING(AttachDetach); condition = QUOTE(_this call FUNC(canAttach)); insertChildren = QUOTE(_this call FUNC(getChildrenAttachActions)); exceptions[] = {"isNotDragging"}; @@ -64,7 +64,7 @@ class CfgVehicles { // hotkey = "T"; }; class GVAR(Detach) { - displayName = "$STR_ACE_Attach_Detach"; + displayName = CSTRING(Detach); condition = QUOTE(_this call FUNC(canDetach)); statement = QUOTE(_this call FUNC(detach)); exceptions[] = {"isNotDragging"}; @@ -87,9 +87,9 @@ class CfgVehicles { class NVGMarker { diffuse[] = {0.006, 0.006, 0.006, 1}; ambient[] = {0.005, 0.005, 0.005, 1}; - brightness = 0.2; + brightness = 0.1; name = "pozicni blik"; - drawLightSize = 0.2; + drawLightSize = 0.1; drawLightCenterSize = 0.003; activeLight = 0; blinking=1; @@ -112,7 +112,7 @@ class CfgVehicles { magazines[] = {}; nvTarget = 1; destrType = "DestructNo"; - brightness = 20; + brightness = 10; }; class NATO_Box_Base; diff --git a/addons/attach/CfgWeapons.hpp b/addons/attach/CfgWeapons.hpp index 9734ceb273..3ad2591f63 100644 --- a/addons/attach/CfgWeapons.hpp +++ b/addons/attach/CfgWeapons.hpp @@ -5,10 +5,10 @@ class CfgWeapons { class ACE_IR_Strobe_Item: ACE_ItemCore { ACE_attachable = "ACE_IR_Strobe_Effect"; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; - displayName = "$STR_ACE_IrStrobe_Name"; - descriptionShort = "$STR_ACE_IrStrobe_Description"; + displayName = CSTRING(IrStrobe_Name); + descriptionShort = CSTRING(IrStrobe_Description); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = PATHTOF(UI\irstrobe_item.paa); diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 45b1c0a336..984c231366 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -37,7 +37,7 @@ if (_itemVehClass == "") then { if (_itemVehClass == "") exitWith {ERROR("no ACE_Attachable for Item");}; -_onAtachText = format [localize "STR_ACE_Attach_Item_Attached", _onAtachText]; +_onAtachText = format [localize LSTRING(Item_Attached), _onAtachText]; if (_unit == _attachToVehicle) then { //Self Attachment _unit removeItem _itemClassname; // Remove item @@ -55,11 +55,11 @@ if (_unit == _attachToVehicle) then { //Self Attachment [_unit, QGVAR(vehAttach), true] call EFUNC(common,setForceWalkStatus); //MenuBack isn't working for now (localize "STR_ACE_Attach_CancelAction") - [{[localize "STR_ACE_Attach_PlaceAction", ""] call EFUNC(interaction,showMouseHint)}, [], 0, 0] call EFUNC(common,waitAndExecute); + [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call EFUNC(common,execNextFrame); _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = 1;}] call EFUNC(common,AddActionEventHandler)]; // _unit setVariable [QGVAR(cancelActionEH), [_unit, "MenuBack", {true}, {GVAR(placeAction) = 0;}] call EFUNC(common,AddActionEventHandler)]; - _actionID = _unit addAction [format ["%1", localize "STR_ACE_Attach_CancelAction"], {GVAR(placeAction) = 0}]; + _actionID = _unit addAction [format ["%1", localize LSTRING(CancelAction)], {GVAR(placeAction) = 0}]; [{ private "_startingPosition"; diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index a56936301d..92df83b5c1 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -49,7 +49,7 @@ if (isNull _attachedObject || {_itemName == ""}) exitWith {ERROR("Could not find // Exit if can't add the item if !(_unit canAdd _itemName) exitWith { - [localize "STR_ACE_Attach_Inventory_Full"] call EFUNC(common,displayTextStructured); + [localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured); }; // Add item to inventory @@ -60,7 +60,7 @@ if (toLower _itemName in ["b_ir_grenade", "o_ir_grenade", "i_ir_grenade"]) then detach _attachedObject; _attachedObject setPos ((getPos _unit) vectorAdd [0, 0, -1000]); // Delete attached item after 0.5 seconds - [{deleteVehicle (_this select 0)}, [_attachedObject], 0.5, 0] call EFUNC(common,waitAndExecute); + [{deleteVehicle (_this select 0)}, [_attachedObject], 2] call EFUNC(common,waitAndExecute); } else { // Delete attached item deleteVehicle _attachedObject; @@ -78,4 +78,4 @@ if (_itemDisplayName == "") then { _itemDisplayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName"); }; -[format [localize "STR_ACE_Attach_Item_Detached", _itemDisplayName]] call EFUNC(common,displayTextStructured); +[format [localize LSTRING(Item_Detached), _itemDisplayName]] call EFUNC(common,displayTextStructured); diff --git a/addons/attach/functions/fnc_placeApprove.sqf b/addons/attach/functions/fnc_placeApprove.sqf index 60c5e3a9bf..d85a65df2b 100644 --- a/addons/attach/functions/fnc_placeApprove.sqf +++ b/addons/attach/functions/fnc_placeApprove.sqf @@ -74,7 +74,7 @@ _closeInDistance = (_closeInMax + _closeInMin) / 2; //Checks (too close to center or can't attach) if (((_startDistanceFromCenter - _closeInDistance) < 0.1) || {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) exitWith { TRACE_2("no valid spot found",_closeInDistance,_startDistanceFromCenter); - [localize "STR_ACE_Attach_Failed"] call EFUNC(common,displayTextStructured); + [localize LSTRING(Failed)] call EFUNC(common,displayTextStructured); }; //Move it out slightly, for visability sake (better to look a little funny than be embedded//sunk in the hull and be useless) diff --git a/addons/attach/script_component.hpp b/addons/attach/script_component.hpp index 6d468d89c1..409f74ab94 100644 --- a/addons/attach/script_component.hpp +++ b/addons/attach/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT attach -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/attach/stringtable.xml b/addons/attach/stringtable.xml index 70b464a6cd..299a1575ac 100644 --- a/addons/attach/stringtable.xml +++ b/addons/attach/stringtable.xml @@ -121,7 +121,7 @@ Nincs több hely В инвентаре нет места - + IR Strobe IR-Stroboskop Marcador IR @@ -133,7 +133,7 @@ Infravörös jeladó ИК-маяк - + IR Strobe allows you to signal your position through a pulsating beacon only visible with NVGs. Das IR-Stroboskop erlaubt es dir deine Position mit einem blinkenden Leuchtfeuer zu signalisieren, welches nur mit Nachtsichtgerät zu erkennen ist. Stroboskop światła podczerwieni umożliwia oznaczenie swojej pozycji pulsacyjnym światłem widocznym tylko przez optykę noktowizyjną i gogle noktowizyjne. @@ -179,7 +179,7 @@ Erro ao fixar Przyczepianie nie powiodło się Hozzácsatolás sikertelen - Impossibile Attaccare + Non si attacca %1<br/>Attached @@ -206,4 +206,4 @@ %1<br/>отсоединен(-а) - \ No newline at end of file + diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 02df51e891..5ffe94ac45 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -20,127 +20,127 @@ class CfgAmmo { }; class B_556x45_Ball : BulletBase { - airFriction=-0.001265; + airFriction=-0.00126466; hit=8; typicalSpeed=750; - tracerStartTime = 0.073; //M856 tracer burns out to 800m - tracerEndTime = 1.579; //Time in seconds calculated with ballistics calculator - ACE_caliber=0.224; - ACE_bulletLength=0.906; - ACE_bulletMass=62; + tracerStartTime=0.073; // M856 tracer burns out to 800m + tracerEndTime=1.57123; // Time in seconds calculated with ballistics calculator + 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[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + 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 ACE_556x45_Ball_Mk262 : B_556x45_Ball { - airFriction=-0.001125; + airFriction=-0.00109563; caliber=0.8; deflecting=18; hit=11; typicalSpeed=836; - ACE_caliber=0.224; - ACE_bulletLength=0.906; - ACE_bulletMass=77; + ACE_caliber=5.69; + ACE_bulletLength=23.012; + ACE_bulletMass=4.9896; 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.361}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={624, 816, 832, 838}; - ACE_barrelLengths[]={7.5, 14.5, 18, 20}; + ACE_barrelLengths[]={190.5, 368.3, 457.2, 508.0}; }; class ACE_556x45_Ball_Mk318 : B_556x45_Ball { - airFriction=-0.001120; + airFriction=-0.00123318; caliber=0.8; deflecting=18; hit=9; typicalSpeed=886; - ACE_caliber=0.224; - ACE_bulletLength=0.906; - ACE_bulletMass=62; + ACE_caliber=5.69; + ACE_bulletLength=23.012; + ACE_bulletMass=4.0176; 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.307}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={780, 886, 950}; - ACE_barrelLengths[]={10, 15.5, 20}; + ACE_barrelLengths[]={254.0, 393.7, 508.0}; }; class ACE_556x45_Ball_M995_AP : B_556x45_Ball { - airFriction=-0.001120; + airFriction=-0.00123272; caliber=1.6; deflecting=18; hit=6; - typicalSpeed=886; - ACE_caliber=0.224; - ACE_bulletLength=0.906; - ACE_bulletMass=46; + typicalSpeed=869; + 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.151}; + ACE_ballisticCoefficients[]={0.310}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; - ACE_dragModel=7; - ACE_muzzleVelocities[]={950, 1030, 1040}; - ACE_barrelLengths[]={10, 15.5, 20}; + ACE_dragModel=1; + ACE_muzzleVelocities[]={820, 865, 880}; + ACE_barrelLengths[]={254.0, 368.3, 508.0}; }; class B_556x45_Ball_Tracer_Red; class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { nvgOnly = 1; }; class ACE_545x39_Ball_7N6M : B_556x45_Ball { - airFriction=-0.001162; + airFriction=-0.00114744; caliber=0.6; deflecting=18; hit=7; typicalSpeed=880; - ACE_caliber=0.220; - ACE_bulletLength=0.85; - ACE_bulletMass=52.9; + 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="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={780, 880, 920}; - ACE_barrelLengths[]={10, 16.3, 20}; + ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_556x45_Ball_Tracer_Green; class ACE_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Green { - airFriction=-0.001162; + airFriction=-0.00114744; caliber=0.6; deflecting=18; hit=7; typicalSpeed=883; - tracerStartTime = 0.073; //7T3M tracer burns out to 850m - tracerEndTime = 1.736; //Time in seconds calculated with ballistics calculator - ACE_caliber=0.220; - ACE_bulletLength=0.85; - ACE_bulletMass=49.8; + tracerStartTime=0.073; // 7T3M tracer burns out to 850m + tracerEndTime=1.70236; // Time in seconds calculated with ballistics calculator + 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="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={785, 883, 925}; - ACE_barrelLengths[]={10, 16.3, 20}; + ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_65x39_Caseless : BulletBase { - airFriction=-0.000785; + airFriction=-0.00075308; typicalSpeed=800; - ACE_caliber=0.264; - ACE_bulletLength=1.295; - ACE_bulletMass=123; + ACE_caliber=6.706; + ACE_bulletLength=32.893; + 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.263}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={730, 760, 788, 800, 810, 830}; - ACE_barrelLengths[]={10, 16, 20, 24, 26, 30}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4, 762.0}; }; class B_65x39_Case_yellow; class ACE_65x39_Caseless_Tracer_Dim : B_65x39_Case_yellow { @@ -151,442 +151,442 @@ class CfgAmmo { nvgOnly = 1; }; class ACE_65x47_Ball_Scenar: B_65x39_Caseless { - airFriction=-0.00078; + airFriction=-0.00067037; typicalSpeed=820 ; caliber=0.9; - ACE_caliber=0.264; - ACE_bulletLength=1.364; - ACE_bulletMass=139; + ACE_caliber=6.706; + ACE_bulletLength=34.646; + ACE_bulletMass=9.0072; 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.290}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={730, 760, 790, 820, 830}; - ACE_barrelLengths[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class ACE_65_Creedmor_Ball: B_65x39_Caseless { - airFriction=-0.000651; + airFriction=-0.00060887; typicalSpeed=860 ; caliber=1.1; - ACE_caliber=0.264; - ACE_bulletLength=1.426; - ACE_bulletMass=140; + ACE_caliber=6.706; + ACE_bulletLength=36.22; + ACE_bulletMass=9.072; 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.317}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={750, 820, 840, 852, 860}; - ACE_barrelLengths[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class B_762x51_Ball : BulletBase { - airFriction=-0.001035; + airFriction=-0.00100957; typicalSpeed=833; hit=9; - tracerStartTime = 0.073; //Based on the British L5A1 which burns out to 1000m - tracerEndTime = 2.058; //Time in seconds calculated with ballistics calculator - ACE_caliber=0.308; - ACE_bulletLength=1.14; - ACE_bulletMass=146; + tracerStartTime=0.073; // Based on the British L5A1 which burns out to 1000m + tracerEndTime=2.15957; // Time in seconds calculated with ballistics calculator + 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[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class B_762x51_Tracer_Yellow; class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Yellow { nvgOnly = 1; }; class ACE_762x51_Ball_M118LR : B_762x51_Ball { - airFriction=-0.0008525; + airFriction=-0.00082828; caliber=1.8; hit=16; typicalSpeed=790; - ACE_caliber=0.308; - ACE_bulletLength=1.24; - ACE_bulletMass=175; + 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[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x51_Ball_Mk316_Mod_0 : B_762x51_Ball { - airFriction=-0.0008525; + airFriction=-0.00082029; caliber=1.8; hit=16; typicalSpeed=790; - ACE_caliber=0.308; - ACE_bulletLength=1.24; - ACE_bulletMass=175; + ACE_caliber=7.823; + ACE_bulletLength=31.496; + ACE_bulletMass=11.34; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.243}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={775, 790, 805, 810}; - ACE_barrelLengths[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x51_Ball_Mk319_Mod_0 : B_762x51_Ball { - airFriction=-0.00103; + airFriction=-0.00102338; caliber=1.5; hit=14; typicalSpeed=900; - ACE_caliber=0.308; - ACE_bulletLength=1.24; - ACE_bulletMass=130; + ACE_caliber=7.823; + ACE_bulletLength=31.496; + ACE_bulletMass=8.424; 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.377}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={838, 892, 910}; - ACE_barrelLengths[]={13, 16, 20}; + ACE_barrelLengths[]={330.2, 406.4, 508.0}; }; class ACE_762x51_Ball_M993_AP : B_762x51_Ball { - airFriction=-0.00103; + airFriction=-0.00107148; caliber=2.2; hit=11; - typicalSpeed=930; - ACE_caliber=0.308; - ACE_bulletLength=1.24; - ACE_bulletMass=127; + typicalSpeed=910; + 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.377}; + ACE_ballisticCoefficients[]={0.359}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={875, 910, 930}; - ACE_barrelLengths[]={13, 16, 20}; + ACE_barrelLengths[]={330.2, 406.4, 508.0}; }; class ACE_762x51_Ball_Subsonic : B_762x51_Ball { - airFriction=-0.000535; + airFriction=-0.00049899; caliber=1; hit=6; typicalSpeed=320; - ACE_caliber=0.308; - ACE_bulletLength=1.340; - ACE_bulletMass=200; + 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[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_30_06_M1_Ball : B_762x51_Ball { - airFriction=-0.0009; + airFriction=-0.00080900; typicalSpeed=800; caliber=2.0; hit=10; - ACE_caliber=0.308; - ACE_bulletLength=1.21; - ACE_bulletMass=174; + ACE_caliber=7.823; + ACE_bulletLength=30.734; + 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.494}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={700, 785, 800, 830, 840}; - ACE_barrelLengths[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class ACE_7_Remington_Magnum_Ball : B_762x51_Ball { - airFriction=-0.0008; + airFriction=-0.00056738; typicalSpeed=820; caliber=2.1; hit=8; - ACE_caliber=0.284; - ACE_bulletLength=1.529; - ACE_bulletMass=180; + ACE_caliber=7.214; + ACE_bulletLength=38.837; + ACE_bulletMass=11.664; 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.345}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={720, 780, 812, 822, 830}; - ACE_barrelLengths[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class ACE_243_Winchester_Ball : B_762x51_Ball { - airFriction=-0.00095; + airFriction=-0.00067875; typicalSpeed=915; caliber=2.3; hit=6; - ACE_caliber=0.243; - ACE_bulletLength=1.282; - ACE_bulletMass=180; + ACE_caliber=6.172; + ACE_bulletLength=32.563; + ACE_bulletMass=11.664; 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.278}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={830, 875, 900, 915, 920}; - ACE_barrelLengths[]={10, 16, 20, 24, 26}; + ACE_barrelLengths[]={254.0, 406.4, 508.0, 609.6, 660.4}; }; class ACE_762x67_Ball_Mk248_Mod_0 : B_762x51_Ball { - airFriction=-0.000830; + airFriction=-0.00070530; caliber=1.8; hit=17; typicalSpeed=900; - ACE_caliber=0.308; - ACE_bulletLength=1.353; - ACE_bulletMass=190; + ACE_caliber=7.823; + ACE_bulletLength=34.366; + ACE_bulletMass=12.312; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.268}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={865, 900, 924}; - ACE_barrelLengths[]={20, 24, 26}; + ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class ACE_762x67_Ball_Mk248_Mod_1 : B_762x51_Ball { - airFriction=-0.000815; + airFriction=-0.00061188; caliber=1.9; hit=18; typicalSpeed=867; - ACE_caliber=0.308; - ACE_bulletLength=1.489; - ACE_bulletMass=220; + ACE_caliber=7.823; + ACE_bulletLength=37.821; + ACE_bulletMass=14.256; ACE_ammoTempMuzzleVelocityShifts[]={-5.3, -5.1, -4.6, -4.2, -3.4, -2.6, -1.4, -0.3, 1.4, 3.0, 5.2}; ACE_ballisticCoefficients[]={0.310}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={847, 867, 877}; - ACE_barrelLengths[]={20, 24, 26}; + ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class ACE_762x67_Ball_Berger_Hybrid_OTM : B_762x51_Ball { - airFriction=-0.00076; + airFriction=-0.00053733; caliber=2.0; hit=19; typicalSpeed=853; - ACE_caliber=0.308; - ACE_bulletLength=1.602; - ACE_bulletMass=230; + ACE_caliber=7.823; + ACE_bulletLength=40.691; + ACE_bulletMass=14.904; 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.368}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={800, 853, 884}; - ACE_barrelLengths[]={20, 24, 26}; + ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class B_762x54_Ball: B_762x51_Ball { - airFriction=-0.001023; + airFriction=-0.00100023; typicalSpeed=820; - ACE_caliber=0.312; - ACE_bulletLength=1.14; - ACE_bulletMass=152; + ACE_caliber=7.925; + ACE_bulletLength=28.956; + ACE_bulletMass=9.8496; 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.4}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={700, 800, 820, 833}; - ACE_barrelLengths[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x54_Ball_7N14 : B_762x51_Ball { - airFriction=-0.001023; + airFriction=-0.00100023; caliber=1.5; hit=15; typicalSpeed=820; - ACE_caliber=0.312; - ACE_bulletLength=1.14; - ACE_bulletMass=152; + ACE_caliber=7.925; + ACE_bulletLength=28.956; + ACE_bulletMass=9.8496; 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.4}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={700, 800, 820, 833}; - ACE_barrelLengths[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class B_762x54_Tracer_Green; class ACE_762x54_Ball_7T2 : B_762x54_Tracer_Green { - airFriction=-0.001023; + airFriction=-0.00103989; caliber=1.5; hit=15; typicalSpeed=800; - tracerStartTime = 0.073; //Based on the 7T2 which burns three seconds - tracerEndTime = 3; - ACE_caliber=0.312; - ACE_bulletLength=1.14; - ACE_bulletMass=149; + tracerStartTime=0.073; // Based on the 7T2 which burns three seconds + tracerEndTime=3; + 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[]={16, 20, 24, 26}; + ACE_barrelLengths[]={406.4, 508.0, 609.6, 660.4}; }; class ACE_762x35_Ball : B_762x51_Ball { - airFriction=-0.000821; + airFriction=-0.00128942; caliber=1.5; hit=11; typicalSpeed=790; - ACE_caliber=0.308; - ACE_bulletLength=1.153; - ACE_bulletMass=125; + ACE_caliber=7.823; + ACE_bulletLength=29.286; + ACE_bulletMass=8.1; 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.349, 0.338, 0.330, 0.310}; ACE_velocityBoundaries[]={792, 610, 488}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={620, 655, 675}; - ACE_barrelLengths[]={9, 16, 20}; + ACE_barrelLengths[]={228.6, 406.4, 508.0}; }; class ACE_762x39_Ball : B_762x51_Ball { - airFriction=-0.0015168; + airFriction=-0.00151621; hit=12; caliber=1.5; typicalSpeed=716; - ACE_caliber=0.308; - ACE_bulletLength=1.14; - ACE_bulletMass=123; + 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[]={10, 16.3, 20}; + ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class ACE_762x39_Ball_57N231P : B_762x54_Tracer_Green { - airFriction=-0.0015168; + airFriction=-0.00151621; hit=12; caliber=1.5; typicalSpeed=716; tracerStartTime = 0.073; //57N231P tracer burns out to 800m tracerEndTime = 2.082; //Time in seconds calculated with ballistics calculator - ACE_caliber=0.308; - ACE_bulletLength=1.14; - ACE_bulletMass=117; + 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[]={10, 16.3, 20}; + ACE_barrelLengths[]={254.0, 414.02, 508.0}; }; class B_9x21_Ball : BulletBase { - airFriction=-0.00125; + airFriction=-0.00226847; typicalSpeed=390; hit=6; - ACE_caliber=0.356; - ACE_bulletLength=0.610; - ACE_bulletMass=115; + ACE_caliber=9.042; + ACE_bulletLength=15.494; + ACE_bulletMass=7.452; 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.17}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={440, 460, 480}; - ACE_barrelLengths[]={4, 5, 9}; + ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; class ACE_9x18_Ball_57N181S : B_9x21_Ball { hit=5; - airFriction=-0.001234; + airFriction=-0.00190333; typicalSpeed=298; - ACE_caliber=0.365; - ACE_bulletLength=0.610; - ACE_bulletMass=92.6; + 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="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={298, 330, 350}; - ACE_barrelLengths[]={3.8, 5, 9}; + ACE_barrelLengths[]={96.52, 127.0, 228.6}; }; class ACE_9x19_Ball : B_9x21_Ball { - airFriction=-0.001234; + airFriction=-0.0018577; typicalSpeed=370; hit=6; - ACE_caliber=0.355; - ACE_bulletLength=0.610; - ACE_bulletMass=124; + 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[]={4, 5, 9}; + ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; class ACE_10x25_Ball : B_9x21_Ball { - airFriction=-0.00168; + airFriction=-0.00181928; typicalSpeed=425; hit=7; - ACE_caliber=0.5; - ACE_bulletLength=0.764; - ACE_bulletMass=165; + ACE_caliber=12.7; + ACE_bulletLength=19.406; + ACE_bulletMass=10.692; 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.189}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=1; ACE_muzzleVelocities[]={360, 400, 430}; - ACE_barrelLengths[]={4, 4.61, 9}; + ACE_barrelLengths[]={101.6, 117.094, 228.6}; }; class ACE_765x17_Ball: B_9x21_Ball { - airFriction=-0.001213; + airFriction=-0.00163356; typicalSpeed=282; hit=7; - ACE_caliber=0.3125; - ACE_bulletLength=0.610; - ACE_bulletMass=65; + 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[]={4, 5, 9}; + ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; class ACE_303_Ball : ACE_762x51_Ball_M118LR { - airFriction=-0.00083; + airFriction=-0.0008349; typicalSpeed=761; caliber=2.0; - ACE_caliber=0.311; - ACE_bulletLength=1.227; - ACE_bulletMass=174; + 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[]={20, 24, 26}; + ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class B_93x64_Ball : BulletBase { - airFriction=-0.00106; + airFriction=-0.00108571; typicalSpeed=880; - ACE_caliber=0.366; - ACE_bulletLength=1.350; - ACE_bulletMass=230; + ACE_caliber=9.296; + ACE_bulletLength=34.29; + ACE_bulletMass=14.904; 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.368}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={850, 870, 880}; - ACE_barrelLengths[]={20, 24.41, 26}; + ACE_barrelLengths[]={508.0, 620.014, 660.4}; }; class B_408_Ball : BulletBase { timeToLive=10; - airFriction=-0.000395; + airFriction=-0.00038944; typicalSpeed=910; - ACE_caliber=0.408; - ACE_bulletLength=2.126; - ACE_bulletMass=410; + ACE_caliber=10.363; + ACE_bulletLength=54.0; + ACE_bulletMass=26.568; ACE_transonicStabilityCoef=1; 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.97}; @@ -594,170 +594,171 @@ class CfgAmmo { ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={910}; - ACE_barrelLengths[]={29}; + ACE_barrelLengths[]={736.6}; }; class ACE_106x83mm_Ball : B_408_Ball { timeToLive=10; - ACE_caliber=0.416; - ACE_bulletLength=2.089; - ACE_bulletMass=398; + airFriction=-0.00052047; + ACE_caliber=10.566; + ACE_bulletLength=53.061; + ACE_bulletMass=25.7904; 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.72}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={960}; - ACE_barrelLengths[]={29}; + ACE_barrelLengths[]={736.6}; }; class B_338_Ball : BulletBase { timeToLive=10; - airFriction=-0.000606; + airFriction=-0.00059133; typicalSpeed=915; - ACE_caliber=0.338; - ACE_bulletLength=1.558; - ACE_bulletMass=250; + 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[]={20, 26, 28}; + ACE_barrelLengths[]={508.0, 660.4, 711.2}; }; class B_338_NM_Ball : BulletBase { - airFriction=-0.000537; + airFriction=-0.00052201; typicalSpeed=820; - ACE_caliber=0.338; - ACE_bulletLength=1.70; - ACE_bulletMass=300; + ACE_caliber=8.585; + ACE_bulletLength=43.18; + ACE_bulletMass=19.44; 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.381}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={790, 807, 820}; - ACE_barrelLengths[]={20, 24, 26}; + ACE_barrelLengths[]={508.0, 609.6, 660.4}; }; class ACE_338_Ball : B_338_Ball { timeToLive=10; - airFriction=-0.000535; + airFriction=-0.00052190; typicalSpeed=826; - ACE_caliber=0.338; - ACE_bulletLength=1.70; - ACE_bulletMass=300; + ACE_caliber=8.585; + ACE_bulletLength=43.18; + ACE_bulletMass=19.44; 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.381}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; ACE_dragModel=7; ACE_muzzleVelocities[]={800, 820, 826, 830}; - ACE_barrelLengths[]={20, 24, 26.5, 28}; + ACE_barrelLengths[]={508.0, 609.6, 673.1, 711.2}; }; class ACE_338_Ball_API526 : B_338_Ball { timeToLive=10; - airFriction=-0.000673; + airFriction=-0.00069611; caliber=2.8; - typicalSpeed=826; - ACE_caliber=0.338; - ACE_bulletLength=1.535; - ACE_bulletMass=253; + typicalSpeed=895; + ACE_caliber=8.585; + ACE_bulletLength=38.989; + ACE_bulletMass=16.3941242; 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.290}; + ACE_ballisticCoefficients[]={0.560}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ICAO"; - ACE_dragModel=7; + ACE_dragModel=1; ACE_muzzleVelocities[]={880, 915, 925}; - ACE_barrelLengths[]={20, 26, 28}; + ACE_barrelLengths[]={508.0, 660.4, 711.2}; }; class B_127x54_Ball : BulletBase { - airFriction=-0.00014; + airFriction=-0.00019268; typicalSpeed=300; - ACE_caliber=0.510; - ACE_bulletLength=2.540; - ACE_bulletMass=750; + ACE_caliber=12.954; + ACE_bulletLength=64.516; + ACE_bulletMass=48.6; 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[]={1.050}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={300}; - ACE_barrelLengths[]={17.2}; + ACE_barrelLengths[]={436.88}; }; class B_127x99_Ball : BulletBase { timeToLive=10; - airFriction=-0.0006; + airFriction=-0.00057503; typicalSpeed=900; - ACE_caliber=0.510; - ACE_bulletLength=2.310; - ACE_bulletMass=647; + 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[]={29}; + ACE_barrelLengths[]={736.6}; }; class ACE_127x99_API : BulletBase { timeToLive=10; - airFriction=-0.0006; + airFriction=-0.00057503; typicalSpeed=900; hit=25; caliber=4.0; - ACE_caliber=0.510; - ACE_bulletLength=2.310; - ACE_bulletMass=648; + 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[]={29}; + ACE_barrelLengths[]={736.6}; }; class ACE_127x99_Ball_AMAX : B_127x99_Ball { timeToLive=10; - airFriction=-0.000374; + airFriction=-0.00036645; typicalSpeed=860; caliber=3.0; - ACE_caliber=0.510; - ACE_bulletLength=2.540; - ACE_bulletMass=750; + ACE_caliber=12.954; + ACE_bulletLength=64.516; + ACE_bulletMass=48.6; 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[]={1.050}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={860}; - ACE_barrelLengths[]={29}; + ACE_barrelLengths[]={736.6}; }; class B_127x108_Ball : BulletBase { timeToLive=10; - airFriction=-0.00064; + airFriction=-0.00063800; typicalSpeed=820; - ACE_caliber=0.511; - ACE_bulletLength=2.520; - ACE_bulletMass=745; + 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[]={28.7}; + ACE_barrelLengths[]={728.98}; }; class B_45ACP_Ball : BulletBase { - airFriction=-0.0007182; + airFriction=-0.00081221; typicalSpeed=250; - ACE_caliber=0.452; - ACE_bulletLength=0.68; - ACE_bulletMass=230; + ACE_caliber=11.481; + ACE_bulletLength=17.272; + ACE_bulletMass=14.904; 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.195}; ACE_velocityBoundaries[]={}; ACE_standardAtmosphere="ASM"; ACE_dragModel=1; ACE_muzzleVelocities[]={230, 250, 285}; - ACE_barrelLengths[]={4, 5, 9}; + ACE_barrelLengths[]={101.6, 127.0, 228.6}; }; }; diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index 32121e4e87..e368381333 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -12,75 +12,75 @@ class CfgMagazines { initSpeed = 760; }; class ACE_100Rnd_65x39_caseless_mag_Tracer_Dim: 100Rnd_65x39_caseless_mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65x39_Caseless_Tracer_Dim"; - displayName = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_100Rnd_65x39_caseless_mag_Tracer_DimDescription"; + displayName = CSTRING(100Rnd_65x39_caseless_mag_Tracer_DimName); + displayNameShort = CSTRING(100Rnd_65x39_caseless_mag_Tracer_DimNameShort); + descriptionShort = CSTRING(100Rnd_65x39_caseless_mag_Tracer_DimDescription); picture = "\A3\weapons_f\data\ui\m_100rnd_65x39_yellow_ca.paa"; }; class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { initSpeed = 760; }; class ACE_200Rnd_65x39_cased_Box_Tracer_Dim: 200Rnd_65x39_cased_Box { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65x39_Caseless_Tracer_Dim"; - displayName = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimName"; - displayNameShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_200Rnd_65x39_cased_Box_Tracer_DimDescription"; + displayName = CSTRING(200Rnd_65x39_cased_Box_Tracer_DimName); + displayNameShort = CSTRING(200Rnd_65x39_cased_Box_Tracer_DimNameShort); + descriptionShort = CSTRING(200Rnd_65x39_cased_Box_Tracer_DimDescription); picture = "\A3\weapons_f\data\ui\m_200rnd_65x39_yellow_ca.paa"; }; class 30Rnd_65x39_caseless_mag_Tracer; class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65x39_Caseless_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimDescription"; + displayName = CSTRING(30Rnd_65x39_caseless_mag_Tracer_DimName); + displayNameShort = CSTRING(30Rnd_65x39_caseless_mag_Tracer_DimNameShort); + descriptionShort = CSTRING(30Rnd_65x39_caseless_mag_Tracer_DimDescription); }; class 30Rnd_65x39_caseless_green_mag_Tracer; class ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim: 30Rnd_65x39_caseless_green_mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65x39_Caseless_green_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimDescription"; + displayName = CSTRING(30Rnd_65x39_caseless_green_mag_Tracer_DimName); + displayNameShort = CSTRING(30Rnd_65x39_caseless_green_mag_Tracer_DimNameShort); + descriptionShort = CSTRING(30Rnd_65x39_caseless_green_mag_Tracer_DimDescription); }; class 30Rnd_556x45_Stanag: CA_Magazine { }; class ACE_30Rnd_556x45_Stanag_M995_AP_mag: 30Rnd_556x45_Stanag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_556x45_Ball_M995_AP"; - displayName = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_M995_AP_mag_Description"; - initSpeed = 1046; + displayName = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_Name); + displayNameShort = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_NameShort); + descriptionShort = CSTRING(30Rnd_556x45_Stanag_M995_AP_mag_Description); + initSpeed = 865; }; class ACE_30Rnd_556x45_Stanag_Mk262_mag: 30Rnd_556x45_Stanag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_556x45_Ball_Mk262"; - displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk262_mag_Description"; + displayName = CSTRING(30Rnd_556x45_Stanag_Mk262_mag_Name); + displayNameShort = CSTRING(30Rnd_556x45_Stanag_Mk262_mag_NameShort); + descriptionShort = CSTRING(30Rnd_556x45_Stanag_Mk262_mag_Description); initSpeed = 832; }; class ACE_30Rnd_556x45_Stanag_Mk318_mag: 30Rnd_556x45_Stanag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_556x45_Ball_Mk318"; - displayName = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_Stanag_Mk318_mag_Description"; + displayName = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_Name); + displayNameShort = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_NameShort); + descriptionShort = CSTRING(30Rnd_556x45_Stanag_Mk318_mag_Description); initSpeed = 922; }; class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { }; class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_B_556x45_Ball_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimDescription"; + displayName = CSTRING(30Rnd_556x45_mag_Tracer_DimName); + displayNameShort = CSTRING(30Rnd_556x45_mag_Tracer_DimNameShort); + descriptionShort = CSTRING(30Rnd_556x45_mag_Tracer_DimDescription); picture = "\A3\weapons_f\data\ui\m_20stanag_red_ca.paa"; }; @@ -97,180 +97,180 @@ class CfgMagazines { initSpeed = 833; }; class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "B_762x51_Tracer_Red"; - displayName = "$STR_ACE_20Rnd_762x51_mag_TracerName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_TracerNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_TracerDescription"; + displayName = CSTRING(20Rnd_762x51_mag_TracerName); + displayNameShort = CSTRING(20Rnd_762x51_mag_TracerNameShort); + descriptionShort = CSTRING(20Rnd_762x51_mag_TracerDescription); tracersEvery = 1; }; class ACE_20Rnd_762x51_Mag_Tracer_Dim: ACE_20Rnd_762x51_Mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_B_762x51_Tracer_Dim"; - displayName = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimDescription"; + displayName = CSTRING(20Rnd_762x51_mag_Tracer_DimName); + displayNameShort = CSTRING(20Rnd_762x51_mag_Tracer_DimNameShort); + descriptionShort = CSTRING(20Rnd_762x51_mag_Tracer_DimDescription); }; class ACE_20Rnd_762x51_Mag_SD: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_Subsonic"; - displayName = "$STR_ACE_20Rnd_762x51_mag_SDName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; + displayName = CSTRING(20Rnd_762x51_mag_SDName); + displayNameShort = CSTRING(20Rnd_762x51_mag_SDNameShort); + descriptionShort = CSTRING(20Rnd_762x51_mag_SDDescription); initSpeed = 325; }; class ACE_10Rnd_762x51_M118LR_Mag: 10Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_M118LR"; count = 10; - displayName = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_762x51_M118LR_Mag_Description"; + displayName = CSTRING(10Rnd_762x51_M118LR_Mag_Name); + displayNameShort = CSTRING(10Rnd_762x51_M118LR_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_762x51_M118LR_Mag_Description); initSpeed = 780; }; class ACE_10Rnd_762x51_Mk316_Mod_0_Mag: 10Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_Mk316_Mod_0"; count = 10; - displayName = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_762x51_Mk316_Mod_0_Mag_Description"; + displayName = CSTRING(10Rnd_762x51_Mk316_Mod_0_Mag_Name); + displayNameShort = CSTRING(10Rnd_762x51_Mk316_Mod_0_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_762x51_Mk316_Mod_0_Mag_Description); initSpeed = 790; }; class ACE_10Rnd_762x51_Mk319_Mod_0_Mag: 10Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_Mk319_Mod_0"; count = 10; - displayName = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_762x51_Mk319_Mod_0_Mag_Description"; + displayName = CSTRING(10Rnd_762x51_Mk319_Mod_0_Mag_Name); + displayNameShort = CSTRING(10Rnd_762x51_Mk319_Mod_0_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_762x51_Mk319_Mod_0_Mag_Description); initSpeed = 900; }; class ACE_10Rnd_762x51_M993_AP_Mag: 10Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_M993_AP"; count = 10; - displayName = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_762x51_M993_AP_Mag_Description"; + displayName = CSTRING(10Rnd_762x51_M993_AP_Mag_Name); + displayNameShort = CSTRING(10Rnd_762x51_M993_AP_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_762x51_M993_AP_Mag_Description); initSpeed = 920; }; class ACE_20Rnd_762x51_M118LR_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_M118LR"; - displayName = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_M118LR_Mag_Description"; + displayName = CSTRING(20Rnd_762x51_M118LR_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x51_M118LR_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x51_M118LR_Mag_Description); initSpeed = 780; }; class ACE_20Rnd_762x51_Mk316_Mod_0_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_Mk316_Mod_0"; count = 20; - displayName = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_Mk316_Mod_0_Mag_Description"; + displayName = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x51_Mk316_Mod_0_Mag_Description); initSpeed = 790; }; class ACE_20Rnd_762x51_Mk319_Mod_0_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_Mk319_Mod_0"; - displayName = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_Mk319_Mod_0_Mag_Description"; + displayName = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x51_Mk319_Mod_0_Mag_Description); initSpeed = 900; }; class ACE_20Rnd_762x51_M993_AP_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x51_Ball_M993_AP"; count = 20; - displayName = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_M993_AP_Mag_Description"; + displayName = CSTRING(20Rnd_762x51_M993_AP_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x51_M993_AP_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x51_M993_AP_Mag_Description); initSpeed = 920; }; class ACE_20Rnd_762x67_Mk248_Mod_0_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x67_Ball_Mk248_Mod_0"; - displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_0_Mag_Description"; + displayName = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x67_Mk248_Mod_0_Mag_Description); initSpeed = 900; }; class ACE_20Rnd_762x67_Mk248_Mod_1_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x67_Ball_Mk248_Mod_1"; - displayName = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x67_Mk248_Mod_1_Mag_Description"; + displayName = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x67_Mk248_Mod_1_Mag_Description); initSpeed = 880; }; class ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x67_Ball_Berger_Hybrid_OTM"; - displayName = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Name"; - displayNameShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_NameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag_Description"; + displayName = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_Name); + displayNameShort = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_NameShort); + descriptionShort = CSTRING(20Rnd_762x67_Berger_Hybrid_OTM_Mag_Description); initSpeed = 832; }; class ACE_30Rnd_65x47_Scenar_mag: 30Rnd_65x39_caseless_mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65x47_Ball_Scenar"; - displayName = "$STR_ACE_30Rnd_65x47_Scenar_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_65x47_Scenar_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x47_Scenar_mag_Description"; + displayName = CSTRING(30Rnd_65x47_Scenar_mag_Name); + displayNameShort = CSTRING(30Rnd_65x47_Scenar_mag_NameShort); + descriptionShort = CSTRING(30Rnd_65x47_Scenar_mag_Description); }; class ACE_30Rnd_65_Creedmor_mag: 30Rnd_65x39_caseless_mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_65_Creedmor_Ball"; - displayName = "$STR_ACE_30Rnd_65_Creedmor_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_65_Creedmor_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_65_Creedmor_mag_Description"; + displayName = CSTRING(30Rnd_65_Creedmor_mag_Name); + displayNameShort = CSTRING(30Rnd_65_Creedmor_mag_NameShort); + descriptionShort = CSTRING(30Rnd_65_Creedmor_mag_Description); }; class 10Rnd_338_Mag; class ACE_10Rnd_338_300gr_HPBT_Mag: 10Rnd_338_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_338_Ball"; - displayName = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_338_300gr_HPBT_Mag_Description"; + displayName = CSTRING(10Rnd_338_300gr_HPBT_Mag_Name); + displayNameShort = CSTRING(10Rnd_338_300gr_HPBT_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_338_300gr_HPBT_Mag_Description); initSpeed = 800; }; class ACE_10Rnd_338_API526_Mag: 10Rnd_338_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_338_Ball_API526"; - displayName = "$STR_ACE_10Rnd_338_API526_Mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_338_API526_Mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_338_API526_Mag_Description"; + displayName = CSTRING(10Rnd_338_API526_Mag_Name); + displayNameShort = CSTRING(10Rnd_338_API526_Mag_NameShort); + descriptionShort = CSTRING(10Rnd_338_API526_Mag_Description); initSpeed = 880; }; class 5Rnd_127x108_Mag; class ACE_5Rnd_127x99_Mag: 5Rnd_127x108_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "B_127x99_Ball"; - displayName = "$STR_ACE_5Rnd_127x99_Mag_Name"; - displayNameShort = "$STR_ACE_5Rnd_127x99_Mag_NameShort"; - descriptionShort = "$STR_ACE_5Rnd_127x99_Mag_Description"; + displayName = CSTRING(5Rnd_127x99_Mag_Name); + displayNameShort = CSTRING(5Rnd_127x99_Mag_NameShort); + descriptionShort = CSTRING(5Rnd_127x99_Mag_Description); initSpeed = 900; }; class ACE_5Rnd_127x99_API_Mag: 5Rnd_127x108_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_127x99_API"; - displayName = "$STR_ACE_5Rnd_127x99_API_Mag_Name"; - displayNameShort = "$STR_ACE_5Rnd_127x99_API_Mag_NameShort"; - descriptionShort = "$STR_ACE_5Rnd_127x99_API_Mag_Description"; + displayName = CSTRING(5Rnd_127x99_API_Mag_Name); + displayNameShort = CSTRING(5Rnd_127x99_API_Mag_NameShort); + descriptionShort = CSTRING(5Rnd_127x99_API_Mag_Description); initSpeed = 900; }; class ACE_5Rnd_127x99_AMAX_Mag: 5Rnd_127x108_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_127x99_Ball_AMAX"; - displayName = "$STR_ACE_5Rnd_127x99_AMAX_Mag_Name"; - displayNameShort = "$STR_ACE_5Rnd_127x99_AMAX_Mag_NameShort"; - descriptionShort = "$STR_ACE_5Rnd_127x99_AMAX_Mag_Description"; + displayName = CSTRING(5Rnd_127x99_AMAX_Mag_Name); + displayNameShort = CSTRING(5Rnd_127x99_AMAX_Mag_NameShort); + descriptionShort = CSTRING(5Rnd_127x99_AMAX_Mag_Description); initSpeed = 860; }; @@ -279,11 +279,11 @@ class CfgMagazines { initSpeed = 450; }; class ACE_30Rnd_9x19_mag: 30Rnd_9x21_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_9x19_Ball"; - displayName = "$STR_ACE_30Rnd_9x19_mag_Name"; - displayNameShort = "$STR_ACE_30Rnd_9x19_mag_NameShort"; - descriptionShort = "$STR_ACE_30Rnd_9x19_mag_Description"; + displayName = CSTRING(30Rnd_9x19_mag_Name); + displayNameShort = CSTRING(30Rnd_9x19_mag_NameShort); + descriptionShort = CSTRING(30Rnd_9x19_mag_Description); initSpeed = 370; }; @@ -311,11 +311,11 @@ class CfgMagazines { initSpeed = 450; }; class ACE_16Rnd_9x19_mag: 16Rnd_9x21_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_9x19_Ball"; - displayName = "$STR_ACE_16Rnd_9x19_mag_Name"; - displayNameShort = "$STR_ACE_16Rnd_9x19_mag_NameShort"; - descriptionShort = "$STR_ACE_16Rnd_9x19_mag_Description"; + displayName = CSTRING(16Rnd_9x19_mag_Name); + displayNameShort = CSTRING(16Rnd_9x19_mag_NameShort); + descriptionShort = CSTRING(16Rnd_9x19_mag_Description); initSpeed = 370; }; @@ -323,11 +323,11 @@ class CfgMagazines { initSpeed = 800; }; class ACE_10Rnd_762x54_Tracer_mag: 10Rnd_762x54_Mag { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_762x54_Ball_7T2"; - displayName = "$STR_ACE_10Rnd_762x54_Tracer_mag_Name"; - displayNameShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_NameShort"; - descriptionShort = "$STR_ACE_10Rnd_762x54_Tracer_mag_Description"; + displayName = CSTRING(10Rnd_762x54_Tracer_mag_Name); + displayNameShort = CSTRING(10Rnd_762x54_Tracer_mag_NameShort); + descriptionShort = CSTRING(10Rnd_762x54_Tracer_mag_Description); initSpeed = 800; tracersEvery = 1; }; diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index 82e7fef5e3..bb50dcdc2e 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class Sign_F; class ACE_TargetWall: Sign_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 0; class Eventhandlers { init = QUOTE(_this call COMPILE_FILE(scripts\initTargetWall)); @@ -190,9 +190,9 @@ class CfgVehicles { class ACE_Box_Ammo: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Ammo Supply Crate"; + displayName = CSTRING(AmmoSupplyCrate_DisplayName); model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class TransportMagazines { MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,4); MACRO_ADDMAGAZINE(ACE_10Rnd_762x51_M993_AP_Mag,4); @@ -225,5 +225,27 @@ class CfgVehicles { MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_API_Mag,4); MACRO_ADDMAGAZINE(ACE_5Rnd_127x99_AMAX_Mag,4); }; + class AnimationSources { + class Ammo_source { + source = "user"; + animPeriod = 1; + initPhase = 0; + }; + class AmmoOrd_source { + source = "user"; + animPeriod = 1; + initPhase = 1; + }; + class Grenades_source { + source = "user"; + animPeriod = 1; + initPhase = 1; + }; + class Support_source { + source = "user"; + animPeriod = 1; + initPhase = 1; + }; + }; }; }; diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 0f9dbcfbe4..e0cc3f203d 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -1,16 +1,13 @@ +class Single; +class Burst; +class FullAuto; class Mode_SemiAuto; +class Mode_Burst; class Mode_FullAuto; class CfgWeapons { - class DMR_02_base_F; - class DMR_03_base_F; - class DMR_04_base_F; - class DMR_05_base_F; - class DMR_06_base_F; - class GM6_base_F; class LMG_RCWS; - class LRR_base_F; class MGun; class MGunCore; class MMG_01_base_F; @@ -22,19 +19,83 @@ class CfgWeapons { /* Long Rifles */ + class GM6_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class LRR_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00020; // radians. Equal to 0.70 MOA. + }; + }; + + class DMR_06_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_05_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_04_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_03_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00032; // radians. Equal to 1.10 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00032; // radians. Equal to 1.10 MOA. + }; + }; + + class DMR_02_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.000262; // radians. Equal to 0.90 MOA. + }; + }; + + class DMR_01_base_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: MuzzleSlot { + compatibleItems[] += {"ACE_muzzle_mzls_B"}; + }; + }; + class Single: Mode_SemiAuto { + dispersion = 0.0004; // radians. Equal to 1.375 MOA. + }; + }; + class EBR_base_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; - }; - - class DMR_01_base_F: Rifle_Long_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: MuzzleSlot { - compatibleItems[] += {"ACE_muzzle_mzls_B"}; - }; + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. }; }; @@ -46,14 +107,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class arifle_MX_SW_F: arifle_MX_Base_F { magazines[] = { @@ -65,8 +118,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -1.0; - ACE_barrelTwist=9; - ACE_barrelLength=16.0; + ACE_barrelTwist=228.6; + ACE_barrelLength=406.4; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { // Shit is broken again @@ -74,14 +127,6 @@ class CfgWeapons { compatibleItems[] = {"muzzle_snds_H","muzzle_snds_H_SW","ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR. - }; - - class manual: FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class arifle_MXM_F: arifle_MX_Base_F { magazines[] = { @@ -92,15 +137,14 @@ class CfgWeapons { "ACE_30Rnd_65_Creedmor_mag" }; initSpeed = -1.018; - ACE_barrelTwist=9; - ACE_barrelLength=18; + ACE_barrelTwist=228.6; + ACE_barrelLength=457.2; class Single: Single { - dispersion = 0.00029; // radians. Equal to 1 MOA. - // 6.5mm is easily capable of this in a half-tuned rifle. + dispersion = 0.000436; // radians. Equal to 1.50 MOA. }; class FullAuto: FullAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. + dispersion = 0.000436; // radians. Equal to 1.50 MOA. }; }; @@ -112,15 +156,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR? - // Use your imagination for fictional weapons! - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; @@ -137,15 +172,8 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; - ACE_barrelTwist=7; - ACE_barrelLength=12.5; - class manual: Mode_FullAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; - - class Single: manual { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; + ACE_barrelTwist=177.8; + ACE_barrelLength=317.5; }; class LMG_Zafir_F: Rifle_Long_Base_F { initSpeed = -1.0; @@ -154,15 +182,8 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; - ACE_barrelTwist=12; - ACE_barrelLength=18.1; - class FullAuto: Mode_FullAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; - - class Single: Mode_SemiAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; + ACE_barrelTwist=304.8; + ACE_barrelLength=459.74; }; @@ -173,13 +194,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000727; // radians. Equal to 2.5 MOA, about the limit of mass-produced M855. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class mk20_base_F: Rifle_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { @@ -187,14 +201,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus - // some extra for these worn out Greek Army service rifles. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; @@ -202,12 +208,15 @@ class CfgWeapons { class SDAR_base_F: Rifle_Base_F { initSpeed = -0.989; class Single: Mode_SemiAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus - // some extra because Kel-Tec. + dispersion = 0.0008727; // radians. Equal to 3 MOA. }; + class Burst: Mode_Burst { + dispersion = 0.0008727; // radians. Equal to 3 MOA. + }; + class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. + dispersion = 0.0008727; // radians. Equal to 3 MOA. }; }; class pdw2000_base_F: Rifle_Base_F { @@ -241,8 +250,8 @@ class CfgWeapons { class hgun_P07_F: Pistol_Base_F { initSpeed = -0.9778; - ACE_barrelTwist=10; - ACE_barrelLength=4; + ACE_barrelTwist=254.0; + ACE_barrelLength=101.6; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; @@ -253,8 +262,8 @@ class CfgWeapons { class hgun_Rook40_F: Pistol_Base_F { initSpeed = -1.0; - ACE_barrelTwist=10; - ACE_barrelLength=4.4; + ACE_barrelTwist=254.0; + ACE_barrelLength=111.76; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; @@ -265,8 +274,8 @@ class CfgWeapons { class hgun_ACPC2_F: Pistol_Base_F { initSpeed = -1.0; - ACE_barrelTwist=16; - ACE_barrelLength=5; + ACE_barrelTwist=406.4; + ACE_barrelLength=127.0; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; @@ -276,8 +285,8 @@ class CfgWeapons { class hgun_Pistol_heavy_01_F: Pistol_Base_F { initSpeed = -0.96; - ACE_barrelTwist=16; - ACE_barrelLength=4.5; + ACE_barrelTwist=406.4; + ACE_barrelLength=114.3; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; @@ -287,8 +296,8 @@ class CfgWeapons { class hgun_Pistol_heavy_02_F: Pistol_Base_F { initSpeed = -0.92; - ACE_barrelTwist=16; - ACE_barrelLength=3; + ACE_barrelTwist=406.4; + ACE_barrelLength=76.2; /* class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot { @@ -300,8 +309,8 @@ class CfgWeapons { }; class hgun_PDW2000_F: pdw2000_base_F { initSpeed = -1.157; - ACE_barrelTwist=9; - ACE_barrelLength=7; + ACE_barrelTwist=228.6; + ACE_barrelLength=177.8; }; class arifle_Katiba_F: arifle_katiba_Base_F { magazines[] = { @@ -310,8 +319,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; initSpeed = -1.08; - ACE_barrelTwist=8; - ACE_barrelLength=28.7; + ACE_barrelTwist=203.2; + ACE_barrelLength=728.98; }; class arifle_Katiba_C_F: arifle_katiba_Base_F { magazines[] = { @@ -320,8 +329,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; initSpeed = -1.07; - ACE_barrelTwist=8; - ACE_barrelLength=26.8; + ACE_barrelTwist=203.2; + ACE_barrelLength=680.72; }; class arifle_Katiba_GL_F: arifle_katiba_Base_F { magazines[] = { @@ -330,8 +339,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim" }; initSpeed = -1.08; - ACE_barrelTwist=8; - ACE_barrelLength=28.7; + ACE_barrelTwist=203.2; + ACE_barrelLength=728.98; }; class arifle_MX_F: arifle_MX_Base_F { magazines[] = { @@ -340,8 +349,8 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -0.99; - ACE_barrelTwist=9; - ACE_barrelLength=14.5; + ACE_barrelTwist=228.6; + ACE_barrelLength=368.3; }; class arifle_MX_GL_F: arifle_MX_Base_F { magazines[] = { @@ -350,13 +359,13 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -0.99; - ACE_barrelTwist=9; - ACE_barrelLength=14.5; + ACE_barrelTwist=228.6; + ACE_barrelLength=368.3; }; /* class arifle_MX_SW_F: arifle_MX_Base_F { - ACE_barrelTwist=9; - ACE_barrelLength=16.0; + ACE_barrelTwist=228.6; + ACE_barrelLength=406.4; }; */ class arifle_MXC_F: arifle_MX_Base_F { @@ -366,13 +375,13 @@ class CfgWeapons { "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim" }; initSpeed = -0.965; - ACE_barrelTwist=8; - ACE_barrelLength=10.5; + ACE_barrelTwist=203.2; + ACE_barrelLength=266.7; }; /* class arifle_MXM_F: arifle_MX_Base_F { - ACE_barrelTwist=9; - ACE_barrelLength=18; + ACE_barrelTwist=228.6; + ACE_barrelLength=457.2; }; */ class arifle_SDAR_F: SDAR_base_F { @@ -388,13 +397,13 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.989; - ACE_barrelTwist=11.25; - ACE_barrelLength=18; + ACE_barrelTwist=285.75; + ACE_barrelLength=457.2; }; class SMG_02_F: SMG_02_base_F { initSpeed = -1.054; - ACE_barrelTwist=10; - ACE_barrelLength=7.7; + ACE_barrelTwist=254.0; + ACE_barrelLength=195.58; }; class arifle_TRG20_F: Tavor_base_F { magazines[] = { @@ -408,8 +417,8 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.95; - ACE_barrelTwist=7; - ACE_barrelLength=15; + ACE_barrelTwist=177.8; + ACE_barrelLength=381.0; }; class arifle_TRG21_F: Tavor_base_F { magazines[] = { @@ -423,8 +432,8 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.989; - ACE_barrelTwist=7; - ACE_barrelLength=18.1; + ACE_barrelTwist=177.8; + ACE_barrelLength=459.74; }; class arifle_TRG21_GL_F: arifle_TRG21_F { magazines[] = { @@ -438,13 +447,13 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.989; - ACE_barrelTwist=7; - ACE_barrelLength=18.1; + ACE_barrelTwist=177.8; + ACE_barrelLength=459.74; }; /* class LMG_Zafir_F: Rifle_Long_Base_F { - ACE_barrelTwist=12; - ACE_barrelLength=18.1; + ACE_barrelTwist=304.8; + ACE_barrelLength=459.74; }; */ class arifle_Mk20_F: mk20_base_F { @@ -459,8 +468,8 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.98; - ACE_barrelTwist=7; - ACE_barrelLength=17.4; + ACE_barrelTwist=177.8; + ACE_barrelLength=441.96; }; class arifle_Mk20C_F: mk20_base_F { magazines[] = { @@ -474,8 +483,8 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.956; - ACE_barrelTwist=7; - ACE_barrelLength=16; + ACE_barrelTwist=177.8; + ACE_barrelLength=406.4; }; class arifle_Mk20_GL_F: mk20_base_F { magazines[] = { @@ -489,13 +498,13 @@ class CfgWeapons { "ACE_30Rnd_556x45_Stanag_Tracer_Dim" }; initSpeed = -0.956; - ACE_barrelTwist=7; - ACE_barrelLength=16; + ACE_barrelTwist=177.8; + ACE_barrelLength=406.4; }; class SMG_01_F: SMG_01_Base { initSpeed = -1.016; - ACE_barrelTwist=16; - ACE_barrelLength=5.5; + ACE_barrelTwist=406.4; + ACE_barrelLength=139.7; }; class srifle_DMR_01_F: DMR_01_base_F { magazines[] = { @@ -503,8 +512,8 @@ class CfgWeapons { "ACE_10Rnd_762x54_Tracer_mag" }; initSpeed = -1.025; - ACE_barrelTwist=9.5; - ACE_barrelLength=24; + ACE_barrelTwist=241.3; + ACE_barrelLength=609.6; }; class srifle_EBR_F: EBR_base_F { magazines[] = { @@ -518,20 +527,20 @@ class CfgWeapons { "ACE_20Rnd_762x51_Mag_SD" }; initSpeed = -0.9724; - ACE_barrelTwist=12; - ACE_barrelLength=18; + ACE_barrelTwist=304.8; + ACE_barrelLength=457.2; }; /* class LMG_Mk200_F: Rifle_Long_Base_F { initSpeed = -1.0; - ACE_barrelTwist=7; - ACE_barrelLength=12.5; + ACE_barrelTwist=177.8; + ACE_barrelLength=317.5; }; */ class srifle_LRR_F: LRR_base_F { initSpeed = -1.0; - ACE_barrelTwist=13; - ACE_barrelLength=29; + ACE_barrelTwist=330.2; + ACE_barrelLength=736.6; }; class srifle_GM6_F: GM6_base_F { magazines[] = { @@ -542,8 +551,8 @@ class CfgWeapons { "ACE_5Rnd_127x99_AMAX_Mag" }; initSpeed = -1.0; - ACE_barrelTwist=15; - ACE_barrelLength=36.6; + ACE_barrelTwist=381.0; + ACE_barrelLength=730; }; class srifle_DMR_02_F: DMR_02_base_F { magazines[] = { @@ -555,8 +564,8 @@ class CfgWeapons { "ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag" }; initSpeed = -0.962; - ACE_barrelTwist=10; - ACE_barrelLength=20; + ACE_barrelTwist=254.0; + ACE_barrelLength=508.0; }; class srifle_DMR_03_F: DMR_03_base_F { magazines[] = { @@ -570,18 +579,18 @@ class CfgWeapons { "ACE_20Rnd_762x51_Mag_SD" }; initSpeed = -0.9843; - ACE_barrelTwist=10; - ACE_barrelLength=20; + ACE_barrelTwist=254.0; + ACE_barrelLength=508.0; }; class srifle_DMR_04_F: DMR_04_base_F { initSpeed = -1.0; - ACE_barrelTwist=8; - ACE_barrelLength=17.72; + ACE_barrelTwist=203.2; + ACE_barrelLength=450.088; }; class srifle_DMR_05_blk_F: DMR_05_base_F { initSpeed = -1.0; - ACE_barrelTwist=14.17; - ACE_barrelLength=24.41; + ACE_barrelTwist=359.918; + ACE_barrelLength=620.014; }; class srifle_DMR_06_camo_F: DMR_06_base_F { magazines[] = { @@ -595,18 +604,18 @@ class CfgWeapons { "ACE_20Rnd_762x51_Mag_SD" }; initSpeed = -0.9916; - ACE_barrelTwist=12; - ACE_barrelLength=22; + ACE_barrelTwist=304.8; + ACE_barrelLength=558.8; }; class MMG_01_hex_F: MMG_01_base_F { initSpeed = -1.0; - ACE_barrelTwist=14.17; - ACE_barrelLength=21.65; + ACE_barrelTwist=359.918; + ACE_barrelLength=549.91; }; class MMG_02_camo_F: MMG_02_base_F { initSpeed = -1.0; - ACE_barrelTwist=9.25; - ACE_barrelLength=24; + ACE_barrelTwist=234.95; + ACE_barrelLength=609.6; }; class HMG_127 : LMG_RCWS { @@ -615,8 +624,8 @@ class CfgWeapons { }; class HMG_M2: HMG_01 { initSpeed = -1.0; - ACE_barrelTwist=12; - ACE_barrelLength=45; + ACE_barrelTwist=304.8; + ACE_barrelLength=1143.0; }; /* Silencers */ @@ -642,11 +651,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -675,11 +684,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -708,11 +717,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -741,11 +750,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -774,11 +783,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -807,11 +816,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -840,11 +849,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -873,11 +882,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -906,11 +915,11 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; diff --git a/addons/ballistics/README.md b/addons/ballistics/README.md index 2bf158cebc..ac727f83c6 100644 --- a/addons/ballistics/README.md +++ b/addons/ballistics/README.md @@ -1,12 +1,12 @@ ace_ballistics ============== -Changes to weapon and ammunition values. - +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) - [KoffeinFlummi](https://github.com/KoffeinFlummi) - [commy2](https://github.com/commy2) diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index 66ff7d188e..768ba63e02 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -6,8 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"TaoSensai","commy2","Ruthberg"}; - authorUrl = "https://github.com/Taosenai/tmr"; + author[] = {"commy2","Ruthberg"}; VERSION_CONFIG; }; }; diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 7c6d9c85ad..db44078980 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1,8 +1,8 @@  - + - + 6.5mm 30Rnd Tracer IR-DIM Mag 6,5mm Nyomjelző IR-DIM 30-as Tár 6,5mm 30-Patronen-Magazin Leuchtspur IR-DIM @@ -14,7 +14,7 @@ Caricatore 6.5mm 30Rnd Traccianti IR-DIM Магазин из 30-ти 6,5 мм ИК-трассирующих - + 6.5mm IR-DIM 6,5mm IR-DIM 6,5mm IR-DIM @@ -26,7 +26,7 @@ 6.5mm IR-DIM 6,5 мм ИК-трассирующие - + Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL Kaliber: 6,5x39mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL Kaliber: 6,5x39mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL @@ -38,7 +38,7 @@ Calibro: 6.5x39mm Traccianti IR-DIM <br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - + 6.5mm 30Rnd SD Mag 6,5mm Halk 30-as Tár 6,5mm 30-Patronen-Magazin SD @@ -50,7 +50,7 @@ Caricatore 6.5mm 30Rnd Sil. Магазин из 30-ти 6,5 мм дозвуковых - + 6.5mm SD 6,5mm Halk 6,5mm SD @@ -62,7 +62,7 @@ 6.5mm Sil. 6,5 мм дозвуковые - + Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL Kaliber: 6,5x39mm Halk<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL Kaliber: 6,5x39mm SD<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL @@ -74,7 +74,7 @@ Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: MX/C/M/SW/3GL Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - + 6.5mm 30Rnd AP Mag 6,5mm Páncéltörő 30-as Tár 6,5mm 30-Patronen-Magazin AP @@ -86,7 +86,7 @@ Caricatore 6.5mm 30Rnd AP Магазин из 30-ти 6,5 мм бронебойных - + 6.5mm AP 6,5mm Páncéltörő 6,5mm AP @@ -98,7 +98,7 @@ 6.5mm AP 6,5 мм бронебойные - + Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: MX/C/M/SW/3GL Kaliber: 6,5x39mm Páncéltörő<br />Lövedékek: 30<br />Használható: MX/C/M/SW/3GL Kaliber: 6,5x39mm AP<br />Patronen: 30<br />Eingesetzt von: MX/C/M/SW/3GL @@ -111,7 +111,7 @@ Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: MX/C/M/SW/3GL - + 6.5mm 30Rnd Tracer IR-DIM Mag 6,5mm IR-DIM Nyomjelző 30-as Tár 6,5mm 30-Patronen-Magazin Leuchtspur IR-DIM @@ -123,7 +123,7 @@ Caricatore 6.5mm 30Rnd Traccianti IR-DIM Магазин из 30-ти 6,5 мм ИК-трассирующих - + 6.5mm IR-DIM 6,5mm IR-DIM 6,5mm IR-DIM @@ -135,7 +135,7 @@ 6.5mm IR-DIM 6,5 мм ИК-трассирующие - + Caliber: 6.5x39mm Tracer IR-DIM<br />Rounds: 30<br />Used in: Katiba Kaliber: 6,5x39mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: Katiba Kaliber: 6,5x39mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: Katiba @@ -147,7 +147,7 @@ Calibro: 6.5x39mm Tracciant IR-DIM<br />Munizioni: 30<br />In uso su: Katiba Калибр: 6,5x39 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: Katiba - + 6.5mm 30Rnd SD Mag 6,5mm Halk 30-as Tár 6,5mm 30-Patronen-Magazin SD @@ -159,7 +159,7 @@ Caricatore 6.5mm 30Rnd Sil. Магазин из 30-ти 6,5 мм дозвуковых - + 6.5mm SD 6,5mm Halk 6,5mm SD @@ -171,7 +171,7 @@ 6.5mm Sil. 6,5 мм дозвуковые - + Caliber: 6.5x39mm SD<br />Rounds: 30<br />Used in: Katiba Kaliber: 6,5x39mm Halk<br />Lövedékek: 30<br />Használható: Katiba Kaliber: 6,5x39mm SD<br />Patronen: 30<br />Eingesetzt von: Katiba @@ -183,7 +183,7 @@ Calibro: 6.5x39mm Sil.<br />Munizioni: 30<br />In uso su: Katiba Калибр: 6,5x39 мм дозвуковые<br />Патронов: 30<br />Используются с: Katiba - + 6.5mm 30Rnd AP Mag 6,5mm Páncéltörő 30-as Tár 6,5mm 30-Patronen-Magazin AP @@ -195,7 +195,7 @@ Caricatore 6.5mm 30Rnd AP Магазин из 30-ти 6,5 мм бронебойных - + 6.5mm AP 6,5mm Páncéltörő 6,5mm AP @@ -207,7 +207,7 @@ 6.5mm AP 6,5 мм бронебойные - + Caliber: 6.5x39mm AP<br />Rounds: 30<br />Used in: Katiba Kaliber: 6,5x39mm Páncéltörő<br />Lövedékek: 30<br />Használható: Katiba Kaliber: 6,5x39mm AP<br />Patronen: 30<br />Eingesetzt von: Katiba @@ -220,7 +220,7 @@ Калибр: 6,5x39 мм бронебойные<br />Патронов: 30<br />Используются с: Katiba - + 5.56mm 30rnd Tracer IR-DIM Mag 5,56mm Nyomjelző IR-DIM 30-as Tár 5,56mm 30-Patronen-Magazin Leuchtspur IR-DIM @@ -232,7 +232,7 @@ Caricatore 5.56mm 30rnd Traccianti IR-DIM Магазин из 30-ти 5,56 мм ИК-трассирующих - + 5.56mm IR-DIM 5,56mm IR-DIM 5,56mm IR-DIM @@ -244,7 +244,7 @@ 5.56mm IR-DIM 5,56 мм ИК-трассирующие - + Caliber: 5.56x45mm Tracer IR-DIM<br />Rounds: 30<br />Used in: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Kaliber: 5,56x45mm Nyomjelző IR-DIM<br />Lövedékek: 30<br />Használható: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR Kaliber: 5,56x45mm Leuchtspur IR-DIM<br />Patronen: 30<br />Eingesetzt von: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR @@ -257,7 +257,7 @@ Калибр: 5,56x45 мм ИК-трассирующие<br />Патронов: 30<br />Используются с: TRG-20, TRG-21/EGLM, Mk20/C/EGLM, SDAR - + 7.62mm 20rnd Tracer Mag 7,62mm Nyomjelző IR-DIM 20-as Tár 7,62mm 20-Patronen-Magazin Leuchtspur @@ -269,7 +269,7 @@ Caricatore 7.62mm 20Rnd Traccianti Магазин из 20-ти 7,62 мм трассирующих - + 7.62mm Tracer 7,62mm Nyomjelző 7,62mm Leuchtspur @@ -281,7 +281,7 @@ 7.62mm Traccianti 7,62 мм трассирущие - + Caliber: 7.62x51mm Tracer<br />Rounds: 20<br />Used in: Mk18 ABR Kaliber: 7,62x51mm Nyomjelző<br />Lövedékek: 20<br />Használható: Mk18 ABR Kaliber: 7,62x51mm Leuchtspur<br />Patronen: 20<br />Eingesetzt von: EBR @@ -293,7 +293,7 @@ Calibro: 7.62x51mm Traccianti<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7,62x51 мм трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR - + 7.62mm 20rnd Tracer IR-DIM Mag 7,62mm Nyomjelző IR-DIM 20-as Tár 7,62mm 20-Patronen-Magazin Leuchtspur IR-DIM @@ -305,7 +305,7 @@ Caricatore 7.62mm 20rnd Traccianti IR-DIM Магазин из 20-ти 7,62 мм ИК-трассирующих - + 7.62mm IR-DIM 7,62mm IR-DIM 7,62mm IR-DIM @@ -317,7 +317,7 @@ 7.62mm IR-DIM 7,62 мм ИК-трассирующие - + Caliber: 7.62x51mm Tracer IR-DIM<br />Rounds: 20<br />Used in: Mk18 ABR Kaliber: 7,62x51mm Nyomjelző IR-DIM<br />Lövedékek: 20<br />Használható: Mk18 ABR Kaliber: 7,62x51mm Leuchtspur IR-DIM<br />Patronen: 20<br />Eingesetzt von: EBR @@ -329,7 +329,7 @@ Calibro: 7.62x51mm Traccianti IR-DIM<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7,62x51 мм ИК-трассирующие<br />Патронов: 20<br />Используются с: Mk18 ABR - + 7.62mm 20Rnd SD Mag 7,62mm Halk 20-as Tár 7,62mm 20-Patronen-Magazin SD @@ -341,7 +341,7 @@ Caricatore 7.62mm 20Rnd Sil. Магазин из 20-ти 7,62 мм дозвуковых - + 7.62mm SD 7,62mm Halk 7,62mm SD @@ -353,7 +353,7 @@ 7.62mm Sil. 7,62 мм дозвуковые - + Caliber: 7.62x51mm SD<br />Rounds: 20<br />Used in: Mk18 ABR Kaliber: 7,62x51mm Halk<br />Lövedékek: 20<br />Használható: Mk18 ABR Kaliber: 7,62x51mm SD<br />Patronen: 20<br />Eingesetzt von: EBR @@ -366,7 +366,7 @@ Калибр: 7,62x51 мм дозвуковые<br />Патронов: 20<br />Используются с: Mk18 ABR - + .338 NM 130Rnd Tracer Belt .338 NM 130-Patronen-Gurt Leuchtspur Taśma .338 NM 130rd Smugacz @@ -378,7 +378,7 @@ Cinto de munição .338 NM com 130 cartuchos .338 NM 130-lövedékes nyomkövető heveder - + .338 NM Tracer .338 NM Leuchtspur .338 NM Tracer @@ -390,7 +390,7 @@ .338 NM Traçante .338 NM nyomkövető - + Caliber: .338 Norma Magnum Tracer<br />Rounds: 130<br />Used in: SPMG Kaliber: .338 Norma Magnum Leuchtspur<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum Smugacz<br />Pociski: 130<br />Używany w: SPMG @@ -402,7 +402,7 @@ Calibre: .338 Norma Magnum Traçante<br />Cartuchos: 130<br />Usado em: SPMG Kaliber: .338 Norma Magnum nyomkövető<br />Lövedékek: 130<br />Használható: SPMG - + .338 NM 130Rnd IR-DIM Belt .338 NM 130-Patronen-Gurt Leuchtspur IR-DIM Taśma .338 NM 130rd IR-DIM @@ -414,7 +414,7 @@ Cinto de munição traçante .338 NM IR-DIM com 130 cartuchos .338 NM 130-lövedékes infravörös nyomkövető heveder - + .338 NM IR-DIM .338 LM IR-DIM .338 NM IR-DIM @@ -426,7 +426,7 @@ .338 NM IR-DIM .338 NM infravörös nyomkövető - + Caliber: .338 Norma Magnum Tracer IR-DIM<br />Rounds: 130<br />Used in: SPMG Kaliber: .338 Norma Magnum Leuchtspur IR-DIM<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum Smugacz IR-DIM<br />Pociski: 130<br />Używany w: SPMG @@ -438,7 +438,7 @@ Calibre: .338 Norma Magnum Traçante IR-DIM<br />Cartuchos: 130<br />Usado em: SPMG Kaliber: .338 Norma Magnum infravörös nyomkövető<br />Lövedékek: 130<br />Használható: SPMG - + .338 NM 130Rnd AP Belt .338 NM 130-Patronen-Gurt Hartkern Taśma .338 NM 130rd AP @@ -450,7 +450,7 @@ Cinto de munição .338 NM com 130 cartuchos AP .338 NM 130-lövedékes páncéltörő heveder - + .338 NM AP .338 NM AP .338 NM AP @@ -462,7 +462,7 @@ .338 NM AP .338 NM páncéltörő - + Caliber: .338 Norma Magnum AP<br />Rounds: 130<br />Used in: SPMG Kaliber: .338 Norma Magnum Hartkern<br />Patronen: 130<br />Eingesetzt von: SPMG Kaliber: .338 Norma Magnum AP<br />Pociski: 130<br />Używane w: SPMG @@ -475,7 +475,7 @@ Kaliber: .338 Norma Magnum páncéltörő<br />Lövedékek: 130<br />Használható: SPMG - + 9.3mm 10Rnd Tracer Mag 9,3mm 10-Patronen-Magazin Leuchtspur Magazynek 9.3mm 10rd Smugacz @@ -487,7 +487,7 @@ Carregador de 10 cartuchos 9.3mm traçantes 9,3mm 10-lövedékes nyomkövető tár - + 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz @@ -499,7 +499,7 @@ 9.3mm Traçante 9,3mm nyomkövető - + Caliber: 9.3x64mm Tracer<br />Rounds: 10<br />Used in: Cyrus Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 10<br />Eingesetzt von: Cyrus Kaliber: 9,3x64mm Smugacz<br />Pociski: 10<br />Używany w: Cyrus @@ -511,7 +511,7 @@ Calibre: 9.3x64mm Traçante<br />Cartuchos: 10<br />Usado em: Cyrus Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 10<br />Használható: Cyrus - + 9.3mm 10Rnd Tracer IR-DIM Mag 9,3mm 10-Patronen-Magazin Leuchtspur IR-DIM Magazynek 9,3mm 10rd Smugacz IR-DIM @@ -523,7 +523,7 @@ Carregador de 10 cartuchos 9.3mm traçantes IR-DIM 9,3mm 10-lövedékes infravörös nyomkövető tár - + 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM @@ -535,7 +535,7 @@ 9.3mm IR-DIM 9,3mm infravörös nyomkövető - + Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 10<br />Used in: Cyrus Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 10<br />Eingesetzt von: Cyrus Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 10<br />Używany w: Cyrus @@ -548,7 +548,7 @@ Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 10<br /> Használható: Cyrus - + 9.3mm 150Rnd Tracer Belt 9,3mm 150-Patronen-Gurt Leuchtspur Taśma 9,3mm 150rd Smugacz @@ -560,7 +560,7 @@ Cinto de munição traçante 9.3mm com 150 cartuchos 9,3mm 150-lövedékes nyomkövető heveder - + 9.3mm Tracer 9,3mm Leuchtspur 9,3mm Smugacz @@ -572,7 +572,7 @@ 9.3mm Traçante 9,3mm nyomkövető - + Caliber: 9.3x64mm Tracer<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Leuchtspur<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm Smugacz<br />Pociski: 150<br />Używane w: Navid @@ -584,7 +584,7 @@ Calibre: 9.3x64mm Traçante<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm nyomkövető<br />Lövedékek: 150<br />Használható: Navid - + 9.3mm 150Rnd Tracer IR-DIM Belt 9,3mm 150-Patronen-Gurt Leuchtspur IR-DIM Taśma 9,3mm 150rd Smugacz IR-DIM @@ -596,7 +596,7 @@ Cinto de munição traçante 9.3mm IR-DIM com 150 cartuchos 9,3mm 150-lövedékes infravörös nyomkövető heveder - + 9.3mm IR-DIM 9,3mm IR-DIM 9,3mm IR-DIM @@ -608,7 +608,7 @@ 9.3mm IR-DIM 9,3mm infravörös nyomkövető - + Caliber: 9.3x64mm Tracer IR-DIM<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Leuchtspur IR-DIM<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm Smugacz IR-DIM<br />Pociski: 150<br />Używane w: Navid @@ -620,7 +620,7 @@ Calibre: 9.3x64mm Traçante IR-DIM<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm infravörös nyomkövető<br />Lövedékek: 150<br />Használható: Navid - + 9.3mm 150Rnd AP Belt 9,3mm 150-Patronen-Gurt Hartkern Taśma 9,3mm 150rd AP @@ -632,7 +632,7 @@ Cinto de munição 9.3mm AP com 150 cartuchos 9,3mm 150-lövedékes páncéltörő heveder - + 9.3mm AP 9,3mm AP 9,3mm AP @@ -644,7 +644,7 @@ 9.3mm AP 9,3mm páncéltörő - + Caliber: 9.3x64mm AP<br />Rounds: 150<br />Used in: Navid Kaliber: 9,3x64mm Hartkern<br />Patronen: 150<br />Eingesetzt von: Navid Kaliber: 9,3x64mm AP<br />Pociski: 150<br />Używane w: Navid @@ -656,7 +656,7 @@ Calibre: 9.3x64mm AP<br />Cartuchos: 150<br />Usado em: Navid Kaliber: 9,3x64mm páncéltörő<br />Lövedékek: 150<br />Használható: Navid - + 9x19mm 16Rnd Mag Magazynek 9x19mm 16rd Ch. 9x19mm 16Cps @@ -668,7 +668,7 @@ Carregador de 16 cartuchos 9x19mm 9x19mm 16-lövedékes tár - + 9x19mm 9x19mm 9x19mm @@ -680,7 +680,7 @@ 9x19mm 9x19mm - + 9x19mm 30Rnd Mag Magazynek 9x19mm 16rd Ch. 9x19mm 30Cps @@ -692,7 +692,7 @@ Carregador de 16 cartuchos 9x19mm 9x19mm 16-lövedékes tár - + 9x19mm 30Rnd Mag Magazynek 9x19mm 30rd Ch. 9x19mm 30Cps @@ -704,7 +704,7 @@ Carregador de 30 cartuchos 9x19mm 9x19mm 30-lövedékes tár - + 9x19mm 9x19mm 9x19mm @@ -716,7 +716,7 @@ 9x19mm 9x19mm - + 9x19mm 30Rnd Mag Magazynek 9x19mm 30rd Ch. 9x19mm 30Cps @@ -728,7 +728,7 @@ Carregador de 30 cartuchos 9x19mm 9x19mm 30-lövedékes tár - + 7.62x54mm 10Rnd Tracer Mag Magazynek 7,62x54mm 10rd Smugacz Ch. 7.62x54mm 10Rnd Traçante @@ -740,7 +740,7 @@ Carregador com 10 cartuchos 7.62x54mm Traçante 7,62x54mm 10-lövedékes nyomkövető tár - + 7.62mm 7,62mm 7.62mm @@ -752,7 +752,7 @@ 7.62mm 7,62mm - + 7.62x54mm 10Rnd Tracer Mag Magazynek 7,62x54mm 10rd Smugacz Ch. 7.62x54mm 10Cps Traçante @@ -764,7 +764,7 @@ Carregador com 10 cartuchos 7.62x54mm Traçante 7,62x54mm 10-lövedékes nyomkövető tár - + 6.5mm 100Rnd Tracer IR-DIM Mag Magazynek 6,5mm 100rd Smugacz IR-DIM Ch. 6.5mm 100Rnd Traçante IR-DIM @@ -776,7 +776,7 @@ Carregador com 100 cartuchos 6.5mm IR-DIM Traçante 6,5mm 100-lövedékes infravörös nyomkövető tár - + 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM @@ -788,7 +788,7 @@ 6.5mm IR-DIM 6,5mm infravörös nyomkövető - + 6.5mm 100Rnd Tracer IR-DIM Mag<br />Rounds: 100<br />Used in: MX LSW Magazynek 6,5mm 100rd Smugacz IR-DIM Ch. 6.5mm 100Rnd Traçante IR-DIM<br />Cartouches: 100<br />Utilisé avec: MX LSW @@ -800,7 +800,7 @@ Carregador 6.5mm 100 Cartuchos Traçantes IR-DIM<br />Cartuchos: 100<br />Usado em: MX LSW 6.5mm 100-lövedékes infravörös nyomkövető tár<br />Lövedékek: 100<br />Használható: MX LSW - + 6.5mm 200Rnd Tracer IR-DIM Belt Magazynek 6,5mm 200rd Smugacz IR-DIM Bande 6.5mm 200Rnd Traçante IR-DIM @@ -812,7 +812,7 @@ Cinto de munição traçante 6.5mm IR-DIM com 200 cartuchos 6,5mm 200-lövedékes infravörös nyomkövető heveder - + 6.5mm IR-DIM 6,5mm IR-DIM 6.5mm IR-DIM @@ -824,7 +824,7 @@ 6.5mm IR-DIM 6,5mm infravörös nyomkövető - + 6.5mm 200Rnd Tracer IR-DIM Belt<br />Rounds: 200<br />Used in: Stoner 99 LMG Magazynek 6,5mm 200rd Smugacz IR-DIM Bande 6.5mm 200Cps Traçante IR-DIM<br />Cartouches: 200<br />Utilisé avec: Stoner 99 LMG @@ -836,7 +836,7 @@ Cinto de munição traçante 6.5mm IR-DIM com 200 cartuchos<br />Cartuchos: 200<br />Usado em: Stoner 99 LMG 6.5mm 200-lövedékes infravörös nyomkövető heveder<br />Lövedékek: 200<br />Használható: Stoner 99 LMG - + 5.56mm 30Rnd Mag (Mk262) Magazynek 5,56mm 30rd Mk262 5.56mm 30Cps (Mk262) @@ -848,7 +848,7 @@ Carregador 5.56mm com 30 cartuchos (Mk262) 5,56mm 30-lövedékes tár (Mk262) - + 5.56mm Mk262 5,56mm Mk262 5.56mm Mk262 @@ -860,7 +860,7 @@ 5.56mm Mk262 5,56mm Mk262 - + Caliber: 5.56x45mm NATO (Mk262)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (Mk262)<br />Pociski: 30 Calibre: 5.56x45mm NATO (Mk262)<br />Cartouches: 30 @@ -872,7 +872,7 @@ Calibre: 5.56x45mm NATO (Mk262)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (Mk262)<br />Lövedékek: 30 - + 5.56mm 30Rnd Mag (Mk318) Magazynek 5,56mm 30rd (Mk318) Ch. 5.56mm 30Cps (Mk318) @@ -884,7 +884,7 @@ Carregador 5.56mm com 30 cartuchos (Mk318) 5,56mm 30-lövedékes tár (Mk318) - + 5.56mm Mk318 5,56mm Mk318 5.56mm Mk318 @@ -896,7 +896,7 @@ 5.56mm Mk318 5,56mm Mk318 - + Caliber: 5.56x45mm NATO (Mk318)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (Mk318)<br />Pociski: 30 Calibre: 5.56x45mm NATO (Mk318)<br />Cartouches: 30 @@ -908,7 +908,7 @@ Calibre: 5.56x45mm NATO (Mk318)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (Mk318)<br />Lövedékek: 30 - + 5.56mm 30Rnd Mag (M995 AP) Magazynek 5,56mm 30rd (M995 AP) Ch. 5.56mm 30Cps (M995 AP) @@ -920,7 +920,7 @@ Carregador 5.56mm com 30 cartuchos (M995 AP) 5,56mm 30-lövedékes tár (M995 páncéltörő) - + 5.56mm AP 5,56mm AP 5.56mm AP @@ -932,7 +932,7 @@ 5.56mm M995 AP 5,56mm páncéltörő - + Caliber: 5.56x45mm NATO (M995 AP)<br />Rounds: 30 Kaliber: 5,56x45mm NATO (M995 AP)<br />Pociski: 30 Calibre: 5.56x45mm NATO (M995 AP)<br />Cartouches: 30 @@ -944,7 +944,7 @@ Calibre: 5.56x45mm NATO (M995 AP)<br/>Cartuchos: 30 Kaliber: 5,56x45mm NATO (M995 páncéltörő)<br />Lövedékek: 30 - + 7.62mm 10Rnd Mag (M118LR) Magazynek 7,62mm 10rd (M118LR) Ch. 7.62mm 10Cps (M118LR) @@ -956,7 +956,7 @@ Carregador 7.62mm com 10 cartuchos (M118LR) 7,62mm 10-lövedékes tár (M118LR) - + 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR @@ -968,7 +968,7 @@ 7.62mm M118LR 7,62mm M118LR - + Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (M118LR)<br />Pociski: 10 Calibre: 7.62x51mm NATO (M118LR)<br />Cartouches: 10 @@ -980,7 +980,7 @@ Calibre: 7.26x51mm NATO (M118LR)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 10 - + 7.62mm 20Rnd Mag (M118LR) Magazynek 7,62mm 20rd (M118LR) Ch. 7.62mm 20Cps (M118LR) @@ -992,7 +992,7 @@ Carregador 7.62mm com 20 cartuchos (M118LR) 7,62mm 20-lövedékes tár (M118LR) - + 7.62mm M118LR 7,62mm M118LR 7.62mm M118LR @@ -1004,7 +1004,7 @@ 7.62mm M118LR 7,62mm M118LR - + Caliber: 7.62x51mm NATO (M118LR)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (M118LR)<br />Pociski: 20 Calibre: 7.62x51mm NATO (M118LR)<br />Cartouches: 20 @@ -1016,7 +1016,7 @@ Calibre: 7.26x51mm NATO (M118LR)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (M118LR)<br />Lövedékek: 20 - + 7.62mm 10Rnd Mag (Mk316 Mod 0) Magazynek 7,62mm 10rd (Mk316 Mod 0) Ch. 7.62mm 10Cps (Mk316 Mod 0) @@ -1028,7 +1028,7 @@ Carregador 7.62mm com 10 cartuchos (Mk316 Mod 0) 7,62mm 10-lövedékes tár (Mk316 Mod 0) - + 7.62mm Mk316 7,62mm Mk316 7.62mm Mk316 @@ -1040,7 +1040,7 @@ 7.62mm Mk316 7,62mm Mk316 - + Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 10 Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 10 @@ -1052,7 +1052,7 @@ Calibre: 7.26x51mm NATO (Mk316 Mod 0)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 10 - + 7.62mm 20Rnd Mag (Mk316 Mod 0) Magazynek 7,62mm 20rd (Mk316 Mod 0) Ch. 7.62mm 20Cps (Mk316 Mod 0) @@ -1064,7 +1064,7 @@ Carregador 7.62mm com 20 cartuchos (Mk316 Mod 0) 7,62mm 20-lövedékes tár (Mk316 Mod 0) - + 7.62mm Mk316 7,62mm Mk316 7.62mm Mk316 @@ -1076,7 +1076,7 @@ 7.62mm Mk316 7,62mm Mk316 - + Caliber: 7.62x51mm NATO (Mk316 Mod 0)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Pociski: 20 Calibre: 7.62x51mm NATO (Mk316 Mod 0)<br />Cartouches: 20 @@ -1088,7 +1088,7 @@ Calibre: 7.26x51mm NATO (Mk316 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk316 Mod 0)<br />Lövedékek: 20 - + 7.62mm 10Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 10rd (Mk319 Mod 0) Ch. 7.62mm 10Cps (Mk319 Mod 0) @@ -1100,7 +1100,7 @@ Carregador 7.62mm com 10 cartuchos (Mk319 Mod 0) 7,62mm 10-lövedékes tár (Mk319 Mod 0) - + 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 @@ -1112,7 +1112,7 @@ 7.62mm Mk319 7,62mm Mk319 - + Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 10 Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 10 @@ -1124,7 +1124,7 @@ Calibre: 7.26x51mm NATO (Mk319 Mod 0)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 10 - + 7.62mm 20Rnd Mag (Mk319 Mod 0) Magazynek 7,62mm 20rd (Mk319 Mod 0) Ch. 7.62mm 20Cps (Mk319 Mod 0) @@ -1136,7 +1136,7 @@ Carregador 7.62mm com 20 cartuchos (Mk319 Mod 0) 7,62mm 20-lövedékes tár (Mk319 Mod 0) - + 7.62mm Mk319 7,62mm Mk319 7.62mm Mk319 @@ -1148,7 +1148,7 @@ 7.62mm Mk319 7,62mm Mk319 - + Caliber: 7.62x51mm NATO (Mk319 Mod 0)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Pociski: 20 Calibre: 7.62x51mm NATO (Mk319 Mod 0)<br />Cartouches: 20 @@ -1160,7 +1160,7 @@ Calibre: 7.26x51mm NATO (Mk319 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk319 Mod 0)<br />Lövedékek: 20 - + 7.62mm 10Rnd Mag (M993 AP) Magazynek 7,62mm 10rd (M993 AP) Ch. 7.62mm 10Cps (M993 AP) @@ -1172,7 +1172,7 @@ Carregador 7.62mm com 10 cartuchos (M993 AP) 7,62mm 10-lövedékes tár (M993 páncéltörő) - + 7.62mm AP 7,62mm AP 7.62mm AP @@ -1184,7 +1184,7 @@ 7.62mm AP 7,62mm páncéltörő - + Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 10 Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 10 Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 10 @@ -1196,7 +1196,7 @@ Calibre: 7.26x51mm NATO (M993 AP)<br/>Cartuchos: 10 Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 10 - + 7.62mm 20Rnd Mag (M993 AP) Magazynek 7,62mm 20rd (M993 AP) Ch. 7.62mm 20Cps (M993 AP) @@ -1208,7 +1208,7 @@ Carregador 7.62mm com 20 cartuchos (M993 AP) 7,62mm 20-lövedékes tár (M993 páncéltörő) - + 7.62mm AP 7,62mm AP 7.62mm AP @@ -1220,7 +1220,7 @@ 7.62mm AP 7,62mm páncéltörő - + Caliber: 7.62x51mm NATO (M993 AP)<br />Rounds: 20 Kaliber: 7,62x51mm NATO (M993 AP)<br />Pociski: 20 Calibre: 7.62x51mm NATO (M993 AP)<br />Cartouches: 20 @@ -1232,7 +1232,7 @@ Calibre: 7.26x51mm NATO (M993 AP)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (M993 páncéltörő)<br />Lövedékek: 20 - + 7.62mm 20Rnd Mag (Mk248 Mod 0) Magazynek 7,62mm 20rd (Mk248 Mod 0) Ch. 7.62mm 20Cps (Mk248 Mod 0) @@ -1244,7 +1244,7 @@ Carregador 7.62mm com 20 cartuchos (Mk248 Mod 0) 7,62mm 20-lövedékes tár (Mk248 Mod 0) - + 7.62mm Mk248 7,62mm Mk248 7.62mm Mk248 @@ -1256,7 +1256,7 @@ 7.62mm Mk248 7,62mm Mk248 - + Caliber: 7.62x67mm NATO (Mk248 Mod 0)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Mk248 Mod 0)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 0)<br />Cartouches: 20 @@ -1268,7 +1268,7 @@ Calibre: 7.26x67mm NATO (Mk248 Mod 0)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 0)<br />Lövedékek: 20 - + 7.62mm 20Rnd Mag (Mk248 Mod 1) Magazynek 7,62mm 20rd (Mk248 Mod 1) Ch. 7.62mm 20Cps (Mk248 Mod 1) @@ -1280,7 +1280,7 @@ Carregador 7.62mm com 20 cartuchos (Mk248 Mod 1) 7,62mm 20-lövedékes tár (Mk248 Mod 1) - + 7.62mm Mk248 7,62mm Mk248 7.62mm Mk248 @@ -1292,7 +1292,7 @@ 7.62mm Mk248 7,62mm Mk248 - + Caliber: 7.62x67mm NATO (Mk248 Mod 1)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Mk248 Mod 1)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Mk248 Mod 1)<br />Cartouches: 20 @@ -1304,7 +1304,7 @@ Calibre: 7.26x67mm NATO (Mk248 Mod 1)<br/>Cartuchos: 20 Kaliber: 7,62x51mm NATO (Mk248 Mod 1)<br />Lövedékek: 20 - + 7.62mm 20Rnd Mag (Berger Hybrid OTM) Magazynek 7,62mm 20rd (Berger Hybrid OTM) Ch. 7.62 20Cps (Berger Hybrid OTM) @@ -1316,7 +1316,7 @@ Carregador 7.62mm com 20 cartuchos (Berger Hybrid OTM) 7,62mm 20-lövedékes tár (Berger Hybrid OTM) - + 7.62mm OTM 7,62mm OTM 7.62mm OTM @@ -1328,7 +1328,7 @@ 7.62mm OTM 7,62mm OTM - + Caliber: 7.62x67mm NATO (Berger Hybrid OTM)<br />Rounds: 20 Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Pociski: 20 Calibre: 7.62x67mm NATO (Berger Hybrid OTM)<br />Cartouches: 20 @@ -1340,7 +1340,7 @@ Calibre: 7.26x67mm NATO (Berger Hybrid OTM)<br/>Cartuchos: 20 Kaliber: 7,62x67mm NATO (Berger Hybrid OTM)<br />Lövedékek: 20 - + 6.5x47mm 30Rnd Mag (HPBT Scenar) Ch. 6.5x47mm 30Cps (HPBT Scenar) Cargador de 30 balas de 6.5x47mm (HPBT Scenar) @@ -1352,7 +1352,7 @@ Carregador 6.5x47mm com 30 cartuchos (HPBT Scenar) 6,5x47mm 30-lövedékes tár (HPBT Scenar) - + 6.5mm Lapua 6.5mm Lapua 6.5mm Lapua @@ -1364,7 +1364,7 @@ 6.5mm Lapua 6,5mm Lapua - + Caliber: 6.5x47mm (HPBT Scenar)<br />Rounds: 30<br />Used in: MXM Calibre: 6.5x47mm (HPBT Scenar)<br />Cartouches: 30 Calibre: 6.5x47mm (HPBT Scenar)<br />Balas: 30<br />Se usa en: MXM @@ -1376,7 +1376,7 @@ Calibre: 6.5x47mm (HPBT Scenar)<br/>Cartuchos: 30<br/>Usado em: MXM Kaliber: 6,5x47mm (HPBT Scenar)<br />Lövedékek: 30<br />Használható: MXM - + 6.5mm Creedmor 30Rnd Mag Magazynek 6,5mm Creedmor 30rd 6.5mm Creedmor 30Rnd Mag @@ -1388,7 +1388,7 @@ Carregador 6.5mm com 30 cartuchos Creedmor 6,5mm Creedmor 30-lövedékes tár - + 6.5mm CM 6.5mm CM 6.5mm CM @@ -1400,7 +1400,7 @@ 6.5mm CM 6,5mm CM - + Caliber: 6.5x47mm Creedmor<br />Rounds: 30<br />Used in: MXM Kaliber: 6,5x47mm Creedmor<br />Pociski: 30<br />Używany w: MXM Kaliber: 6,5x47mm Creedmor<br />Patronen: 30<br />Eingesetzt von: MXM @@ -1412,7 +1412,7 @@ Calibre: 6.5x47mm Creedmor<br/>Cartuchos: 30<br/>Usado em: MXM Kaliber: 6,5x47mm Creedmor<br />Lövedékek: 30<br />Használható: MXM - + .338 10Rnd Mag (300gr Sierra MatchKing HPBT) Ch. .338 10 Cps (300gr Sierra MatchKing HPBT) Cargador de 10 balas de 8.6x70mm (300gr Sierra MatchKing HPBT) @@ -1424,7 +1424,7 @@ Carregador .338 (300gr Sierra MatchKing HPBT) com 10 cartuchos .338 10-lövedékes tár (300gr Sierra MatchKing HPBT) - + .338 HPBT .338 HPBT .338 HPBT @@ -1436,7 +1436,7 @@ .338 HPBT .338 HPBT - + Caliber: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Rounds: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Cartouches: 10 Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br />Balas: 10 @@ -1448,7 +1448,7 @@ Calibre: 8.6x70mm (300gr Sierra MatchKing HPBT)<br/>Cartuchos: 10 Kaliber: 8,6x70mm (300gr Sierra MatchKing HPBT)<br />Lövedékek: 10 - + .338 10Rnd Mag (API526) Ch. .338 10Cps (API526) Cargador de 10 balas de .338 (API526) @@ -1460,7 +1460,7 @@ Carregador .338 (API526) com 10 cartuchos .338 10-lövedékes tár (API526) - + .338 AP .338 AP .338 AP @@ -1472,7 +1472,7 @@ .338 AP .338 páncéltörő - + Caliber: 8.6x70mm (API526)<br />Rounds: 10 Calibre: 8.6x70mm (API526)<br />Cartouches: 10 Calibre: 8.6x70mm (API526)<br />Balas: 10 @@ -1484,7 +1484,7 @@ Calibre: 8.6x70mm (API526)<br/>Cartuchos: 10 Kaliber: 8,6x70mm (API526)<br />Lövedékek: 10 - + 12.7x99mm 5Rnd Mag Ch. 12.7x99mm 5Cps Cargador de 5 balas de 12.7x99mm @@ -1496,7 +1496,7 @@ Carregador 12.7x99mm com 5 cartuchos 12,7x99mm 5-lövedékes tár - + 12.7mm 12.7mm 12.7mm @@ -1508,7 +1508,7 @@ 12.7mm 12,7mm - + Caliber: 12.7x99mm<br />Rounds: 5 Calibre: 12.7x99mm<br />Cartouches: 5 Calibre: 12.7x99mm<br />Balas: 5 @@ -1520,7 +1520,7 @@ Calibre: 12.7x99mm<br/>Cartuchos: 5 Kaliber: 12,7x99mm<br />Lövedékek: 5 - + 12.7x99mm API 5Rnd Mag Ch. 12.7x99mm API 5Cps Cargador de 5 balas de 12.7x99mm API @@ -1532,7 +1532,7 @@ Carregador 12.7x99mm API com 5 cartuchos 12,7x99mm 5-lövedékes tár (páncéltörő-gyújtó) - + 12.7mm API 12.7mm API 12.7mm API @@ -1544,7 +1544,7 @@ 12.7mm API 12,7mm páncéltörő-gyújtó - + Caliber: 12.7x99mm API<br />Rounds: 5 Calibre: 12.7x99mm API<br />Cartouches: 5 Calibre: 12.7x99mm API<br />Balas: 5 @@ -1556,7 +1556,7 @@ Calibre: 12.7x99mm API<br/>Cartuchos: 5 Kaliber: 12,7x99mm API<br />Lövedékek: 5 - + 12.7x99mm 5Rnd Mag (AMAX) Ch. 12.7x99mm 5Cps (AMAX) Cargador de 5 balas de 12.7x99mm (AMAX) @@ -1568,7 +1568,7 @@ Carregador 12.7x99mm (AMAX) com 5 cartuchos 12,7x99mm 5-lövedékes tár (AMAX) - + 12.7mm 12.7mm 12.7mm @@ -1580,7 +1580,7 @@ 12.7mm 12,7mm - + Caliber: 12.7x99mm (AMAX)<br />Rounds: 5 Calibre: 12.7x99mm (AMAX)<br />Cartouches: 5 Calibre: 12.7x99mm (AMAX)<br />Balas: 5 @@ -1592,5 +1592,13 @@ Calibre: 12.7x99mm (AMAX)<br/>Cartuchos: 5 Kaliber: 12,7x99mm (AMAX)<br />Lövedékek: 5 + + [ACE] Ammo Supply Crate + [ACE] Skrzynka z amunicją + [ACE] Caja de suministros de munición + [ACE] Munitionskiste + [ACE] Bedna s municí + [ACE] Caixa com suprimentos de munição + \ No newline at end of file diff --git a/addons/captives/ACE_Settings.hpp b/addons/captives/ACE_Settings.hpp new file mode 100644 index 0000000000..73bafbab41 --- /dev/null +++ b/addons/captives/ACE_Settings.hpp @@ -0,0 +1,14 @@ +class ACE_Settings { + class GVAR(allowHandcuffOwnSide) { + displayName = CSTRING(ModuleSettings_handcuffSide_name); + description = CSTRING(ModuleSettings_handcuffSide_description); + typeName = "BOOL"; + value = 1; + }; + class GVAR(allowSurrender) { + displayName = CSTRING(ModuleSettings_allowSurrender_name); + description = CSTRING(ModuleSettings_allowSurrender_description); + typeName = "BOOL"; + value = 1; + }; +}; diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 1e2eb3f201..746a1c4b63 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ACE_Actions { class ACE_ApplyHandcuffs { - displayName = "$STR_ACE_Captives_SetCaptive"; + displayName = CSTRING(SetCaptive); selection = "righthand"; distance = 2; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canApplyHandcuffs)); @@ -13,7 +13,7 @@ class CfgVehicles { icon = QUOTE(PATHTOF(UI\handcuff_ca.paa)); }; class ACE_RemoveHandcuffs { - displayName = "$STR_ACE_Captives_ReleaseCaptive"; + displayName = CSTRING(ReleaseCaptive); selection = "righthand"; distance = 2; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRemoveHandcuffs)); @@ -24,7 +24,7 @@ class CfgVehicles { class ACE_MainActions { class ACE_EscortCaptive { - displayName = "$STR_ACE_Captives_EscortCaptive"; + displayName = CSTRING(EscortCaptive); distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canEscortCaptive)); statement = QUOTE([ARR_3(_player, _target, true)] call FUNC(doEscortCaptive)); @@ -35,7 +35,7 @@ class CfgVehicles { hotkey = "E"; }; class ACE_StopEscorting { - displayName = "$STR_ACE_Captives_StopEscorting"; + displayName = CSTRING(StopEscorting); distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canStopEscorting)); statement = QUOTE([ARR_3(_player,_target, false)] call FUNC(doEscortCaptive)); @@ -46,7 +46,7 @@ class CfgVehicles { hotkey = "E"; }; class ACE_LoadCaptive { - displayName = "$STR_ACE_Captives_LoadCaptive"; + displayName = CSTRING(LoadCaptive); distance = 4; condition = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(canLoadCaptive)); statement = QUOTE([ARR_3(_player, _target, objNull)] call FUNC(doLoadCaptive)); @@ -56,22 +56,19 @@ class CfgVehicles { priority = 2.2; hotkey = "L"; }; - class ACE_FriskPerson { - displayName = "$STR_ACE_Captives_FriskPerson"; - distance = 2; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canFriskPerson)); - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doFriskPerson)); - showDisabled = 0; - //icon = ""; //@todo - priority = 3; - hotkey = "F"; + class GVAR(UnloadCaptive) { + displayName = CSTRING(UnloadCaptive); + distance = 4; + condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); + statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); + priority = 1.2; }; }; }; class ACE_SelfActions { class ACE_StopEscortingSelf { - displayName = "$STR_ACE_Captives_StopEscorting"; + displayName = CSTRING(StopEscorting); condition = QUOTE([ARR_2(_player, objNull)] call FUNC(canStopEscorting)); statement = QUOTE([ARR_3(_player,objNull, false)] call FUNC(doEscortCaptive)); exceptions[] = {"isNotEscorting"}; @@ -80,20 +77,22 @@ class CfgVehicles { hotkey = "C"; }; class ACE_StartSurrenderingSelf { - displayName = "$STR_ACE_Captives_StartSurrendering"; + displayName = CSTRING(StartSurrendering); condition = QUOTE([ARR_2(_player, true)] call FUNC(canSurrender)); statement = QUOTE([ARR_2(_player, true)] call FUNC(setSurrendered)); exceptions[] = {}; showDisabled = 0; priority = 0; + icon = QUOTE(PATHTOF(UI\Surrender_ca.paa)); }; class ACE_StopSurrenderingSelf { - displayName = "$STR_ACE_Captives_StopSurrendering"; + displayName = CSTRING(StopSurrendering); condition = QUOTE([ARR_2(_player, false)] call FUNC(canSurrender)); statement = QUOTE([ARR_2(_player, false)] call FUNC(setSurrendered)); exceptions[] = {"isNotSurrendering"}; showDisabled = 0; priority = 0; + icon = QUOTE(PATHTOF(UI\Surrender_ca.paa)); }; }; }; @@ -102,20 +101,13 @@ class CfgVehicles { class ACE_Actions { \ class ACE_MainActions { \ class GVAR(LoadCaptive) { \ - displayName = "$STR_ACE_Captives_LoadCaptive"; \ + displayName = CSTRING(LoadCaptive); \ distance = 4; \ condition = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(canLoadCaptive)); \ statement = QUOTE([ARR_3(_player, objNull, _target)] call FUNC(doLoadCaptive)); \ exceptions[] = {"isNotEscorting"}; \ priority = 1.2; \ }; \ - class GVAR(UnloadCaptive) { \ - displayName = "$STR_ACE_Captives_UnloadCaptive"; \ - distance = 4; \ - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canUnloadCaptive)); \ - statement = QUOTE([ARR_2(_player, _target)] call FUNC(doUnloadCaptive)); \ - priority = 1.2; \ - }; \ }; \ }; @@ -159,21 +151,48 @@ class CfgVehicles { }; class GVAR(ModuleSurrender): Module_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Make Unit Surrender"; - function = QUOTE(DFUNC(moduleSurrender)); + displayName = CSTRING(ModuleSurrender_DisplayName); //Make Unit Surrender + function = QFUNC(moduleSurrender); scope = 2; //show in editor - scopeCurator = 2; //show in zeus - curatorCost = 0; //??? isGlobal = 1; //run global isTriggerActivated = 1; //Wait for triggers icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa)); functionPriority = 0; class Arguments {}; class ModuleDescription: ModuleDescription { - description = "Sync a unit to make them surrender.
Source: ace_captives"; + description = CSTRING(ModuleSurrender_Description); //Sync a unit to make them surrender.
Source: ace_captives sync[] = {"AnyAI"}; }; }; + + class ACE_Module: Module_F {}; + class GVAR(moduleSettings): ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleSettings_DisplayName); + function = QFUNC(moduleSettings); + scope = 2; + icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa)); + isGlobal = 1; + class Arguments { + class allowHandcuffOwnSide { + displayName = CSTRING(ModuleSettings_handcuffSide_name); + description = CSTRING(ModuleSettings_handcuffSide_description); + typeName = "BOOL"; + defaultValue = 1; + }; + class allowSurrender { + displayName = CSTRING(ModuleSettings_allowSurrender_name); + description = CSTRING(ModuleSettings_allowSurrender_description); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription: ModuleDescription { + description = CSTRING(ModuleSettings_Description); + sync[] = {}; + }; + }; }; diff --git a/addons/captives/CfgWeapons.hpp b/addons/captives/CfgWeapons.hpp index be2149ca88..7092962519 100644 --- a/addons/captives/CfgWeapons.hpp +++ b/addons/captives/CfgWeapons.hpp @@ -3,8 +3,8 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_CableTie: ACE_ItemCore { - displayName = "$STR_ACE_Captives_CableTie"; - descriptionShort = "$STR_ACE_Captives_CableTieDescription"; + displayName = CSTRING(CableTie); + descriptionShort = CSTRING(CableTieDescription); model = QUOTE(PATHTOF(models\ace_cabletie.p3d)); picture = QUOTE(PATHTOF(UI\ace_cabletie_ca.paa)); scope = 2; diff --git a/addons/captives/UI/Icon_Module_settings_ca.paa b/addons/captives/UI/Icon_Module_settings_ca.paa new file mode 100644 index 0000000000..365f02cb21 Binary files /dev/null and b/addons/captives/UI/Icon_Module_settings_ca.paa differ diff --git a/addons/captives/UI/Surrender_ca.paa b/addons/captives/UI/Surrender_ca.paa new file mode 100644 index 0000000000..6ddabf4d56 Binary files /dev/null and b/addons/captives/UI/Surrender_ca.paa differ diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index f91f24025e..da2192d3d6 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -11,7 +11,7 @@ if (isServer) then { _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; - systemChat "debug: DC detach"; + //systemChat "debug: DC detach"; }; if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then { _disconnectedPlayer setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index bc6a61bc4f..31bcbe8e02 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -24,6 +24,7 @@ PREP(handlePlayerChanged); PREP(handleRespawn); PREP(handleUnitInitPost); PREP(handleZeusDisplayChanged); +PREP(moduleSettings); PREP(moduleSurrender); PREP(setHandcuffed); PREP(setSurrendered); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index 57de6ee970..cdaf6dc4e4 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {QGVAR(ModuleSurrender)}; + units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)}; weapons[] = {"ACE_CableTie"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ACE_Interaction"}; @@ -12,6 +12,7 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgMoves.hpp" #include "CfgVehicles.hpp" diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf index f69bb2544d..e42b5455ff 100644 --- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf +++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf @@ -18,8 +18,9 @@ PARAMS_2(_unit,_target); -//Player has cableTie, target is alive and not already handcuffed +//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])} diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index 85bd8bbd3e..1d9480fd0b 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -23,4 +23,6 @@ PARAMS_2(_unit,_target); (_target getVariable [QGVAR(isHandcuffed), false]) && {isNull (attachedTo _target)} && {alive _target} && -{!(_target getVariable ["ACE_isUnconscious", false])} +{!(_target getVariable ["ACE_isUnconscious", false])} && +{(vehicle _unit) == _unit} && +{(vehicle _target) == _target} diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 3b810a0c5c..059fb98d03 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks the conditions for being able to surrender + * Checks the conditions for being able switch surrender states * * Arguments: * 0: caller (player) @@ -18,14 +18,14 @@ PARAMS_2(_unit,_newSurrenderState); -if (currentWeapon _unit != "") exitWith {false}; - private "_returnValue"; _returnValue = if (_newSurrenderState) then { - !(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering + //no weapon equiped AND not currently surrendering and + GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { - (_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering + //is Surrendering + (_unit getVariable [QGVAR(isSurrendering), false]) }; _returnValue diff --git a/addons/captives/functions/fnc_canUnloadCaptive.sqf b/addons/captives/functions/fnc_canUnloadCaptive.sqf index a86bdae588..59e798a24c 100644 --- a/addons/captives/functions/fnc_canUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_canUnloadCaptive.sqf @@ -3,15 +3,14 @@ * Check if the unit can unload a captive from the vehicle. * * Arguments: - * 0: Unit that wants to unload a captive - * 1: A captive. ObjNull for the first escorted captive - * 2: Vehicle to unload a captive from + * 0: Unit that wants to unload a captive (player) + * 1: A captive loaded in a vehicle * * Return Value: * The return value * * Example: - * [player, bob, car1] call ACE_captives_fnc_canUnloadCaptive; + * [player, bob] call ACE_captives_fnc_canUnloadCaptive; * * Public: No */ @@ -19,10 +18,6 @@ private ["_cargo"]; -PARAMS_2(_unit,_vehicle); +PARAMS_2(_player,_unit); -_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway. - -_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - -count _cargo > 0 +((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]} diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index b8758065d8..bc2cd97ffd 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -30,7 +30,7 @@ if (_state) then { _unit setVariable [QGVAR(escortedUnit), _target, true]; //Add Actionmenu to release captive - _actionID = _unit addAction [format ["%1", localize "STR_ACE_Captives_StopEscorting"], + _actionID = _unit addAction [format ["%1", localize LSTRING(StopEscorting)], {[(_this select 0), ((_this select 0) getVariable [QGVAR(escortedUnit), objNull]), false] call FUNC(doEscortCaptive);}, nil, 20, false, true, "", QUOTE(!isNull (GETVAR(_target,QGVAR(escortedUnit),objNull)))]; diff --git a/addons/captives/functions/fnc_doFriskPerson.sqf b/addons/captives/functions/fnc_doFriskPerson.sqf index dd7cc3c675..d79c88a5fb 100644 --- a/addons/captives/functions/fnc_doFriskPerson.sqf +++ b/addons/captives/functions/fnc_doFriskPerson.sqf @@ -27,7 +27,7 @@ if (_weapon == primaryWeapon _player && {_weapon != ""}) then { _listedItemClasses = []; -_actions = [localize "STR_ACE_Captives_FriskMenuHeader", ""] call ACE_Interaction_fnc_prepareSelectMenu; +_actions = [localize LSTRING(FriskMenuHeader), ""] call ACE_Interaction_fnc_prepareSelectMenu; _allGear = []; diff --git a/addons/captives/functions/fnc_doUnloadCaptive.sqf b/addons/captives/functions/fnc_doUnloadCaptive.sqf index b7fa57a7bb..5d95189742 100644 --- a/addons/captives/functions/fnc_doUnloadCaptive.sqf +++ b/addons/captives/functions/fnc_doUnloadCaptive.sqf @@ -4,29 +4,18 @@ * * Arguments: * 0: Unit that wants to unload a captive - * 1: Vehicle to unload a captive from. + * 1: A captive loaded in a vehicle * * Return Value: * Nothing * * Example: - * [bob, car] call ACE_captives_fnc_doUnloadCaptive + * [bob, prisoner] call ACE_captives_fnc_doUnloadCaptive * * Public: No */ #include "script_component.hpp" -PARAMS_2(_unit,_vehicle); +PARAMS_2(_unit,_target); -private ["_cargo", "_target"]; - -_cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turret positions. They shouldn't be there anyway. - -_cargo = [_cargo, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter); - -if ((count _cargo) > 0) then { - _target = _cargo select 0; - ["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); -} else { - ERROR("No captive to unload"); -}; +["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent); diff --git a/addons/captives/functions/fnc_handleKilled.sqf b/addons/captives/functions/fnc_handleKilled.sqf index 720bde9df7..3eed932d5a 100644 --- a/addons/captives/functions/fnc_handleKilled.sqf +++ b/addons/captives/functions/fnc_handleKilled.sqf @@ -17,8 +17,10 @@ PARAMS_1(_oldUnit); +if (!local _oldUnit) exitWith {}; + if (_oldUnit getVariable [QGVAR(isHandcuffed), false]) then { - [_oldUnit, false] call FUNC(setSurrendered); + [_oldUnit, false] call FUNC(setHandcuffed); }; if (_oldUnit getVariable [QGVAR(isEscorting), false]) then { diff --git a/addons/captives/functions/fnc_moduleSettings.sqf b/addons/captives/functions/fnc_moduleSettings.sqf new file mode 100644 index 0000000000..c12ac80b99 --- /dev/null +++ b/addons/captives/functions/fnc_moduleSettings.sqf @@ -0,0 +1,19 @@ +/* + * Author: PabstMirror + * Module for captivity settings + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_1(_logic); + +[_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule); diff --git a/addons/captives/functions/fnc_moduleSurrender.sqf b/addons/captives/functions/fnc_moduleSurrender.sqf index bf0e04cd6a..5b40b7663e 100644 --- a/addons/captives/functions/fnc_moduleSurrender.sqf +++ b/addons/captives/functions/fnc_moduleSurrender.sqf @@ -23,37 +23,13 @@ private ["_bisMouseOver", "_mouseOverObject"]; if (!_activated) exitWith {}; if (local _logic) then { - if ((!isnull curatorcamera) && {((count curatorMouseOver) == 2) && {(curatorMouseOver select 1) == _logic}}) then {//in zeus interface and we placed the module - _bisMouseOver = missionNamespace getVariable ["bis_fnc_curatorObjectPlaced_mouseOver", []];//bis caches the previous curatorMouseOver - if ((count _bisMouseOver) == 2) then {//check what mouse was over before the module was placed - _mouseOverObject = _bisMouseOver select 1; - if ((_mouseOverObject isKindOf "CAManBase") && {(vehicle _mouseOverObject) == _mouseOverObject}) then { - TRACE_2("Debug - module surrendering %1",_mouseOverObject,(name _mouseOverObject)); - if (alive _mouseOverObject) then { - if (!(_mouseOverObject getVariable [QGVAR(isSurrendering), false])) then { - ["SetSurrendered", [_mouseOverObject], [_mouseOverObject, true]] call EFUNC(common,targetEvent); - } else { - ["SetSurrendered", [_mouseOverObject], [_mouseOverObject, false]] call EFUNC(common,targetEvent); - }; - } else { - ["STR_ACE_Captives_Zeus_OnlyAlive"] call EFUNC(common,displayTextStructured); - }; - } else { - ["STR_ACE_Captives_Zeus_OnlyInfantry"] call EFUNC(common,displayTextStructured); - }; - } else { - ["STR_ACE_Captives_Zeus_NothingSelected"] call EFUNC(common,displayTextStructured); - }; - } else { - //an editor module - //Modules run before postInit can instal the event handler, so we need to wait a little bit - [{ - PARAMS_1(_units); - { - ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); - } forEach _units; - }, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute); - }; + //Modules run before postInit can instal the event handler, so we need to wait a little bit + [{ + PARAMS_1(_units); + { + ["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent); + } forEach _units; + }, [_units], 0.05, 0.05]call EFUNC(common,waitAndExecute); deleteVehicle _logic; }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 22de70921d..c1a34b636c 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -89,7 +89,7 @@ if (_state) then { PARAMS_2(_args,_pfID); EXPLODE_2_PVT(_args,_unit,_maxTime); //If waited long enough or they re-surrendered or they are unconscious, exit loop - if ((time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { + if ((ACE_time > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; }; //Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition) @@ -98,6 +98,6 @@ if (_state) then { //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpSsurWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; - }, 0, [_unit, (time + 20)]] call CBA_fnc_addPerFrameHandler; + }, 0, [_unit, (ACE_time + 20)]] call CBA_fnc_addPerFrameHandler; }; }; diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 4c139897c9..a65daba683 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -8,7 +8,7 @@ Capturer le prisonnier Aresztuj Zajmout Osobu - Arresta il Prigioniero + Arresta il prigioniero Tomar Prisioneiro Foglyul ejtés Взять в плен @@ -20,7 +20,7 @@ Wypuść więźnia Libérer le prisonnier Osvobodit Zajatce - Libera il Prigioniero + Libera il prigioniero Libertar Prisioneiro Fogoly szabadon engedése Освободить пленника @@ -71,7 +71,7 @@ Fogoly berakása Загрузить пленного Embarcar Prisioneiro - Carica il prigioniero + Fai salire il prigioniero Unload Captive @@ -83,7 +83,7 @@ Fogoly kivevése Выгрузить пленного Desembarcar Prisioneiro - Scarica il prigioniero + Fai scendere il prigioniero Cable Tie @@ -105,7 +105,7 @@ Les Serflex permettent de menotter les prisonniers. Stahovací pásky vám umožní zadržet vězně. A algema plástica permite que você contenha prisioneiros. - Fascietta che ti consente di arrestare i prigionieri. + Fascetta per arrestare i prigionieri Gyorskötöző, emberek foglyulejtéséhez használható. Кабельные стяжки позволяют связывать пленников. @@ -119,7 +119,7 @@ Ekwipunek rewidowanej osoby Инвентарь обысканного человека Inventário da pessoa revistada - Inventario delle persone perquisite + Inventario della persona perquisita Frisk person @@ -140,10 +140,10 @@ Rendirse Render-se Vzdát se - Poddaj się + Kapituluj Сдаться Megadás - Arreso + Arrenditi Stop Surrendering @@ -155,43 +155,65 @@ Podejmij walkę ponownie Прекратить сдачу в плен Megadás abbahagyása - Annulla la resa + Smetti di arrenderti - - Only use on alive units - Utiliser uniquement sur une unité vivante - Nur bei lebenden Einheiten verwendbar - Utilizar solo en unidades vivas - Použitelné jen na živé jednotky - Używaj tylko na żywych jednostkach - Применимо только к живым юнитам - Csak élő egységeken használni - Si può fare solo su persone vive - Usar somente em unidades vivas + + Make Unit Surrender + Skapituluj jednostkę + Hacer que la unidad se rinda + Einheit kapitulieren lassen + Vzdávající se jednotka + Fazer unidade se render - - Only use on dismounted inf - Utiliser uniquement sur du personnel à pied - Nur bei abgesessener Infanterie verwendbar - Utilizar solo en infanteria desmontada - Použitelné jen na pěsích jednotkách - Używaj tylko na piechocie poza wszelkimi pojazdami - Применимо только к пехоте вне техники - Csak járműben kívül lévő egységeken használni - Si può usare solo su fanteria a piedi - Usar somente em infantaria desmontada + + Sync a unit to make them surrender.<br />Source: ace_captives + Zsynchronizuj z jednostką, aby skapitulowała.<br />Źródło: ace_captives + Sincroniza una unidad para hacer que se rinda.<br />Fuente: ace_captives + Einheit synchronisieren, um sie kapitulieren zu lassen.<br />Quelle: ace_captives + Synchronizuj s jednotkou, která se má vzdát.<br />Zdroj: ace_captives + Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives - - Nothing under mouse - Rien sous le curseur - Es wurde nichts ausgewählt - Nada bajo el ratón - Nada debaixo do mouse - Nic není vybráno - Nie ma nic pod kursorem - Ничего не выделено - Semmi sincs az egér alatt - Niente selezionato + + Captives Settings + Ustawienia więźniów + Ajustes de prisioneros + Nastavení zajatce + Ajustes de prisioneiros + + + Controls settings for surrender and cable ties + Moduł ten kontroluje ustawienia kapitulacji oraz opasek zaciskowych + Ajustes de control para rendición y precintos + Toto kontroluje nastavení kapitulace a pout + Controla as configurações de rendição e abraçadeiras + + + Can handcuff own side + Skuwanie sojuszników + Se puede esposar el bando propio + Může spoutat spolubojovníky + Pode algemar o próprio lado + + + Can players cabletie units on their own side + Czy gracze mogą skuwać sojuszników? + Pueden los jugadores esposar unidades en su propio bando + Mohou hráči spoutat jednotky na své straně + Os jogadores podem algemar unidades do seu lado + + + Allow surrendering + Pozwól kapitulować + Permitir rendición + Povolit vzdávání + Permite rendição + + + Players can surrender after holstering their weapon + Gracze mogą skapitulować po schowaniu swojej broni do kabury + Los jugadores pueden rendirse después de enfundar su arma + Hráč se může vzdát poté, co si skryje zbraň + Jogadores podem se render depois de guardar sua arma \ No newline at end of file diff --git a/addons/common/ACE_Settings.hpp b/addons/common/ACE_Settings.hpp new file mode 100644 index 0000000000..d6226fd0ab --- /dev/null +++ b/addons/common/ACE_Settings.hpp @@ -0,0 +1,75 @@ +class ACE_Settings { + /* + * class GVAR(sampleSetting) { + * value = 1; // Value + * typeName = "SCALAR"; // Type (SCALAR, BOOL, STRING, ARRAY, COLOR) + * force = 0; // Force the setting? + * isClientSettable = 1; // Does it appear on the options menu? + * + * // The following settings only apply when isClientSettable == 1 + * displayName = "$STR_ACE_Common_SettingName"; // Stringtable entry with the setting name + * description = "$STR_ACE_Common_SettingDescription"; // Stringtable entry with the setting description + * + * // Only applies if typeName == "SCALAR"; + * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; // Stringtable entries that describe the options + * }; + */ + class GVAR(forceAllSettings) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(checkPBOsAction) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 0; + values[] = {CSTRING(CheckPBO_Action_WarnOnce), CSTRING(CheckPBO_Action_WarnPerm), CSTRING(CheckPBO_Action_Kick)}; + }; + class GVAR(checkPBOsCheckAll) { + value = 0; + typeName = "BOOL"; + isClientSettable = 0; + }; + class GVAR(checkPBOsWhitelist) { + value = "[]"; + typeName = "STRING"; + isClientSettable = 0; + }; + /*class GVAR(enableNumberHotkeys) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(EnableNumberHotkeys); + };*/ + class GVAR(settingFeedbackIcons) { + value = 1; + typeName = "SCALAR"; + force = 0; + isClientSettable = 1; + displayName = CSTRING(SettingFeedbackIconsName); + description = CSTRING(SettingFeedbackIconsDesc); + values[] = {ECSTRING(optionsmenu,Hide), ECSTRING(optionsmenu,TopRightDown), ECSTRING(optionsmenu,TopRightLeft), ECSTRING(optionsmenu,TopLeftDown), ECSTRING(optionsmenu,TopLeftRight)}; + }; + class GVAR(SettingProgressBarLocation) { + value = 0; + typeName = "SCALAR"; + force = 0; + isClientSettable = 1; + displayName = CSTRING(SettingProgressbarLocationName); + description = CSTRING(SettingProgressbarLocationDesc); + values[] = {ECSTRING(optionsmenu,Top), ECSTRING(optionsmenu,Bottom)}; + }; + class GVAR(displayTextColor) { + value[] = {0,0,0,0.1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(SettingDisplayTextColorName); + description = CSTRING(SettingDisplayTextColorDesc); + }; + class GVAR(displayTextFontColor) { + value[] = {1,1,1,1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(SettingDisplayTextFontColorName); + description = CSTRING(SettingDisplayTextFontColorDesc); + }; +}; diff --git a/addons/common/CfgUnitInsignia.hpp b/addons/common/CfgUnitInsignia.hpp index aba82823c9..c1cd541e9c 100644 --- a/addons/common/CfgUnitInsignia.hpp +++ b/addons/common/CfgUnitInsignia.hpp @@ -2,13 +2,13 @@ class CfgUnitInsignia { class ACE_insignia_logo { displayName = "ACE3"; - author = "$STR_ACE_Common_ACETeam"; + author = CSTRING(ACETeam); texture = PATHTOF(data\Insignia_ace3logo_ca.paa); textureVehicle = ""; }; class ACE_insignia_banana { displayName = "ABE3"; - author = "$STR_ACE_Common_ACETeam"; + author = CSTRING(ACETeam); texture = PATHTOF(data\insignia_banana_ca.paa); textureVehicle = ""; }; diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 5a00c038e7..767822f4ea 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -1,124 +1,119 @@ - class CfgVehicles { - /*class Man; - class CAManBase: Man { - // @todo - class UserActions { - class ACE_Fire { - displayName = ""; - priority = -99; - available = 1; - radius = 2.5; - radiusView = 0; - position = ""; - showWindow = 0; - showIn3D = 0; - onlyForPlayer = 1; - shortcut = "DefaultAction"; - condition = QUOTE(call GVAR(UserActionFireCondition)); - statement = QUOTE(call GVAR(UserActionFire)); - userActionID = 100; - }; - }; - };*/ - - // += needs a non inherited entry in that class, otherwise it simply overwrites - //#include - - class Module_F; - class ACE_ModuleCheckPBOs: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Check PBOs"; - function = QFUNC(moduleCheckPBOs); - scope = 2; - isGlobal = 1; - icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); - class Arguments { - class Action { - displayName = "Action"; - description = "What to do with people who do not have the right PBOs?"; - class values { - class WarnOnce { - default = 1; - name = "Warn once"; - value = 0; - }; - class Warn { - name = "Warn (permanent)"; - value = 1; - }; - class Kick { - name = "Kick"; - value = 2; - }; + /*class Man; + class CAManBase: Man { + // @todo + class UserActions { + class ACE_Fire { + displayName = ""; + priority = -99; + available = 1; + radius = 2.5; + radiusView = 0; + position = ""; + showWindow = 0; + showIn3D = 0; + onlyForPlayer = 1; + shortcut = "DefaultAction"; + condition = QUOTE(call GVAR(UserActionFireCondition)); + statement = QUOTE(call GVAR(UserActionFire)); + userActionID = 100; + }; }; - }; - class CheckAll { - displayName = "Check all addons"; - description = "Check all addons instead of only those of ACE?"; - typeName = "BOOL"; - class values { - class WarnOnce { - default = 1; - name = "No"; - value = 0; - }; - class Warn { - name = "Yes"; - value = 1; - }; - }; - }; - class Whitelist { - displayName = "Whitelist"; - description = "What addons are allowed regardless?"; - typeName = "STRING"; - class values { - default = "[]"; - }; - }; + };*/ + + // += needs a non inherited entry in that class, otherwise it simply overwrites + //#include + class Logic; + class Module_F: Logic { + class ModuleDescription; }; - }; - - class ACE_ModuleLSDVehicles: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "LSD Vehicles"; - function = "ACE_Common_fnc_moduleLSDVehicles"; - scope = 2; - icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa)); - isGlobal = 1; - class Arguments { + class ACE_Module: Module_F {}; + class ACE_ModuleCheckPBOs: ACE_Module { + author = CSTRING(ACETeam); + category = "ACE"; + displayName = CSTRING(CheckPBO_DisplayName); + function = QFUNC(moduleCheckPBOs); + scope = 2; + isGlobal = 1; + icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); + class Arguments { + class Action { + displayName = CSTRING(CheckPBO_Action_DisplayName); + description = CSTRING(CheckPBO_Action_Description); + typeName = "NUMBER"; + class values { + class WarnOnce { + default = 1; + name = CSTRING(CheckPBO_Action_WarnOnce); + value = 0; + }; + class Warn { + name = CSTRING(CheckPBO_Action_WarnPerm); + value = 1; + }; + class Kick { + name = CSTRING(CheckPBO_Action_Kick); + value = 2; + }; + }; + }; + class CheckAll { + displayName = CSTRING(CheckPBO_CheckAll_DisplayName); + description = CSTRING(CheckPBO_CheckAll_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class Whitelist { + displayName = CSTRING(CheckPBO_Whitelist_DisplayName); + description = CSTRING(CheckPBO_Whitelist_Description); + typeName = "STRING"; + defaultValue = "[]"; + }; + }; + class ModuleDescription: ModuleDescription { + description = CSTRING(CheckPBO_Description); + }; }; - }; - class Box_NATO_Support_F; - class ACE_Box_Misc: Box_NATO_Support_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Common_MiscItems"; - transportMaxWeapons = 9001; - transportMaxMagazines = 9001; - transportMaxItems = 9001; - maximumload = 9001; + class ACE_ModuleLSDVehicles: ACE_Module { + author = CSTRING(ACETeam); + category = "ACE"; + displayName = CSTRING(LSDVehicles_DisplayName); + function = "ACE_Common_fnc_moduleLSDVehicles"; + scope = 2; + icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa)); + isGlobal = 1; + class Arguments {}; + class ModuleDescription: ModuleDescription { + description = CSTRING(LSDVehicles_Description); + sync[] = {"AnyVehicle"}; + }; + }; - class TransportWeapons {}; - class TransportMagazines {}; - class TransportItems {}; - class TransportBackpacks {}; - }; + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + author = CSTRING(ACETeam); + displayName = CSTRING(MiscItems); + transportMaxWeapons = 9001; + transportMaxMagazines = 9001; + transportMaxItems = 9001; + maximumload = 9001; + + class TransportWeapons {}; + class TransportMagazines {}; + class TransportItems {}; + class TransportBackpacks {}; + }; class Item_Base_F; class ACE_bananaItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = "$STR_ACE_Common_bananaDisplayName"; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(bananaDisplayName); + author = CSTRING(ACETeam); vehicleClass = "Items"; - class TransportItems - { - class ACE_banana - { + class TransportItems { + class ACE_banana { name = "ACE_banana"; count = 1; }; diff --git a/addons/common/CfgVoice.hpp b/addons/common/CfgVoice.hpp index 1fb0f5d2b6..22e0bd7066 100644 --- a/addons/common/CfgVoice.hpp +++ b/addons/common/CfgVoice.hpp @@ -209,7 +209,7 @@ class ACE_RadioProtocolNoRadio: RadioProtocolBase { class CfgVoice { class ACE_NoVoice { - author = "$STR_ACE_Common_ACETeam"; + author = CSTRING(ACETeam); protocol = "ACE_RadioProtocolNoRadio"; variants[] = {1}; directories[] = {"",""}; @@ -217,13 +217,13 @@ class CfgVoice { scope = 2; voiceType = ""; icon = "\a3\Ui_f\data\Map\Markers\Flags\nato_ca.paa"; - displayName = "$STR_ACE_Common_NoVoice"; + displayName = CSTRING(NoVoice); }; }; class CfgVoiceTypes { class ACE_NoVoice { - name = "$STR_ACE_Common_NoVoice"; + name = CSTRING(NoVoice); voices[] = {"ACE_NoVoice","ACE_NoVoice","ACE_NoVoice"}; preview = "ACE_NoVoice"; alternative = ""; diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index 59bb8f6b9a..aa905bb3e6 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -30,10 +30,10 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_Banana: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = CSTRING(ACETeam); scope = 2; - displayName = "$STR_ACE_Common_bananaDisplayName"; - descriptionShort = "$STR_ACE_Common_bananaDescr"; + displayName = CSTRING(bananaDisplayName); + descriptionShort = CSTRING(bananaDescr); model = PATHTOF(data\banana.p3d); picture = PATHTOF(data\icon_banana_ca.paa); icon = "iconObject_circle"; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 9fd402f081..bad8a2b427 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -15,8 +15,12 @@ class RscInGameUI { class RscUnitInfoTank: RscUnitInfo { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent);); }; + + class RscUnitInfoAirNoWeapon: RscUnitInfo { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); + }; - class RscUnitInfoAir: RscUnitInfo { + class RscUnitInfoAir: RscUnitInfoAirNoWeapon { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent);); }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 53de6b5d69..22513ec468 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,18 +1,34 @@ // ACE - Common #include "script_component.hpp" -// Load settings from profile -if (hasInterface) then { - call FUNC(loadSettingsFromProfile); - call FUNC(loadSettingsLocalizedText); -}; +//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); + +//Singe PFEH to handle execNextFrame and waitAndExec: +[{ + private ["_entry"]; + + //Handle the waitAndExec array: + while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do { + _entry = GVAR(waitAndExecArray) deleteAt 0; + (_entry select 2) call (_entry select 1); + }; + + //Handle the execNextFrame array: + { + (_x select 0) call (_x select 1); + } forEach GVAR(nextFrameBufferA); + //Swap double-buffer: + GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB); + GVAR(nextFrameBufferB) = []; + GVAR(nextFrameNo) = diag_frameno + 1; +}, 0, []] call CBA_fnc_addPerFrameHandler; + // Listens for global "SettingChanged" events, to update the force status locally ["SettingChanged", { - PARAMS_2(_name,_value); if !(count _this > 2) exitWith {}; - + private ["_force", "_settingData"]; _force = _this select 2; if (_force) then { _settingData = [_name] call FUNC(getSettingData); @@ -25,6 +41,8 @@ if (hasInterface) then { ["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler); ["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler); +["unloadPersonEvent", DFUNC(unloadPersonLocal)] call FUNC(addEventhandler); + ["lockVehicle", { _this setVariable [QGVAR(lockStatus), locked _this]; _this lock 2; @@ -38,9 +56,13 @@ if (hasInterface) then { ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); +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 (time > 0) exitWith { + if (ACE_time > 0) exitWith { [QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler; }; @@ -54,6 +76,7 @@ QGVAR(remoteFnc) addPublicVariableEventHandler { [missionNamespace] call FUNC(executePersistent); +private ["_currentVersion", "_previousVersion"]; // check previous version number from profile _currentVersion = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); _previousVersion = profileNamespace getVariable ["ACE_VersionNumberString", ""]; @@ -64,8 +87,6 @@ if (_currentVersion != _previousVersion) then { profileNamespace setVariable ["ACE_VersionNumberString", _currentVersion]; }; -0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); - // ACE events "ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; "ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; @@ -84,6 +105,53 @@ if(!isServer) then { ["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler); [FUNC(syncedEventPFH), 0.5, []] call cba_fnc_addPerFrameHandler; +call FUNC(checkFiles); + + +// Create a pfh to wait until all postinits are ready and settings are initialized +[{ + PARAMS_1(_args); + EXPLODE_1_PVT(_args,_waitingMsgSent); + // If post inits are not ready then wait + if !(SLX_XEH_MACHINE select 8) exitWith {}; + + // If settings are not initialized then wait + if (isNil QGVAR(settings) || {(!isServer) && (isNil QEGVAR(modules,serverModulesRead))}) exitWith { + if (!_waitingMsgSent) then { + _args set [0, true]; + diag_log text format["[ACE] Waiting on settings from server"]; + }; + }; + + [(_this select 1)] call cba_fnc_removePerFrameHandler; + + diag_log text format["[ACE] Settings received from server"]; + + // Event so that ACE_Modules have their settings loaded: + ["InitSettingsFromModules", []] call FUNC(localEvent); + + // Load user settings from profile + if (hasInterface) then { + call FUNC(loadSettingsFromProfile); + call FUNC(loadSettingsLocalizedText); + }; + + diag_log text format["[ACE] Settings initialized"]; + + //Event that settings are safe to use: + ["SettingsInitialized", []] call FUNC(localEvent); + +}, 0, [false]] call cba_fnc_addPerFrameHandler; + + +["SettingsInitialized", { + [ + GVAR(checkPBOsAction), + GVAR(checkPBOsCheckAll), + call compile GVAR(checkPBOsWhitelist) + ] call FUNC(checkPBOs) +}] call FUNC(addEventHandler); + /***************************************************************/ /***************************************************************/ @@ -132,6 +200,7 @@ GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ + private ["_newCameraView", "_newInventoryDisplayIsOpen", "_newPlayerInventory", "_newPlayerTurret", "_newPlayerVehicle", "_newPlayerVisionMode", "_newPlayerWeapon", "_newZeusDisplayIsOpen"]; // "playerInventoryChanged" event _newPlayerInventory = [ACE_player] call FUNC(getAllGear); if !(_newPlayerInventory isEqualTo GVAR(OldPlayerInventory)) then { @@ -213,6 +282,7 @@ GVAR(OldIsCamera) = false; [{ // "activeCameraChanged" event + private ["_isCamera"]; _isCamera = {!isNull _x} count ALL_CAMERAS > 0; if !(_isCamera isEqualTo GVAR(OldIsCamera)) then { // Raise ACE event locally @@ -220,7 +290,7 @@ GVAR(OldIsCamera) = false; ["activeCameraChanged", [ACE_player, _isCamera]] call FUNC(localEvent); }; -}, 1, []] call cba_fnc_addPerFrameHandler; // feel free to decrease the sleep 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); @@ -241,7 +311,7 @@ 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 && { time > 0 || isNull player } ) then { +if(isMultiplayer && { ACE_time > 0 || isNull player } ) then { // We are jipping! Get ready and wait, and throw the event [{ if(!(isNull player)) then { @@ -251,13 +321,41 @@ if(isMultiplayer && { time > 0 || isNull player } ) then { }, 0, []] call cba_fnc_addPerFrameHandler; }; -// check dlls -{ - if (_x callExtension "version" == "") then { - private "_errorMsg"; - _errorMsg = format ["Extension %1.dll not installed.", _x]; +//Device Handler: +GVAR(deviceKeyHandlingArray) = []; +GVAR(deviceKeyCurrentIndex) = -1; - diag_log text format ["[ACE] ERROR: %1", _errorMsg]; - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); - }; -} forEach getArray (configFile >> "ACE_Extensions" >> "extensions"); +["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"), +{ + [] call FUNC(deviceKeyFindValidIndex); + if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; + [] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 3); + true +}, +{false}, +[0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key + +["ACE3 Equipment", QGVAR(closeDevice), (localize "STR_ACE_Common_closeHandheldDevice"), +{ + [] call FUNC(deviceKeyFindValidIndex); + if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; + [] call ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 4); + true +}, +{false}, +[0xC7, [false, true, false]], false] call cba_fnc_addKeybind; //CTRL + Home Key + +["ACE3 Equipment", QGVAR(cycleDevice), (localize "STR_ACE_Common_cycleHandheldDevices"), +{ + [1] call FUNC(deviceKeyFindValidIndex); + if (GVAR(deviceKeyCurrentIndex) == -1) exitWith {false}; + _displayName = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 0); + _iconImage = ((GVAR(deviceKeyHandlingArray) select GVAR(deviceKeyCurrentIndex)) select 1); + [_displayName, _iconImage] call FUNC(displayTextPicture); + true +}, +{false}, +[0xC7, [true, false, false]], false] call cba_fnc_addKeybind; //SHIFT + Home Key + + +GVAR(commonPostInited) = true; diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 54a5118cb0..54f374fcc2 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent"); + ADDON = false; // ACE Common Function @@ -9,7 +11,6 @@ PREP(addCanInteractWithCondition); PREP(addLineToDebugDraw); PREP(addSetting); PREP(addToInventory); -PREP(adminKick); PREP(ambientBrightness); PREP(applyForceWalkStatus); PREP(ASLToPosition); @@ -21,6 +22,7 @@ PREP(canInteract); PREP(canInteractWith); PREP(canUseWeapon); PREP(changeProjectileDirection); +PREP(checkFiles); PREP(checkPBOs); PREP(claim); PREP(closeDialogIfTargetMoves); @@ -32,6 +34,8 @@ PREP(currentChannel); PREP(debug); PREP(debugModule); PREP(defineVariable); +PREP(deviceKeyFindValidIndex); +PREP(deviceKeyRegisterNew); PREP(disableAI); PREP(disableUserInput); PREP(displayIcon); @@ -98,6 +102,7 @@ PREP(goKneeling); PREP(hadamardProduct); PREP(hasItem); PREP(hasMagazine); +PREP(hideUnit); PREP(inheritsFrom); PREP(insertionSort); PREP(interpolateFromArray); @@ -169,19 +174,21 @@ PREP(sortAlphabeticallyBy); PREP(stringCompare); PREP(stringToColoredText); PREP(stringRemoveWhiteSpace); -PREP(subString); PREP(switchToGroupSide); PREP(throttledPublicVariable); PREP(toBin); PREP(toBitmask); PREP(toHex); PREP(toNumber); +PREP(unhideUnit); PREP(uniqueElementsOnly); PREP(unloadPerson); +PREP(unloadPersonLocal); PREP(unmuteUnit); PREP(useItem); PREP(useMagazine); PREP(waitAndExecute); +PREP(waveHeightAt); PREP(translateToWeaponSpace); PREP(translateToModelSpace); @@ -284,12 +291,18 @@ PREP(_handleRequestAllSyncedEvents); GVAR(syncedEvents) = HASH_CREATE; +//GVARS for execNextFrame and waitAndExec +GVAR(waitAndExecArray) = []; +GVAR(nextFrameNo) = diag_frameno; +GVAR(nextFrameBufferA) = []; +GVAR(nextFrameBufferB) = []; + // @TODO: Generic local-managed global-synced objects (createVehicleLocal) //Debug ACE_COUNTERS = []; -// Load settings +// Load settings on the server and broadcast them if (isServer) then { call FUNC(loadSettingsOnServer); }; @@ -300,6 +313,7 @@ if (hasInterface) then { // PFH to update the ACE_player variable [{ if !(ACE_player isEqualTo (call FUNC(player))) then { + private ["_oldPlayer"]; _oldPlayer = ACE_player; ACE_player = call FUNC(player); @@ -311,6 +325,18 @@ if (hasInterface) then { }, 0, []] call cba_fnc_addPerFrameHandler; }; +// Time handling +ACE_time = diag_tickTime; +ACE_realTime = diag_tickTime; +ACE_virtualTime = diag_tickTime; +ACE_diagTime = diag_tickTime; +ACE_gameTime = time; +ACE_pausedTime = 0; +ACE_virtualPausedTime = 0; + +PREP(timePFH); +[FUNC(timePFH), 0, []] call cba_fnc_addPerFrameHandler; + // Init toHex [0] call FUNC(toHex); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 27647f8d00..f1bca395f8 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main"}; + requiredAddons[] = {"ace_main","ace_modules"}; author[] = {"KoffeinFlummi"}; authorUrl = "https://github.com/KoffeinFlummi/"; VERSION_CONFIG; @@ -57,77 +57,7 @@ class ACE_Rsc_Control_Base { h = 0; }; -class ACE_Settings { - /* - *class GVAR(sampleSetting) { - * Value - * value = 1; - * - * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) - * typeName = "SCALAR"; - * - * Force the setting? - * force = 0; - * - * Does it appear on the options menu? - * isClientSettable = 1; - * - * The following settings only apply when isClientSettable == 1 - * Stringtable entry with the setting name - * displayName = "$STR_ACE_Common_SettingName"; - * - * Stringtable entry with the setting description - * description = "$STR_ACE_Common_SettingDescription"; - * - * Stringtable entries that describe the options - * Only applies if typeName == "SCALAR"; - * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; - *}; - */ - class GVAR(forceAllSettings) { - value = 0; - typeName = "BOOL"; - }; - /*class GVAR(enableNumberHotkeys) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_EnableNumberHotkeys"; - };*/ - class GVAR(settingFeedbackIcons) { - value = 1; - typeName = "SCALAR"; - force = 0; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingFeedbackIconsName"; - description = "$STR_ACE_Common_SettingFeedbackIconsDesc"; - values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"}; - }; - class GVAR(SettingProgressBarLocation) { - value = 0; - typeName = "SCALAR"; - force = 0; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; - description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; - values[] = {"Top", "Bottom"}; - }; - class GVAR(displayTextColor) { - value[] = {0,0,0,0.1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; - description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; - }; - class GVAR(displayTextFontColor) { - value[] = {1,1,1,1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; - description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; - }; -}; - +#include "ACE_Settings.hpp" #include "define.hpp" #include #include diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 804a0ade78..7ee1f9c502 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -2,18 +2,19 @@ // internal handler for net events #include "script_component.hpp" -private ["_eventType", "_event", "_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged"]; +private ["_eventName", "_eventArgs", "_eventNames", "_eventIndex", "_eventTargets", "_sentEvents", "_owner", "_serverFlagged", "_events"]; +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); -_eventType = _this select 0; -_event = _this select 1; -if(_eventType == "ACEg") then { +PARAMS_2(_eventType,_event); + +if (_eventType == "ACEg") then { _eventName = _event select 0; _eventArgs = _event select 1; _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; - if(_eventIndex != -1) then { + if (_eventIndex != -1) then { _events = (GVAR(events) select 1) select _eventIndex; #ifdef DEBUG_EVENTS @@ -22,7 +23,7 @@ if(_eventType == "ACEg") then { #endif { - if(!isNil "_x") then { + if (!isNil "_x") then { _eventArgs call CALLSTACK_NAMED(_x, format[ARR_3("Net Event %1 ID: %2",_eventName,_forEachIndex)]); #ifdef DEBUG_EVENTS_CALLSTACK diag_log text format[ARR_2(" ID: %1",_forEachIndex)]; @@ -32,14 +33,14 @@ if(_eventType == "ACEg") then { }; }; -if(_eventType == "ACEc") then { - if(isServer) then { +if (_eventType == "ACEc") then { + if (isServer) then { _eventName = _event select 0; _eventTargets = _event select 1; _eventArgs = _event select 2; _sentEvents = []; - if(!IS_ARRAY(_eventTargets)) then { + if (!IS_ARRAY(_eventTargets)) then { _eventTargets = [_eventTargets]; }; @@ -52,14 +53,14 @@ if(_eventType == "ACEc") then { _serverFlagged = false; { _owner = _x; - if(IS_OBJECT(_x)) then { + if (IS_OBJECT(_x)) then { _owner = owner _x; }; - if(!(_owner in _sentEvents)) then { + if (!(_owner in _sentEvents)) then { PUSH(_sentEvents, _owner); ACEg = [_eventName, _eventArgs]; - if(isDedicated || {_x != ACE_player}) then { - if(isDedicated && {local _x} && {!_serverFlagged}) then { + if (isDedicated || {_x != ACE_player}) then { + if (isDedicated && {local _x} && {!_serverFlagged}) then { _serverFlagged = true; ["ACEg", ACEg] call FUNC(_handleNetEvent); } else { diff --git a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf index 2d58aae869..fe05bc498b 100644 --- a/addons/common/functions/fnc__handleRequestSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleRequestSyncedEvent.sqf @@ -17,6 +17,8 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); + //SEH_s if(isServer) then { // Find the event name, and shovel out the events to the client @@ -33,6 +35,7 @@ if(isServer) then { ["SEH_s", _client, [_eventName, _eventLog] ] call FUNC(targetEvent); } else { PARAMS_2(_eventName,_eventLog); + private ["_eventArgs"]; // This is the client handling the response from the server // Start running the events { diff --git a/addons/common/functions/fnc__handleSyncedEvent.sqf b/addons/common/functions/fnc__handleSyncedEvent.sqf index 9807896358..053ecb60b7 100644 --- a/addons/common/functions/fnc__handleSyncedEvent.sqf +++ b/addons/common/functions/fnc__handleSyncedEvent.sqf @@ -28,7 +28,7 @@ if(isServer) then { if(_ttl > -1) then { _internalData = HASH_GET(GVAR(syncedEvents),_name); _eventLog = _internalData select 1; - _eventLog pushback [diag_tickTime, _args, _ttl]; + _eventLog pushback [ACE_diagTime, _args, _ttl]; }; }; diff --git a/addons/common/functions/fnc_addActionEventHandler.sqf b/addons/common/functions/fnc_addActionEventHandler.sqf index a0e9d24f2c..29b058487b 100644 --- a/addons/common/functions/fnc_addActionEventHandler.sqf +++ b/addons/common/functions/fnc_addActionEventHandler.sqf @@ -15,6 +15,7 @@ #include "script_component.hpp" private ["_unit", "_action", "_condition", "_statement", "_name", "_actionsVar", "_actionID", "_actions", "_id", "_actionIDs"]; +//IGNORE_PRIVATE_WARNING("_count", "_index", "_return", "_target"); _unit = _this select 0; _action = _this select 1; diff --git a/addons/common/functions/fnc_addActionMenuEventHandler.sqf b/addons/common/functions/fnc_addActionMenuEventHandler.sqf index 249ee7e1cd..268cc18d5a 100644 --- a/addons/common/functions/fnc_addActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_addActionMenuEventHandler.sqf @@ -18,33 +18,27 @@ */ #include "script_component.hpp" -private ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", "_priority", "_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; +private ["_name", "_actionsVar", "_id", "_actionIDs", "_actions", "_nameVar", "_addAction", "_actionID"]; +//IGNORE_PRIVATE_WARNING("_target"); -_unit = _this select 0; -_displayName = _this select 1; -_action = _this select 2; -_condition = _this select 3; -_statement = _this select 4; -_condition2 = _this select 5; -_statement2 = _this select 6; -_priority = _this select 7; +PARAMS_8(_unit,_displayName,_action,_condition,_statement,_condition2,_statement2,_priority); if (isNil "_priority") then {_priority = 0}; if (typeName _condition == "STRING") then { - _condition = compile _condition; + _condition = compile _condition; }; if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; if (typeName _condition2 == "STRING") then { - _condition2 = compile _condition2; + _condition2 = compile _condition2; }; if (typeName _statement2 == "STRING") then { - _statement2 = compile _statement2; + _statement2 = compile _statement2; }; _name = format ["ACE_ActionMenu_%1", _action]; @@ -61,20 +55,20 @@ missionNamespace setVariable [_nameVar, [_condition, _statement, _condition2, _s _actionIDs pushBack _id; _addAction = call compile format [ - "[ - '%2', - {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, - nil, - %4, - false, - true, - '%1', - ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" - ]", - _action, - _displayName, - _nameVar, - _priority + "[ + '%2', + {if (inputAction '%1' == 0) then {if (_this call (%3 select 2)) then {_this call (%3 select 3)}} else {_this call (%3 select 1)}}, + nil, + %4, + false, + true, + '%1', + ""if (_this != ACE_player || {vehicle _this != _target}) exitWith {false}; [_target, _this] call (%3 select 0)"" + ]", + _action, + _displayName, + _nameVar, + _priority ]; _actionID = _unit addAction _addAction; diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index ef46b23706..10ea084858 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -14,6 +14,8 @@ #include "script_component.hpp" private ["_conditionName", "_conditionFunc"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); + _conditionName = toLower (_this select 0); _conditionFunc = _this select 1; diff --git a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf index 0d1606aaf6..4623bb4ddb 100644 --- a/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf +++ b/addons/common/functions/fnc_addCuratorUnloadEventhandler.sqf @@ -7,7 +7,7 @@ disableSerialization; _dlg = ctrlParent _this; _dlg displayAddEventHandler ["unload", { - if (_this select 1 == 1) then { - [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); - }; + if (_this select 1 == 1) then { + [missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); + }; }]; diff --git a/addons/common/functions/fnc_addEventHandler.sqf b/addons/common/functions/fnc_addEventHandler.sqf index 8524a4abef..86e034a0d9 100644 --- a/addons/common/functions/fnc_addEventHandler.sqf +++ b/addons/common/functions/fnc_addEventHandler.sqf @@ -11,14 +11,15 @@ * Event handler ID number (for use with fnc_removeEventHandler) */ #include "script_component.hpp" -private ["_eventName", "_eventCode", "_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"]; -_eventName = _this select 0; -_eventCode = _this select 1; + +private ["_eventNames", "_eventFunctions", "_eventNameCount", "_eventIndex", "_eventFunctionCount"]; + +PARAMS_2(_eventName,_eventCode); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { +if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; } else { _eventNameCount = count _eventNames; @@ -27,6 +28,6 @@ if(_eventIndex != -1) then { }; _eventFunctionCount = count _eventFunctions; -_eventFunctions set[_eventFunctionCount, _eventCode]; +_eventFunctions set [_eventFunctionCount, _eventCode]; _eventFunctionCount; \ No newline at end of file diff --git a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf index 64ce3e9735..c3975be496 100644 --- a/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_addMapMarkerCreatedEventHandler.sqf @@ -11,12 +11,12 @@ */ #include "script_component.hpp" -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; +private ["_actionsVar", "_id", "_actionIDs", "_actions"]; -_statement = _this select 0; +PARAMS_1(_statement); if (typeName _statement == "STRING") then { - _statement = compile _statement; + _statement = compile _statement; }; _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; @@ -26,8 +26,8 @@ _actionIDs = _actionsVar select 1; _actions = _actionsVar select 2; if (_id == 0) then { - uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; - ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; + uiNamespace setVariable ["ACE_EventHandler_MapMarker", count allMapMarkers]; + ("ACE_EventHandlerHelper2" call BIS_fnc_rscLayer) cutRsc ["ACE_EventHandlerHelper2", "PLAIN"]; }; _actionIDs pushBack _id; diff --git a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf index 98444a160d..d079b4b17e 100644 --- a/addons/common/functions/fnc_addScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_addScrollWheelEventHandler.sqf @@ -1,7 +1,7 @@ /* * Author: commy2 * - * Add an event handler that executes every time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. Argument will be [Interval] where 'Interval' is a number. + * Add an event handler that executes every ACE_time the scroll wheel is used. This is needed, because adding a MouseZ display event handler to display 46 will break in save games. Argument will be [Interval] where 'Interval' is a number. * * Argument: * 0: Code to execute (Code or String) @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_statement", "_actionsVar", "_id", "_actionIDs", "_actions"]; +private ["_actionsVar", "_id", "_actionIDs", "_actions"]; -_statement = _this select 0; +PARAMS_1(_statement); if (typeName _statement == "STRING") then { _statement = compile _statement; diff --git a/addons/common/functions/fnc_addSetting.sqf b/addons/common/functions/fnc_addSetting.sqf index d3f97f8ae0..42299e6458 100644 --- a/addons/common/functions/fnc_addSetting.sqf +++ b/addons/common/functions/fnc_addSetting.sqf @@ -4,14 +4,14 @@ * If has only local effects. * * Arguments: - * 0: _name (String) - * 1: _typeName (String) - * 2: _isClientSetable (Bool) - * 3: _localizedName (String) - * 4: _localizedDescription (String) - * 5: _possibleValues (Array) - * 6: _isForced (Bool) - * 7: _defaultValue (Any) + * 0: name + * 1: typeName + * 2: isClientSetable + * 3: localizedName + * 4: localizedDescription + * 5: possibleValues + * 6: isForced + * 7: defaultValue (Any) * * Return Value: * None @@ -20,7 +20,9 @@ */ #include "script_component.hpp" -EXPLODE_8_PVT(_this,_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); +PARAMS_8(_name,_typeName,_isClientSetable,_localizedName,_localizedDescription,_possibleValues,_isForced,_value); + +private ["_settingData"]; _settingData = [_name] call FUNC(getSettingData); diff --git a/addons/common/functions/fnc_addSyncedEventHandler.sqf b/addons/common/functions/fnc_addSyncedEventHandler.sqf index 5d2b221178..60c90672ef 100644 --- a/addons/common/functions/fnc_addSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_addSyncedEventHandler.sqf @@ -13,6 +13,8 @@ */ //#define DEBUG_MODE_FULL #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING("_handleSyncedEvent"); + PARAMS_2(_name,_handler); private["_ttl", "_eventId", "_data"]; diff --git a/addons/common/functions/fnc_addToInventory.sqf b/addons/common/functions/fnc_addToInventory.sqf index 339055487b..ba76831ba4 100644 --- a/addons/common/functions/fnc_addToInventory.sqf +++ b/addons/common/functions/fnc_addToInventory.sqf @@ -19,13 +19,11 @@ //#define DEBUG_MODE_FULL #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_classname); +PARAMS_2(_unit,_classname); DEFAULT_PARAM(2,_container,""); DEFAULT_PARAM(3,_ammoCount,-1); -private "_addedToPlayer"; -private "_canAdd"; -private "_type"; +private ["_addedToPlayer", "_canAdd", "_type", "_pos"]; _canAdd = false; _addedToPlayer = true; diff --git a/addons/common/functions/fnc_adminKick.sqf b/addons/common/functions/fnc_adminKick.sqf deleted file mode 100644 index bc9afd9fcb..0000000000 --- a/addons/common/functions/fnc_adminKick.sqf +++ /dev/null @@ -1,8 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private "_name"; - -_name = name (_this select 0); - -[_name, "{if (serverCommandAvailable '#kick') then {serverCommand format['#kick %1', _this]}}"] call FUNC(execRemoteFnc); diff --git a/addons/common/functions/fnc_applyForceWalkStatus.sqf b/addons/common/functions/fnc_applyForceWalkStatus.sqf index 0f8ffb58ea..2e1c36db4a 100644 --- a/addons/common/functions/fnc_applyForceWalkStatus.sqf +++ b/addons/common/functions/fnc_applyForceWalkStatus.sqf @@ -17,9 +17,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_forceWalkNumber"]; +private ["_forceWalkNumber"]; -_unit = _this select 0; +PARAMS_1(_unit); _forceWalkNumber = _unit getVariable ["ACE_forceWalkStatusNumber", 0]; _unit forceWalk (_forceWalkNumber > 0); diff --git a/addons/common/functions/fnc_binarizeNumber.sqf b/addons/common/functions/fnc_binarizeNumber.sqf index 11334083f8..0bf968b7ee 100644 --- a/addons/common/functions/fnc_binarizeNumber.sqf +++ b/addons/common/functions/fnc_binarizeNumber.sqf @@ -23,16 +23,16 @@ _array = []; _array resize _minLength; for "_index" from 0 to (_minLength - 1) do { - _array set [_index, false]; + _array set [_index, false]; }; _index = 0; while {_number > 0} do { - _rest = _number mod 2; - _number = floor (_number / 2); + _rest = _number mod 2; + _number = floor (_number / 2); - _array set [_index, _rest == 1]; - _index = _index + 1; + _array set [_index, _rest == 1]; + _index = _index + 1; }; _array diff --git a/addons/common/functions/fnc_blurScreen.sqf b/addons/common/functions/fnc_blurScreen.sqf index 8f5e50289f..57714b63cd 100644 --- a/addons/common/functions/fnc_blurScreen.sqf +++ b/addons/common/functions/fnc_blurScreen.sqf @@ -10,11 +10,11 @@ #include "script_component.hpp" -private ["_id", "_show"]; -_id = _this select 0; +private ["_show"]; +PARAMS_1(_id); _show = if (count _this > 1) then {_this select 1} else {false}; -if (isnil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { +if (isNil QGVAR(SHOW_BLUR_SCREEN_COLLECTION)) then { GVAR(SHOW_BLUR_SCREEN_COLLECTION) = []; }; if (typeName _show == typeName 0) then { diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index ac6687fd4f..f9d9c74dd3 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -1,6 +1,6 @@ /* * Author: esteldunedain and Jaynus - * Returns the result of the function and caches it up to a given time or event + * Returns the result of the function and caches it up to a given ACE_time or event * * Arguments: * 0: Parameters @@ -17,10 +17,12 @@ */ #include "script_component.hpp" -EXPLODE_5_PVT(_this,_params,_function,_namespace,_uid,_duration); +PARAMS_5(_params,_function,_namespace,_uid,_duration); -if (((_namespace getVariable [_uid, [-99999]]) select 0) < diag_tickTime) then { - _namespace setVariable [_uid, [diag_tickTime + _duration, _params call _function]]; +//IGNORE_PRIVATE_WARNING("_eventName"); + +if (((_namespace getVariable [_uid, [-99999]]) select 0) < ACE_diagTime) then { + _namespace setVariable [_uid, [ACE_diagTime + _duration, _params call _function]]; // Does the cache needs to be cleared on an event? if (count _this > 5) then { diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index f4337b6171..2c84f11b4d 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -19,12 +19,11 @@ #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_unit", "_vehicle", "_position", "_checkDistance", "_index"]; +private ["_position", "_checkDistance", "_index"]; _this resize 5; -_unit = _this select 0; -_vehicle = _this select 1; +PARAMS_2(_unit,_vehicle); _position = toLower (_this select 2); _checkDistance = _this select 3; _index = _this select 4; // optional, please don't use @@ -44,218 +43,217 @@ _radius = 0; _enemiesInVehicle = false; //Possible Side Restriction { - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; _return = false; switch (_position) do { - case "driver" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - if (_vehicle isKindOf "Tank") then { - _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; - }; - - _return = CANGETINDRIVER; - }; - - case "pilot" : { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - - _return = CANGETINDRIVER; - }; - - case "gunner" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretGunner); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "commander" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretCommander); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "copilot" : { - private "_turretConfig"; - _turret = [_vehicle] call FUNC(getTurretCopilot); - if (_turret isEqualTo []) exitWith {false}; - - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = CANGETINTURRETINDEX - }; - - case "turret" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "ffv" : { - private ["_turrets", "_turretConfig"]; - _turrets = [_vehicle] call FUNC(getTurretsFFV); - - if (_index != -1 && {_turret = _turrets select _index; - CANGETINTURRETINDEX - }) then { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - } else { - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { - _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); - - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); - - _return = true - }; - }; - }; - }; - - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { + case "driver" : { _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + if (_vehicle isKindOf "Tank") then { + _selectionPosition2 = [-(_selectionPosition select 0), _selectionPosition select 1, _selectionPosition select 2]; }; - _return = true - }; + _return = CANGETINDRIVER; }; - }; - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); - - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; - - if (_index != -1 && {_index in _positions}) then { - _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); - - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - } else { - - _index = _positions select 0; - if (!isNil "_index") then { + case "pilot" : { _radius = getNumber (_config >> "getInRadius"); - _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); - _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; - }; - - _return = true - }; + _return = CANGETINDRIVER; }; - }; - default {}; + case "gunner" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretGunner); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "commander" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretCommander); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "copilot" : { + private "_turretConfig"; + _turret = [_vehicle] call FUNC(getTurretCopilot); + if (_turret isEqualTo []) exitWith {false}; + + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = CANGETINTURRETINDEX + }; + + case "turret" : { + private ["_turrets", "_turretConfig"]; + _turrets = [_vehicle] call FUNC(getTurretsOther); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "ffv" : { + private ["_turrets", "_turretConfig"]; + _turrets = [_vehicle] call FUNC(getTurretsFFV); + + if (_index != -1 && {_turret = _turrets select _index; + CANGETINTURRETINDEX + }) then { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath); + + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_turretConfig >> "memoryPointsGetInGunner")); + + _return = true + }; + }; + }; + }; + + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + } else { + + _index = _positions select 0; + if (!isNil "_index") then { + _radius = getNumber (_config >> "getInRadius"); + _selectionPosition = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInCargo")); + + if (_vehicle isKindOf "Car" && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _selectionPosition2 = _vehicle selectionPosition (getText (_config >> "memoryPointsGetInDriver")); + _selectionPosition2 set [0, -(_selectionPosition2 select 0)]; + }; + + _return = true + }; + }; + }; + + default {}; }; private "_fnc_isInRange"; _fnc_isInRange = { - if (_radius == 0) exitWith {true}; + if (_radius == 0) exitWith {true}; - private ["_unitPosition", "_distance"]; - _unitPosition = getPos _unit; + private ["_unitPosition", "_distance"]; + _unitPosition = getPos _unit; - _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); + _distance = _unitPosition distance (_vehicle modelToWorldVisual _selectionPosition); - if (!isNil "_selectionPosition2") then { - _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); - }; + if (!isNil "_selectionPosition2") then { + _distance = _distance min (_unitPosition distance (_vehicle modelToWorldVisual _selectionPosition2)); + }; - _distance < _radius + _distance < _radius }; // if you want into the cargo and you can't, then check ffv turrets aswell if (_position == "cargo") exitWith { - if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { - [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); - } + if (_return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange}) then {true} else { + [_unit, _vehicle, "ffv", _checkDistance] call FUNC(canGetInPosition); + }; }; _return && {!_checkDistance || {_vehicle == vehicle _unit} || _fnc_isInRange} diff --git a/addons/common/functions/fnc_canInteract.sqf b/addons/common/functions/fnc_canInteract.sqf index e7c2ba1441..4b3e22f646 100644 --- a/addons/common/functions/fnc_canInteract.sqf +++ b/addons/common/functions/fnc_canInteract.sqf @@ -8,6 +8,7 @@ * @PublicAPI: true */ #include "script_component.hpp" -private ["_unit","_return"]; -_unit = _this select 0; + +PARAMS_1(_unit); + (((_unit getvariable [QGVAR(canInteract),0]) < 1) && ([_unit] call FUNC(isAwake)) && !([_unit] call FUNC(isArrested))) \ No newline at end of file diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 667aec38b3..1a6e766855 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -14,10 +14,10 @@ */ #include "script_component.hpp" -private ["_unit", "_target", "_exceptions"]; +private ["_exceptions"]; + +PARAMS_2(_unit,_target); -_unit = _this select 0; -_target = _this select 1; _exceptions = if (count _this > 2) then { _this select 2; } else { diff --git a/addons/common/functions/fnc_canUseWeapon.sqf b/addons/common/functions/fnc_canUseWeapon.sqf index cbb33f1905..ed478a4470 100644 --- a/addons/common/functions/fnc_canUseWeapon.sqf +++ b/addons/common/functions/fnc_canUseWeapon.sqf @@ -3,9 +3,9 @@ // returns true if the unit is on foot or in a ffv position -private ["_unit", "_config"]; +private ["_config"]; -_unit = _this select 0; +PARAMS_1(_unit); if (_unit == vehicle _unit) exitWith {true}; diff --git a/addons/common/functions/fnc_changeProjectileDirection.sqf b/addons/common/functions/fnc_changeProjectileDirection.sqf index 2cb37650b8..5a65ccff41 100644 --- a/addons/common/functions/fnc_changeProjectileDirection.sqf +++ b/addons/common/functions/fnc_changeProjectileDirection.sqf @@ -14,11 +14,9 @@ */ #include "script_component.hpp" -private ["_projectile", "_adjustDir", "_adjustUp", "_adjustSpeed", "_vdir", "_dir", "_up", "_l", "_r", "_vup", "_vel"]; +private ["_adjustSpeed", "_vdir", "_dir", "_up", "_vup", "_vel", "_vlat"]; -_projectile = _this select 0; -_adjustDir = _this select 1; -_adjustUp = _this select 2; +PARAMS_3(_projectile,_adjustDir,_adjustUp); _adjustSpeed = if (count _this > 3) then { _this select 3 diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf new file mode 100644 index 0000000000..647a1b00a6 --- /dev/null +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -0,0 +1,102 @@ +/* + * Author: commy2 + * + * Compares version numbers of PBOs and DLLs. + * + * Argument: + * None. + * + * Return value: + * None. + */ +#include "script_component.hpp" + +/////////////// +// check addons +/////////////// +private "_version"; +_version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); + +diag_log text format ["[ACE]: ACE is version %1.", _version]; + +private "_addons"; +_addons = activatedAddons; +_addons = [_addons, {_this find "ace_" == 0}] call FUNC(filter); + +{ + if (getText (configFile >> "CfgPatches" >> _x >> "versionStr") != _version) then { + private "_errorMsg"; + _errorMsg = format ["File %1.pbo is outdated.", _x]; + + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + + if (hasInterface) then { + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + }; +} forEach _addons; + +/////////////// +// check dlls +/////////////// +{ + if (_x callExtension "version" == "") then { + private "_errorMsg"; + _errorMsg = format ["Extension %1.dll not installed.", _x]; + + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + + if (hasInterface) then { + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + } else { + // Print the current extension version + diag_log text format ["[ACE] Extension version: %1: %2", _x, (_x callExtension "version")]; + }; +} forEach getArray (configFile >> "ACE_Extensions" >> "extensions"); + +/////////////// +// check server version/addons +/////////////// +if (isMultiplayer) then { + if (isServer) then { + // send servers version of ACE to all clients + GVAR(ServerVersion) = _version; + GVAR(ServerAddons) = _addons; + publicVariable QGVAR(ServerVersion); + publicVariable QGVAR(ServerAddons); + } else { + // clients have to wait for the variables + [{ + if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {}; + + private ["_version","_addons"]; + _version = (_this select 0) select 0; + _addons = (_this select 0) select 1; + + if (_version != GVAR(ServerVersion)) then { + private "_errorMsg"; + _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _version]; + + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + + if (hasInterface) then {diag_log str "1"; + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + }; + + _addons = _addons - GVAR(ServerAddons); + if !(_addons isEqualTo []) then { + _errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons]; + + diag_log text format ["[ACE] ERROR: %1", _errorMsg]; + + if (hasInterface) then {diag_log str "1"; + ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + }; + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }, 1, [_version,_addons]] call CBA_fnc_addPerFrameHandler; + }; +}; diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index 7c4aaeba13..ac6d8fb270 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -1,40 +1,97 @@ /* * Author: commy2 - * * Used to execute the checkPBOs module without placing the module. Don't use this together with the module. + * Checks PBO versions and compares to the one running on server. * - * Argument: - * 0: Mode (Number) + * Arguments: + * 0: Mode * 0: Warn once * 1: Warn permanently * 2: Kick - * 1: Check all PBOs? (Boolean, optional default: "[]") - * 2: Whitelist (String, optinal default: false) + * 1: Check all PBOs? (Optional - default: false) + * 2: Whitelist (Optinal - default: "[]") * * Return value: - * None. + * None */ #include "script_component.hpp" -private ["_mode", "_checkAll", "_whitelist", "_logic"]; - -_this resize 3; +private ["_mode", "_checkAll", "_whitelist"]; _mode = _this select 0; -_checkAll = _this select 1; -_whitelist = _this select 2; +_checkAll = if (count _this > 1) then {_this select 1} else {false}; +_whitelist = if (count _this > 2) then {_this select 2} else {"[]"}; -if (isNil "_checkAll") then { - _checkAll = false; +_whitelist = [_whitelist, {toLower _this}] call FUNC(map); + +ACE_Version_CheckAll = _checkAll; +ACE_Version_Whitelist = _whitelist; + +if (!isServer) then { + [_mode, _checkAll, _whitelist] spawn { + private ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer", "_text", "_error", "_rscLayer", "_ctrlHint"]; + PARAMS_3(_mode,_checkAll,_whitelist); + + waitUntil { + sleep 1; + !isNil "ACE_Version_ClientErrors" + }; + + _missingAddon = ACE_Version_ClientErrors select 0; + _missingAddonServer = ACE_Version_ClientErrors select 1; + _oldVersionClient = ACE_Version_ClientErrors select 2; + _oldVersionServer = ACE_Version_ClientErrors select 3; + + // Display error message. + if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { + _text = "[ACE] Version mismatch:

"; + _error = format ["ACE version mismatch: %1: ", profileName]; + + if (_missingAddon) then { + _text = _text + "Detected missing addon on client
"; + _error = _error + "Missing file(s); "; + }; + if (_missingAddonServer) then { + _text = _text + "Detected missing addon on server
"; + _error = _error + "Additional file(s); "; + }; + if (_oldVersionClient) then { + _text = _text + "Detected old client version
"; + _error = _error + "Older version; "; + }; + if (_oldVersionServer) then { + _text = _text + "Detected old server version
"; + _error = _error + "Newer version; "; + }; + + //[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + diag_log text _error; + + if (_mode < 2) then { + _text = composeText [lineBreak, parseText format ["%1", _text]]; + + _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; + _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; + + disableSerialization; + _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; + _ctrlHint ctrlSetStructuredText _text; + + if (_mode == 0) then { + sleep 10; + _rscLayer cutFadeOut 0.2; + }; + }; + + if (_mode == 2) then { + waitUntil {alive player}; // To be able to show list if using checkAll + _text = composeText [parseText format ["%1", _text]]; + ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + }; + }; + }; }; -if (isNil "_whitelist") then { - _whitelist = "[]"; +if (_checkAll) then { + 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); }; - -_logic = "Logic" createVehicleLocal [0,0,0]; -_logic setVariable ["Action", _mode]; -_logic setVariable ["CheckAll", _checkAll]; -_logic setVariable ["Whitelist", _whitelist]; -[_logic, [], true] call FUNC(moduleCheckPBOs); -deleteVehicle _logic; diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index 73317ee876..f97b69e194 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -13,12 +13,8 @@ * */ #include "script_component.hpp" - -private ["_unit", "_target", "_lockTarget"]; - -_unit = _this select 0; -_target = _this select 1; -_lockTarget = _this select 2; + +PARAMS_3(_unit,_target,_lockTarget); if (isNil "_lockTarget") then {_lockTarget = false}; @@ -26,7 +22,7 @@ private "_owner"; _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { - diag_log text "[ACE] ERROR: Claiming already owned object."; + diag_log text "[ACE] ERROR: Claiming already owned object."; }; // transfer this immediately diff --git a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf index bfb8e3f18c..db60180bd1 100644 --- a/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf +++ b/addons/common/functions/fnc_closeDialogIfTargetMoves.sqf @@ -13,36 +13,37 @@ #include "script_component.hpp" _this spawn { - _target = _this select 0; - _ignoreDead = _this select 1; - if (isNil "_ignoreDead") then {_ignoreDead = false}; + PARAMS_2(_target,_ignoreDead); + private["_inVehicle", "_position", "_vehiclePlayer", "_vehicleTarget"]; + + if (isNil "_ignoreDead") then {_ignoreDead = false}; - _vehicleTarget = vehicle _target; - _vehiclePlayer = vehicle ACE_player; - _inVehicle = _target != _vehicleTarget; + _vehicleTarget = vehicle _target; + _vehiclePlayer = vehicle ACE_player; + _inVehicle = _target != _vehicleTarget; - _position = getPosASL _target; + _position = getPosASL _target; - _fnc_check = { - // either unit changed vehicles - if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; - if (_vehicleTarget != vehicle _target) exitWith {True}; + _fnc_check = { + // either unit changed vehicles + if (_vehiclePlayer != vehicle ACE_player) exitWith {True}; + if (_vehicleTarget != vehicle _target) exitWith {True}; - // target died - if (!alive _target && {!_ignoreDead}) exitWith {True}; + // target died + if (!alive _target && {!_ignoreDead}) exitWith {True}; - // player fell unconscious - if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; + // player fell unconscious + if (ACE_player getVariable ["ACE_isUnconscious", False]) exitWith {True}; - // target moved (outside of vehicle) - (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) - }; - - waitUntil { - if (call _fnc_check) then { - closeDialog 0; - call EFUNC(interaction,hideMenu); + // target moved (outside of vehicle) + (!_inVehicle && {getPosASL _target distanceSqr _position > 1}) + }; + + waitUntil { + if (call _fnc_check) then { + closeDialog 0; + call EFUNC(interaction,hideMenu); + }; + (isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open }; - (isNil QEGVAR(interaction,MainButton) && !dialog) || {!isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull])} //Exit loop if DisableMouse dialog open - }; }; diff --git a/addons/common/functions/fnc_codeToString.sqf b/addons/common/functions/fnc_codeToString.sqf index 440cacc5a3..1698182051 100644 --- a/addons/common/functions/fnc_codeToString.sqf +++ b/addons/common/functions/fnc_codeToString.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_function"; - -_function = _this select 0; +PARAMS_1(_function); if (typeName _function == "STRING") exitWith {_function}; diff --git a/addons/common/functions/fnc_convertKeyCode.sqf b/addons/common/functions/fnc_convertKeyCode.sqf index a8af25401c..498a3eb706 100644 --- a/addons/common/functions/fnc_convertKeyCode.sqf +++ b/addons/common/functions/fnc_convertKeyCode.sqf @@ -16,9 +16,7 @@ #define KEY_MODIFIERS [42, 54, 29, 157, 56, 184] -private "_key"; - -_key = _this select 0; +PARAMS_1(_key); if (_key in KEY_MODIFIERS) exitWith {_key}; diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index c87772eb8a..fd1d3d59fa 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -12,8 +12,8 @@ #define DEFAULT_LOGGING_LEVEL -1 #define DEFAULT_TEXT_DISPLAY -1 -private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message", "_from"]; -_msg = _this select 0; +private ["_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLevel", "_message"]; +PARAMS_1(_msg); _level = if (count _this > 1) then {_this select 1} else { 2 }; if (typeName _level != "NUMBER") then { diff --git a/addons/common/functions/fnc_debugModule.sqf b/addons/common/functions/fnc_debugModule.sqf index f36bd97014..262ae9c02d 100644 --- a/addons/common/functions/fnc_debugModule.sqf +++ b/addons/common/functions/fnc_debugModule.sqf @@ -7,9 +7,10 @@ * @Return: * @PublicAPI: false */ + #include "script_component.hpp" -private ["_entity"]; -_entity = _this select 0; + +PARAMS_1(_entity); GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 8796edc920..28ed5b2015 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -9,11 +9,10 @@ */ #include "script_component.hpp" -private ["_name","_value","_defaultGlobal","_catagory","_code","_persistent"]; -_name = _this select 0; -_value = _this select 1; -_defaultGlobal = _this select 2; -_catagory = _this select 3; +private ["_code","_persistent"]; + +PARAMS_4(_name,_value,_defaultGlobal,_catagory); + _code = 0; _persistent = false; diff --git a/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf new file mode 100644 index 0000000000..a8418cd4cd --- /dev/null +++ b/addons/common/functions/fnc_deviceKeyFindValidIndex.sqf @@ -0,0 +1,45 @@ +/* + * Author: PabstMirror + * Finds next valid index for the device array. + * + * Arguments: + * 0: Offset from currentIndex (use 1 to find next valid after current) or a displayName string or + * + * Return Value: + * The new index (-1 if no valid) + * + * Example: + * [] call ace_common_fnc_deviceKeyFindValidIndex + * ["kestral4500"] call ace_common_fnc_deviceKeyFindValidIndex + * + * Public: No + */ +#include "script_component.hpp" + +DEFAULT_PARAM(0,_searchOffsetOrName,0); + +private ["_validIndex", "_offsetBy", "_realIndex", "_offset"]; + +_validIndex = -1; + +if ((typeName _searchOffsetOrName) == "STRING") then { + { + if ((_x select 0) == _searchOffsetOrName) exitWith { + _validIndex = _forEachIndex; + }; + } forEach GVAR(deviceKeyHandlingArray); +} else { + if ((count GVAR(deviceKeyHandlingArray)) > 0) then { + _baseIndex = if (GVAR(deviceKeyCurrentIndex) == -1) then {0} else {GVAR(deviceKeyCurrentIndex) + _searchOffsetOrName}; + for "_offset" from _baseIndex to ((count GVAR(deviceKeyHandlingArray)) - 1 + _baseIndex) do { + _realIndex = _offset % (count GVAR(deviceKeyHandlingArray)); + if ([] call ((GVAR(deviceKeyHandlingArray) select _realIndex) select 2)) exitWith { + _validIndex = _realIndex; + }; + }; + }; +}; + +GVAR(deviceKeyCurrentIndex) = _validIndex; + +GVAR(deviceKeyCurrentIndex) diff --git a/addons/common/functions/fnc_deviceKeyRegisterNew.sqf b/addons/common/functions/fnc_deviceKeyRegisterNew.sqf new file mode 100644 index 0000000000..88ffa84af7 --- /dev/null +++ b/addons/common/functions/fnc_deviceKeyRegisterNew.sqf @@ -0,0 +1,25 @@ +/* + * Author: PabstMirror + * Finds next valid index for the device array. + * + * Arguments: + * 0: Localized Device Display Name + * 1: Image + * 2: Condtion Code (do they have the device) + * 3: Toggle Code (on home press) + * 4: Close Code (on ctrl-home press) + * + * Return Value: + * Nothing + * + * Example: + * [(localize "STR_ACE_microdagr_itemName"), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditionCode, _toggleCode, _closeCode] call ace_common_fnc_deviceKeyRegisterNew + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_5(_displayName,_iconImage,_conditionCode,_toggleCode,_closeCode); + +GVAR(deviceKeyHandlingArray) pushBack [_displayName,_iconImage,_conditionCode,_toggleCode,_closeCode]; +[] call FUNC(deviceKeyFindValidIndex); diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 0b1275e9cf..520e4131b2 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -13,9 +13,9 @@ #include "script_component.hpp" -private ["_state", "_dlg"]; +private ["_dlg"]; -_state = _this select 0; +PARAMS_1(_state); if (_state) then { disableSerialization; @@ -37,6 +37,7 @@ if (_state) then { _dlg = uiNamespace getVariable QGVAR(dlgDisableMouse); _dlg displayAddEventHandler ["KeyDown", { + private ["_key", "_dlg", "_ctrl", "_config", "_acc", "_index"]; _key = _this select 1; if (_key == 1 && {alive player}) then { diff --git a/addons/common/functions/fnc_displayIcon.sqf b/addons/common/functions/fnc_displayIcon.sqf index 15cda902d7..2fd5245465 100644 --- a/addons/common/functions/fnc_displayIcon.sqf +++ b/addons/common/functions/fnc_displayIcon.sqf @@ -2,7 +2,7 @@ * Author: Glowbal * * Draw progress bar and execute given function if succesful. -* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] +* Finish/Failure/Conditional are all passed [args, elapsedTime, totalTime, errorCode] * * Argument: * 0: icon ID @@ -42,11 +42,10 @@ // other constants #define DEFAULT_TIME 6 -private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"]; -_iconId = _this select 0; -_show = _this select 1; -_icon = _this select 2; -_color = _this select 3; +private ["_allControls", "_refresh", "_timeAlive", "_list"]; + +PARAMS_4(_iconId,_show,_icon,_color); + _timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME}; disableSerialization; @@ -62,7 +61,7 @@ _refresh = { _allControls = []; - private ["_ctrl", "_setting"]; + private ["_ctrl", "_setting", "_position"]; _setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0]; if (_setting > 0) then { { @@ -87,13 +86,13 @@ _refresh = { if (_show) then { if ({(_x select 0 == _iconId)} count _list == 0) then { - _list pushback [_iconId, _icon, _color, time]; + _list pushback [_iconId, _icon, _color, ACE_time]; } else { { if (_x select 0 == _iconId) exitwith { - _list set [_foreachIndex, [_iconId, _icon, _color, time]]; + _list set [_foreachIndex, [_iconId, _icon, _color, ACE_time]]; }; - }foreach _list; + } forEach _list; }; missionNamespace setvariable [QGVAR(displayIconList), _list]; call _refresh; @@ -112,7 +111,7 @@ if (_show) then { if (_x select 0 != _iconId) then { _newList pushback _x; }; - }foreach _list; + } forEach _list; missionNamespace setvariable [QGVAR(displayIconList), _newList]; call _refresh; diff --git a/addons/common/functions/fnc_displayText.sqf b/addons/common/functions/fnc_displayText.sqf index 7121ef6813..22349962ac 100644 --- a/addons/common/functions/fnc_displayText.sqf +++ b/addons/common/functions/fnc_displayText.sqf @@ -20,11 +20,9 @@ _this resize 4; -private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"]; -_text = _this select 0; -_sound = _this select 1; -_delay = _this select 2; -_priority = _this select 3; +private ["_lastHintTime", "_lastHintPriority", "_time"]; + +PARAMS_4(_text,_sound,_delay,_priority); if (isNil QGVAR(lastHint)) then { GVAR(lastHint) = [0, 0]; @@ -38,7 +36,7 @@ if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND}; if (isNil "_delay") then {_delay = DEFAULT_DELAY}; if (isNil "_priority") then {_priority = DEFAULT_PRIORITY}; -_time = time; +_time = ACE_time; if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then { hintSilent _text; if (_sound) then {playSound "ACE_Sound_Click"}; diff --git a/addons/common/functions/fnc_displayTextPicture.sqf b/addons/common/functions/fnc_displayTextPicture.sqf index fadf28b480..93d4d38df7 100644 --- a/addons/common/functions/fnc_displayTextPicture.sqf +++ b/addons/common/functions/fnc_displayTextPicture.sqf @@ -15,9 +15,8 @@ #include "script_component.hpp" -private ["_text", "_image", "_imageColor", "_target"]; -_text = _this select 0; -_image = _this select 1; +private ["_imageColor", "_target"]; +PARAMS_2(_text,_image); _imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]}; _imageColor resize 3; _target = if (count _this > 3) then {_this select 3} else {ACE_player}; diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 9f683800a1..07d9ec9e35 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -16,23 +16,21 @@ */ #include "script_component.hpp" -private ["_unit", "_animation", "_priority", "_force"]; +private ["_force"]; -_unit = _this select 0; -_animation = _this select 1; -_priority = _this select 2; +PARAMS_3(_unit,_animation,_priority); _force = False; // no animation given if (isNil "_animation") exitWith { - diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent]; + diag_log format ["[ACE] ERROR: No animation specified in %1", _fnc_scriptNameParent]; }; if (isNil "_priority") then { - _priority = 0; + _priority = 0; }; if (count _this > 3) then { - _force = _this select 3; + _force = _this select 3; }; // don't overwrite more important animations @@ -43,31 +41,31 @@ if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", f // switchMove "" no longer works in dev 1.37 if (_animation == "") then { - _animation = [_unit] call FUNC(getDefaultAnim); + _animation = [_unit] call FUNC(getDefaultAnim); }; switch (_priority) do { - case 0 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); + case 0 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMove '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; }; - }; - case 1 : { - if (_unit == vehicle _unit) then { - [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); - } else { - // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. - [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + case 1 : { + if (_unit == vehicle _unit) then { + [_unit, format ["{_this playMoveNow '%1'}", _animation], _unit] call FUNC(execRemoteFnc); + } else { + // Execute on all machines. PlayMove and PlayMoveNow are bugged: They have no global effects when executed on remote machines inside vehicles. + [_unit, format ["{_this playMoveNow '%1'}", _animation]] call FUNC(execRemoteFnc); + }; }; - }; - case 2 : { - // Execute on all machines. SwitchMove has local effects. - [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); - }; - default {}; + case 2 : { + // Execute on all machines. SwitchMove has local effects. + [_unit, format ["{_this switchMove '%1'}", _animation]] call FUNC(execRemoteFnc); + }; + default {}; }; ["Anim", [_priority, _animation]] call FUNC(log); diff --git a/addons/common/functions/fnc_dropBackpack.sqf b/addons/common/functions/fnc_dropBackpack.sqf index a2fd38b7c3..05ee3ab750 100644 --- a/addons/common/functions/fnc_dropBackpack.sqf +++ b/addons/common/functions/fnc_dropBackpack.sqf @@ -12,17 +12,13 @@ */ #include "script_component.hpp" -private "_unit"; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_backpackObject","_holder"]; -private "_backpackObject"; _backpackObject = backpackContainer _unit; - _unit addBackpack "Bag_Base"; removeBackpack _unit; - -private "_holder"; _holder = objNull; { diff --git a/addons/common/functions/fnc_dumpArray.sqf b/addons/common/functions/fnc_dumpArray.sqf index 8a95172ea7..8572aaf134 100644 --- a/addons/common/functions/fnc_dumpArray.sqf +++ b/addons/common/functions/fnc_dumpArray.sqf @@ -1,17 +1,20 @@ //fnc_dumpArray.sqf #include "script_component.hpp" -private ["_var", "_depth", "_pad", "_i", "_x"]; +private ["_pad", "_i", "_x"]; + +PARAMS_2(_var,_depth); -_var = _this select 0; -_depth = _this select 1; _pad = ""; + for "_i" from 0 to _depth do { _pad = _pad + toString [9]; }; + _depth = _depth + 1; -if(IS_ARRAY(_var)) then { - if((count _var) > 0) then { + +if (IS_ARRAY(_var)) then { + if ((count _var) > 0) then { diag_log text format["%1[", _pad]; { [_x, _depth] call FUNC(dumpArray); diff --git a/addons/common/functions/fnc_dumpPerformanceCounters.sqf b/addons/common/functions/fnc_dumpPerformanceCounters.sqf index acf81ff20a..532850d7bb 100644 --- a/addons/common/functions/fnc_dumpPerformanceCounters.sqf +++ b/addons/common/functions/fnc_dumpPerformanceCounters.sqf @@ -5,7 +5,7 @@ diag_log text format["REGISTERED ACE PFH HANDLERS"]; diag_log text format["-------------------------------------------"]; -if(!isNil "ACE_PFH_COUNTER") then { +if (!isNil "ACE_PFH_COUNTER") then { { private["_pfh"]; _pfh = _x select 0; @@ -16,7 +16,7 @@ if(!isNil "ACE_PFH_COUNTER") then { diag_log text format["ACE COUNTER RESULTS"]; diag_log text format["-------------------------------------------"]; { - private["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; + private ["_counterEntry", "_iter", "_total", "_count", "_delta", "_averageResult"]; _counterEntry = _x; _iter = 0; _total = 0; diff --git a/addons/common/functions/fnc_eraseCache.sqf b/addons/common/functions/fnc_eraseCache.sqf index 94592ad409..9521bb3630 100644 --- a/addons/common/functions/fnc_eraseCache.sqf +++ b/addons/common/functions/fnc_eraseCache.sqf @@ -13,6 +13,6 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_namespace,_uid); +PARAMS_2(_namespace,_uid); _namespace setVariable [_uid, nil]; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index e061772942..3929477e76 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -15,10 +15,23 @@ disableSerialization; endLoadingScreen; -private ["_textHeader", "_textMessage", "_onOK", "_onCancel"]; +// no message without player possible +if (!hasInterface) exitWith {}; -_textHeader = _this select 0; -_textMessage = _this select 1; +// wait for display +if (isNull (call BIS_fnc_displayMission)) exitWith { + [{ + if (isNull (call BIS_fnc_displayMission)) exitWith {}; + + (_this select 0) call FUNC(errorMessage); + [_this select 1] call CBA_fnc_removePerFrameHandler; + + }, 1, _this] call CBA_fnc_addPerFrameHandler; +}; + +private ["_onOK", "_onCancel"]; + +PARAMS_2(_textHeader,_textMessage); _onOK = ARR_SELECT(_this,2,{}); _onCancel = ARR_SELECT(_this,3,{}); diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf index a0f71f9d51..ddd36be073 100644 --- a/addons/common/functions/fnc_execNextFrame.sqf +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -12,23 +12,10 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_func,_params); +PARAMS_2(_func,_params); -[ - { - EXPLODE_2_PVT(_this,_params,_pfhId); - EXPLODE_2_PVT(_params,_delayedExecParams,_startFrame); - EXPLODE_2_PVT(_delayedExecParams,_func,_funcParams); - - // Exit if we are still on the same frame - if (diag_frameno == _startFrame) exitWith {}; - - // Remove the PFH - [_pfhId] call cba_fnc_removePerFrameHandler; - - // Execute the function - _funcParams call _func; - }, - 0, - [_this, diag_frameno] -] call CBA_fnc_addPerFrameHandler +if (diag_frameno != GVAR(nextFrameNo)) then { + GVAR(nextFrameBufferA) pushBack [_params, _func]; +} else { + GVAR(nextFrameBufferB) pushBack [_params, _func]; +}; diff --git a/addons/common/functions/fnc_execPersistentFnc.sqf b/addons/common/functions/fnc_execPersistentFnc.sqf index 248d35636e..dd160b8bfd 100644 --- a/addons/common/functions/fnc_execPersistentFnc.sqf +++ b/addons/common/functions/fnc_execPersistentFnc.sqf @@ -36,9 +36,9 @@ _persistentFunctions = _unit getVariable ["ACE_PersistentFunctions", []]; // find index to overwrite function with the same name, add to end otherwise _index = count _persistentFunctions; { - if (_x select 2 == _name) exitWith { - _index = _forEachIndex; - }; + if (_x select 2 == _name) exitWith { + _index = _forEachIndex; + }; } forEach _persistentFunctions; // set new value @@ -46,8 +46,8 @@ _persistentFunctions set [_index, [_arguments, _function, _name]]; // broadcast variable if (typeName _unit == "NAMESPACE") then { - ACE_PersistentFunctions = _persistentFunctions; - publicVariable "ACE_PersistentFunctions"; + ACE_PersistentFunctions = _persistentFunctions; + publicVariable "ACE_PersistentFunctions"; } else { - _unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true]; + _unit setVariable ["ACE_PersistentFunctions", _persistentFunctions, true]; }; diff --git a/addons/common/functions/fnc_execRemoteFnc.sqf b/addons/common/functions/fnc_execRemoteFnc.sqf index 111dbbdc0c..1df17050e6 100644 --- a/addons/common/functions/fnc_execRemoteFnc.sqf +++ b/addons/common/functions/fnc_execRemoteFnc.sqf @@ -26,46 +26,46 @@ _function = call compile (_this select 1); _unit = _this select 2; if (isNil "_unit") then { - _unit = 2; + _unit = 2; }; ["Remote", [_arguments, _this select 1, _unit], {format ["%1 call %2 to: %3", _this select 0, _this select 1, _this select 2]}, false] call FUNC(log); if (typeName _unit == "SCALAR") exitWith { - switch (_unit) do { - case 0 : { - _arguments call _function; - }; - case 1 : { - if (isServer) then { - _arguments call _function; - } else { - publicVariableServer QGVAR(remoteFnc); - }; - }; - case 2 : { - _arguments call _function; + switch (_unit) do { + case 0 : { + _arguments call _function; + }; + case 1 : { + if (isServer) then { + _arguments call _function; + } else { + publicVariableServer QGVAR(remoteFnc); + }; + }; + case 2 : { + _arguments call _function; - GVAR(remoteFnc) set [2, 0]; - publicVariable QGVAR(remoteFnc); + GVAR(remoteFnc) set [2, 0]; + publicVariable QGVAR(remoteFnc); + }; + case 3 : { + if (isDedicated) then { + _arguments call _function; + } else { + if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; + }; + }; }; - case 3 : { - if (isDedicated) then { - _arguments call _function; - } else { - if (!isServer) then {publicVariableServer QGVAR(remoteFnc)}; - }; - }; - }; }; if (local _unit) then { - _arguments call _function; + _arguments call _function; } else { - if (isServer) then { - _id = owner _unit; - _id publicVariableClient QGVAR(remoteFnc); - } else { - publicVariableServer QGVAR(remoteFnc); - }; + if (isServer) then { + _id = owner _unit; + _id publicVariableClient QGVAR(remoteFnc); + } else { + publicVariableServer QGVAR(remoteFnc); + }; }; diff --git a/addons/common/functions/fnc_executePersistent.sqf b/addons/common/functions/fnc_executePersistent.sqf index 80f29f35ad..a11fbb07aa 100644 --- a/addons/common/functions/fnc_executePersistent.sqf +++ b/addons/common/functions/fnc_executePersistent.sqf @@ -1,16 +1,14 @@ // by commy2 #include "script_component.hpp" -private "_target"; - -_target = _this select 0; +PARAMS_1(_target); { - if (isNil "_x") then { - diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; - } else { - if (typeName _x == "ARRAY") then { - [_x select 0, _target] call (_x select 1); + if (isNil "_x") then { + diag_log text format ["[ACE] ERROR: No argument and function for remote function. ID: %1", _forEachIndex]; + } else { + if (typeName _x == "ARRAY") then { + [_x select 0, _target] call (_x select 1); + }; }; - }; } forEach (_target getVariable ["ACE_PersistentFunctions", []]); diff --git a/addons/common/functions/fnc_exportConfig.sqf b/addons/common/functions/fnc_exportConfig.sqf index c298785c26..e8370c8f0f 100644 --- a/addons/common/functions/fnc_exportConfig.sqf +++ b/addons/common/functions/fnc_exportConfig.sqf @@ -9,61 +9,59 @@ private "_fnc_logEntries"; _fnc_logEntries = { - private ["_c", "_d", "_p", "_t", "_e"]; + private ["_p", "_t", "_e", "_a", "_i"]; - _c = _this select 0; - _d = _this select 1; + PARAMS_2(_c,_d); - _p = inheritsFrom _c; + _p = inheritsFrom _c; - _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - - _e = []; - for "_i" from 0 to (count _c - 1) do { - private ["_e1, _e2"]; - _e1 = _c select _i; - - _e2 = switch (true) do { - case (isNumber _e1): {getNumber _e1}; - case (isText _e1): {getText _e1}; - case (isArray _e1): {getArray _e1}; - case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; - }; - - if (typeName _e2 != "BOOL") then { - if (typeName _e2 == "ARRAY") then { - _e2 = toArray str _e2; - { - if (_x == toArray "[" select 0) then { - _e2 set [_forEachIndex, toArray "{" select 0]; - }; - if (_x == toArray "]" select 0) then { - _e2 set [_forEachIndex, toArray "}" select 0]; - }; - } forEach _e2; - _e2 = toString _e2; - _t = format ["%1[] = %2;", configName _e1, _e2]; - } else { - _t = format ["%1 = %2;", configName _e1, str _e2]; - }; - for "_a" from 0 to _d do { + _t = format [["class %1: %2 {", "class %1 {"] select (configName _p == ""), configName _c, configName _p]; + for "_a" from 1 to _d do { _t = " " + _t; - }; - diag_log text _t; }; - }; + diag_log text _t; - _t = "};"; - for "_a" from 1 to _d do { - _t = " " + _t; - }; - diag_log text _t; - diag_log text ""; + _e = []; + for "_i" from 0 to (count _c - 1) do { + private ["_e1, _e2"]; + _e1 = _c select _i; + _e2 = switch (true) do { + case (isNumber _e1): {getNumber _e1}; + case (isText _e1): {getText _e1}; + case (isArray _e1): {getArray _e1}; + case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; + }; + + if (typeName _e2 != "BOOL") then { + if (typeName _e2 == "ARRAY") then { + _e2 = toArray str _e2; + { + if (_x == toArray "[" select 0) then { + _e2 set [_forEachIndex, toArray "{" select 0]; + }; + if (_x == toArray "]" select 0) then { + _e2 set [_forEachIndex, toArray "}" select 0]; + }; + } forEach _e2; + _e2 = toString _e2; + _t = format ["%1[] = %2;", configName _e1, _e2]; + } else { + _t = format ["%1 = %2;", configName _e1, str _e2]; + }; + for "_a" from 0 to _d do { + _t = " " + _t; + }; + diag_log text _t; + }; + }; + + _t = "};"; + for "_a" from 1 to _d do { + _t = " " + _t; + }; + diag_log text _t; + diag_log text ""; }; [_this, 0] call _fnc_logEntries; diff --git a/addons/common/functions/fnc_filter.sqf b/addons/common/functions/fnc_filter.sqf index 23e28c5fc5..8d4146faa5 100644 --- a/addons/common/functions/fnc_filter.sqf +++ b/addons/common/functions/fnc_filter.sqf @@ -15,10 +15,9 @@ */ #include "script_component.hpp" -private ["_array", "_code", "_newArray", "_index"]; +private ["_newArray", "_index"]; -_array = _this select 0; -_code = _this select 1; +PARAMS_2(_array,_code); if (isNil "_array") exitWith { diag_log text format ["[ACE] ERROR: No array for function filter in %1", _fnc_scriptNameParent]; @@ -27,8 +26,8 @@ if (isNil "_array") exitWith { _newArray = []; for "_index" from 0 to (count _array - 1) do { - if ((_array select _index) call _code) then { - _newArray pushBack (_array select _index); - }; + if ((_array select _index) call _code) then { + _newArray pushBack (_array select _index); + }; }; _newArray diff --git a/addons/common/functions/fnc_fixCrateContent.sqf b/addons/common/functions/fnc_fixCrateContent.sqf index 3128f783d5..ad3ed8e528 100644 --- a/addons/common/functions/fnc_fixCrateContent.sqf +++ b/addons/common/functions/fnc_fixCrateContent.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_crate", "_weapons", "_items"]; +private ["_weapons", "_items"]; -_crate = _this select 0; +PARAMS_1(_crate); // get all weapons inside the crate _weapons = weaponCargo _crate; diff --git a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf index 411fdd2eb3..f39f85cc94 100644 --- a/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf +++ b/addons/common/functions/fnc_fixLoweredRifleAnimation.sqf @@ -9,7 +9,7 @@ * Nothing * * Example: - * [_player] call ace_common_fnc_fixLoweredRifleAnimation + * [ACE_player] call ace_common_fnc_fixLoweredRifleAnimation * * Public: No */ @@ -18,5 +18,5 @@ PARAMS_1(_unit); if (currentWeapon _unit != "" && {currentWeapon _unit == primaryWeapon _unit} && {weaponLowered _unit} && {stance _unit == "STAND"} && {(vehicle _unit) == _unit}) then { - [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); + [_unit, "amovpercmstpsraswrfldnon", 0] call FUNC(doAnimation); }; diff --git a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf index 529c11c549..2163accae2 100644 --- a/addons/common/functions/fnc_getAllDefinedSetVariables.sqf +++ b/addons/common/functions/fnc_getAllDefinedSetVariables.sqf @@ -10,8 +10,8 @@ #include "script_component.hpp" -private ["_object", "_return", "_val", "_category"]; -_object = _this select 0; +private ["_return", "_val", "_category"]; +PARAMS_1(_object); _category = if (count _this > 1) then { _this select 1 } else { "" }; if (isnil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith { diff --git a/addons/common/functions/fnc_getAllGear.sqf b/addons/common/functions/fnc_getAllGear.sqf index 1b1d7e03fa..aa2289309e 100644 --- a/addons/common/functions/fnc_getAllGear.sqf +++ b/addons/common/functions/fnc_getAllGear.sqf @@ -22,7 +22,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_unit); +PARAMS_1(_unit); if (isNull _unit) exitWith {[ "", diff --git a/addons/common/functions/fnc_getCaptivityStatus.sqf b/addons/common/functions/fnc_getCaptivityStatus.sqf index dcd3d6b0ff..50aeeced3a 100644 --- a/addons/common/functions/fnc_getCaptivityStatus.sqf +++ b/addons/common/functions/fnc_getCaptivityStatus.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; +private ["_captivityReasons", "_unitCaptivityStatus", "_unitCaptivityReasons"]; -_unit = _this select 0; +PARAMS_1(_unit); _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; @@ -21,9 +21,9 @@ _unitCaptivityStatus = [captiveNum _unit, count _captivityReasons] call FUNC(bin _unitCaptivityReasons = []; { - if (_unitCaptivityStatus select _forEachIndex) then { - _unitCaptivityReasons pushBack _x; - }; + if (_unitCaptivityStatus select _forEachIndex) then { + _unitCaptivityReasons pushBack _x; + }; } forEach _captivityReasons; _unitCaptivityReasons diff --git a/addons/common/functions/fnc_getChildren.sqf b/addons/common/functions/fnc_getChildren.sqf index 057b14ff40..d28ba7cb70 100644 --- a/addons/common/functions/fnc_getChildren.sqf +++ b/addons/common/functions/fnc_getChildren.sqf @@ -1,10 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_name", "_cfgClass", "_classes"]; +private ["_classes"]; -_name = _this select 0; -_cfgClass = _this select 1; +PARAMS_2(_name,_cfgClass); _classes = format ["configName inheritsFrom _x == '%1'", _name] configClasses (configFile >> _cfgClass); _classes = [_classes, {configName _this}] call FUNC(map); diff --git a/addons/common/functions/fnc_getConfigCommander.sqf b/addons/common/functions/fnc_getConfigCommander.sqf index 4003c2a51f..44f02cbeb1 100644 --- a/addons/common/functions/fnc_getConfigCommander.sqf +++ b/addons/common/functions/fnc_getConfigCommander.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_turret"]; +private ["_config", "_turret"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretCommander); diff --git a/addons/common/functions/fnc_getConfigGunner.sqf b/addons/common/functions/fnc_getConfigGunner.sqf index 80bdfb2cfa..a28491bfff 100644 --- a/addons/common/functions/fnc_getConfigGunner.sqf +++ b/addons/common/functions/fnc_getConfigGunner.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_turret"]; +private ["_config", "_turret"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _turret = [_vehicle] call FUNC(getTurretGunner); diff --git a/addons/common/functions/fnc_getConfigType.sqf b/addons/common/functions/fnc_getConfigType.sqf index f3c21923ef..b2d601c121 100644 --- a/addons/common/functions/fnc_getConfigType.sqf +++ b/addons/common/functions/fnc_getConfigType.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_item"; - -_item = _this select 0; +PARAMS_1(_item); if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"}; diff --git a/addons/common/functions/fnc_getConfigTypeObject.sqf b/addons/common/functions/fnc_getConfigTypeObject.sqf index 35799da6b5..ef39ce22c7 100644 --- a/addons/common/functions/fnc_getConfigTypeObject.sqf +++ b/addons/common/functions/fnc_getConfigTypeObject.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_object"; - -_object = _this select 0; +PARAMS_1(_object); if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"}; diff --git a/addons/common/functions/fnc_getDeathAnim.sqf b/addons/common/functions/fnc_getDeathAnim.sqf index 1e84224b0f..539c8d2616 100644 --- a/addons/common/functions/fnc_getDeathAnim.sqf +++ b/addons/common/functions/fnc_getDeathAnim.sqf @@ -1,6 +1,6 @@ /* * Author: Glowbal, PabstMirror - * Get the death animation for the unit at current time + * Get the death animation for the unit at current ACE_time * * Arguments: * 0: unit diff --git a/addons/common/functions/fnc_getDefaultAnim.sqf b/addons/common/functions/fnc_getDefaultAnim.sqf index fd53668396..fbcca2712e 100644 --- a/addons/common/functions/fnc_getDefaultAnim.sqf +++ b/addons/common/functions/fnc_getDefaultAnim.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_anim", "_stance"]; +private ["_anim", "_stance"]; -_unit = _this select 0; +PARAMS_1(_unit); _anim = toLower (animationState _unit); // stance is broken for some animations. diff --git a/addons/common/functions/fnc_getDefinedVariableInfo.sqf b/addons/common/functions/fnc_getDefinedVariableInfo.sqf index d371af6769..03b50b0649 100644 --- a/addons/common/functions/fnc_getDefinedVariableInfo.sqf +++ b/addons/common/functions/fnc_getDefinedVariableInfo.sqf @@ -7,5 +7,6 @@ * @Return: * @PublicAPI: false */ + #include "script_component.hpp" +(missionNamespace getvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + (_this select 0),[]]) diff --git a/addons/common/functions/fnc_getDisplayConfigName.sqf b/addons/common/functions/fnc_getDisplayConfigName.sqf index 3ffc20de2f..92b6700238 100644 --- a/addons/common/functions/fnc_getDisplayConfigName.sqf +++ b/addons/common/functions/fnc_getDisplayConfigName.sqf @@ -1,15 +1,15 @@ // by commy2 #include "script_component.hpp" -private ["_configName", "_index"]; +private ["_configName", "_index", "_config"]; _configName = ""; for "_index" from 0 to (count configFile - 1) do { - _config = configFile select _index; - if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { - _configName = configName _config; - }; + _config = configFile select _index; + if (isClass _config && {isNumber (_config >> "idd")} && {getNumber (_config >> "idd") == _this}) exitWith { + _configName = configName _config; + }; }; _configName diff --git a/addons/common/functions/fnc_getDoorTurrets.sqf b/addons/common/functions/fnc_getDoorTurrets.sqf index cfa7e0532c..f304c1714c 100644 --- a/addons/common/functions/fnc_getDoorTurrets.sqf +++ b/addons/common/functions/fnc_getDoorTurrets.sqf @@ -11,21 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_doorTurrets", "_config"]; +private ["_turrets", "_doorTurrets", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _doorTurrets = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = [_config, _x] call FUNC(getTurretConfigPath); - if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { - _doorTurrets pushBack _x; - }; + if ((getNumber (_config >> "isCopilot") == 0) && count (getArray (_config >> "weapons")) > 0 ) then { + _doorTurrets pushBack _x; + }; } forEach _turrets; _doorTurrets diff --git a/addons/common/functions/fnc_getFirstObjectIntersection.sqf b/addons/common/functions/fnc_getFirstObjectIntersection.sqf index 4cd493ec2c..3a99f244ed 100644 --- a/addons/common/functions/fnc_getFirstObjectIntersection.sqf +++ b/addons/common/functions/fnc_getFirstObjectIntersection.sqf @@ -9,10 +9,9 @@ */ #include "script_component.hpp" -private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersections", "_result"]; -_source = _this select 0; -_destination = _this select 1; -_accuracy = _this select 2; +private ["_distance", "_lower", "_upper", "_mid", "_intersections", "_result", "_dir"]; + +PARAMS_3(_source,_destination,_accuracy); _result = [false, [0, 0, 0]]; diff --git a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf index 1b645bcdb2..2fe8242c15 100644 --- a/addons/common/functions/fnc_getFirstTerrainIntersection.sqf +++ b/addons/common/functions/fnc_getFirstTerrainIntersection.sqf @@ -7,12 +7,11 @@ * @Return: [intersects BOOL, intersection PositionASL] * @PublicAPI: true */ - #include "script_component.hpp" +#include "script_component.hpp" -private ["_source", "_destination", "_accuracy", "_distance", "_lower", "_upper", "_mid", "_intersection", "_result"]; -_source = _this select 0; -_destination = _this select 1; -_accuracy = _this select 2; +private ["_distance", "_lower", "_upper", "_mid", "_intersection", "_result", "_dir"]; + +PARAMS_3(_source,_destination,_accuracy); _result = [false, [0, 0, 0]]; diff --git a/addons/common/functions/fnc_getForceWalkStatus.sqf b/addons/common/functions/fnc_getForceWalkStatus.sqf index 10a70546fb..dbab640d86 100644 --- a/addons/common/functions/fnc_getForceWalkStatus.sqf +++ b/addons/common/functions/fnc_getForceWalkStatus.sqf @@ -17,9 +17,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; +private ["_forceWalkReasons", "_unitForceWalkNumber", "_unitForceWalkStatus", "_unitForceWalkReasons"]; -_unit = _this select 0; +PARAMS_1(_unit); _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; @@ -29,9 +29,9 @@ _unitForceWalkStatus = [_unitForceWalkNumber, count _forceWalkReasons] call FUNC _unitForceWalkReasons = []; { - if (_unitForceWalkStatus select _forEachIndex) then { - _unitForceWalkReasons pushBack _x; - }; + if (_unitForceWalkStatus select _forEachIndex) then { + _unitForceWalkReasons pushBack _x; + }; } forEach _forceWalkReasons; _unitForceWalkReasons diff --git a/addons/common/functions/fnc_getGunner.sqf b/addons/common/functions/fnc_getGunner.sqf index e832214601..ce73019f70 100644 --- a/addons/common/functions/fnc_getGunner.sqf +++ b/addons/common/functions/fnc_getGunner.sqf @@ -31,7 +31,7 @@ _gunner = objNull; // ensure that at least the pilot is returned if there is no gunner if (isManualFire _vehicle && {isNull _gunner}) then { - _gunner = driver _vehicle; + _gunner = driver _vehicle; }; -_gunner +_gunner \ No newline at end of file diff --git a/addons/common/functions/fnc_getHitPoints.sqf b/addons/common/functions/fnc_getHitPoints.sqf index 26b0b1b840..06b2b8d40b 100644 --- a/addons/common/functions/fnc_getHitPoints.sqf +++ b/addons/common/functions/fnc_getHitPoints.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints"]; +private ["_config", "_hitpoints", "_i"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; diff --git a/addons/common/functions/fnc_getHitPointsWithSelections.sqf b/addons/common/functions/fnc_getHitPointsWithSelections.sqf index f0c9801382..2bf568ec8a 100644 --- a/addons/common/functions/fnc_getHitPointsWithSelections.sqf +++ b/addons/common/functions/fnc_getHitPointsWithSelections.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections", "_i"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; diff --git a/addons/common/functions/fnc_getInPosition.sqf b/addons/common/functions/fnc_getInPosition.sqf index 062cc6cae4..d80c387b5d 100644 --- a/addons/common/functions/fnc_getInPosition.sqf +++ b/addons/common/functions/fnc_getInPosition.sqf @@ -18,10 +18,10 @@ #define CANGETINDRIVER (isNull (driver _vehicle) || {!alive driver _vehicle}) && {!lockedDriver _vehicle} && {getNumber (_config >> "isUav") != 1} #define CANGETINTURRETINDEX (isNull (_vehicle turretUnit _turret) || {!alive (_vehicle turretUnit _turret)}) && {!(_vehicle lockedTurret _turret)} && {getNumber (_config >> "isUav") != 1} -private ["_unit", "_vehicle", "_position", "_index"]; +private ["_position", "_index"]; + +PARAMS_2(_unit,_vehicle); -_unit = _this select 0; -_vehicle = _this select 1; _position = toLower (_this select 2); _index = _this select 3; // optional, please don't use @@ -40,107 +40,55 @@ _isInside = vehicle _unit == _vehicle; _script = {}; _enemiesInVehicle = false; //Possible Side Restriction { - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; + if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; } forEach crew _vehicle; switch (_position) do { - case "driver" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "pilot" : { - if (CANGETINDRIVER) then { - _script = [ - {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - _position = "driver"; - }; - }; - - case "gunner" : { - _turret = [_vehicle] call FUNC(getTurretGunner); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "commander" : { - _turret = [_vehicle] call FUNC(getTurretCommander); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} - ] select _enemiesInVehicle; - }; - }; - - case "copilot" : { - _turret = [_vehicle] call FUNC(getTurretCopilot); - - if (CANGETINTURRETINDEX) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - }; - }; - - case "turret" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsOther); - - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "gunner"; - } else { - - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { + case "driver" : { + if (CANGETINDRIVER) then { _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + {_unit action [["GetInDriver", "MoveToDriver"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} ] select _enemiesInVehicle; - - _position = "gunner"; }; - }; }; - }; - case "ffv" : { - private "_turrets"; - _turrets = [_vehicle] call FUNC(getTurretsFFV); + case "pilot" : { + if (CANGETINDRIVER) then { + _script = [ + {_unit action [["GetInPilot", "MoveToPilot"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInDriver _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + _position = "driver"; + }; + }; - if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { - _script = [ - {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, - {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + case "gunner" : { + _turret = [_vehicle] call FUNC(getTurretGunner); - _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" - } else { + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInGunner", "MoveToGunner"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInGunner _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; - for "_index" from 0 to (count _turrets - 1) do { - _turret = _turrets select _index; - if (CANGETINTURRETINDEX) exitWith { + case "commander" : { + _turret = [_vehicle] call FUNC(getTurretCommander); + + if (CANGETINTURRETINDEX) then { + _script = [ + {_unit action [["GetInCommander", "MoveToCommander"] select _isInside, _vehicle];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCommander _vehicle; call _fnc_getInEH;} + ] select _enemiesInVehicle; + }; + }; + + case "copilot" : { + _turret = [_vehicle] call FUNC(getTurretCopilot); + + if (CANGETINTURRETINDEX) then { _script = [ {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} @@ -148,93 +96,141 @@ switch (_position) do { _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" }; - }; }; - }; - case "codriver" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + case "turret" : { + private "_turrets"; + _turrets = [_vehicle] call FUNC(getTurretsOther); - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _position = "gunner"; + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; + _position = "gunner"; + }; + }; + }; }; - }; - case "cargo" : { - private "_positions"; - _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + case "ffv" : { + private "_turrets"; + _turrets = [_vehicle] call FUNC(getTurretsFFV); - { - if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; - } forEach crew _vehicle; + if (_index != -1 && {_turret = _turrets select _index; CANGETINTURRETINDEX}) then { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - if (_index != -1 && {_index in _positions}) then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + } else { + for "_index" from 0 to (count _turrets - 1) do { + _turret = _turrets select _index; + if (CANGETINTURRETINDEX) exitWith { + _script = [ + {_unit action [["GetInTurret", "moveToTurret"] select _isInside, _vehicle, _turret];}, + {if (_isInside) then {moveOut _unit}; _unit moveInTurret [_vehicle, _turret]; call _fnc_getInEH;} + ] select _enemiesInVehicle; - _position = "cargo"; - } else { - - _index = _positions select 0; - if (!isNil "_index") then { - _script = [ - {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, - {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} - ] select _enemiesInVehicle; - - _position = "cargo"; - }; + _position = "gunner"; // I think. It's a turret after all and turrets supposedly return "gunner" + }; + }; + }; }; - }; - default {}; + case "codriver" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCodriver); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + case "cargo" : { + private "_positions"; + _positions = [typeOf _vehicle] call FUNC(getVehicleCargo); + + { + if (alive _x) then {_positions deleteAt (_positions find (_vehicle getCargoIndex _x))}; + } forEach crew _vehicle; + + if (_index != -1 && {_index in _positions}) then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + } else { + _index = _positions select 0; + if (!isNil "_index") then { + _script = [ + {_unit action [["GetInCargo", "MoveToCargo"] select _isInside, _vehicle, _index];}, + {if (_isInside) then {moveOut _unit}; _unit moveInCargo [_vehicle, _index]; call _fnc_getInEH;} + ] select _enemiesInVehicle; + + _position = "cargo"; + }; + }; + }; + + default {}; }; // this will execute all config based event handlers. Not script based ones unfortunately, but atleast we don't use any. private "_fnc_getInEH"; _fnc_getInEH = { - private "_config"; - // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? - _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; + private "_config"; + // config based getIn EHs are assigned to the soldier, not the vehicle. Why Bis? Why? + _config = configFile >> "CfgVehicles" >> typeOf _unit >> "EventHandlers"; - if (isClass _config) then { - //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats - if !(_isInside) then { - [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); + if (isClass _config) then { + //getIn is local effects with global arguments. It doesn't trigger if the unit was already inside and only switched seats + if !(_isInside) then { + [_vehicle, _position, _unit, _turret] call compile getText (_config >> "getIn"); + }; }; - }; }; // if you want into the cargo and you can't, then check ffv turrets aswell if (_position == "cargo") exitWith { - if (_script isEqualTo {}) then { - [_unit, _vehicle, "ffv"] call FUNC(getInPosition); - } else { - call _script; - }; + if (_script isEqualTo {}) then { + [_unit, _vehicle, "ffv"] call FUNC(getInPosition); + } else { + call _script; + }; }; call _script; diff --git a/addons/common/functions/fnc_getItemType.sqf b/addons/common/functions/fnc_getItemType.sqf index 20d581f526..4de2bfa862 100644 --- a/addons/common/functions/fnc_getItemType.sqf +++ b/addons/common/functions/fnc_getItemType.sqf @@ -14,9 +14,9 @@ */ #include "script_component.hpp" -private "_item"; +PARAMS_1(_item); -_item = _this select 0; +private ["_cfgType"]; _cfgType = [_item] call FUNC(getConfigType); @@ -46,7 +46,7 @@ switch (true) do { case (_type == 2^4): {["magazine","handgun"]}; // handgun case (_type == 2^8): {["magazine","primary"]}; // rifle case (_type == 2^9): {["magazine","secondary"]}; // rpg, mg, mines - //case (_type < 2^11): {["magazine","unknown"]}; + //case (_type < 2^11): {["magazine","unknown"]}; case (_type == 101): {["item","muzzle"]}; case (_type == 201): {["item","optics"]}; diff --git a/addons/common/functions/fnc_getLightProperties.sqf b/addons/common/functions/fnc_getLightProperties.sqf index ee1884ac1b..456084c3f9 100644 --- a/addons/common/functions/fnc_getLightProperties.sqf +++ b/addons/common/functions/fnc_getLightProperties.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_vehicle", "_light"]; - -_vehicle = _this select 0; -_light = _this select 1; +PARAMS_2(_vehicle,_light); private "_config"; _config = configFile >> "CfgVehicles" >> typeOf _vehicle >> "Reflectors" >> _light; diff --git a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf index d444654b5f..03c6753a76 100644 --- a/addons/common/functions/fnc_getLightPropertiesWeapon.sqf +++ b/addons/common/functions/fnc_getLightPropertiesWeapon.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_weapon"; - -_weapon = _this select 0; +PARAMS_1(_weapon); private "_config"; _config = configFile >> "CfgWeapons" >> _weapon >> "ItemInfo" >> "FlashLight"; diff --git a/addons/common/functions/fnc_getMarkerType.sqf b/addons/common/functions/fnc_getMarkerType.sqf index 0324bf0ede..bba8c15199 100644 --- a/addons/common/functions/fnc_getMarkerType.sqf +++ b/addons/common/functions/fnc_getMarkerType.sqf @@ -11,25 +11,28 @@ */ #include "script_component.hpp" -_group = _this select 0; +private ["_leader","_vehicle","_side"]; + +PARAMS_1(_group); + _leader = leader _group; _vehicle = vehicle _leader; _side = side _leader; if (_vehicle == _leader) exitWith { - if ( - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or - (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or - (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") - ) then { - ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - } else { - ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) - }; + if ( + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "detectSkill") > 20) or + (getNumber (configFile >> "CfgVehicles" >> (typeOf _leader) >> "camouflage") < 1) or + (getText (configFile >> "CfgVehicles" >> (typeOf _leader) >> "textsingular") == "diver") + ) then { + ["n_recon", "b_recon", "o_recon"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + } else { + ["n_inf", "b_inf", "o_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + }; }; if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "attendant") == 1) exitWith { - ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_med", "b_med", "o_med"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if ( (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportRepair") > 0) or @@ -38,35 +41,35 @@ if ( (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_canRepair") > 0) or (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "ACE_fuelCapacityCargo") > 0) ) exitWith { - ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_maint", "b_maint", "o_maint"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Plane") exitWith { - ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_plane", "b_plane", "o_plane"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Air") exitWith { - ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_air", "b_air", "o_air"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "StaticMortar") exitWith { - ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_mortar", "b_mortar", "o_mortar"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "artilleryScanner") == 1) exitWith { - ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_art", "b_art", "o_art"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Car") exitWith { - ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_motor_inf", "b_motor_inf", "o_motor_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if ((_vehicle isKindOf "Tank") and (getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "transportSoldier") > 0)) exitWith { - ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_mech_inf", "b_mech_inf", "o_mech_inf"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Tank") exitWith { - ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_armor", "b_armor", "o_armor"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; if (_vehicle isKindOf "Ship") exitWith { - ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) + ["n_naval", "b_naval", "o_naval"] select ((["GUER", "WEST", "EAST"] find (str _side)) max 0) }; // generic marker diff --git a/addons/common/functions/fnc_getName.sqf b/addons/common/functions/fnc_getName.sqf index 4d10ce052c..1da59534f0 100644 --- a/addons/common/functions/fnc_getName.sqf +++ b/addons/common/functions/fnc_getName.sqf @@ -12,25 +12,24 @@ */ #include "script_component.hpp" -private ["_unit", "_showEffective", "_name"]; +private ["_name"]; -_unit = _this select 0; -_showEffective = _this select 1; +PARAMS_2(_unit,_showEffective); if (isNil "_showEffective") then { - _showEffective = false; + _showEffective = false; }; _name = ""; if (_unit isKindOf "CAManBase") then { - _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; + _name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))]; } else { - if (_showEffective) then { - _name = [effectiveCommander _unit] call FUNC(getName); - } else { - _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); - }; + if (_showEffective) then { + _name = [effectiveCommander _unit] call FUNC(getName); + } else { + _name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); + }; }; _name diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index ec4e9b5755..91921abd77 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -10,9 +10,9 @@ #include "script_component.hpp" -private ["_unit","_magazine"]; -_unit = _this select 0; -_magazine = _this select 1; +PARAMS_2(_unit,_magazine); + +private ["_return"]; _return = 0; if (_unit isKindOf "CAManBase") then { @@ -20,9 +20,9 @@ if (_unit isKindOf "CAManBase") then { } else { { _return = _return + {_x == _magazine} count magazines _x; - }foreach (crew _unit); + } forEach (crew _unit); _return = _return + ({_x == _magazine} count getMagazineCargo _unit); }; -_return \ No newline at end of file +_return diff --git a/addons/common/functions/fnc_getReflectorsWithSelections.sqf b/addons/common/functions/fnc_getReflectorsWithSelections.sqf index 6d47943155..d50269ade8 100644 --- a/addons/common/functions/fnc_getReflectorsWithSelections.sqf +++ b/addons/common/functions/fnc_getReflectorsWithSelections.sqf @@ -13,9 +13,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_hitpoints", "_selections"]; +private ["_config", "_hitpoints", "_selections", "_i"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> typeOf _vehicle; @@ -24,8 +24,8 @@ _selections = []; // iterate through all parents while {isClass _config} do { - private "_class"; - _class = _config >> "Reflectors"; + private "_class"; + _class = _config >> "Reflectors"; for "_i" from 0 to (count _class - 1) do { private ["_entry", "_selection"]; diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index a3733560da..40ed962a7a 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -20,7 +20,7 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_name); +PARAMS_1(_name); private ["_value"]; _value = []; diff --git a/addons/common/functions/fnc_getStringFromMissionSQM.sqf b/addons/common/functions/fnc_getStringFromMissionSQM.sqf index a19e3490aa..cfb7495467 100644 --- a/addons/common/functions/fnc_getStringFromMissionSQM.sqf +++ b/addons/common/functions/fnc_getStringFromMissionSQM.sqf @@ -19,26 +19,26 @@ if (missionName == "") exitWith {""}; _mission = toArray toLower loadFile "mission.sqm"; _mission resize 65536; { - if (_x < 33) then { - _mission set [_forEachIndex, -1]; - } + if (_x < 33) then { + _mission set [_forEachIndex, -1]; + } } forEach _mission; _mission = toString (_mission - [-1]); {_path set [_forEachIndex, toLower _x]} forEach _path; for "_a" from 0 to (count _path - 2) do { - _class = format ["class%1{", _path select _a]; + _class = format ["class%1{", _path select _a]; - _index = _mission find _class; + _index = _mission find _class; - _array = toArray _mission; - for "_b" from 0 to (_index + count toArray _class - 1) do { - _array set [_b, -1]; - }; - _array = _array - [-1]; + _array = toArray _mission; + for "_b" from 0 to (_index + count toArray _class - 1) do { + _array set [_b, -1]; + }; + _array = _array - [-1]; - _mission = toString _array; + _mission = toString _array; }; _entry = format ["%1=", _path select (count _path - 1)]; @@ -47,7 +47,7 @@ if (_index == -1) exitWith {""}; _array = toArray _mission; for "_b" from 0 to (_index + count toArray _entry - 1) do { - _array set [_b, -1]; + _array set [_b, -1]; }; _mission = toString (_array - [-1]); diff --git a/addons/common/functions/fnc_getTargetDistance.sqf b/addons/common/functions/fnc_getTargetDistance.sqf index 79ef273fad..ac3c444a73 100644 --- a/addons/common/functions/fnc_getTargetDistance.sqf +++ b/addons/common/functions/fnc_getTargetDistance.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_interval", "_maxDistance", "_minDistance", "_position", "_laser", "_line", "_distance", "_iteration"]; +private ["_position", "_laser", "_line", "_distance", "_iteration"]; -_interval = _this select 0; -_maxDistance = _this select 1; -_minDistance = _this select 2; +PARAMS_3(_interval,_maxDistance,_minDistance); _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; @@ -29,15 +27,15 @@ _distance = _maxDistance; _iteration = _distance; while { - _iteration > _interval / 2 + _iteration > _interval / 2 } do { - _iteration = _iteration / 2; + _iteration = _iteration / 2; - _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; - _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; - _line set [1, _laser]; + _laser = ATLToASL positionCameraToWorld [0, 0, _distance]; + _laser set [2, (_laser select 2) - (getTerrainHeightASL _laser min 0)]; + _line set [1, _laser]; - _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration); + _distance = _distance + (([1, -1] select (lineIntersects (_line + [vehicle ACE_player]) || {terrainIntersectASL _line})) * _iteration); }; _distance = _interval * round (_distance / _interval); diff --git a/addons/common/functions/fnc_getTargetObject.sqf b/addons/common/functions/fnc_getTargetObject.sqf index c00a0e2340..6e3db94763 100644 --- a/addons/common/functions/fnc_getTargetObject.sqf +++ b/addons/common/functions/fnc_getTargetObject.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_maxDistance", "_position", "_laser", "_intersects"]; +private ["_position", "_laser", "_intersects"]; -_maxDistance = _this select 0; +PARAMS_1(_maxDistance); _position = ATLToASL positionCameraToWorld [0, 0, 0]; _position set [2, (_position select 2) - (getTerrainHeightASL _position min 0)]; diff --git a/addons/common/functions/fnc_getTurnedOnLights.sqf b/addons/common/functions/fnc_getTurnedOnLights.sqf index e50c15f593..b0eb201bca 100644 --- a/addons/common/functions/fnc_getTurnedOnLights.sqf +++ b/addons/common/functions/fnc_getTurnedOnLights.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_vehicle"; - -_vehicle = _this select 0; +PARAMS_1(_vehicle); if (!isLightOn _vehicle) exitWith {[]}; diff --git a/addons/common/functions/fnc_getTurretCommander.sqf b/addons/common/functions/fnc_getTurretCommander.sqf index b26060b221..99665d03e3 100644 --- a/addons/common/functions/fnc_getTurretCommander.sqf +++ b/addons/common/functions/fnc_getTurretCommander.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; diff --git a/addons/common/functions/fnc_getTurretConfigPath.sqf b/addons/common/functions/fnc_getTurretConfigPath.sqf index aab3433a4f..1fca65eaac 100644 --- a/addons/common/functions/fnc_getTurretConfigPath.sqf +++ b/addons/common/functions/fnc_getTurretConfigPath.sqf @@ -12,28 +12,27 @@ */ #include "script_component.hpp" -private ["_config", "_turretIndex", "_index", "_offset", "_config2", "_foundClasses"]; +private ["_index", "_offset", "_config2", "_foundClasses", "_a"]; -_config = _this select 0; -_turretIndex = _this select 1; +PARAMS_2(_config,_turretIndex); for "_index" from 0 to (count _turretIndex - 1) do { - _config = _config >> "Turrets"; + _config = _config >> "Turrets"; - _offset = 0; - _config2 = _config select 0; + _offset = 0; + _config2 = _config select 0; - _foundClasses = 0; - for "_a" from 0 to (count _config - 1) do { - if (isClass _config2) then { - _foundClasses = _foundClasses + 1; - } else { - _offset = _offset + 1; + _foundClasses = 0; + for "_a" from 0 to (count _config - 1) do { + if (isClass _config2) then { + _foundClasses = _foundClasses + 1; + } else { + _offset = _offset + 1; + }; + _config2 = _config select (_turretIndex select _index) + _offset; + + if (_foundClasses == _turretIndex select _index) exitWith {}; }; - _config2 = _config select (_turretIndex select _index) + _offset; - - if (_foundClasses == _turretIndex select _index) exitWith {}; - }; - _config = _config2; + _config = _config2; }; _config diff --git a/addons/common/functions/fnc_getTurretCopilot.sqf b/addons/common/functions/fnc_getTurretCopilot.sqf index 9f51f8724c..d496051558 100644 --- a/addons/common/functions/fnc_getTurretCopilot.sqf +++ b/addons/common/functions/fnc_getTurretCopilot.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { - _turret = _x; - }; + if (getNumber (_config >> "isCopilot") == 1 && {getNumber (_config >> "primaryGunner") != 1} && {getNumber (_config >> "primaryObserver") != 1}) exitWith { + _turret = _x; + }; } forEach _turrets; + _turret diff --git a/addons/common/functions/fnc_getTurretDirection.sqf b/addons/common/functions/fnc_getTurretDirection.sqf index fb265bf545..31b68ccabc 100644 --- a/addons/common/functions/fnc_getTurretDirection.sqf +++ b/addons/common/functions/fnc_getTurretDirection.sqf @@ -12,8 +12,8 @@ */ #include "script_component.hpp" -EXPLODE_2_PVT(_this,_vehicle,_position); -private ["_turrets", "_turret", "_config", "_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov"]; +PARAMS_2(_vehicle,_position); +private ["_turret", "_povPos", "_povDir", "_gunBeginPos", "_gunEndPos", "_pov", "_gunBeg", "_gunEnd", "_pipDir"]; _turret = [_vehicle, _position] call CBA_fnc_getTurret; _pov = getText (_turret >> "memoryPointGunnerOptics"); @@ -25,7 +25,7 @@ TRACE_3("", _pov, _gunBeg, _gunEnd); _povPos = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition _pov ) ); _povDir = [0,0,0]; -if(_pov == "pip0_pos") then { +if (_pov == "pip0_pos") then { _pipDir = ATLtoASL ( _vehicle modelToWorldVisual (_vehicle selectionPosition "pip0_dir" ) ); _povDir = _pipDir vectorDiff _povPos; } else { diff --git a/addons/common/functions/fnc_getTurretGunner.sqf b/addons/common/functions/fnc_getTurretGunner.sqf index ba1802c37f..a4bcca54dd 100644 --- a/addons/common/functions/fnc_getTurretGunner.sqf +++ b/addons/common/functions/fnc_getTurretGunner.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "primaryGunner") == 1) exitWith { - _turret = _x; - }; + if (getNumber (_config >> "primaryGunner") == 1) exitWith { + _turret = _x; + }; } forEach _turrets; + _turret diff --git a/addons/common/functions/fnc_getTurretIndex.sqf b/addons/common/functions/fnc_getTurretIndex.sqf index 85d69b6828..bfb96b4665 100644 --- a/addons/common/functions/fnc_getTurretIndex.sqf +++ b/addons/common/functions/fnc_getTurretIndex.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_turrets", "_units", "_index"]; +private ["_vehicle", "_turrets", "_units", "_index"]; -_unit = _this select 0; +PARAMS_1(_unit); _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; diff --git a/addons/common/functions/fnc_getTurrets.sqf b/addons/common/functions/fnc_getTurrets.sqf index 47ffcde090..ea656941e4 100644 --- a/addons/common/functions/fnc_getTurrets.sqf +++ b/addons/common/functions/fnc_getTurrets.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_type", "_config", "_turrets", "_fnc_addTurret"]; +private ["_config", "_turrets", "_fnc_addTurret", "_varName"]; -_type = _this select 0; +PARAMS_1(_type); _varName = format ["ACE_CachedTurrets_%1", _type]; _turrets = + (uiNamespace getVariable _varName); @@ -24,26 +24,25 @@ _config = configFile >> "CfgVehicles" >> _type; _turrets = []; _fnc_addTurret = { - private ["_config", "_path", "_count", "_offset", "_index", "_path2", "_config2"]; + private ["_count", "_offset", "_index", "_path2", "_config2"]; - _config = _this select 0; - _path = _this select 1; + PARAMS_2(_config,_path); - _config = _config >> "Turrets"; - _count = count _config; + _config = _config >> "Turrets"; + _count = count _config; - _offset = 0; - for "_index" from 0 to (_count - 1) do { - _path2 = _path + [_index - _offset]; - _config2 = _config select _index; + _offset = 0; + for "_index" from 0 to (_count - 1) do { + _path2 = _path + [_index - _offset]; + _config2 = _config select _index; - if (isClass _config2) then { - _turrets pushBack _path2; - [_config2, _path2] call _fnc_addTurret; - } else { - _offset = _offset + 1; + if (isClass _config2) then { + _turrets pushBack _path2; + [_config2, _path2] call _fnc_addTurret; + } else { + _offset = _offset + 1; + }; }; - }; }; [_config, []] call _fnc_addTurret; diff --git a/addons/common/functions/fnc_getTurretsFFV.sqf b/addons/common/functions/fnc_getTurretsFFV.sqf index f915d6c096..2eaa8807b0 100644 --- a/addons/common/functions/fnc_getTurretsFFV.sqf +++ b/addons/common/functions/fnc_getTurretsFFV.sqf @@ -11,20 +11,20 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if (getNumber (_config >> "isPersonTurret") == 1) then { - _turret pushBack _x; - }; + if (getNumber (_config >> "isPersonTurret") == 1) then { + _turret pushBack _x; + }; } forEach _turrets; _turret diff --git a/addons/common/functions/fnc_getTurretsOther.sqf b/addons/common/functions/fnc_getTurretsOther.sqf index 102c1a9d1c..5f373f7c9c 100644 --- a/addons/common/functions/fnc_getTurretsOther.sqf +++ b/addons/common/functions/fnc_getTurretsOther.sqf @@ -11,24 +11,24 @@ */ #include "script_component.hpp" -private ["_vehicle", "_turrets", "_turret", "_config"]; +private ["_turrets", "_turret", "_config"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turrets = allTurrets [_vehicle, true]; _turret = []; { - _config = configFile >> "CfgVehicles" >> typeOf _vehicle; + _config = configFile >> "CfgVehicles" >> typeOf _vehicle; - _config = [_config, _x] call FUNC(getTurretConfigPath); + _config = [_config, _x] call FUNC(getTurretConfigPath); - if ( getNumber (_config >> "isCopilot") != 1 - && {getNumber (_config >> "primaryGunner") != 1} - && {getNumber (_config >> "primaryObserver") != 1} - && {getNumber (_config >> "isPersonTurret") != 1} - ) then { - _turret pushBack _x; - }; + if ( getNumber (_config >> "isCopilot") != 1 + && {getNumber (_config >> "primaryGunner") != 1} + && {getNumber (_config >> "primaryObserver") != 1} + && {getNumber (_config >> "isPersonTurret") != 1} + ) then { + _turret pushBack _x; + }; } forEach _turrets; _turret diff --git a/addons/common/functions/fnc_getUavControlPosition.sqf b/addons/common/functions/fnc_getUavControlPosition.sqf index 82b04e2928..ad2487c9c1 100644 --- a/addons/common/functions/fnc_getUavControlPosition.sqf +++ b/addons/common/functions/fnc_getUavControlPosition.sqf @@ -20,9 +20,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_uav", "_positionArray", "_playerIndex"]; +private ["_uav", "_positionArray", "_playerIndex"]; -_unit = _this select 0; +PARAMS_1(_unit); _uav = getConnectedUAV _unit; if (isNull _uav) exitWith {""}; _positionArray = UAVControl _uav; diff --git a/addons/common/functions/fnc_getVehicleCargo.sqf b/addons/common/functions/fnc_getVehicleCargo.sqf index e0483e8487..4b8ca63f5c 100644 --- a/addons/common/functions/fnc_getVehicleCargo.sqf +++ b/addons/common/functions/fnc_getVehicleCargo.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers", "_index"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> _vehicle; @@ -21,8 +21,8 @@ _cargo = []; _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; + if !(_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; }; _cargo diff --git a/addons/common/functions/fnc_getVehicleCodriver.sqf b/addons/common/functions/fnc_getVehicleCodriver.sqf index 4fd8058d1e..019c7b9971 100644 --- a/addons/common/functions/fnc_getVehicleCodriver.sqf +++ b/addons/common/functions/fnc_getVehicleCodriver.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_config", "_cargo", "_codrivers"]; +private ["_config", "_cargo", "_codrivers", "_index"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _config = configFile >> "CfgVehicles" >> _vehicle; @@ -21,8 +21,8 @@ _cargo = []; _codrivers = getArray (_config >> "cargoIsCoDriver"); for "_index" from 0 to (getNumber (_config >> "transportSoldier") - 1) do { - if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { - _cargo pushBack _index; - }; + if (_index in _codrivers && {_vehicle isKindOf "Car"} && {!(_vehicle isKindOf "Wheeled_APC_F")}) then { + _cargo pushBack _index; + }; }; _cargo diff --git a/addons/common/functions/fnc_getVehicleCrew.sqf b/addons/common/functions/fnc_getVehicleCrew.sqf index b14fbe561e..23957c31fd 100644 --- a/addons/common/functions/fnc_getVehicleCrew.sqf +++ b/addons/common/functions/fnc_getVehicleCrew.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_types", "_crew"]; +private ["_crew"]; -_vehicle = _this select 0; -_types = _this select 1; +PARAMS_2(_vehicle,_types); _crew = []; diff --git a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf index 7433991e29..03b7b1c707 100644 --- a/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf +++ b/addons/common/functions/fnc_getWeaponAzimuthAndInclination.sqf @@ -12,9 +12,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_direction", "_azimuth", "_inclination"]; +private ["_direction", "_azimuth", "_inclination"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _direction = ACE_player weaponDirection _weapon; diff --git a/addons/common/functions/fnc_getWeaponIndex.sqf b/addons/common/functions/fnc_getWeaponIndex.sqf index f2b8bce9f2..b11054a5e7 100644 --- a/addons/common/functions/fnc_getWeaponIndex.sqf +++ b/addons/common/functions/fnc_getWeaponIndex.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" - EXPLODE_2_PVT(_this,_unit,_weapon); +PARAMS_2(_unit,_weapon); if (_weapon == "") exitWith {-1}; diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index c5f04d1e5d..83e7b7559f 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_modes"]; +private ["_modes"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _modes = []; { diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index a3e308abfc..b0b7173d2f 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_weapon", "_muzzles"]; +private ["_muzzles"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); diff --git a/addons/common/functions/fnc_getWeaponState.sqf b/addons/common/functions/fnc_getWeaponState.sqf index 4ec54cc787..543f356b7e 100644 --- a/addons/common/functions/fnc_getWeaponState.sqf +++ b/addons/common/functions/fnc_getWeaponState.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +PARAMS_2(_unit,_weapon); private "_muzzles"; _muzzles = [_weapon] call FUNC(getWeaponMuzzles); diff --git a/addons/common/functions/fnc_getWeaponType.sqf b/addons/common/functions/fnc_getWeaponType.sqf index 89ee46427b..c153bb2b3c 100644 --- a/addons/common/functions/fnc_getWeaponType.sqf +++ b/addons/common/functions/fnc_getWeaponType.sqf @@ -11,20 +11,21 @@ */ #include "script_component.hpp" -private ["_weapon", "_type", "_index"]; +private ["_type", "_index"]; -_weapon = _this select 0; +PARAMS_1(_weapon); _type = [getNumber (configFile >> "CfgWeapons" >> _weapon >> "type")] call FUNC(binarizeNumber); _index = 0; + while {!(_type select _index) && {_index < 16}} do { - _index = _index + 1; + _index = _index + 1; }; switch (_index) do { - case 0 : {1}; - case 1 : {3}; - case 2 : {2}; - default {-1}; + case 0 : {1}; + case 1 : {3}; + case 2 : {2}; + default {-1}; } diff --git a/addons/common/functions/fnc_getWindDirection.sqf b/addons/common/functions/fnc_getWindDirection.sqf index 5bd4ff12ff..d93023bfe4 100644 --- a/addons/common/functions/fnc_getWindDirection.sqf +++ b/addons/common/functions/fnc_getWindDirection.sqf @@ -12,20 +12,20 @@ #include "script_component.hpp" switch (round (windDir / 360 * 16)) do { - case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; - case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; - case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; - case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; - case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; - case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; - case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; - case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; - case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; - case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; - case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; - case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; - case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; - case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; - case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; - default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; + case 1 : {localize QUOTE(DOUBLES(STR,GVAR(SSW)))}; + case 2 : {localize QUOTE(DOUBLES(STR,GVAR(SW)))}; + case 3 : {localize QUOTE(DOUBLES(STR,GVAR(WSW)))}; + case 4 : {localize QUOTE(DOUBLES(STR,GVAR(W)))}; + case 5 : {localize QUOTE(DOUBLES(STR,GVAR(WNW)))}; + case 6 : {localize QUOTE(DOUBLES(STR,GVAR(NW)))}; + case 7 : {localize QUOTE(DOUBLES(STR,GVAR(NNW)))}; + case 8 : {localize QUOTE(DOUBLES(STR,GVAR(N)))}; + case 9 : {localize QUOTE(DOUBLES(STR,GVAR(NNE)))}; + case 10 : {localize QUOTE(DOUBLES(STR,GVAR(NE)))}; + case 11 : {localize QUOTE(DOUBLES(STR,GVAR(ENE)))}; + case 12 : {localize QUOTE(DOUBLES(STR,GVAR(E)))}; + case 13 : {localize QUOTE(DOUBLES(STR,GVAR(ESE)))}; + case 14 : {localize QUOTE(DOUBLES(STR,GVAR(SE)))}; + case 15 : {localize QUOTE(DOUBLES(STR,GVAR(SSE)))}; + default {localize QUOTE(DOUBLES(STR,GVAR(S)))}; }; diff --git a/addons/common/functions/fnc_globalEvent.sqf b/addons/common/functions/fnc_globalEvent.sqf index dcf40261cf..b605a406b1 100644 --- a/addons/common/functions/fnc_globalEvent.sqf +++ b/addons/common/functions/fnc_globalEvent.sqf @@ -11,11 +11,9 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs"]; - -_eventName = _this select 0; -_eventArgs = _this select 1; +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); +PARAMS_2(_eventName,_eventArgs); ACEg = [_eventName, _eventArgs]; publicVariable "ACEg"; diff --git a/addons/common/functions/fnc_goKneeling.sqf b/addons/common/functions/fnc_goKneeling.sqf index fbe7c3b8f3..0ff25b460f 100644 --- a/addons/common/functions/fnc_goKneeling.sqf +++ b/addons/common/functions/fnc_goKneeling.sqf @@ -11,22 +11,22 @@ */ #include "script_component.hpp" -private "_unit"; +PARAMS_1(_unit); -_unit = _this select 0; +//IGNORE_PRIVATE_WARNING("_exception"); try { - if (_unit == vehicle _unit) then { - switch (currentWeapon _unit) do { - case "" : {throw "AmovPknlMstpSnonWnonDnon"}; - case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; - case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; - case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; - case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; + if (_unit == vehicle _unit) then { + switch (currentWeapon _unit) do { + case "" : {throw "AmovPknlMstpSnonWnonDnon"}; + case (primaryWeapon _unit) : {throw "AmovPknlMstpSlowWrflDnon"}; + case (secondaryWeapon _unit) : {throw "AmovPknlMstpSrasWlnrDnon"}; + case (handgunWeapon _unit) : {throw "AmovPknlMstpSlowWpstDnon"}; + case (binocular _unit) : {throw "AmovPknlMstpSoptWbinDnon"}; + }; }; - }; } catch { - if (stance _unit != "PRONE") then { - [_unit, _exception] call FUNC(doAnimation); - }; + if (stance _unit != "PRONE") then { + [_unit, _exception] call FUNC(doAnimation); + }; }; diff --git a/addons/common/functions/fnc_hadamardProduct.sqf b/addons/common/functions/fnc_hadamardProduct.sqf index db52a48d80..b063b35313 100644 --- a/addons/common/functions/fnc_hadamardProduct.sqf +++ b/addons/common/functions/fnc_hadamardProduct.sqf @@ -13,8 +13,9 @@ */ #include "script_component.hpp" -_vector1 = _this select 0; -_vector2 = _this select 1; +PARAMS_2(_vector1,_vector2); + +private ["_newVector", "_i"]; _newVector = []; diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 0157fab8e3..52a5ed4cd5 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -10,13 +10,13 @@ #include "script_component.hpp" -private ["_unit","_magazine","_return"]; -_unit = _this select 0; -_magazine = _this select 1; +private ["_return"]; +PARAMS_2(_unit,_magazine); if (_magazine != "") then { _return = (_magazine in magazines _unit); } else { _return = false; }; + _return \ No newline at end of file diff --git a/addons/common/functions/fnc_hashGet.sqf b/addons/common/functions/fnc_hashGet.sqf index 7682b2f6a2..6b47b98ad9 100644 --- a/addons/common/functions/fnc_hashGet.sqf +++ b/addons/common/functions/fnc_hashGet.sqf @@ -1,11 +1,11 @@ //fnc_hashGet.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; -// diag_log text format["%1 HASH GET: %2", diag_tickTime, _this]; +private ["_val", "_index"]; +// diag_log text format["%1 HASH GET: %2", ACE_diagTime, _this]; + +PARAMS_2(_hash,_key); -_hash = _this select 0; -_key = _this select 1; ERRORDATA(2); _val = nil; try { @@ -23,4 +23,6 @@ try { } catch { HANDLECATCH; }; -_val + +if (isNil "_val") exitWith { nil }; +_val; diff --git a/addons/common/functions/fnc_hashHasKey.sqf b/addons/common/functions/fnc_hashHasKey.sqf index 8011e987fb..8d31a6fcb4 100644 --- a/addons/common/functions/fnc_hashHasKey.sqf +++ b/addons/common/functions/fnc_hashHasKey.sqf @@ -1,11 +1,11 @@ //fnc_hashHasKey.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; -// diag_log text format["%1 HASH HAS KEY: %2", diag_tickTime, _this]; +private ["_val", "_index"]; +// diag_log text format["%1 HASH HAS KEY: %2", ACE_diagTime, _this]; + +PARAMS_2(_hash,_key); -_hash = _this select 0; -_key = _this select 1; ERRORDATA(2); _val = false; try { diff --git a/addons/common/functions/fnc_hashListCreateHash.sqf b/addons/common/functions/fnc_hashListCreateHash.sqf index cdad5987cd..c7a6085fea 100644 --- a/addons/common/functions/fnc_hashListCreateHash.sqf +++ b/addons/common/functions/fnc_hashListCreateHash.sqf @@ -1,9 +1,10 @@ //fnc_hashListCreateHash.sqf #include "script_component.hpp" -private ["_hashList", "_hashKeys"]; +private ["_hashKeys"]; + +PARAMS_1(_hashList); -_hashList = _this select 0; ERRORDATA(1); _hashKeys = []; try { diff --git a/addons/common/functions/fnc_hashListCreateList.sqf b/addons/common/functions/fnc_hashListCreateList.sqf index 66061c1aa0..d24b22e7c3 100644 --- a/addons/common/functions/fnc_hashListCreateList.sqf +++ b/addons/common/functions/fnc_hashListCreateList.sqf @@ -1,7 +1,6 @@ //fnc_hashListCreateList.sqf #include "script_component.hpp" -private ["_keys"]; +PARAMS_1(_keys); -_keys = _this select 0; [_keys,[]]; diff --git a/addons/common/functions/fnc_hashListPush.sqf b/addons/common/functions/fnc_hashListPush.sqf index afd092a1b9..d8908dbe33 100644 --- a/addons/common/functions/fnc_hashListPush.sqf +++ b/addons/common/functions/fnc_hashListPush.sqf @@ -1,10 +1,8 @@ //fnc_hashListPush.sqf #include "script_component.hpp" -private ["_hashList", "_value"]; +PARAMS_2(_hashList,_value); -_hashList = _this select 0; -_value = _this select 1; ERRORDATA(2); try { if(VALIDHASH(_hashList)) then { diff --git a/addons/common/functions/fnc_hashListSelect.sqf b/addons/common/functions/fnc_hashListSelect.sqf index 0c552d072e..9f6f6489d0 100644 --- a/addons/common/functions/fnc_hashListSelect.sqf +++ b/addons/common/functions/fnc_hashListSelect.sqf @@ -1,10 +1,9 @@ //fnc_hashListSelect.sqf #include "script_component.hpp" -private ["_hashList", "_index", "_hash", "_keys", "_hashes", "_values"]; +private ["_hash", "_keys", "_hashes", "_values"]; -_hashList = _this select 0; -_index = _this select 1; +PARAMS_2(_hashList,_index); ERRORDATA(2); _hash = nil; try { @@ -24,4 +23,6 @@ try { } catch { HANDLECATCH; }; + +if (isNil "_hash") exitWith { nil }; _hash; diff --git a/addons/common/functions/fnc_hashListSet.sqf b/addons/common/functions/fnc_hashListSet.sqf index c384bc15c9..fdb19350df 100644 --- a/addons/common/functions/fnc_hashListSet.sqf +++ b/addons/common/functions/fnc_hashListSet.sqf @@ -1,11 +1,9 @@ //fnc_hashListSet.sqf #include "script_component.hpp" -private ["_hashList", "_index", "_value", "_vals"]; +private ["_vals"]; -_hashList = _this select 0; -_index = _this select 1; -_value = _this select 2; +PARAMS_3(_hashList,_index,_value); ERRORDATA(3); try { if(VALIDHASH(_hashList)) then { diff --git a/addons/common/functions/fnc_hashRem.sqf b/addons/common/functions/fnc_hashRem.sqf index 000dbbefe0..7f7bb17cc4 100644 --- a/addons/common/functions/fnc_hashRem.sqf +++ b/addons/common/functions/fnc_hashRem.sqf @@ -1,10 +1,9 @@ //fnc_hashRem.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; +private ["_val", "_index"]; -_hash = _this select 0; -_key = _this select 1; +PARAMS_2(_hash,_key); ERRORDATA(2); _val = nil; try { diff --git a/addons/common/functions/fnc_hashSet.sqf b/addons/common/functions/fnc_hashSet.sqf index 0e374d5f12..1b3bded6e9 100644 --- a/addons/common/functions/fnc_hashSet.sqf +++ b/addons/common/functions/fnc_hashSet.sqf @@ -1,12 +1,11 @@ //fnc_hashSet.sqf #include "script_component.hpp" -private ["_hash", "_key", "_val", "_index"]; -// diag_log text format["%1 HASH SET: %2", diag_tickTime, _this]; +private ["_index"]; +// diag_log text format["%1 HASH SET: %2", ACE_diagTime, _this]; + +PARAMS_3(_hash,_key,_val); -_hash = _this select 0; -_key = _this select 1; -_val = _this select 2; ERRORDATA(3); try { if(VALIDHASH(_hash)) then { diff --git a/addons/common/functions/fnc_hideUnit.sqf b/addons/common/functions/fnc_hideUnit.sqf new file mode 100644 index 0000000000..94857335f4 --- /dev/null +++ b/addons/common/functions/fnc_hideUnit.sqf @@ -0,0 +1,34 @@ +/* + * Author: SilentSpike (based on muteUnit) + * Globally hides a unit. This allows the handling of more than one reason to hide an object globally. + * + * Arguments: + * 0: Unit + * 1: Reason to hide the unit + * + * Return Value: + * nil + * + * Example: + * [ACE_Player, "SpectatorMode"] call ace_common_fnc_hideUnit + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_2(_unit,_reason); + +if (isNull _unit) exitWith {}; + +private "_setHiddenReasons"; +_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; + +if !(_reason in _setHiddenReasons) then { + _setHiddenReasons pushBack _reason; + _unit setVariable [QGVAR(setHiddenReasons), _setHiddenReasons, true]; +}; + +//if !(isObjectHidden _unit) then { (Uncomment when isObjectHidden hits stable branch) + ["hideObjectGlobal",[_unit,true]] call FUNC(serverEvent); +//}; diff --git a/addons/common/functions/fnc_inWater.sqf b/addons/common/functions/fnc_inWater.sqf index 2fdede1737..f6f491535f 100644 --- a/addons/common/functions/fnc_inWater.sqf +++ b/addons/common/functions/fnc_inWater.sqf @@ -10,13 +10,16 @@ #include "script_component.hpp" -private ["_unit","_return","_aslPos"]; -_unit = _this select 0; +private ["_return","_aslPos"]; + +PARAMS_1(_unit); _return = false; + if ((surfaceIsWater getPos _unit)) then { _aslPos = _unit modelToWorldVisual (_unit selectionPosition "head"); if ((_aslPos select 2) <= 0) then { _return = true; }; }; -_return; \ No newline at end of file + +_return; diff --git a/addons/common/functions/fnc_inheritsFrom.sqf b/addons/common/functions/fnc_inheritsFrom.sqf index 6a39152b9b..27d84b9d12 100644 --- a/addons/common/functions/fnc_inheritsFrom.sqf +++ b/addons/common/functions/fnc_inheritsFrom.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" - private ["_configEntry","_configMatch", "_match"]; -_configEntry = _this select 0; -_configMatch = _this select 1; + private ["_match"]; +PARAMS_2(_configEntry,_configMatch); if (configName _configEntry == _configMatch) exitWith { true }; if (configName _configEntry == ",") exitWith { false }; diff --git a/addons/common/functions/fnc_interpolateFromArray.sqf b/addons/common/functions/fnc_interpolateFromArray.sqf index 8c0c8daa36..2427fa47b5 100644 --- a/addons/common/functions/fnc_interpolateFromArray.sqf +++ b/addons/common/functions/fnc_interpolateFromArray.sqf @@ -1,10 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_array", "_value", "_min", "_max"]; +private ["_min", "_max"]; -_array = _this select 0; -_value = _this select 1; +PARAMS_2(_array,_value); _min = _array select floor _value; _max = _array select ceil _value; diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index 10136c0369..c0dd59288e 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -10,6 +10,6 @@ #include "script_component.hpp" -private ["_unit","_return"]; -_unit = _this select 0; +PARAMS_1(_unit); + (!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false])); diff --git a/addons/common/functions/fnc_isEOD.sqf b/addons/common/functions/fnc_isEOD.sqf index 6149dfa37b..92c5dc6dc4 100644 --- a/addons/common/functions/fnc_isEOD.sqf +++ b/addons/common/functions/fnc_isEOD.sqf @@ -16,12 +16,10 @@ BOOLEAN Example: - _isSpecialist = [player] call FUNC(isEOD); + isSpecialist = [player] call FUNC(isEOD); */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_isEOD", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "canDeactivateMines") == 1] diff --git a/addons/common/functions/fnc_isEngineer.sqf b/addons/common/functions/fnc_isEngineer.sqf index 2bdb62df4c..4cc5f42bc9 100644 --- a/addons/common/functions/fnc_isEngineer.sqf +++ b/addons/common/functions/fnc_isEngineer.sqf @@ -11,8 +11,6 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_IsEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] diff --git a/addons/common/functions/fnc_isInBuilding.sqf b/addons/common/functions/fnc_isInBuilding.sqf index 0989db42da..adecf5ac0c 100644 --- a/addons/common/functions/fnc_isInBuilding.sqf +++ b/addons/common/functions/fnc_isInBuilding.sqf @@ -13,9 +13,9 @@ #define DISTANCE 10 -private ["_unit", "_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; +private ["_position", "_positionX", "_positionY", "_positionZ", "_intersections"]; -_unit = _this select 0; +PARAMS_1(_unit); _position = eyePos _unit; _positionX = _position select 0; diff --git a/addons/common/functions/fnc_isPlayer.sqf b/addons/common/functions/fnc_isPlayer.sqf index 772fae1746..91e54a51c1 100644 --- a/addons/common/functions/fnc_isPlayer.sqf +++ b/addons/common/functions/fnc_isPlayer.sqf @@ -1,15 +1,21 @@ /* - * Author: bux578, commy2 + * Author: bux578, commy2, akalegman * * Checks if a unit is a player / curator controlled unit. * Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine) * * Arguments: * 0: unit to be checked (object) + * 1: exclude remote controlled units (boolean) * * Return Value: * Bool: is unit a player? */ #include "script_component.hpp" -isPlayer (_this select 0) || {_this select 0 == call FUNC(player)} +private ["_unit", "_excludeRemoteControlled"]; + +_unit = _this select 0; +_excludeRemoteControlled = if (count _this > 1) then {_this select 1} else {false}; + +isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) diff --git a/addons/common/functions/fnc_isTurnedOut.sqf b/addons/common/functions/fnc_isTurnedOut.sqf index 8f722ed733..35270ccfc4 100644 --- a/addons/common/functions/fnc_isTurnedOut.sqf +++ b/addons/common/functions/fnc_isTurnedOut.sqf @@ -11,23 +11,23 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; +private ["_vehicle", "_config", "_animation", "_action", "_inAction", "_turretIndex"]; -_unit = _this select 0; +PARAMS_1(_unit); _vehicle = vehicle _unit; _config = configFile >> "CfgVehicles" >> typeOf _vehicle; _animation = animationState _unit; if (_unit == driver _vehicle) then { - _action = getText (_config >> "driverAction"); - _inAction = getText (_config >> "driverInAction"); + _action = getText (_config >> "driverAction"); + _inAction = getText (_config >> "driverInAction"); } else { - _turretIndex = [_unit] call FUNC(getTurretIndex); + _turretIndex = [_unit] call FUNC(getTurretIndex); - _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); + _config = [_config, _turretIndex] call FUNC(getTurretConfigPath); - _action = getText (_config >> "gunnerAction"); - _inAction = getText (_config >> "gunnerInAction"); + _action = getText (_config >> "gunnerAction"); + _inAction = getText (_config >> "gunnerInAction"); }; if (_action == "" || {_inAction == ""} || {_action == _inAction}) exitWith {false}; diff --git a/addons/common/functions/fnc_lightIntensityFromObject.sqf b/addons/common/functions/fnc_lightIntensityFromObject.sqf index 785ebf8212..6722c3a554 100644 --- a/addons/common/functions/fnc_lightIntensityFromObject.sqf +++ b/addons/common/functions/fnc_lightIntensityFromObject.sqf @@ -12,15 +12,11 @@ */ #include "script_component.hpp" -private ["_unit", "_lightSource"]; +private ["_unitPos","_lightLevel"]; -_unit = _this select 0; -_lightSource = _this select 1; +PARAMS_2(_unit,_lightSource); -private "_unitPos"; _unitPos = _unit modelToWorld (_unit selectionPosition "spine3"); - -private "_lightLevel"; _lightLevel = 0; if (_lightSource isKindOf "CAManBase") then { diff --git a/addons/common/functions/fnc_loadSettingsOnServer.sqf b/addons/common/functions/fnc_loadSettingsOnServer.sqf index 9255d047b3..61431ff220 100644 --- a/addons/common/functions/fnc_loadSettingsOnServer.sqf +++ b/addons/common/functions/fnc_loadSettingsOnServer.sqf @@ -13,6 +13,8 @@ */ #include "script_component.hpp" +private ["_parseConfigForSettings"]; + GVAR(settings) = []; _parseConfigForSettings = { diff --git a/addons/common/functions/fnc_localEvent.sqf b/addons/common/functions/fnc_localEvent.sqf index 0b8c218eca..256282f97f 100644 --- a/addons/common/functions/fnc_localEvent.sqf +++ b/addons/common/functions/fnc_localEvent.sqf @@ -14,6 +14,8 @@ PARAMS_2(_eventName,_eventArgs); +private["_eventIndex", "_eventNames", "_events"]; + _eventNames = GVAR(events) select 0; _eventIndex = _eventNames find _eventName; if(_eventIndex != -1) then { diff --git a/addons/common/functions/fnc_log.sqf b/addons/common/functions/fnc_log.sqf index 43a5a27682..21ae4cfbf8 100644 --- a/addons/common/functions/fnc_log.sqf +++ b/addons/common/functions/fnc_log.sqf @@ -2,29 +2,24 @@ #include "script_component.hpp" if ((_this select 0) in (missionNamespace getVariable ["ACE_Debug", []])) then { - private ["_type", "_argument", "_function", "_showInGame"]; + _this resize 4; - _this resize 4; + PARAMS_4(_type,_argument,_function,_showInGame); - _type = _this select 0; - _argument = _this select 1; - _function = _this select 2; - _showInGame = _this select 3; + if (isNil "_function") then { + _function = {_this}; + }; - if (isNil "_function") then { - _function = {_this}; - }; + if (isNil "_showInGame") then { + _showInGame = true; + }; - if (isNil "_showInGame") then { - _showInGame = true; - }; + private "_result"; + _result = _argument call _function; - private "_result"; - _result = _argument call _function; + if (_showInGame) then { + systemChat format ["%1", _result]; + }; - if (_showInGame) then { - systemChat format ["%1", _result]; - }; - - diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; + diag_log text format ["[ACE] Debug: %1 : %2 - %3 : %4", _type, diag_frameno, _fnc_scriptNameParent, _result]; }; diff --git a/addons/common/functions/fnc_logModEntries.sqf b/addons/common/functions/fnc_logModEntries.sqf index 4b94c557bc..ec8c94b190 100644 --- a/addons/common/functions/fnc_logModEntries.sqf +++ b/addons/common/functions/fnc_logModEntries.sqf @@ -1,6 +1,7 @@ // by commy2 +#include "script_component.hpp" -private ["_configs", "_entries"]; +private ["_configs", "_entries", "_name"]; _configs = "true" configClasses (configFile >> _this); diff --git a/addons/common/functions/fnc_map.sqf b/addons/common/functions/fnc_map.sqf index 99c52ae742..16ed168218 100644 --- a/addons/common/functions/fnc_map.sqf +++ b/addons/common/functions/fnc_map.sqf @@ -21,11 +21,11 @@ _array = + _this select 0; _code = _this select 1; if (isNil "_array") exitWith { - diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent]; - [] + diag_log text format ["[ACE] ERROR: No array for function map in %1", _fnc_scriptNameParent]; + [] }; { - _array set [_forEachIndex, _x call _code]; + _array set [_forEachIndex, _x call _code]; } forEach _array; _array diff --git a/addons/common/functions/fnc_moduleCheckPBOs.sqf b/addons/common/functions/fnc_moduleCheckPBOs.sqf index 4b5ea2374a..c75324c9a3 100644 --- a/addons/common/functions/fnc_moduleCheckPBOs.sqf +++ b/addons/common/functions/fnc_moduleCheckPBOs.sqf @@ -1,97 +1,25 @@ /* * Author: KoffeinFlummi - * * Initializes the check-PBOs module. * * Arguments: - * Whatever the module provides. (I dunno.) + * 0: The module logic + * 1: units + * 2: activated * * Return Value: * None */ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +if !(isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; -_mode = parseNumber (_logic getVariable "Action"); -_checkAll = _logic getVariable ["CheckAll", false]; -_whitelist = call compile (_logic getVariable ["Whitelist", "[]"]); +[_logic, QGVAR(checkPBOsAction), "Action" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(checkPBOsCheckAll), "CheckAll" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(checkPBOsWhitelist), "Whitelist" ] call EFUNC(common,readSettingFromModule); -if (isNil "_whitelist") then { - _whitelist = []; -}; - -_whitelist = [_whitelist, {toLower _this}] call FUNC(map); - -ACE_Version_CheckAll = _checkAll; -ACE_Version_Whitelist = _whitelist; - -if (!isServer) then { - [_mode, _checkAll, _whitelist] spawn { - _mode = _this select 0; - _checkAll = _this select 1; - _whitelist = _this select 2; - - waitUntil { - sleep 1; - !isNil "ACE_Version_ClientErrors" - }; - - _missingAddon = ACE_Version_ClientErrors select 0; - _missingAddonServer = ACE_Version_ClientErrors select 1; - _oldVersionClient = ACE_Version_ClientErrors select 2; - _oldVersionServer = ACE_Version_ClientErrors select 3; - - // Display error message. - if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { - _text = "[ACE] Version mismatch:

"; - _error = format ["ACE version mismatch: %1: ", profileName]; - - if (_missingAddon) then { - _text = _text + "Detected missing addon on client
"; - _error = _error + "Missing file(s); "; - }; - if (_missingAddonServer) then { - _text = _text + "Detected missing addon on server
"; - _error = _error + "Additional file(s); "; - }; - if (_oldVersionClient) then { - _text = _text + "Detected old client version
"; - _error = _error + "Older version; "; - }; - if (_oldVersionServer) then { - _text = _text + "Detected old server version
"; - _error = _error + "Newer version; "; - }; - - //[_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - diag_log text _error; - - _text = composeText [lineBreak, parseText format ["%1", _text]]; - - _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; - _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; - - disableSerialization; - _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; - _ctrlHint ctrlSetStructuredText _text; - - if (_mode == 0) then { - sleep 10; - _rscLayer cutFadeOut 0.2; - }; - - if (_mode == 2) then { - sleep 10; - waitUntil {alive player}; - [player] call FUNC(adminKick); - }; - }; - }; -}; - -diag_log text format ["[ACE]: Check-PBOs Module Initialized. Mode: %1.", _mode]; +diag_log text format ["[ACE]: Check-PBOs Module Initialized. Mode: %1.", GVAR(checkPBOsAction)]; diff --git a/addons/common/functions/fnc_moduleLSDVehicles.sqf b/addons/common/functions/fnc_moduleLSDVehicles.sqf index f06c1cf2ea..59744016ce 100644 --- a/addons/common/functions/fnc_moduleLSDVehicles.sqf +++ b/addons/common/functions/fnc_moduleLSDVehicles.sqf @@ -11,37 +11,37 @@ */ #include "script_component.hpp" -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; +PARAMS_3(_logic,_units,_activated); + +private["_colors", "_hSCount", "_hiddenSelections", "_i", "_index", "_vehicle"]; if !(_activated) exitWith {}; { - _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); - if (_hiddenSelections > 0) then { - nul = [_x, _hiddenSelections] spawn { - _vehicle = _this select 0; - _hSCount = _this select 1; - _colors = [ - "#(argb,8,8,3)color(1,0,0,1,co)", - "#(argb,8,8,3)color(1,0.5,0,1,co)", - "#(argb,8,8,3)color(1,1,0,1,co)", - "#(argb,8,8,3)color(0,1,0,1,co)", - "#(argb,8,8,3)color(0,0,1,1,co)", - "#(argb,8,8,3)color(0.2,0,0.5,1,co)", - "#(argb,8,8,3)color(0.5,0,1,1,co)" - ]; - _index = 0; - while {True} do { - for "_i" from 0 to (_hSCount - 1) do { - _vehicle setObjectTexture [_i, (_colors select _index)]; + _hiddenSelections = count (getArray (configFile >> "CfgVehicles" >> (typeOf _x) >> "hiddenSelections")); + if (_hiddenSelections > 0) then { + nul = [_x, _hiddenSelections] spawn { + _vehicle = _this select 0; + _hSCount = _this select 1; + _colors = [ + "#(argb,8,8,3)color(1,0,0,1,co)", + "#(argb,8,8,3)color(1,0.5,0,1,co)", + "#(argb,8,8,3)color(1,1,0,1,co)", + "#(argb,8,8,3)color(0,1,0,1,co)", + "#(argb,8,8,3)color(0,0,1,1,co)", + "#(argb,8,8,3)color(0.2,0,0.5,1,co)", + "#(argb,8,8,3)color(0.5,0,1,1,co)" + ]; + _index = 0; + while {True} do { + for "_i" from 0 to (_hSCount - 1) do { + _vehicle setObjectTexture [_i, (_colors select _index)]; + }; + _index = (_index + 1) % 7; + sleep 0.02; + }; }; - _index = (_index + 1) % 7; - sleep 0.02; - }; }; - }; } count _units; diag_log text "[ACE]: WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE."; diff --git a/addons/common/functions/fnc_monitor.sqf b/addons/common/functions/fnc_monitor.sqf index dcb9e5163f..f77aa2dd7c 100644 --- a/addons/common/functions/fnc_monitor.sqf +++ b/addons/common/functions/fnc_monitor.sqf @@ -4,8 +4,8 @@ terminate (missionNamespace getVariable [QGVAR(MonitorFnc), scriptNull]); GVAR(MonitorFnc) = _this spawn { - waitUntil { - hintSilent str (call _this); - false - }; + waitUntil { + hintSilent str (call _this); + false + }; }; diff --git a/addons/common/functions/fnc_moveToTempGroup.sqf b/addons/common/functions/fnc_moveToTempGroup.sqf index 802bc2285d..be7335c705 100644 --- a/addons/common/functions/fnc_moveToTempGroup.sqf +++ b/addons/common/functions/fnc_moveToTempGroup.sqf @@ -10,7 +10,7 @@ #include "script_component.hpp" -private ["_unit","_moveTo","_previousGroup","_newGroup", "_currentGroup", "_switchToGroup"]; +private ["_unit","_moveTo","_previousGroup","_newGroup", "_currentGroup"]; _unit = [_this, 0,ObjNull,[ObjNull]] call BIS_fnc_Param; _moveTo = [_this, 1,false,[false]] call BIS_fnc_Param; diff --git a/addons/common/functions/fnc_muteUnit.sqf b/addons/common/functions/fnc_muteUnit.sqf index 5c496ea58e..1eceff744c 100644 --- a/addons/common/functions/fnc_muteUnit.sqf +++ b/addons/common/functions/fnc_muteUnit.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_reason"]; - -_unit = _this select 0; -_reason = _this select 1; +PARAMS_2(_unit,_reason); if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf index f0abcfcf01..a257a22ea0 100644 --- a/addons/common/functions/fnc_muteUnitHandleInitPost.sqf +++ b/addons/common/functions/fnc_muteUnitHandleInitPost.sqf @@ -1,9 +1,7 @@ // by commy2 #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); // setSpeaker gets overwritten after init on remote units; if unit is muted, setSpeaker again if (count (_unit getVariable [QGVAR(muteUnitReasons), []]) > 0) then { diff --git a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf index 021b083bfd..5cef18a0b3 100644 --- a/addons/common/functions/fnc_muteUnitHandleRespawn.sqf +++ b/addons/common/functions/fnc_muteUnitHandleRespawn.sqf @@ -1,9 +1,7 @@ // by commy2 #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); // setVariable is broken on JIP after respawn _unit setVariable [QGVAR(muteUnitReasons), _unit getVariable [QGVAR(muteUnitReasons), []], true]; diff --git a/addons/common/functions/fnc_numberToDigits.sqf b/addons/common/functions/fnc_numberToDigits.sqf index fe62ab626b..3545b53257 100644 --- a/addons/common/functions/fnc_numberToDigits.sqf +++ b/addons/common/functions/fnc_numberToDigits.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_number", "_minLength", "_length", "_digits"]; +private ["_length", "_digits"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); _number = _number min 999999; diff --git a/addons/common/functions/fnc_numberToDigitsString.sqf b/addons/common/functions/fnc_numberToDigitsString.sqf index 24b3791d68..e42f246460 100644 --- a/addons/common/functions/fnc_numberToDigitsString.sqf +++ b/addons/common/functions/fnc_numberToDigitsString.sqf @@ -12,10 +12,9 @@ */ #include "script_component.hpp" -private ["_number", "_minLength", "_length"]; +private ["_length"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); _number = _number min 999999; diff --git a/addons/common/functions/fnc_numberToString.sqf b/addons/common/functions/fnc_numberToString.sqf index e0ebf1d77f..30efcd8955 100644 --- a/addons/common/functions/fnc_numberToString.sqf +++ b/addons/common/functions/fnc_numberToString.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_number", "_decimals"]; +private ["_decimals"]; -_number = _this select 0; +PARAMS_1(_number); _decimals = str (abs(_number) mod 1); _decimals = toArray _decimals; diff --git a/addons/common/functions/fnc_onAnswerRequest.sqf b/addons/common/functions/fnc_onAnswerRequest.sqf index aa3ae8fb45..a8dd2ce351 100644 --- a/addons/common/functions/fnc_onAnswerRequest.sqf +++ b/addons/common/functions/fnc_onAnswerRequest.sqf @@ -9,10 +9,9 @@ */ #include "script_component.hpp" -private ["_unit","_requestID", "_id", "_accepted", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; -_unit = _this select 0; -_id = _this select 1; -_accepted = _this select 2; +private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; + +PARAMS_3(_unit,_id,_accepted); _info = _unit getvariable _id; if (!isnil "_info") then { diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index 5588c23781..b76edb31c1 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -12,8 +12,6 @@ */ #include "script_component.hpp" -private "_target"; - -_target = _this select 0; +PARAMS_1(_target); !isNull (_target getVariable [QGVAR(owner), objNull]) diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index f7d927556c..adc1b8d4c3 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -5,7 +5,7 @@ * Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode] * * Argument: - * 0: NUMBER - Total Time (in game "time" seconds) + * 0: NUMBER - Total Time (in game "ACE_time" seconds) * 1: ARRAY - Arguments, passed to condition, fail and finish * 2: CODE or STRING - On Finish: Code called or STRING raised as event. * 3: CODE or STRING - On Failure: Code called or STRING raised as event. @@ -53,14 +53,14 @@ _perFrameFunction = { EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions); private ["_elapsedTime", "_errorCode"]; - _elapsedTime = time - _startTime; + _elapsedTime = ACE_time - _startTime; _errorCode = -1; // this does not check: target fell unconscious, target died, target moved inside vehicle / left vehicle, target moved outside of players range, target moves at all. if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then { _errorCode = 1; } else { - if (ACE_player != _player) then { + if (ACE_player != _player || !alive _player) then { _errorCode = 2; } else { if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then { @@ -105,4 +105,4 @@ _perFrameFunction = { }; }; -[_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; +[_perFrameFunction, 0, [_args, _onFinish, _onFail, _condition, _player, ACE_time, _totalTime, _exceptions]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index c92bb4ab94..0bf2693eba 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -16,11 +16,11 @@ if !(isServer) exitWith {}; -EXPLODE_3_PVT(_this,_logic,_settingName,_moduleVariable); +PARAMS_3(_logic,_settingName,_moduleVariable); // Check if the parameter is defined in the module if (isNil {_logic getVariable _moduleVariable}) exitWith { - diag_log text format["[ACE]: Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable]; + diag_log text format["[ACE]: Warning in %1 module: %2 setting is missing. Probably an obsolete version of the module is used in the mission.", typeOf _logic, _moduleVariable]; }; // Set the setting globally and force it diff --git a/addons/common/functions/fnc_receiveRequest.sqf b/addons/common/functions/fnc_receiveRequest.sqf index c74a69013d..dc028724f6 100644 --- a/addons/common/functions/fnc_receiveRequest.sqf +++ b/addons/common/functions/fnc_receiveRequest.sqf @@ -10,12 +10,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -_caller = _this select 0; -_target = _this select 1; -_requestID = _this select 2; -_requestMessage = _this select 3; -_callBack = _this select 4; +PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); _requestID = ("ace_recieveRequest_f_id_"+_requestID); @@ -46,7 +41,8 @@ GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = _target addAction ["Decline", compile GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = _requestID; -GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { +GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn { + private["_id", "_t", "_requestID", "_target"]; _t = (_this select 0) + 40; _target = _this select 1; _requestID = _this select 2; @@ -54,7 +50,7 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { waituntil { _id = _target getvariable _requestID; - (time > _t || isnil "_id")}; + (ACE_time > _t || isnil "_id")}; _target setvariable [_requestID, nil]; GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { @@ -65,5 +61,4 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [time, _target, _requestID] spawn { _target removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; }; - }; \ No newline at end of file diff --git a/addons/common/functions/fnc_removeActionEventHandler.sqf b/addons/common/functions/fnc_removeActionEventHandler.sqf index 2bcc970ab0..805a0bdde9 100644 --- a/addons/common/functions/fnc_removeActionEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionEventHandler.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs", "_count"]; +private ["_name", "_actionsVar", "_actionID", "_actions", "_currentID", "_actionIDs"]; -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; +PARAMS_3(_unit,_action,_id); if (_id == -1) exitWith {}; @@ -45,8 +43,8 @@ _actions set [_id, []]; _actions = _actions - [[]]; if (count _actions == 0) then { - _unit removeAction _actionID; - _actionID = -1; + _unit removeAction _actionID; + _actionID = -1; }; _unit setVariable [_name, [_actionID, [_currentID, _actionIDs, _actions], _unit], false]; diff --git a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf index 7c45bae112..b45476a3da 100644 --- a/addons/common/functions/fnc_removeActionMenuEventHandler.sqf +++ b/addons/common/functions/fnc_removeActionMenuEventHandler.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_action", "_id", "_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; +private ["_name", "_actionsVar", "_currentID", "_actionIDs", "_actions", "_actionID", "_nameVar"]; -_unit = _this select 0; -_action = _this select 1; -_id = _this select 2; +PARAMS_3(_unit,_action,_id); if (_id == -1) exitWith {}; diff --git a/addons/common/functions/fnc_removeAllEventHandlers.sqf b/addons/common/functions/fnc_removeAllEventHandlers.sqf index 170d4f8cbb..6bf4dc742a 100644 --- a/addons/common/functions/fnc_removeAllEventHandlers.sqf +++ b/addons/common/functions/fnc_removeAllEventHandlers.sqf @@ -10,12 +10,12 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex"]; -_eventName = _this select 0; +private ["_eventNames", "_eventFunctions", "_eventIndex"]; +PARAMS_1(_eventName); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { - (GVAR(events) select 1) set[_eventIndex, []]; +if (_eventIndex != -1) then { + (GVAR(events) select 1) set [_eventIndex, []]; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_removeEventHandler.sqf b/addons/common/functions/fnc_removeEventHandler.sqf index d87c72933d..16954d5523 100644 --- a/addons/common/functions/fnc_removeEventHandler.sqf +++ b/addons/common/functions/fnc_removeEventHandler.sqf @@ -11,14 +11,15 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventNames", "_eventFunctions", "_eventIndex", "_eventCodeIndex"]; -_eventName = _this select 0; -_eventCodeIndex = _this select 1; +private ["_eventNames", "_eventFunctions", "_eventIndex"]; + +PARAMS_2(_eventName,_eventCodeIndex); _eventNames = GVAR(events) select 0; _eventFunctions = []; _eventIndex = _eventNames find _eventName; -if(_eventIndex != -1) then { + +if (_eventIndex != -1) then { _eventFunctions = (GVAR(events) select 1) select _eventIndex; _eventFunctions set[_eventCodeIndex, nil]; }; \ No newline at end of file diff --git a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf index 0f31b5e886..39225bf9dd 100644 --- a/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf +++ b/addons/common/functions/fnc_removeMapMarkerCreatedEventHandler.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; +private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; -_id = _this select 0; +PARAMS_1(_id); _actionsVar = missionNamespace getVariable ["ACE_EventHandler_MapMarker", [-1, [], []]]; diff --git a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf index 914064538d..ff7c0c281e 100644 --- a/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf +++ b/addons/common/functions/fnc_removeScrollWheelEventHandler.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_id", "_actionsVar", "_currentId", "_actionIDs", "_actions"]; +private ["_actionsVar", "_currentId", "_actionIDs", "_actions"]; -_id = _this select 0; +PARAMS_1(_id); _actionsVar = missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]; diff --git a/addons/common/functions/fnc_removeSyncedEventHandler.sqf b/addons/common/functions/fnc_removeSyncedEventHandler.sqf index 6429120bbe..84aa98c0ea 100644 --- a/addons/common/functions/fnc_removeSyncedEventHandler.sqf +++ b/addons/common/functions/fnc_removeSyncedEventHandler.sqf @@ -10,9 +10,12 @@ * Boolean of success */ #include "script_component.hpp" + PARAMS_1(_name); -if(!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { +private ["_data", "_eventId"]; + +if (!HASH_HASKEY(GVAR(syncedEvents),_name)) exitWith { diag_log text format["[ACE] Error, synced event key not found."]; false }; diff --git a/addons/common/functions/fnc_requestCallback.sqf b/addons/common/functions/fnc_requestCallback.sqf index b5c9312d3d..827519b99c 100644 --- a/addons/common/functions/fnc_requestCallback.sqf +++ b/addons/common/functions/fnc_requestCallback.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_info", "_accepted", "_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; -_info = _this select 0; -_accepted = _this select 1; +private ["_caller", "_target", "_requestID", "_requestMessage", "_callBack"]; +PARAMS_2(_info,_accepted); _caller = _info select 0; _target = _info select 1; diff --git a/addons/common/functions/fnc_resetAllDefaults.sqf b/addons/common/functions/fnc_resetAllDefaults.sqf index 64a8e39fa6..3040334ad0 100644 --- a/addons/common/functions/fnc_resetAllDefaults.sqf +++ b/addons/common/functions/fnc_resetAllDefaults.sqf @@ -10,8 +10,7 @@ #include "script_component.hpp" -private ["_unit","_oldUnit","_sets"]; -_unit = _this select 0; +PARAMS_1(_unit); _unit setvariable ["ACE_isDead",nil,true]; _unit setvariable ["ACE_isUnconscious", nil, true]; @@ -26,7 +25,7 @@ if (isPlayer _unit) then { if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { // clear all disable user input { - [_X, false] call FUNC(setDisableUserInputStatus); + [_x, false] call FUNC(setDisableUserInputStatus); }foreach GVAR(DISABLE_USER_INPUT_COLLECTION); }; }; @@ -35,6 +34,6 @@ if (isPlayer _unit) then { if (!(_x select 4)) then { _unit setvariable [(_x select 0),nil,_x select 3]; }; -}foreach ([_unit] call FUNC(getAllDefinedSetVariables)); +} forEach ([_unit] call FUNC(getAllDefinedSetVariables)); _unit setVariable ["ACE_forceWalkStatusNumber", 0, true]; diff --git a/addons/common/functions/fnc_restoreVariablesJIP.sqf b/addons/common/functions/fnc_restoreVariablesJIP.sqf index ca185082cb..9ca911d79c 100644 --- a/addons/common/functions/fnc_restoreVariablesJIP.sqf +++ b/addons/common/functions/fnc_restoreVariablesJIP.sqf @@ -11,9 +11,9 @@ */ #include "script_component.hpp" -private ["_unit", "_respawnVariables"]; +private "_respawnVariables"; -_unit = _this select 0; +PARAMS_1(_unit); _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; @@ -21,5 +21,5 @@ _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; _respawnVariables pushBack "ACE_PersistentFunctions"; { - _unit setVariable [_x, _unit getVariable _x, true]; + _unit setVariable [_x, _unit getVariable _x, true]; } forEach _respawnVariables; diff --git a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf index bdffb3a6c9..75168d4e84 100644 --- a/addons/common/functions/fnc_revertKeyCodeLocalized.sqf +++ b/addons/common/functions/fnc_revertKeyCodeLocalized.sqf @@ -11,29 +11,29 @@ */ #include "script_component.hpp" -private ["_keyCode", "_key", "_alt", "_ctrl", "_shft"]; +private ["_key", "_alt", "_ctrl", "_shift"]; -_keyCode = _this select 0; +PARAMS_1(_keyCode); _key = toString ((toArray keyName floor _keyCode) - [34]); _keyCode = round ((_keyCode % 1) * 10); switch (_keyCode) do { - case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; - case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; - default { - _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); + case 8 : {format [localize QUOTE(DOUBLES(STR,GVAR(DoubleTapKey))), _key]}; + case 9 : {format [localize QUOTE(DOUBLES(STR,GVAR(HoldKey))), _key]}; + default { + _keyCode = toArray ([_keyCode, 3] call FUNC(toBin)); - _alt = "1" == toString [_keyCode select 0]; - _ctrl = "1" == toString [_keyCode select 1]; - _shift = "1" == toString [_keyCode select 2]; + _alt = "1" == toString [_keyCode select 0]; + _ctrl = "1" == toString [_keyCode select 1]; + _shift = "1" == toString [_keyCode select 2]; - format ["%1%2%3%4", - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, - ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, - _key - ] - }; + format ["%1%2%3%4", + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Alt)))]] select _alt, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Ctrl)))]] select _ctrl, + ["", format ["%1 + ", localize QUOTE(DOUBLES(STR,GVAR(Shift)))]] select _shift, + _key + ] + }; }; diff --git a/addons/common/functions/fnc_sanitizeString.sqf b/addons/common/functions/fnc_sanitizeString.sqf index 85f743150e..2bc170872d 100644 --- a/addons/common/functions/fnc_sanitizeString.sqf +++ b/addons/common/functions/fnc_sanitizeString.sqf @@ -12,10 +12,10 @@ */ #include "script_component.hpp" -private ["_string", "_removeTags", "_array", "_arrayNew"]; +private ["_array", "_arrayNew"]; + +PARAMS_2(_string,_removeTags); -_string = _this select 0; -_removeTags = _this select 1; if (isNil "_removeTags") then {_removeTags = false}; _array = toArray _string; diff --git a/addons/common/functions/fnc_sendDisplayInformationTo.sqf b/addons/common/functions/fnc_sendDisplayInformationTo.sqf index 33254fa81e..1ff209dac6 100644 --- a/addons/common/functions/fnc_sendDisplayInformationTo.sqf +++ b/addons/common/functions/fnc_sendDisplayInformationTo.sqf @@ -27,7 +27,7 @@ if (isPlayer _reciever) then { _localizationArray = [_title]; { _localizationArray pushback _x; - }foreach _parameters; + } forEach _parameters; _title = format _localizationArray; { @@ -35,7 +35,7 @@ if (isPlayer _reciever) then { _localizationArray = [localize _x]; { _localizationArray pushback _x; - }foreach _parameters; + } forEach _parameters; _content set [_foreachIndex, format _localizationArray]; }; diff --git a/addons/common/functions/fnc_sendRequest.sqf b/addons/common/functions/fnc_sendRequest.sqf index fdd88716e9..68b42ce302 100644 --- a/addons/common/functions/fnc_sendRequest.sqf +++ b/addons/common/functions/fnc_sendRequest.sqf @@ -10,12 +10,7 @@ #include "script_component.hpp" -private ["_caller", "_target", "_requestMessage", "_requestID", "_callBack"]; -_caller = _this select 0; -_target = _this select 1; -_requestID = _this select 2; -_requestMessage = _this select 3; -_callBack = _this select 4; +PARAMS_5(_caller,_target,_requestID,_requestMessage,_callBack); if (isPlayer _target) then { // Pass request on to target locality for player accept/decline. diff --git a/addons/common/functions/fnc_serverEvent.sqf b/addons/common/functions/fnc_serverEvent.sqf index b792323867..9227b1a783 100644 --- a/addons/common/functions/fnc_serverEvent.sqf +++ b/addons/common/functions/fnc_serverEvent.sqf @@ -11,10 +11,9 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs"]; +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); -_eventName = _this select 0; -_eventArgs = _this select 1; +PARAMS_2(_eventName,_eventArgs); #ifdef DEBUG_EVENTS diag_log text format[ARR_2("* Server Event: %1",_eventName)]; @@ -22,7 +21,7 @@ _eventArgs = _this select 1; #endif ACEg = [_eventName, _eventArgs]; -if(!isServer) then { +if (!isServer) then { publicVariableServer "ACEg"; } else { ["ACEg", ACEg] call FUNC(_handleNetEvent); diff --git a/addons/common/functions/fnc_serverLog.sqf b/addons/common/functions/fnc_serverLog.sqf index 058b68b3cc..76560e45a3 100644 --- a/addons/common/functions/fnc_serverLog.sqf +++ b/addons/common/functions/fnc_serverLog.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" if (isServer) then { - diag_log _this; + diag_log _this; } else { - [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); + [_this, QUOTE(FUNC(serverLog)), 1] call FUNC(execRemoteFnc); }; diff --git a/addons/common/functions/fnc_setCanInteract.sqf b/addons/common/functions/fnc_setCanInteract.sqf index 091bbf8cc6..ae05d3cd5b 100644 --- a/addons/common/functions/fnc_setCanInteract.sqf +++ b/addons/common/functions/fnc_setCanInteract.sqf @@ -11,9 +11,11 @@ #include "script_component.hpp" private ["_unit","_to","_return"]; + _unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param; _to = _this select 1; _return = false; + if (((typeName _to) == "SCALAR")) then { if (_to <-1) then { _to = -1; diff --git a/addons/common/functions/fnc_setCaptivityStatus.sqf b/addons/common/functions/fnc_setCaptivityStatus.sqf index b943fce4ab..f579b5cfbc 100644 --- a/addons/common/functions/fnc_setCaptivityStatus.sqf +++ b/addons/common/functions/fnc_setCaptivityStatus.sqf @@ -13,20 +13,18 @@ */ #include "script_component.hpp" -private ["_unit", "_reason", "_status", "_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; +private ["_captivityReasons", "_unitCaptivityReasons", "_captivityReasonsBooleans", "_bitmask"]; -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; +PARAMS_3(_unit,_reason,_status); _captivityReasons = missionNamespace getVariable ["ACE_captivityReasons", []]; // register new reason (these reasons are shared publicly, since units can change ownership, but keep their captivity status) if !(_reason in _captivityReasons) then { - _captivityReasons pushBack _reason; + _captivityReasons pushBack _reason; - ACE_captivityReasons = _captivityReasons; - publicVariable "ACE_captivityReasons"; + ACE_captivityReasons = _captivityReasons; + publicVariable "ACE_captivityReasons"; }; // get reasons why the unit is captive already and update to the new status @@ -34,7 +32,7 @@ _unitCaptivityReasons = [_unit] call FUNC(getCaptivityStatus); _captivityReasonsBooleans = []; { - _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; + _captivityReasonsBooleans set [_forEachIndex, (_captivityReasons select _forEachIndex) in _unitCaptivityReasons]; } forEach _captivityReasons; _captivityReasonsBooleans set [_captivityReasons find _reason, _status]; diff --git a/addons/common/functions/fnc_setDefinedVariable.sqf b/addons/common/functions/fnc_setDefinedVariable.sqf index b2eece4424..ea8a326f21 100644 --- a/addons/common/functions/fnc_setDefinedVariable.sqf +++ b/addons/common/functions/fnc_setDefinedVariable.sqf @@ -10,10 +10,10 @@ #include "script_component.hpp" -private ["_unit","_variable","_value","_update","_global","_definedVariable","_defaultGlobal","_currentValue"]; -_unit = _this select 0; -_variable = _this select 1; -_value = _this select 2; +private ["_global","_definedVariable"]; + +PARAMS_3(_unit,_variable,_value); + _global = false; if (count _this > 3) then { diff --git a/addons/common/functions/fnc_setDisableUserInputStatus.sqf b/addons/common/functions/fnc_setDisableUserInputStatus.sqf index 2cf25b827a..8836f4cd0d 100644 --- a/addons/common/functions/fnc_setDisableUserInputStatus.sqf +++ b/addons/common/functions/fnc_setDisableUserInputStatus.sqf @@ -8,10 +8,8 @@ * @PublicAPI: true */ #include "script_component.hpp" -private ["_id","_disable"]; -_id = _this select 0; -_disable = _this select 1; +PARAMS_2(_id,_disable); if (isnil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then { GVAR(DISABLE_USER_INPUT_COLLECTION) = []; diff --git a/addons/common/functions/fnc_setForceWalkStatus.sqf b/addons/common/functions/fnc_setForceWalkStatus.sqf index 477f76297d..9935f4ad21 100644 --- a/addons/common/functions/fnc_setForceWalkStatus.sqf +++ b/addons/common/functions/fnc_setForceWalkStatus.sqf @@ -20,11 +20,9 @@ Example: */ #include "script_component.hpp" -private ["_unit", "_reason", "_status", "_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; +private ["_forceWalkReasons", "_unitForceWalkReasons", "_forceWalkReasonsBooleans", "_bitmaskNumber"]; -_unit = _this select 0; -_reason = _this select 1; -_status = _this select 2; +PARAMS_3(_unit,_reason,_status); _forceWalkReasons = missionNamespace getVariable ["ACE_forceWalkReasons", []]; diff --git a/addons/common/functions/fnc_setHearingCapability.sqf b/addons/common/functions/fnc_setHearingCapability.sqf index 76837b4433..3e2939d29b 100644 --- a/addons/common/functions/fnc_setHearingCapability.sqf +++ b/addons/common/functions/fnc_setHearingCapability.sqf @@ -10,10 +10,11 @@ #include "script_component.hpp" -private ["_id", "_settings", "_add", "_exists", "_map", "_lowestVolume"]; -_id = _this select 0; -_settings = _this select 1; -_add = true; +private ["_add", "_exists", "_map", "_lowestVolume"]; + +PARAMS_2(_id,_settings); + +_add = true; if (count _this > 2) then { _add = _this select 2; }; diff --git a/addons/common/functions/fnc_setName.sqf b/addons/common/functions/fnc_setName.sqf index d50d5b1987..980408fb12 100644 --- a/addons/common/functions/fnc_setName.sqf +++ b/addons/common/functions/fnc_setName.sqf @@ -11,16 +11,16 @@ */ #include "script_component.hpp" -private ["_unit", "_name"]; +private ["_name"]; -_unit = _this select 0; +PARAMS_1(_unit); if (isNull _unit || {!alive _unit}) exitWith {}; if (_unit isKindOf "CAManBase") then { - _name = [name _unit, true] call FUNC(sanitizeString); - - //if (_name != _unit getVariable ["ACE_Name", ""]) then { + _name = [name _unit, true] call FUNC(sanitizeString); + + //if (_name != _unit getVariable ["ACE_Name", ""]) then { _unit setVariable ["ACE_Name", _name, true]; - //}; + //}; }; diff --git a/addons/common/functions/fnc_setParameter.sqf b/addons/common/functions/fnc_setParameter.sqf index 4dbc5fc84e..d7a4573935 100644 --- a/addons/common/functions/fnc_setParameter.sqf +++ b/addons/common/functions/fnc_setParameter.sqf @@ -12,16 +12,13 @@ */ #include "script_component.hpp" - private ["_name", "_value"]; - -_name = _this select 0; -_value = _this select 1; +PARAMS_2(_name,_value); // Hack to keep backward compatibility for the moment if ((typeName (missionNamespace getVariable _name)) == "BOOL") then { - if ((typeName _value) == "SCALAR") then { - _value = _value > 0; - }; + if ((typeName _value) == "SCALAR") then { + _value = _value > 0; + }; }; missionNamespace setVariable [_name, _value]; diff --git a/addons/common/functions/fnc_setSetting.sqf b/addons/common/functions/fnc_setSetting.sqf index 67068c6ad1..8effc3680d 100644 --- a/addons/common/functions/fnc_setSetting.sqf +++ b/addons/common/functions/fnc_setSetting.sqf @@ -17,9 +17,9 @@ */ #include "script_component.hpp" -private ["_name","_value"]; -_name = _this select 0; -_value = _this select 1; +private ["_force", "_settingData","_failed"]; + +PARAMS_2(_name,_value); private ["_force"]; _force = false; diff --git a/addons/common/functions/fnc_setSettingFromConfig.sqf b/addons/common/functions/fnc_setSettingFromConfig.sqf index 3a1b6fd055..9a95819996 100644 --- a/addons/common/functions/fnc_setSettingFromConfig.sqf +++ b/addons/common/functions/fnc_setSettingFromConfig.sqf @@ -12,7 +12,9 @@ */ #include "script_component.hpp" -EXPLODE_1_PVT(_this,_optionEntry); +PARAMS_1(_optionEntry); + +private ["_fnc_getValueWithType", "_value","_name", "_typeName", "_settingData", "_valueConfig", "_text"]; _fnc_getValueWithType = { EXPLODE_2_PVT(_this,_optionEntry,_typeName); @@ -56,14 +58,14 @@ if (isNil _name) then { // Add the setting to a list on the server // Set the variable to not forced /*_settingData = [ - _name, - _typeName, - _isClientSettable, - _localizedName, - _localizedDescription, - _possibleValues, - _isForced, - _defaultValue + name, + typeName, + isClientSettable, + localizedName, + localizedDescription, + possibleValues, + isForced, + defaultValue ];*/ _settingData = [ _name, diff --git a/addons/common/functions/fnc_setVariableJIP.sqf b/addons/common/functions/fnc_setVariableJIP.sqf index 8e790353f4..8177e97473 100644 --- a/addons/common/functions/fnc_setVariableJIP.sqf +++ b/addons/common/functions/fnc_setVariableJIP.sqf @@ -13,11 +13,9 @@ */ #include "script_component.hpp" -private ["_unit", "_varName", "_value", "_respawnVariables"]; +private ["_respawnVariables"]; -_unit = _this select 0; -_varName = _this select 1; -_value = _this select 2; +PARAMS_3(_unit,_varName,_value); _respawnVariables = _unit getVariable ["ACE_respawnVariables", []]; diff --git a/addons/common/functions/fnc_setVariablePublic.sqf b/addons/common/functions/fnc_setVariablePublic.sqf index 81093a2679..f5ab1920db 100644 --- a/addons/common/functions/fnc_setVariablePublic.sqf +++ b/addons/common/functions/fnc_setVariablePublic.sqf @@ -1,25 +1,20 @@ /* * Author: commy2 * - * Sets a public variable, but wait a certain amount of time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. + * Sets a public variable, but wait a certain amount of ACE_time to transfer the value over the network. Changing the value by calling this function again resets the windup timer. * * Argument: * 0: Object the variable should be assigned to (Object) * 1: Name of the variable (String) * 2: Value of the variable (Any) - * 3: Windup time (Number, optional. Default: 1) + * 3: Windup ACE_time (Number, optional. Default: 1) * * Return value: * Nothing. */ #include "script_component.hpp" -private ["_object", "_varName", "_value", "_sync"]; - -_object = _this select 0; -_varName = _this select 1; -_value = _this select 2; -_sync = _this select 3; +PARAMS_4(_object,_varName,_value,_sync); if (isNil "_sync") then { _sync = 1; @@ -43,12 +38,12 @@ if (_idName in _allIdNames) exitWith {}; // when to push the value private "_syncTime"; -_syncTime = diag_tickTime + _sync; +_syncTime = ACE_diagTime + _sync; // add eventhandler [_idName, "onEachFrame", { // wait to sync the variable - if (diag_tickTime > _this select 2) then { + if (ACE_diagTime > _this select 2) then { // set value public (_this select 0) setVariable [_this select 1, (_this select 0) getVariable (_this select 1), true]; diff --git a/addons/common/functions/fnc_showUser.sqf b/addons/common/functions/fnc_showUser.sqf index a5d602251d..a88d39ce0d 100644 --- a/addons/common/functions/fnc_showUser.sqf +++ b/addons/common/functions/fnc_showUser.sqf @@ -1,10 +1,8 @@ // by commy2 #include "script_component.hpp" -private "_object"; - GVAR(Debug_Object) = _this select 0; onEachFrame { - hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); + hintSilent str (GVAR(Debug_Object) getVariable ["ACE_isUsedBy", objNull]); }; diff --git a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf index 1d2a2af1bf..db142b01b6 100644 --- a/addons/common/functions/fnc_sortAlphabeticallyBy.sqf +++ b/addons/common/functions/fnc_sortAlphabeticallyBy.sqf @@ -10,9 +10,9 @@ #include "script_component.hpp" -private ["_array", "_elements", "_elementN", "_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; -_array = _this select 0; -_elementN = _this select 1; +private ["_elements","_indexes", "_theElement", "_tmp", "_tempIndex", "_j", "_i", "_returnArray"]; + +PARAMS_2(_array,_elementN); _indexes = []; _elements = []; @@ -21,7 +21,7 @@ _elements = []; _theElement = toArray (_x select _elementN); _indexes pushback _foreachIndex; _elements pushback _theElement; -}foreach _array; +} forEach _array; for "_i" from 1 to (count _elements) - 1 do { _tmp = _elements select _i; @@ -39,6 +39,6 @@ for "_i" from 1 to (count _elements) - 1 do { _returnArray = []; { _returnArray pushback (_array select _x); -}foreach _indexes; +} forEach _indexes; _returnArray; \ No newline at end of file diff --git a/addons/common/functions/fnc_subString.sqf b/addons/common/functions/fnc_subString.sqf deleted file mode 100644 index 2389dbed00..0000000000 --- a/addons/common/functions/fnc_subString.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Returns a fraction of the given string, starting at a given index, with a given length. - * - * Arguments: - * 0: Source string - * 1: Starting index of new string - * 2: Length of the new string - * - * Return Value: - * String when successfull / False when not - */ -#include "script_component.hpp" - -_string = _this select 0; -_index = _this select 1; -_length = _this select 2; - -_array = toArray _string; -if (_index < 0 or _length < 0 or _index + _length > (count _array) + 1) exitWith {false}; - -_arrayNew = []; -for "_i" from _index to (_index + _length - 1) do { - _arrayNew = _arrayNew + [(_array select _i)]; -}; - -toString _arrayNew diff --git a/addons/common/functions/fnc_syncedEvent.sqf b/addons/common/functions/fnc_syncedEvent.sqf index 70c30a19da..9100e5a19a 100644 --- a/addons/common/functions/fnc_syncedEvent.sqf +++ b/addons/common/functions/fnc_syncedEvent.sqf @@ -13,8 +13,10 @@ */ //#define DEBUG_MODE_FULL #include "script_component.hpp" + PARAMS_2(_name,_args); -private["_ttl", "_eventData", "_internalData", "_eventLog"]; + +private["_ttl", "_eventData"]; if( (count _this) > 2) then { _ttl = _this select 2; diff --git a/addons/common/functions/fnc_syncedEventPFH.sqf b/addons/common/functions/fnc_syncedEventPFH.sqf index e8a21202ab..a5ec809706 100644 --- a/addons/common/functions/fnc_syncedEventPFH.sqf +++ b/addons/common/functions/fnc_syncedEventPFH.sqf @@ -7,7 +7,7 @@ if(!isServer) exitWith { false }; // @TODO: This should be iteration limited to prevent FPS lag private["_data"]; { - private["_data", "_ttl", "_eventLog", "_newEventLog", "_name"]; + private["_data", "_eventLog", "_newEventLog", "_name", "_globalEventTTL"]; _name = _x; _data = HASH_GET(GVAR(syncedEvents),_name); @@ -24,7 +24,7 @@ private["_data"]; if(typeName _globalEventTTL == "CODE") then { _ttlReturn = [(_data select 0),_eventEntry] call _globalEventTTL; } else { - _ttlReturn = call { _globalEventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _globalEventTTL} }; + _ttlReturn = call { _globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL} }; }; if(_ttlReturn) then { @@ -35,7 +35,7 @@ private["_data"]; if(typeName _eventTTL == "CODE") then { _ttlReturn = [(_data select 0),_eventEntry] call _eventTTL; } else { - _ttlReturn = call { _eventTTL < 1 || {diag_tickTime < (_eventEntry select 0) + _eventTTL} }; + _ttlReturn = call { _eventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _eventTTL} }; }; }; diff --git a/addons/common/functions/fnc_targetEvent.sqf b/addons/common/functions/fnc_targetEvent.sqf index 7299eeb057..22bd7431f5 100644 --- a/addons/common/functions/fnc_targetEvent.sqf +++ b/addons/common/functions/fnc_targetEvent.sqf @@ -15,11 +15,10 @@ * Nothing */ #include "script_component.hpp" -private ["_eventName", "_eventArgs", "_eventTargets"]; -_eventName = _this select 0; -_eventTargets = _this select 1; -_eventArgs = _this select 2; +//IGNORE_PRIVATE_WARNING("_handleNetEvent"); + +PARAMS_3(_eventName,_eventTargets,_eventArgs); #ifdef DEBUG_EVENTS diag_log text format[ARR_3("* Target Event: %1 - %2",_eventName,_eventTargets)]; diff --git a/addons/common/functions/fnc_throttledPublicVariable.sqf b/addons/common/functions/fnc_throttledPublicVariable.sqf index e5e30b6664..e7966c3b4d 100644 --- a/addons/common/functions/fnc_throttledPublicVariable.sqf +++ b/addons/common/functions/fnc_throttledPublicVariable.sqf @@ -17,9 +17,9 @@ */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_unit,_varName,_maxDelay); +PARAMS_3(_unit,_varName,_maxDelay); -// Create the publish scheduler PFH the first time +// Create the publish scheduler PFH the first ACE_time if (isNil QGVAR(publishSchedId)) then { GVAR(publishVarNames) = []; @@ -27,7 +27,7 @@ if (isNil QGVAR(publishSchedId)) then { GVAR(publishSchedId) = [{ - if (diag_tickTime > GVAR(publishNextTime)) then { + if (ACE_diagTime > GVAR(publishNextTime)) then { { EXPLODE_2_PVT(_x,_unit,_varName); _unit setVariable [_varName, (_unit getVariable _varName), true]; @@ -42,8 +42,8 @@ if (isNil QGVAR(publishSchedId)) then { // If the variable is not on the list if (GVAR(publishVarNames) find [_unit,_varName] == -1) exitWith { GVAR(publishVarNames) pushBack [_unit,_varName]; - GVAR(publishNextTime) = GVAR(publishNextTime) min (diag_tickTime + _maxDelay); + GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); }; // If the variable is on the list -GVAR(publishNextTime) = GVAR(publishNextTime) min (diag_tickTime + _maxDelay); \ No newline at end of file +GVAR(publishNextTime) = GVAR(publishNextTime) min (ACE_diagTime + _maxDelay); \ No newline at end of file diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf new file mode 100644 index 0000000000..40fef519a8 --- /dev/null +++ b/addons/common/functions/fnc_timePFH.sqf @@ -0,0 +1,26 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +private["_lastTickTime", "_lastGameTime", "_delta"]; + +_lastTickTime = ACE_diagTime; +_lastGameTime = ACE_gameTime; + +ACE_gameTime = time; +ACE_diagTime = diag_tickTime; + +_delta = ACE_diagTime - _lastTickTime; +if(ACE_gameTime <= _lastGameTime) then { + TRACE_1("paused",_delta); + ACE_paused = true; + // Game is paused or not running + ACE_pausedTime = ACE_pausedTime + _delta; + ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime); +} else { + TRACE_1("live",_delta); + ACE_paused = false; + // Time is updating + ACE_realTime = ACE_realTime + _delta; + ACE_virtualTime = ACE_virtualTime + (_delta * accTime); + ACE_time = ACE_virtualTime; +}; diff --git a/addons/common/functions/fnc_toBin.sqf b/addons/common/functions/fnc_toBin.sqf index 4fdcded607..7c666f2f73 100644 --- a/addons/common/functions/fnc_toBin.sqf +++ b/addons/common/functions/fnc_toBin.sqf @@ -12,10 +12,9 @@ A binary number, String */ #include "script_component.hpp" -private ["_number", "_minLength", "_sign", "_bin", "_rest"]; +private ["_sign", "_bin", "_rest"]; -_number = _this select 0; -_minLength = _this select 1; +PARAMS_2(_number,_minLength); if (isNil "_minLength") then {_minLength = 1}; @@ -25,14 +24,13 @@ _number = round abs _number; _bin = ["", "0"] select (_number == 0); while {_number > 0} do { - _rest = str (_number mod 2); - _number = floor (_number / 2); - - _bin = _rest + _bin; + _rest = str (_number mod 2); + _number = floor (_number / 2); + _bin = _rest + _bin; }; while {count toArray _bin < _minLength} do { - _bin = "0" + _bin; + _bin = "0" + _bin; }; _sign + _bin diff --git a/addons/common/functions/fnc_toBitmask.sqf b/addons/common/functions/fnc_toBitmask.sqf index eb69e67621..14ddb90541 100644 --- a/addons/common/functions/fnc_toBitmask.sqf +++ b/addons/common/functions/fnc_toBitmask.sqf @@ -17,7 +17,7 @@ _array = _this; _result = 0; { - if (_x) then {_result = _result + 2 ^ _forEachIndex}; + if (_x) then {_result = _result + 2 ^ _forEachIndex}; } forEach _array; _result diff --git a/addons/common/functions/fnc_toNumber.sqf b/addons/common/functions/fnc_toNumber.sqf index fc481398d3..55a9ba2787 100644 --- a/addons/common/functions/fnc_toNumber.sqf +++ b/addons/common/functions/fnc_toNumber.sqf @@ -14,12 +14,12 @@ NUMBER Example: - _number = ["102"] call FUNC(toNumber); + number = ["102"] call FUNC(toNumber); */ #include "script_component.hpp" if (typeName (_this select 0) == "SCALAR") exitWith { - (_this select 0) + (_this select 0) }; (parseNumber (_this select 0)) \ No newline at end of file diff --git a/addons/common/functions/fnc_translateToModelSpace.sqf b/addons/common/functions/fnc_translateToModelSpace.sqf index 1e2e930ac7..d2dfa38643 100644 --- a/addons/common/functions/fnc_translateToModelSpace.sqf +++ b/addons/common/functions/fnc_translateToModelSpace.sqf @@ -1,3 +1,7 @@ +#include "script_component.hpp" + +private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; + _object = _this select 0; _origin = getPosASL _object; _matrix = _this select 1; diff --git a/addons/common/functions/fnc_translateToWeaponSpace.sqf b/addons/common/functions/fnc_translateToWeaponSpace.sqf index 2c7dc5e6da..ca1544b317 100644 --- a/addons/common/functions/fnc_translateToWeaponSpace.sqf +++ b/addons/common/functions/fnc_translateToWeaponSpace.sqf @@ -1,3 +1,7 @@ +#include "script_component.hpp" + +private["_matrix", "_object", "_offset", "_origin", "_out", "_xVec", "_y", "_yVec", "_z", "_zVec"]; + _object = _this select 0; _origin = getPosASL _object; _matrix = _this select 1; diff --git a/addons/common/functions/fnc_unhideUnit.sqf b/addons/common/functions/fnc_unhideUnit.sqf new file mode 100644 index 0000000000..190be47664 --- /dev/null +++ b/addons/common/functions/fnc_unhideUnit.sqf @@ -0,0 +1,34 @@ +/* + * Author: SilentSpike (based on unmuteUnit) + * Globally unhides a unit. Only unhides if the last reason was removed. + * + * Arguments: + * 0: Unit + * 1: Reason to unhide the unit + * + * Return Value: + * nil + * + * Example: + * [ACE_Player, "SpectatorMode"] call ace_common_fnc_unhideUnit + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_2(_unit,_reason); + +if (isNull _unit) exitWith {}; + +private "_setHiddenReasons"; +_setHiddenReasons = _unit getVariable [QGVAR(setHiddenReasons), []]; + +if (_reason in _setHiddenReasons) then { + _setHiddenReasons deleteAt (_setHiddenReasons find _reason); + _unit setVariable [QGVAR(setHiddenReasons), _setHiddenReasons, true]; +}; + +if (_setHiddenReasons isEqualTo []) then { + ["hideObjectGlobal",[_unit,false]] call FUNC(serverEvent); +}; diff --git a/addons/common/functions/fnc_uniqueElementsOnly.sqf b/addons/common/functions/fnc_uniqueElementsOnly.sqf index 21d42072da..c81efb8308 100644 --- a/addons/common/functions/fnc_uniqueElementsOnly.sqf +++ b/addons/common/functions/fnc_uniqueElementsOnly.sqf @@ -10,8 +10,8 @@ #include "script_component.hpp" -private ["_array", "_result", "_value"]; -_array = _this select 0; +private ["_result", "_value"]; +PARAMS_1(_array); _result = []; { @@ -19,6 +19,6 @@ _result = []; if ({_x isEqualTo _value} count _result == 0) then { _result pushback _x; }; -}foreach _array; +} forEach _array; _result; \ No newline at end of file diff --git a/addons/common/functions/fnc_unloadPerson.sqf b/addons/common/functions/fnc_unloadPerson.sqf index 60e4f56d7d..cd421fd3e5 100644 --- a/addons/common/functions/fnc_unloadPerson.sqf +++ b/addons/common/functions/fnc_unloadPerson.sqf @@ -10,13 +10,13 @@ * * Public: No */ - +//#define DEBUG_MODE_FULL #include "script_component.hpp" #define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) -private ["_unit","_vehicle", "_loaded", "_emptyPos"]; -_unit = _this select 0; +private ["_vehicle","_emptyPos"]; +PARAMS_1(_unit); _vehicle = vehicle _unit; if (_vehicle == _unit) exitwith {false;}; @@ -25,20 +25,8 @@ if !(speed _vehicle <1 && (((getpos _vehicle) select 2) < 2)) exitwith {false;}; _emptyPos = ((getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]); if (count _emptyPos == 0) exitwith {false}; -_unit setPos _emptyPos; -unassignVehicle _unit; -if (!alive _unit) then { - _unit action ["Eject", vehicle _unit]; -}; - -[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); - -_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; -_loaded = _loaded - [_unit]; -_vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; - -if (!([_unit] call FUNC(isAwake))) then { - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); +if (!isNull _vehicle) then { + [[_unit], QUOTE(FUNC(unloadPersonLocal)), _unit, false] call EFUNC(common,execRemoteFnc); }; true; diff --git a/addons/common/functions/fnc_unloadPersonLocal.sqf b/addons/common/functions/fnc_unloadPersonLocal.sqf new file mode 100644 index 0000000000..23d33e4bfe --- /dev/null +++ b/addons/common/functions/fnc_unloadPersonLocal.sqf @@ -0,0 +1,60 @@ +/* + * Author: ViperMaul + * Unload a person from a vehicle, local + * + * Arguments: + * 0: unit + * + * Return Value: + * Returns true if succesfully unloaded person + * + * Public: No + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +#define GROUP_SWITCH_ID QUOTE(FUNC(loadPerson)) + +private ["_loaded", "_emptyPos"]; +PARAMS_2(_unit,_vehicle); + +if (driver _vehicle == _unit) exitwith {TRACE_1("Exiting on Failed Driver Check", driver _vehicle == _unit); false;}; +TRACE_1("Vehicle Check", driver _vehicle == _unit); +if !(speed _vehicle <1 && (((getPos _vehicle) select 2) < 2)) exitwith {TRACE_1("Exiting on Failed speed check", getPosASL _vehicle == _unit); false;}; +TRACE_1("getPosASL Vehicle Check", getPos _vehicle); + +_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]); +if (count _emptyPos == 0) exitwith {false}; //consider displaying text saying there are no safe places to exit the vehicle + +unassignVehicle _unit; +[_unit] orderGetIn false; +TRACE_1("Ejecting", alive _unit); +_unit action ["Eject", vehicle _unit]; +[ { + private "_anim"; + PARAMS_2(_unit,_emptyPos); + _unit setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); + if (!([_unit] call FUNC(isAwake))) then { + TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake)); + if (driver _unit == _unit) then { + _anim = [_unit] call EFUNC(common,getDeathAnim); + [_unit, _anim, 1, true] call EFUNC(common,doAnimation); + [{ + _unit = _this select 0; + _anim = _this select 1; + if ((_unit getVariable "ACE_isUnconscious") and (animationState _unit != _anim)) then { + [_unit, _anim, 2, true] call EFUNC(common,doAnimation); + }; + }, [_unit, _anim], 0.5, 0] call EFUNC(common,waitAndExecute); + }; + }; +},[_unit,_emptyPos], 0.5, 0] call EFUNC(common,waitAndExecute); + + +[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); + +_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; +_loaded = _loaded - [_unit]; +_vehicle setvariable [QGVAR(loaded_persons),_loaded,true]; + +true \ No newline at end of file diff --git a/addons/common/functions/fnc_unmuteUnit.sqf b/addons/common/functions/fnc_unmuteUnit.sqf index 94ba72f5a4..24b74785de 100644 --- a/addons/common/functions/fnc_unmuteUnit.sqf +++ b/addons/common/functions/fnc_unmuteUnit.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_reason"]; - -_unit = _this select 0; -_reason = _this select 1; +PARAMS_2(_unit,_reason); if (isNull _unit) exitWith {}; diff --git a/addons/common/functions/fnc_useItem.sqf b/addons/common/functions/fnc_useItem.sqf index d03ec4d156..03589cd56d 100644 --- a/addons/common/functions/fnc_useItem.sqf +++ b/addons/common/functions/fnc_useItem.sqf @@ -10,9 +10,10 @@ #include "script_component.hpp" -private ["_unit","_item","_return"]; -_unit = _this select 0; -_item = _this select 1; +PARAMS_2(_unit,_item); + +private ["_return", "_vehicleUsage"]; + _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; _return = false; diff --git a/addons/common/functions/fnc_useMagazine.sqf b/addons/common/functions/fnc_useMagazine.sqf index 726e169383..f21a04d026 100644 --- a/addons/common/functions/fnc_useMagazine.sqf +++ b/addons/common/functions/fnc_useMagazine.sqf @@ -10,9 +10,8 @@ #include "script_component.hpp" -private ["_unit","_magazine","_return"]; -_unit = _this select 0; -_magazine = _this select 1; +private ["_return", "_vehicleUsage"]; +PARAMS_2(_unit,_magazine); _vehicleUsage = [_this, 2, false, [false]] call BIS_fnc_Param; if (!_vehicleUsage) then { @@ -24,7 +23,6 @@ if (!_vehicleUsage) then { }; [format["fnc_useMagazine: %1 | %2",_this,_return]] call FUNC(debug); _return -} else -{ +} else { // TODO implement shared magazine functionality }; \ No newline at end of file diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf index 777cd72c0a..977e4f146d 100644 --- a/addons/common/functions/fnc_waitAndExecute.sqf +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -1,36 +1,24 @@ /* * Author: esteldunedain * - * Executes a code once with a given game time delay, using a PFH + * Executes a code once with a given game ACE_time delay, using a PFH * * Argument: * 0: Code to execute (Code) * 1: Parameters to run the code with (Array) * 2: Delay in seconds before executing the code (Number) - * 3: Interval of time in which the execution is evaluated, 0 means every frame (Number) * * Return value: - * PFH handler ID + * None + * + * Example: + * [{(_this select 0) setVelocity [0,0,200];}, [player], 10] call ace_common_fnc_waitAndExecute + * + * Public: No */ #include "script_component.hpp" -EXPLODE_4_PVT(_this,_func,_params,_delay,_interval); +PARAMS_3(_func,_params,_delay); -[ - { - EXPLODE_2_PVT(_this,_params,_pfhId); - EXPLODE_2_PVT(_params,_delayedExecParams,_startTime); - EXPLODE_3_PVT(_delayedExecParams,_func,_funcParams,_delay); - - // Exit if the time was not reached yet - if (time < _startTime + _delay) exitWith {}; - - // Remove the PFH - [_pfhId] call cba_fnc_removePerFrameHandler; - - // Execute the function - _funcParams call _func; - }, - _interval, - [_this, time] -] call CBA_fnc_addPerFrameHandler +GVAR(waitAndExecArray) pushBack [(ACE_time + _delay), _func, _params]; +GVAR(waitAndExecArray) sort true; diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf new file mode 100644 index 0000000000..e05e4219b7 --- /dev/null +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -0,0 +1,20 @@ +/* + * Author: jaynus + * + * Gets the wave height at a specific location. Uses a logic, so may be performance iffy + * + * Arguments: + * 0: Position ASL to get height at + * + * Return Value: + * Wave height in meters + * + */ +#include "script_component.hpp" + +if(isNil QGVAR(waveHeightLogic)) then { + GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; +}; +GVAR(waveHeightLogic) setPosASL (_this select 0); + +(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2)) \ No newline at end of file diff --git a/addons/common/functions/fnc_worldToScreenBounds.sqf b/addons/common/functions/fnc_worldToScreenBounds.sqf index afb5817d81..b3b5ba3f1e 100644 --- a/addons/common/functions/fnc_worldToScreenBounds.sqf +++ b/addons/common/functions/fnc_worldToScreenBounds.sqf @@ -5,7 +5,7 @@ #include "script_component.hpp" -private ["_minX","_minY","_maxX","_maxY"]; +private ["_minX","_minY","_maxX","_maxY", "_bounds", "_boundsCorners", "_boundsMax", "_boundsMaxX", "_boundsMaxY", "_boundsMaxZ", "_boundsMin", "_boundsMinX", "_boundsMinY", "_boundsMinZ"]; PARAMS_3(_object,_margins,_offsets); diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf index e6509cd9c4..07bd443a06 100644 --- a/addons/common/scripts/Version/checkVersionNumber.sqf +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -1,193 +1,158 @@ // by commy2 #include "script_component.hpp" -sleep 1; //wait for module +private["_client", "_clientVersion", "_count", "_error", "_files", "_index", "_missingAddon", "_missingAddonServer", "_missingAddons", "_missingAddonsServer", "_oldVersionClient", "_oldVersionServer", "_oldVersionsClient", "_oldVersionsServer", "_serverFiles", "_serverVersion", "_serverVersions", "_string", "_version", "_versions"]; _files = []; -if (missionNamespace getVariable ["ACE_Version_CheckAll", false]) then { - { - if (toLower _x find "a3_" != 0 && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then { - _files pushBack _x; +{ + if (_x find "a3_" != 0 && {_x find "ace_" != 0} && {!(toLower _x in (missionNamespace getVariable ["ACE_Version_Whitelist", []]))}) then { + _files pushBack _x; }; - } forEach activatedAddons; -} else { - { - if (toLower _x find "ace_" == 0) then { - _files pushBack _x; - }; - } forEach activatedAddons; -}; - -_versionMain = parseNumber getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "version"); +} forEach activatedAddons; _versions = []; { - _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); - _versions set [_forEachIndex, _version]; + _version = parseNumber getText (configFile >> "CfgPatches" >> _x >> "version"); + _versions set [_forEachIndex, _version]; } forEach _files; -_versionFull = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "versionStr"); -diag_log text format ["[ACE] Full Version Number: %1", _versionFull]; - if (isServer) then { - diag_log text format ["[ACE] Server: ACE_Common is Version %1.", _versionMain]; - - { - if (toLower _x find "ace_" == 0) then {// - _version = _versions select _forEachIndex; - if (_version != _versionMain) then { - diag_log text format ["[ACE] Server: %1 is Version %2.", _x, _version]; - }; - }; - } forEach _files; - - ACE_Version_ServerVersions = [_files, _versions]; - publicVariable "ACE_Version_ServerVersions"; + ACE_Version_ServerVersions = [_files, _versions]; + publicVariable "ACE_Version_ServerVersions"; } else { - diag_log text format ["[ACE] Client: ACE_Common is Version %1.", _versionMain]; - - { - if (toLower _x find "ace_" == 0) then {// - _version = _versions select _forEachIndex; - if (_version != _versionMain) then { - diag_log text format ["[ACE] Client: %1 is Version %2.", _x, _version]; - }; - }; - } forEach _files; - - ACE_Version_ClientVersions = [_files, _versions]; + ACE_Version_ClientVersions = [_files, _versions]; }; // Begin client version check if (!isServer) then { - // Wait for server to send the servers files and version numbers - waitUntil { - sleep 1; - !isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"} - }; - - _client = profileName; - - _files = ACE_Version_ClientVersions select 0; - _versions = ACE_Version_ClientVersions select 1; - - _serverFiles = ACE_Version_ServerVersions select 0; - _serverVersions = ACE_Version_ServerVersions select 1; - - // Compare client and server files and versions - _missingAddons = []; - _oldVersionsClient = []; - _oldVersionsServer = []; - { - _serverVersion = _serverVersions select _forEachIndex; - - _index = _files find _x; - if (_index == -1) then { - if (_x != "ace_serverconfig") then {_missingAddons pushBack _x;}; - } else { - - _clientVersion = _versions select _index; - - if (_clientVersion < _serverVersion) then { - _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; - }; - - if (_clientVersion > _serverVersion) then { - _oldVersionsServer pushBack [_x, _clientVersion, _serverVersion]; - }; + // Wait for server to send the servers files and version numbers + waitUntil { + sleep 1; + !isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"} }; - } forEach _serverFiles; - // find client files which the server doesn't have - _missingAddonsServer = []; - { - _index = _serverFiles find _x; - if (_index == -1) then { - _missingAddonsServer pushBack _x; - } - } forEach _files; + _client = profileName; - // display and log error messages - _fnc_cutComma = { - _string = _this; - _string = toArray _string; + _files = ACE_Version_ClientVersions select 0; + _versions = ACE_Version_ClientVersions select 1; - _count = count _string; - _string set [_count - 2, toArray "." select 0]; - _string set [_count - 1, -1]; - _string = _string - [-1]; + _serverFiles = ACE_Version_ServerVersions select 0; + _serverVersions = ACE_Version_ServerVersions select 1; - toString _string; - }; - - _missingAddon = false; - if (count _missingAddons > 0) then { - _missingAddon = true; - - _error = format ["[ACE] %1: ERROR missing addon(s): ", _client]; + // Compare client and server files and versions + _missingAddons = []; + _oldVersionsClient = []; + _oldVersionsServer = []; { - _error = _error + format ["%1, ", _x]; + _serverVersion = _serverVersions select _forEachIndex; - if (_forEachIndex > 9) exitWith {};// - } forEach _missingAddons; + _index = _files find _x; + if (_index == -1) then { + if (_x != "ace_server") then {_missingAddons pushBack _x;}; + } else { - _error = _error call _fnc_cutComma; + _clientVersion = _versions select _index; - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; + if (_clientVersion < _serverVersion) then { + _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; + }; - _missingAddonServer = false; - if (count _missingAddonsServer > 0) then { - _missingAddonServer = true; + if (_clientVersion > _serverVersion) then { + _oldVersionsServer pushBack [_x, _clientVersion, _serverVersion]; + }; + }; + } forEach _serverFiles; - _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client]; + // find client files which the server doesn't have + _missingAddonsServer = []; { - _error = _error + format ["%1, ", _x]; + _index = _serverFiles find _x; + if (_index == -1) then { + _missingAddonsServer pushBack _x; + } + } forEach _files; - if (_forEachIndex > 9) exitWith {};// - } forEach _missingAddonsServer; + // display and log error messages + _fnc_cutComma = { + _string = _this; + _string = toArray _string; - _error = _error call _fnc_cutComma; + _count = count _string; + _string set [_count - 2, toArray "." select 0]; + _string set [_count - 1, -1]; + _string = _string - [-1]; - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; + toString _string; + }; - _oldVersionClient = false; - if (count _oldVersionsClient > 0) then { - _oldVersionClient = true; + _missingAddon = false; + if (count _missingAddons > 0) then { + _missingAddon = true; - _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + _error = format ["[ACE] %1: ERROR missing addon(s): ", _client]; + { + _error = _error + format ["%1, ", _x]; - if (_forEachIndex > 9) exitWith {};// - } forEach _oldVersionsClient; + if (_forEachIndex > 9) exitWith {};// + } forEach _missingAddons; - _error = _error call _fnc_cutComma; + _error = _error call _fnc_cutComma; - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; - _oldVersionServer = false; - if (count _oldVersionsServer > 0) then { - _oldVersionServer = true; + _missingAddonServer = false; + if (count _missingAddonsServer > 0) then { + _missingAddonServer = true; - _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + _error = format ["[ACE] %1: ERROR missing server addon(s): ", _client]; + { + _error = _error + format ["%1, ", _x]; - if (_forEachIndex > 9) exitWith {};// - } forEach _oldVersionsServer; + if (_forEachIndex > 9) exitWith {};// + } forEach _missingAddonsServer; - _error = _error call _fnc_cutComma; + _error = _error call _fnc_cutComma; - diag_log text _error; - [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); - }; + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; - ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; + _oldVersionClient = false; + if (count _oldVersionsClient > 0) then { + _oldVersionClient = true; + + _error = format ["[ACE] %1: ERROR outdated addon(s): ", _client]; + { + _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _oldVersionsClient; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + _oldVersionServer = false; + if (count _oldVersionsServer > 0) then { + _oldVersionServer = true; + + _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; + { + _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; + + if (_forEachIndex > 9) exitWith {};// + } forEach _oldVersionsServer; + + _error = _error call _fnc_cutComma; + + diag_log text _error; + [_error, "{systemChat _this}"] call FUNC(execRemoteFnc); + }; + + ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; }; diff --git a/addons/common/scripts/assignedItemFix.sqf b/addons/common/scripts/assignedItemFix.sqf index c118115bed..bcf79a3ac1 100644 --- a/addons/common/scripts/assignedItemFix.sqf +++ b/addons/common/scripts/assignedItemFix.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +private ["_config"]; + ACE_isMapEnabled = call {_config = missionConfigFile >> "showMap"; !isNumber _config || {getNumber _config == 1}}; // default value is 1, so do isNumber check first ACE_isCompassEnabled = call {_config = missionConfigFile >> "showCompass"; !isNumber _config || {getNumber _config == 1}}; ACE_isWatchEnabled = call {_config = missionConfigFile >> "showWatch"; !isNumber _config || {getNumber _config == 1}}; diff --git a/addons/common/scripts/initScrollWheel.sqf b/addons/common/scripts/initScrollWheel.sqf index 5a8bf57d79..78920bb371 100644 --- a/addons/common/scripts/initScrollWheel.sqf +++ b/addons/common/scripts/initScrollWheel.sqf @@ -4,12 +4,13 @@ GVAR(ScrollWheelFrame) = diag_frameno; GVAR(onScrollWheel) = { - _scroll = _this select 1; + private ["_scroll"]; + _scroll = _this select 1; - if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; - GVAR(ScrollWheelFrame) = diag_frameno; + if (GVAR(ScrollWheelFrame) == diag_frameno) exitWith {}; + GVAR(ScrollWheelFrame) = diag_frameno; - { - [_scroll] call _x; - } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); + { + [_scroll] call _x; + } count ((missionNamespace getVariable ["ACE_EventHandler_ScrollWheel", [-1, [], []]]) select 2); }; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index a78ff0a7fc..28a40e382a 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -39,7 +39,7 @@ ACE Options - ACE Optionen + ACE-Optionen Opciones ACE Ustawienia ACE Nastavení ACE @@ -275,7 +275,7 @@ Désactiver menu commande Выключить командное меню Parancsnoki menü kikapcsolása - Disabilita Menù di comando + Disabilita menù di comando Desabilitar menu de comando @@ -308,11 +308,11 @@ Aceptar peticiones Akceptuj prośby Přijmout žádost - Accetta Richieste Accepter requête Принять запросы Kérések elfogadása Aceitar Pedido + Accetta la richiesta Decline Requests @@ -320,11 +320,11 @@ Rechazar peticiones Ignoruj prośby Zamítnout žádost - Rifiuta Richieste Отклонить запросы Rejeter requête Kérések elutasítása Rejeitar pedido + Rifiuta la richiesta Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -402,7 +402,7 @@ Hint Background color Hintergrundfarbe der Hinweise Color de fondo de las notificaciones - Colore di sfondo dei Suggerimenti + Colore di sfondo dei suggerimenti Цвет фона всплывающих подсказок Kolor tła powiadomień Notification: couleur de l'arrière plan @@ -414,7 +414,7 @@ The color of the background from the ACE hints. Die Hintergrundfarbe der ACE-Hinweise. El color de fondo de las notificaciones del ACE - Il colore di sfondo dei suggerimenti dell'ACE. + Il colore di sfondo dei suggerimenti di ACE. Цвет фона всплывающих подсказок АСЕ. Kolor tła dla powiadomień ACE Notification ACE: couleur de l'arrière plan @@ -426,7 +426,7 @@ Hint text font color Textfarbe der Hinweise Color del texto de las notificaciones - Il colore del Testo dei Suggerimenti + Il colore del testo dei suggerimenti Цвет шрифта всплывающих подсказок Kolor tekstu powiadomień Notification: couleur du texte @@ -438,7 +438,7 @@ The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified. Wähle die Textfarbe für ACE-Hinweise. Die gewählte Farbe wird als Standartfarbe der Hinweise angezeigt, wenn der Hinweis selbst keine spezifische Farbe hat. El color del texto de las notificaciones del ACE. Este es el color predeterminado para todo el texto que se muestra a través del sistema de notificaciones del ACE, si el texto de notificación no tiene otro color especificado. - Il colore del testo dei suggerimenti dell'ACE. Questo è il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se il colore del testo non è specificato. + Il colore del testo dei suggerimenti di ACE. Questo è il colore predefinito per tutto il testo mostrato dal sistema di suggerimenti di ACE quando il colore del testo non ha altro colore specificato. Цвет шрифта текста всплывающих подсказок АСЕ. Этот цвет является стандартным для всего текста, транслирующегося через систему подсказок АСЕ, если не установлено другого цвета для текста подсказок. Kolor tekstu dla powiadomień ACE. Ten kolor jest domyślnym dla wszystkich tekstów wyświetlanych poprzez System Powiadomień ACE, jeżeli dla powiadomienia nie określono innego koloru. Notification ACE: couleur du texte. C'est la couleur par défaut de tout texte affiché dans les notifications ACE, si aucune couleur n'est spécifiée pour les notifications @@ -470,5 +470,130 @@ Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes à fleurs herbacées du type Musa. A banana é uma fruta comestível, botanicamente uma baga, produzida por vários tipos de plantas herbáceas grandes do genero Musa. + + Check PBOs + Sprawdzaj PBO + Comprobar PBOs + Überprüfe PBOs + Zkontrolovat PBO + 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. + Zjistit addon který je v souladu se serverem + Este módulo verifica a integridade dos addons quando iniciamos a simulação + + + Action + Akcja + Acción + Aktion + Akce + Ação + + + What to do with people who do not have the right PBOs? + Co zrobić z graczami, którzy nie mają właściwych PBO? + ¿Qué hacer con la gente que no tiene correctamente los PBOs? + Was soll mit Leuten passieren, die nicht die richtigen PBOs haben? + Co udělat s lidmi, co nemají správné addony? + O que fazer com pessoas que não tem os PBOs corretos? + + + Warn once + Ostrzeż raz + Avisar una vez + Einmal verwarnen + Upozornit jednou + Avisar uma vez + + + Warn (permanent) + Ostrzeżenie (permanentne) + Avisar (permanente) + Immer verwarnen + Upozornit (permanentně) + Avisar (permanente) + + + Kick + Kick + Expulsar + Kicken + Vyhodit + Chutar + + + Check all addons + Sprawdź wsz. addony + Comprobar todos los addons + Alle Addons überprüfen + Zkontrolovat všechny addony + Verificar todos addons + + + Check all addons instead of only those of ACE? + Sprawdzaj wszystkie addony czy tylko te z ACE? + Comprobar todos los addons en vez de solo los del ACE + Alle Addons anstatt nur ACE überprüfen? + Zkontrolovat všechny addony namísto jen těch od ACE? + Verificar todos addons invés de só os do ACE? + + + Whitelist + Biała lista + Lista blanca + Whitelist + Seznam povolených + Lista branca + + + What addons are allowed regardless? + Jakie addony są dozwolone? + Qué addons están permitidos igualmente + Welche Addons werden dennoch erlaubt? + Jaké addony jsou povoleny? + Quais addons são permitidos de qualquer maneira? + + + LSD Vehicles + Pojazdy LSD + Vehículos LSD + LSD-Fahrzeuge + LSD vozidla + Veículos LSD + + + Adds LSD effect to synchronized vehicle + Dodaje efekt LSD pod zsynchronizowany pojazd + Añade el efecto LSD al vehículo sincronizado + Fügt einen LSD-Effekt zum synchronisierten Fahrzeug hinzu + Přidá LSD efekt pro synchronizované vozidla + Adiciona efeito LSD ao veículo sincronizado + + + Toggle Handheld Device + Seleccionar dispositivo de mano + Ativa dispositivo de mão + Przełącz urządzenie podręczne + Přepnout ruční zařízení + + + Close Handheld Device + Cerrar dispositivo de mano + Fecha dispositivo de mão + Zamknij urządzenie podręczne + Zavřít ruční zařízení + + + Cycle Handheld Devices + Cambiar dispositivos de mano + Troca dispositivos de mão + Następne urządzenie podręczne + Procházet ruční zařízení + - + \ No newline at end of file diff --git a/addons/concertina_wire/$PBOPREFIX$ b/addons/concertina_wire/$PBOPREFIX$ new file mode 100644 index 0000000000..0ca718ad15 --- /dev/null +++ b/addons/concertina_wire/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\concertina_wire \ No newline at end of file diff --git a/addons/concertina_wire/CfgEventHandlers.hpp b/addons/concertina_wire/CfgEventHandlers.hpp new file mode 100644 index 0000000000..026afb4e2d --- /dev/null +++ b/addons/concertina_wire/CfgEventHandlers.hpp @@ -0,0 +1,44 @@ +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 { + // TODO: Probably needs handledamage eh for better tracking what killed the wire + // Also disallow wire becoming destroyed by small explosives e.g. 40mm + class ACE_ConcertinaWire { + class ADDON { + killed = QUOTE(call FUNC(handleKilled)); + }; + }; + class Land_Razorwire_F { + class ADDON { + killed = QUOTE(call FUNC(handleKilled)); + }; + }; +}; + +class Extended_Init_EventHandlers { + class ACE_ConcertinaWireCoil { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; + class ACE_ConcertinaWire { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_init)); + }; + }; + class Land_Razorwire_F { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_init)); + }; + }; +}; diff --git a/addons/concertina_wire/CfgVehicles.hpp b/addons/concertina_wire/CfgVehicles.hpp new file mode 100644 index 0000000000..2592bf5b77 --- /dev/null +++ b/addons/concertina_wire/CfgVehicles.hpp @@ -0,0 +1,139 @@ + +class CfgVehicles { + class Fence; + class thingX; + class NonStrategic; + + class ACE_ConcertinaWireNoGeo: Fence { + XEH_ENABLED; + scope = 1; + displayName = ""; + model = PATHTOF(data\ACE_ConcertinaWireNoGeo.p3d); + destrType = "DestructTent"; + accuracy = 0.3; + mapSize = 2.8; + animated = 1; + autocenter = 0; + armor = 200; + class AnimationSources { + class fix1 { + source = "user"; + animPeriod = 1e-007; + initPhase = 0; + }; + class fix2: fix1 {}; + class fix3: fix1 {}; + class fix4: fix1 {}; + class rotate { + source = "user"; + animPeriod = 1e-007; + }; + class wire_2 { + source = "user"; + animPeriod = 1e-007; + }; + class wire_3: wire_2{}; + class wire_4: wire_2{}; + class wire_5: wire_2{}; + class wire_6: wire_2{}; + class wire_7: wire_2{}; + class wire_8: wire_2{}; + class wire_9: wire_2{}; + class wire_10: wire_2{}; + class wire_11: wire_2{}; + class wire_12: wire_2{}; + class wire_13: wire_2{}; + class wire_14: wire_2{}; + class wire_15: wire_2{}; + class wire_16: wire_2{}; + class wire_17: wire_2{}; + class wire_18: wire_2{}; + + class wire_2_1: wire_2 { + animPeriod = 8; + }; + class wire_3_1: wire_2_1 {}; + class wire_4_1: wire_2_1 {}; + class wire_5_1: wire_2_1 {}; + class wire_6_1: wire_2_1 {}; + class wire_7_1: wire_2_1 {}; + class wire_8_1: wire_2_1 {}; + class wire_9_1: wire_2_1 {}; + class wire_10_1: wire_2_1 {}; + class wire_11_1: wire_2_1 {}; + class wire_12_1: wire_2_1 {}; + class wire_13_1: wire_2_1 {}; + class wire_14_1: wire_2_1 {}; + 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 ACE_ConcertinaWire: ACE_ConcertinaWireNoGeo { + scope = 2; + displayName = $STR_ACE_CONCERTINA_WIRE; + model = PATHTOF(data\ACE_ConcertinaWire.p3d); + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 5; + condition = "true"; + class ACE_Dismount { + selection = ""; + displayName = "$STR_ACE_UNROLLWIRE"; + distance = 5; + condition = "true"; + statement = QUOTE([ARR_2(_target,_player)] call FUNC(dismount)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + }; + }; + }; + }; + class ACE_ConcertinaWireCoil: thingX { + XEH_ENABLED; + scope = 2; + displayName = $STR_ACE_CONCERTINA_WIRECOIL; + model = PATHTOF(data\ACE_ConcertinaWireCoil.p3d); + mapsize = 0.5; + animated = 0; + nameSound = "fence"; + typicalCargo[] = {}; + transportAmmo = 0; + transportRepair = 0; + transportFuel = 0; + cost = 0; + armor = 1000; + destrType = "DestructNo"; + accuracy = 1000; + autocenter = 0; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,0.5,0.5}; + EGVAR(dragging,dragDirection) = 0; + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 4; + condition = "true"; + class ACE_Deploy { + selection = ""; + displayName = "$STR_ACE_ROLLWIRE"; + distance = 4; + condition = "true"; + statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + }; + }; + }; + }; + + class Land_Razorwire_F: NonStrategic { + XEH_ENABLED; + }; +}; diff --git a/addons/concertina_wire/README.md b/addons/concertina_wire/README.md new file mode 100644 index 0000000000..ab62458de9 --- /dev/null +++ b/addons/concertina_wire/README.md @@ -0,0 +1,10 @@ +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 diff --git a/addons/concertina_wire/UI/icon_sandbag_ca.paa b/addons/concertina_wire/UI/icon_sandbag_ca.paa new file mode 100644 index 0000000000..5d6ea6d4d9 Binary files /dev/null and b/addons/concertina_wire/UI/icon_sandbag_ca.paa differ diff --git a/addons/concertina_wire/XEH_init.sqf b/addons/concertina_wire/XEH_init.sqf new file mode 100644 index 0000000000..dbce4a9b92 --- /dev/null +++ b/addons/concertina_wire/XEH_init.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +PARAMS_1(_wire); +_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}]; \ No newline at end of file diff --git a/addons/concertina_wire/XEH_postInit.sqf b/addons/concertina_wire/XEH_postInit.sqf new file mode 100644 index 0000000000..ff3b5c5167 --- /dev/null +++ b/addons/concertina_wire/XEH_postInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +GVAR(placer) = objNull; +GVAR(deployPFH) = -1; + +// Deploy concertina wire if interact menu is opened +["interactMenuOpened", { + if (GVAR(deployPFH) != -1) then { + GVAR(placer) setVariable [QGVAR(wireDeployed), true]; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/concertina_wire/XEH_preInit.sqf b/addons/concertina_wire/XEH_preInit.sqf new file mode 100644 index 0000000000..f15feb48bd --- /dev/null +++ b/addons/concertina_wire/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(deploy); +PREP(dismount); +PREP(dismountSuccess); +PREP(handleDamage); +PREP(handleKilled); + +ADDON = true; diff --git a/addons/concertina_wire/config.cpp b/addons/concertina_wire/config.cpp new file mode 100644 index 0000000000..06b7bf5d86 --- /dev/null +++ b/addons/concertina_wire/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_ConcertinaWire", "ACE_ConcertinaWireNoGeo", "ACE_ConcertinaWireCoil"}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_apl", "ace_interaction"}; + author[] = {"Rocko", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/concertina_wire/data/ACE_ConcertinaWire.p3d b/addons/concertina_wire/data/ACE_ConcertinaWire.p3d new file mode 100644 index 0000000000..3e1c9c881c Binary files /dev/null and b/addons/concertina_wire/data/ACE_ConcertinaWire.p3d differ diff --git a/addons/concertina_wire/data/ACE_ConcertinaWireCoil.p3d b/addons/concertina_wire/data/ACE_ConcertinaWireCoil.p3d new file mode 100644 index 0000000000..24f6ebf0fe Binary files /dev/null and b/addons/concertina_wire/data/ACE_ConcertinaWireCoil.p3d differ diff --git a/addons/concertina_wire/data/ACE_ConcertinaWireNoGeo.p3d b/addons/concertina_wire/data/ACE_ConcertinaWireNoGeo.p3d new file mode 100644 index 0000000000..3af6a40a15 Binary files /dev/null and b/addons/concertina_wire/data/ACE_ConcertinaWireNoGeo.p3d differ diff --git a/addons/concertina_wire/data/model.cfg b/addons/concertina_wire/data/model.cfg new file mode 100644 index 0000000000..20845cfacb --- /dev/null +++ b/addons/concertina_wire/data/model.cfg @@ -0,0 +1,290 @@ +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ACE_SB_Skeleton: Default {}; + class ACE_ConcertinaSkeleton { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "1","", + "2","1", + "3","2", + "4","3", + "5","4", + "6","5", + "7","6", + "8","7", + "9","8", + "10","9", + "11","10", + "12","11", + "13","12", + "14","13", + "15","14", + "16","15", + "17","16", + "18","17", + "fix1","", + "fix2","", + "fix3","", + "fix4","" + }; + }; + class ace_tacticalladder_skeleton: Default { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "base","", + "1","base", + "2","1", + "3","2", + "4","3", + "5","4", + "6","5", + "7","6", + "8","7", + "9","8", + "10","9", + "11","10", + "step","11" + }; + }; +}; + +class CfgModels { + class Default { + sectionsInherit=""; + sections[] = {""}; + skeletonName = ""; + }; + class ace_sandbag_build { + sectionsInherit = "Default"; + sections[] = {"zbytek"}; + skeletonName = "ACE_SB_Skeleton"; + }; + class ACE_ConcertinaWire { + skeletonName = "ACE_ConcertinaSkeleton"; + sections[] = {}; + sectionsInherit = ""; + class Animations { + class fix1 { + type="hide"; + source="user"; + selection="fix1"; + minValue = 0; + maxValue = 1; + minPhase = 0; + maxPhase = 1; + hideValue = 1; + }; + class fix2: fix1 { + selection="fix2"; + }; + class fix3: fix1 { + selection="fix3"; + }; + class fix4: fix1 { + selection="fix4"; + }; + class rotate { + type = "rotation"; + source = ""; + sourceAddress = "loop"; + selection = "1"; + axis = "rotate_axis"; + minValue = 0; + maxValue = 360; + + angle0="rad -360"; + angle1="rad +360"; + }; + class wire_2 { + type = "translation"; + source = ""; + selection = "2"; + axis = "2_axis"; + animPeriod = 0; + minValue = 0; + maxValue = 1; + minPhase = 0; + maxPhase = 1; + offset0 = 0; + offset1 = -1; + }; + class wire_3: wire_2 { + selection = "3"; axis = "3_axis"; + }; + class wire_4: wire_2 { + selection = "4"; axis = "4_axis"; + }; + class wire_5: wire_2 { + selection = "5"; axis = "5_axis"; + }; + class wire_6: wire_2 { + selection = "6"; axis = "6_axis"; + }; + class wire_7: wire_2 { + selection = "7"; axis = "7_axis"; + }; + class wire_8: wire_2 { + selection = "8"; axis = "8_axis"; + }; + class wire_9: wire_2 { + selection = "9"; axis = "9_axis"; + }; + class wire_10: wire_2 { + selection = "10"; axis = "10_axis"; + }; + class wire_11: wire_2 { + selection = "11"; axis = "11_axis"; + }; + class wire_12: wire_2 { + selection = "12"; axis = "12_axis"; + }; + class wire_13: wire_2 { + selection = "13"; axis = "13_axis"; + }; + class wire_14: wire_2 { + selection = "14"; axis = "14_axis"; + }; + class wire_15: wire_2 { + selection = "15"; axis = "15_axis"; + }; + class wire_16: wire_2 { + selection = "16"; axis = "16_axis"; + }; + class wire_17: wire_2 { + selection = "17"; axis = "17_axis"; + }; + class wire_18: wire_2 { + selection = "18"; axis = "18_axis"; + }; + class wire_2_1: wire_2 { + selection = "2";axis = "2_axis";offset1 = -1; + }; + class wire_3_1: wire_2_1 { + selection = "3"; axis = "3_axis"; + }; + class wire_4_1: wire_2_1 { + selection = "4"; axis = "4_axis"; + }; + class wire_5_1: wire_2_1 { + selection = "5"; axis = "5_axis"; + }; + class wire_6_1: wire_2_1 { + selection = "6"; axis = "6_axis"; + }; + class wire_7_1: wire_2_1 { + selection = "7"; axis = "7_axis"; + }; + class wire_8_1: wire_2_1 { + selection = "8"; axis = "8_axis"; + }; + class wire_9_1: wire_2_1 { + selection = "9"; axis = "9_axis"; + }; + class wire_10_1: wire_2_1 { + selection = "10"; axis = "10_axis"; + }; + class wire_11_1: wire_2_1 { + selection = "11"; axis = "11_axis"; + }; + class wire_12_1: wire_2_1 { + selection = "12"; axis = "12_axis"; + }; + class wire_13_1: wire_2_1 { + selection = "13"; axis = "13_axis"; + }; + class wire_14_1: wire_2_1 { + selection = "14"; axis = "14_axis"; + }; + class wire_15_1: wire_2_1 { + selection = "15"; axis = "15_axis"; + }; + class wire_16_1: wire_2_1 { + selection = "16"; axis = "16_axis"; + }; + class wire_17_1: wire_2_1 { + selection = "17"; axis = "17_axis"; + }; + class wire_18_1: wire_2_1 { + selection = "18"; axis = "18_axis"; + }; + }; + }; + class ACE_ConcertinaWireNoGeo: ACE_ConcertinaWire {}; + class ace_tacticalladder { + skeletonName = "ace_tacticalladder_skeleton"; + sections[] = { "roadway" }; + sectionsInherit = ""; + class Animations { + class rotate { + type = "rotation"; + source = ""; + sourceAddress = "clamp"; + selection = "base"; + axis = "axis_rotate"; + minValue = 0; + maxValue = 90; + angle0="rad 0"; + angle1="rad +90"; + }; + class extract_1 { + type = "translation"; + source = ""; + selection = "1"; + axis = "axis_1"; + animPeriod = 0; + minValue = 0; + maxValue = 1; + minPhase = 0; + maxPhase = 1; + offset0 = 0; + offset1 = 0.82; + }; + class extract_2: extract_1 { + selection = "2"; + axis = "axis_2"; + }; + class extract_3: extract_1 { + selection = "3"; + axis = "axis_3"; + }; + class extract_4: extract_1 { + selection = "4"; + axis = "axis_4"; + }; + class extract_5: extract_1 { + selection = "5"; + axis = "axis_5"; + }; + class extract_6: extract_1 { + selection = "6"; + axis = "axis_6"; + }; + class extract_7: extract_1 { + selection = "7"; + axis = "axis_7"; + }; + class extract_8: extract_1 { + selection = "8"; + axis = "axis_8"; + }; + class extract_9: extract_1 { + selection = "9"; + axis = "axis_9"; + }; + class extract_10: extract_1 { + selection = "10"; + axis = "axis_10"; + }; + class extract_11: extract_1 { + selection = "11"; + axis = "axis_11"; + }; + }; + }; +}; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf new file mode 100644 index 0000000000..c30e767266 --- /dev/null +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -0,0 +1,84 @@ +/* + * Author: Rocko, Ruthberg + * + * Deploys the concertina wire + * + * Arguments: + * 0: wire coil + * 1: unit + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_wirecoil,_unit); + +private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"]; + +_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; +{ + _wireNoGeo animate [_x, 1]; +} foreach WIRE_FAST; + +GVAR(placer) = _unit; +_dir = getDir _unit; +_pos = getPosASL _unit; +_wireNoGeoPos = _pos vectorAdd [1.1 * sin(_dir), 1.1 * cos(_dir), 0]; + +_wireNoGeo setDir _dir; +_wireNoGeo setPosASL _wireNoGeoPos; + +deleteVehicle _wirecoil; + +_unit setVariable [QGVAR(wireDeployed), false]; + +GVAR(deployPFH) = [{ + EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action); + + private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"]; + _posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL); + _posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit); + _dirVect = _posStart vectorDiff _posEnd; + _dir = _dirVect call CBA_fnc_vectDir; + _range = vectorMagnitude _dirVect; + _anim = 0 max (1 - (_range / 12)); + + if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith { + _wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0]; + { + _wire animate [_x, _anim]; + } foreach WIRE_FAST; + + [{ + EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos); + if (_wire animationPhase "wire_2" == _anim) then { + deleteVehicle _wireNoGeo; + _wire setDir _dir; + _wire setPosASL _wireNoGeoPos; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler; + + [_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); + call EFUNC(interaction,hideMouseHint); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _wireNoGeo setDir _dir; + { + _wireNoGeo animate [_x, _anim]; + } foreach WIRE_FAST; +}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler; + +[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint); + +GVAR(placer) setVariable [QGVAR(Deploy), + [GVAR(placer), "DefaultAction", + {GVAR(deployPFH) != -1}, + {GVAR(placer) setVariable [QGVAR(wireDeployed), true]} +] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf new file mode 100644 index 0000000000..c9a5d1f9ff --- /dev/null +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -0,0 +1,41 @@ +/* + * Author: Ruthberg + * + * Start dismounting the concertina wire + * + * Arguments: + * 0: wire + * 1: unit + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine +if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { + [{ + _this call FUNC(dismount); + }, _this] call EFUNC(common,execNextFrame); +}; + +PARAMS_2(_wire,_unit); + +private ["_config", "_delay"]; +_config = (configFile >> "CfgVehicles" >> typeOf _unit); +_delay = if (getNumber(_config >> "engineer") == 1 || getNumber(_config >> "canDeactivateMines") == 1) then {60} else {120}; + +// TODO: Animation? + +[ + _delay, + [_wire], + {(_this select 0) call FUNC(dismountSuccess)}, + {}, + localize "STR_ACE_UNROLLWIRE", + {true}, + ["isnotinside"] +] call EFUNC(common,progressBar); diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf new file mode 100644 index 0000000000..a6e34fe44f --- /dev/null +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -0,0 +1,42 @@ +/* + * Author: Rocko, Ruthberg + * + * Dismounts the concertina wire + * + * Arguments: + * 0: wire + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_1(_wire); + +{ + _wire animate [_x, 1]; +} foreach WIRE_FAST; + +[{ + EXPLODE_1_PVT(_this select 0,_wire); + + if (_wire animationPhase "wire_2" == 1) then { + private ["_dir", "_pos", "_wirecoil"]; + + _dir = getDir _wire; + _pos = getPosASL _wire; + + _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0]; + + deleteVehicle _wire; + + _wirecoil setDir _dir; + _wirecoil setPosASL _pos; + _wirecoil setVelocity [0, 0, 0]; + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; +}, 0, [_wire]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf new file mode 100644 index 0000000000..61cd1c4e7c --- /dev/null +++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf @@ -0,0 +1,29 @@ +/* + * Author: Ruthberg + * + * Handles wire damage + * + * Arguments: + * 0: wire + * 1: selectionName + * 2: damage + * 3: source + * 4: projectile + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_5(_wire,_selectionName,_damage,_source,_projectile); + +if (_damage < 0.5) exitWith { 0 }; + +if (!(isNull _source)) then { + _wire setVariable [QGVAR(lastDamager), _source]; +}; + +_damage diff --git a/addons/concertina_wire/functions/fnc_handleKilled.sqf b/addons/concertina_wire/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..2d2cd7f789 --- /dev/null +++ b/addons/concertina_wire/functions/fnc_handleKilled.sqf @@ -0,0 +1,135 @@ +/* + * Author: Rocko + * + * Handles wire and vehicle damage + * + * Arguments: + * 0: wire + * 1: killer (vehicle) + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_wire,_killer); + +if (isNull _killer) then { + _killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull]; + if (isNull _killer) then { + _killer = nearestObject [_wire, "car"]; + }; +}; +if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {}; + +private ["_type", "_mode", "_distance", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w", "_vehicle"]; +_type = typeOf _wire; +_mode = switch (_type) do { + case "ACE_ConcertinaWire": { 0 }; + case "Land_Razorwire_F": { 1 }; + default { -1 }; +}; + +if (_mode == -1) exitWith {}; + +// _mode = 0 = Single Coil +// _mode = 1 = Triple Coil + +// -------------------------------- +// L M R +// 4.54929 (4) +// 6.13564 (6) +//9.78744 (10) + +_distance = _wire distance _killer; +if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire + +_type = typeOf _wire; +_anim = _wire animationPhase "wire_2"; +_pos_w = getPos _wire; +_dir_w = getDir _wire; +_vehicle = vehicle _killer; + +if (_mode == 0) then { + private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"]; + _x = _pos_w select 0; + _y = _pos_w select 1; + // Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle) + _wireCheckPosAr = [ + [_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)], + [(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)], + [_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)], + [(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)] + ]; + { + _found = false; + _no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log "....."; + _no = _no - [_wire]; //diag_log _no; + if (count _no > 0) exitWith { + _found = true; //diag_log "found"; + }; + } foreach _wireCheckPosAr; + // Double coil found! + if (_found) then { + _mode = 1; + } else { + // Randomly make a single coil also catch tanks, if speed is high + if (_vehicle isKindOf "Tank" && {20 > random 100} && {speed _vehicle > 30}) then { + _mode = 1; + } else { + if !(_vehicle isKindOf "Tank") then { + _mode = 1; + }; + }; + }; +}; + +if (_mode == 1) then { + switch (true) do { + case (_vehicle isKindOf "Tank"): { + _parts = ["ltrack","rtrack"]; + }; + case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): { + _parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"]; + }; + }; +} else { + switch (true) do { + case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): { + _parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"]; + }; + }; +}; + +if (canMove _vehicle) then { + { + _selectionPart = "hit" + _x; + if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then { + _selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name"); + // TODO: Only the tires that have touched the wire should burst. + _vehicle setHit [_selection, 1]; + }; + } forEach _parts; +}; + +if (_mode == 1) then { + if (_vehicle isKindOf "StaticWeapon") exitWith {}; + [{ + PARAMS_2(_vehicle,_wire); + + _vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75); + + private ["_vPos", "_vDir"]; + // Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable + _vPos = getPosASL _vehicle; + _vDir = getDir _vehicle; + _vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]); + // TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires + }, [_vehicle, _wire], 0.1, 0] call EFUNC(common,waitAndExecute); +}; + +//TODO: Create broken geoless wire (two version) +//TODO: Make wire remains stop vehicles diff --git a/addons/concertina_wire/functions/script_component.hpp b/addons/concertina_wire/functions/script_component.hpp new file mode 100644 index 0000000000..5ec20093ef --- /dev/null +++ b/addons/concertina_wire/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\concertina_wire\script_component.hpp" \ No newline at end of file diff --git a/addons/concertina_wire/script_component.hpp b/addons/concertina_wire/script_component.hpp new file mode 100644 index 0000000000..f3f353f181 --- /dev/null +++ b/addons/concertina_wire/script_component.hpp @@ -0,0 +1,15 @@ +#define COMPONENT concertina_wire +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_CONCERTINA_WIRE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_CONCERTINA_WIRE + #define DEBUG_SETTINGS DEBUG_SETTINGS_CONCERTINA_WIRE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define WIRE_FAST ["wire_2","wire_3","wire_4","wire_5","wire_6","wire_7","wire_8","wire_9","wire_10","wire_11","wire_12","wire_13","wire_14","wire_15","wire_16","wire_17","wire_18"] +#define WIRE_SLOW ["wire_2_1","wire_3_1","wire_4_1","wire_5_1","wire_6_1","wire_7_1","wire_8_1","wire_9_1","wire_10_1","wire_11_1","wire_12_1","wire_13_1","wire_14_1","wire_15_1","wire_16_1","wire_17_1","wire_18_1"] diff --git a/addons/concertina_wire/stringtable.xml b/addons/concertina_wire/stringtable.xml new file mode 100644 index 0000000000..4400866e87 --- /dev/null +++ b/addons/concertina_wire/stringtable.xml @@ -0,0 +1,53 @@ + + + + + Concertina Wire + NATO-Draht + Проволочная спираль + Drut kolczasty + Concertina wire + Concertina wire + Ostnatý drát + Concertina wire + Concertina wire + Arame farpado + + + Concertina Wire Coil + NATO-Draht Rolle + Проволочная спираль (моток) + Zwój drutu kolczastego + Concertina wire coil + Concertina wire coil + Smyčka ostnatého drátu + Concertina wire coil + Concertina wire coil + Bobina de arame farpado + + + Dismount Concertina Wire + NATO-Draht abbauen + Демонтировать проволочную спираль + Zwiń drut kolczasty + Dismount Concertina wire + Dismount Concertina wire + Svinout ostnatý drát + Dismount Concertina wire + Dismount Concertina wire + Desmontar arame farpado + + + Deploy Concertina Wire + NATO-Draht verlegen + Монтировать проволочную спираль + Rozwiń drut kolczasty + Deploy Concertina wire + Deploy Concertina wire + Rozvinout ostnatý drát + Deploy Concertina wire + Deploy Concertina wire + Colocar arame farpado + + + \ No newline at end of file diff --git a/addons/dagr/$PBOPREFIX$ b/addons/dagr/$PBOPREFIX$ new file mode 100644 index 0000000000..98e51ae9ea --- /dev/null +++ b/addons/dagr/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\dagr \ No newline at end of file diff --git a/addons/dagr/CfgEventHandlers.hpp b/addons/dagr/CfgEventHandlers.hpp new file mode 100644 index 0000000000..2a05b72298 --- /dev/null +++ b/addons/dagr/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) ); + }; +}; \ No newline at end of file diff --git a/addons/dagr/CfgVehicles.hpp b/addons/dagr/CfgVehicles.hpp new file mode 100644 index 0000000000..f26d8841ae --- /dev/null +++ b/addons/dagr/CfgVehicles.hpp @@ -0,0 +1,49 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(menu) { + displayName = "Configure DAGR"; + condition = QUOTE([ARR_2(_player,'ACE_DAGR')] call EFUNC(common,hasItem)); + statement = QUOTE(call FUNC(menuInit)); + showDisabled = 0; + priority = 0.1; + icon = QUOTE(PATHTOF(UI\DAGR_Icon.paa)); + exceptions[] = {"isNotInside", "isNotSitting"}; + class GVAR(toggle) { + displayName = "Toggle DAGR"; + condition = QUOTE([ARR_2(_player,'ACE_DAGR')] call EFUNC(common,hasItem)); + statement = QUOTE(call FUNC(toggleOverlay)); + showDisabled = 0; + priority = 0.2; + icon = QUOTE(PATHTOF(UI\DAGR_Icon.paa)); + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + }; + }; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_DAGR: Item_Base_F { + author[] = {"Rosuto", "Ruthberg"}; + scope = 2; + scopeCurator = 2; + displayName = "DAGR"; + vehicleClass = "Items"; + class TransportItems { + class ACE_DAGR { + name = "ACE_DAGR"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_DAGR,6); + }; + }; +}; diff --git a/addons/dagr/CfgWeapons.hpp b/addons/dagr/CfgWeapons.hpp new file mode 100644 index 0000000000..31b0603ff2 --- /dev/null +++ b/addons/dagr/CfgWeapons.hpp @@ -0,0 +1,19 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_DAGR: ACE_ItemCore { + author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"}; + scope = 2; + displayName = "DAGR"; + descriptionShort = ""; + picture = PATHTOF(UI\DAGR_Icon.paa); + icon = "iconObject_circle"; + mapSize = 0.034; + + class ItemInfo: InventoryItem_Base_F { + mass = 10; + }; + }; +}; diff --git a/addons/dagr/Dialog.hpp b/addons/dagr/Dialog.hpp new file mode 100644 index 0000000000..2faeb03879 --- /dev/null +++ b/addons/dagr/Dialog.hpp @@ -0,0 +1,424 @@ +// Control types +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUT_BUTTON 16 // Arma 2 - textured button + +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_List_N_Box 102 // Arma 2 - N columns list box + + +// Static styles +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0c +#define ST_TYPE 0xF0 +#define ST_SINGLE 0 +#define ST_MULTI 16 +#define ST_TITLE_BAR 32 +#define ST_PICTURE 48 +#define ST_FRAME 64 +#define ST_BACKGROUND 80 +#define ST_GROUP_BOX 96 +#define ST_GROUP_BOX2 112 +#define ST_HUD_BACKGROUND 128 +#define ST_TILE_PICTURE 144 +#define ST_WITH_RECT 160 +#define ST_LINE 176 +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 +#define ST_KEEP_ASPECT_RATIO 0x800 +#define ST_TITLE ST_TITLE_BAR + ST_CENTER + +// Slider styles +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 +#define SL_TEXTURES 0x10 + +// Listbox styles +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 +#define FontM "PuristaMedium" + +class RscText; + +class DAGR_Button { + idc = -1; + type = CT_BUTTON; + style = ST_LEFT; + font = "PuristaMedium"; + sizeEx = 0.02; + colorText[] = { 0, 1, 0, 1 }; + colorFocused[] = { 0, 0, 0, 0 }; // border color for focused state + colorDisabled[] = { 0, 0, 0, 0 }; // text color for disabled state + colorBackground[] = { 0, 0, 0, 0 }; + colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // background color for disabled state + colorBackgroundActive[] = { 0, 0, 0, 0 }; // background color for active state + offsetX = 0; + offsetY = 0; + offsetPressedX = 0; + offsetPressedY = 0; + colorShadow[] = { 0, 0, 0, 0 }; + colorBorder[] = { 0, 0, 0, 0 }; + borderSize = 0; + soundEnter[] = { "", 0, 1 }; // no sound + soundPush[] = { "", 0, 1 }; + soundClick[] = { "", 0, 1 }; // no sound + soundEscape[] = { "", 0, 1 }; // no sound + x = 0.5; + y = 0.5; + w = 0.07; + h = 0.05; + text = ""; + action = ""; +}; +class DAGR_Menu_Pic { + type = 0; + idc = -1; + style = 48; + x = 0; + y = 0; + w = 0.7; + h = 1.4; + text = ""; + colorBackground[] = {}; + colorText[] = {}; + font = "PuristaMedium"; + sizeEx = 0.04; + waitForLoad = 0; +}; + +class DAGR_Menu_Text { + type = 0; + idc = -1; + style = 0x00; + x = 0.5; + y = 0.5; + w = 0.15; + h = 0.15; + colorBackground[] = { 0, 0, 0, 0 }; + colorText[] = { 0.239, 0.216, 0.153, 1 }; + font = "PuristaMedium"; + sizeEx = 0.03; + waitForLoad = 0; + text = ""; +}; + +class DAGR_Menu { + idd = 266860; + movingEnable = false; + duration = 100000; + fadein = 0; + fadeout = 0; + name = "Dagr_Menu"; + onLoad = "uiNamespace setVariable ['DAGR_Menu', _this select 0]"; + onUnload = QUOTE(GVAR(PWR) = true); // Simulate pressing the power button + controls[] = {"DAGR_MENU_UI", "DAGR_PWR_Button", "DAGR_UP_Button", "DAGR_DOWN_Button", "DAGR_LEFT_Button", "DAGR_RIGHT_Button", "DAGR_NEXT_Button", + "DAGR_SEL_Button", "DAGR_MENU_Button", "DAGR_F1_Button", "DAGR_F2_Button", "DAGR_F3_Button", "DAGR_F1_Text", "DAGR_F2_Text", "DAGR_F3_Text", "DAGR_MENU_OPTION0", + "DAGR_MENU_OPTION1", "DAGR_MENU_OPTION2", "DAGR_MENU_OPTION3", "DAGR_MENU_OPTION4", "DAGR_MENU_SELECTION0", "DAGR_MENU_SELECTION1", "DAGR_MENU_SELECTION2", + "DAGR_MENU_SELECTION3", "DAGR_MENU_SELECTION4", "DAGR_MENU_Main_Text", "DAGR_MENU_PSELECTION1", "DAGR_MENU_PSELECTION2", "DAGR_MENU_PSELECTION3", + "DAGR_MENU_PSELECTION4", "DAGR_MENU_PSELECTION5", "DAGR_MENU_PSELECTION6","DAGR_MENU_PSELECTION7", "DAGR_MENU_PSELECTION8"}; + + class DAGR_MENU_UI : DAGR_Menu_Pic { + idc = 266861; + x = 0.175; + y = -0.173; + text = QUOTE(PATHTOF(UI\dagr_menu.paa)); + sizeEx = 0.1; + }; + + class DAGR_PWR_Button : DAGR_Button { + idc = 266863; + action = QUOTE(GVAR(PWR) = true); + x = 0.40; + y = 0.65; + }; + + class DAGR_UP_Button : DAGR_Button { + idc = 266864; + action = QUOTE(GVAR(UP) = true); + x = 0.50; + y = 0.675; + }; + + class DAGR_DOWN_Button : DAGR_Button { + idc = 266865; + action = QUOTE(GVAR(DOWN) = true); + x = 0.50; + y = 0.81; + }; + + class DAGR_LEFT_Button : DAGR_Button { + idc = 266866; + action = QUOTE(GVAR(LEFT) = true); + x = 0.40; + y = 0.735; + w = 0.05; + h = 0.07; + }; + + class DAGR_RIGHT_Button : DAGR_Button { + idc = 266867; + action = QUOTE(GVAR(RIGHT) = true); + x = 0.62; + y = 0.735; + w = 0.05; + h = 0.07; + }; + + class DAGR_NEXT_Button : DAGR_Button { + idc = 266868; + action = QUOTE(DAGR_NEXT = true); + x = 0.60; + y = 0.65; + }; + + class DAGR_SEL_Button : DAGR_Button { + idc = 266869; + action = QUOTE(GVAR(SEL) = true); + x = 0.54; + y = 0.735; + w = 0.06; + h = 0.06; + }; + + class DAGR_MENU_Button : DAGR_Button { + idc = 266870; + action = QUOTE(GVAR(MENU_B) = true); + x = 0.46; + y = 0.735; + w = 0.06; + h = 0.06; + }; + + class DAGR_F1_Button : DAGR_Button { + idc = 266871; + action = QUOTE(GVAR(F1) = true); + x = 0.40; + y = 0.575; + }; + + class DAGR_F2_Button : DAGR_Button { + idc = 266872; + action = QUOTE(GVAR(F2) = true); + x = 0.495; + y = 0.575; + }; + + class DAGR_F3_Button : DAGR_Button { + idc = 266873; + action = QUOTE(GVAR(F3) = true); + x = 0.59; + y = 0.575; + }; + + class DAGR_F1_Text : DAGR_Menu_Text { + idc = 266874; + x = 0.388; + y = 0.38; + text = ""; + }; + + class DAGR_F2_Text : DAGR_Menu_Text { + idc = 266875; + x = 0.506; + y = 0.38; + }; + + class DAGR_F3_Text : DAGR_Menu_Text { + idc = 266876; + x = 0.612; + y = 0.38; + }; + + class DAGR_MENU_OPTION0 : DAGR_Menu_Text { + idc = 2668777; + style = 0x02; + sizeEx = 0.035; + x = 0.43; + y = 0.19; + }; + + class DAGR_MENU_OPTION1 : DAGR_Menu_Text { + idc = 2668778; + style = 0x02; + sizeEx = 0.035; + x = 0.43; + y = 0.225; + }; + + class DAGR_MENU_OPTION2 : DAGR_Menu_Text { + idc = 2668779; + style = 0x02; + sizeEx = 0.035; + x = 0.43; + y = 0.26; + }; + + class DAGR_MENU_OPTION3 : DAGR_Menu_Text { + idc = 2668780; + style = 0x02; + sizeEx = 0.035; + x = 0.43; + y = 0.295; + }; + + class DAGR_MENU_OPTION4 : DAGR_Menu_Text { + idc = 2668781; + style = 0x02; + sizeEx = 0.035; + x = 0.43; + y = 0.33; + }; + class DAGR_MENU_SELECTION0 : DAGR_Menu_Pic { + idc = 2668783; + x = 0.42; + y = 0.246; + w = 0.17; + h = 0.035; + sizeEx = 0.05; + }; + + class DAGR_MENU_SELECTION1 : DAGR_Menu_Pic { + idc = 2668784; + x = 0.42; + y = 0.281; + w = 0.17; + h = 0.035; + sizeEx = 0.05; + }; + + class DAGR_MENU_SELECTION2 : DAGR_Menu_Pic { + idc = 2668785; + x = 0.42; + y = 0.316; + w = 0.17; + h = 0.035; + sizeEx = 0.05; + }; + + class DAGR_MENU_SELECTION3 : DAGR_Menu_Pic { + idc = 2668786; + x = 0.42; + y = 0.351; + w = 0.17; + h = 0.035; + sizeEx = 0.05; + }; + + class DAGR_MENU_SELECTION4 : DAGR_Menu_Pic { + idc = 2668787; + x = 0.42; + y = 0.386; + w = 0.17; + h = 0.035; + sizeEx = 0.05; + }; + + class DAGR_MENU_Main_Text : DAGR_Menu_Text { + idc = 2668782; + style = ST_CENTER; + x = 0.38; + y = 0.32; + w = 0.25; + h = 0.035; + sizeEx = 0.04; + }; + + class DAGR_MENU_PSELECTION1 : DAGR_Menu_Pic { + idc = 2668788; + x = 0.451; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION2 : DAGR_Menu_Pic { + idc = 2668789; + x = 0.465; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION3 : DAGR_Menu_Pic { + idc = 2668790; + x = 0.479; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION4 : DAGR_Menu_Pic { + idc = 2668791; + x = 0.493; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION5 : DAGR_Menu_Pic { + idc = 2668792; + x = 0.507; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION6 : DAGR_Menu_Pic { + idc = 2668793; + x = 0.521; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION7 : DAGR_Menu_Pic { + idc = 2668794; + x = 0.535; + y = 0.352; + w = 0.01; + h = 0.003; + }; + + class DAGR_MENU_PSELECTION8 : DAGR_Menu_Pic { + idc = 2668795; + x = 0.549; + y = 0.352; + w = 0.01; + h = 0.003; + }; +}; diff --git a/addons/dagr/README.md b/addons/dagr/README.md new file mode 100644 index 0000000000..33d095dca4 --- /dev/null +++ b/addons/dagr/README.md @@ -0,0 +1,10 @@ +ace_dagr +=============== + +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 diff --git a/addons/dagr/RscTitles.hpp b/addons/dagr/RscTitles.hpp new file mode 100644 index 0000000000..8467c70f66 --- /dev/null +++ b/addons/dagr/RscTitles.hpp @@ -0,0 +1,95 @@ +class RscTitles { + class DAGR_Text { + type = 0; + idc = -1; + style = 0x01; + x = 0; + y = 0; + w = 0.15; + h = 0.050; + text = ""; + colorBackground[] = { 0, 0, 0, 0 }; + colorText[] = { 0.239, 0.216, 0.153, 1 }; + font = "PuristaMedium"; + sizeEx = 0.04; + waitForLoad = 0; + }; + class DAGR_Pic { + type = 0; + idc = -1; + style = 48; + x = 0; + y = 0; + w = 0.50; + h = 0.50; + text = ""; + colorBackground[] = {}; + colorText[] = {}; + font = "PuristaMedium"; + sizeEx = 0.02; + waitForLoad = 0; + }; + + class DAGR_Display { + idd = 266850; + movingEnable = false; + duration = 100000; + fadein = 0; + fadeout = 0; + name = "Dagr_Display"; + onLoad="uiNamespace setVariable ['DAGR_Display', _this select 0]"; + controls[] = {"DAGR_UI", "DAGR_Grid", "DAGR_Speed", "DAGR_Elevation", "DAGR_Heading", "DAGR_Time", "DAGR_WP", "DAGR_Bearing", "DAGR_DIST"}; + + class DAGR_UI : DAGR_Pic { + idc = 266856; + x = "(SafeZoneW + SafeZoneX) - 0.45"; + y = "(SafeZoneH + SafeZoneY) - 0.47"; + }; + + class DAGR_Grid : DAGR_Text { + idc = 266851; + x = "(SafeZoneW + SafeZoneX) - 0.370";// 0.830 + y = "(SafeZoneH + SafeZoneY)- 0.250";// 0.845 + w = 0.25; + h = 0.06; + sizeEx = 0.07; + }; + class DAGR_Speed : DAGR_Text { + idc = 266852; + x = "(SafeZoneW + SafeZoneX) - 0.388"; //0.812 + y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 + }; + class DAGR_Elevation : DAGR_Text { + idc = 266853; + x = "(SafeZoneW + SafeZoneX) - 0.270"; //0.930 + y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 + }; + class DAGR_Heading : DAGR_Text { + idc = 266854; + x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787 + y = "(SafeZoneH + SafeZoneY) - 0.1294"; //0.9656 + }; + class DAGR_Time : DAGR_Text { + idc = 266855; + x = "(SafeZoneW + SafeZoneX) - 0.275"; //0.925 + y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965 + }; + + class DAGR_WP : DAGR_Text { + idc = 266857; + x = "(SafeZoneW + SafeZoneX) - 0.235"; //0.965 + y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 + }; + + class DAGR_Bearing : DAGR_Text { + idc = 266858; + x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787 + y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 + }; + class DAGR_DIST : DAGR_Text { + idc = 266859; + x = "(SafeZoneW + SafeZoneX) - 0.265"; //0.935 + y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965 + }; + }; +}; diff --git a/addons/dagr/UI/DAGR_Button.paa b/addons/dagr/UI/DAGR_Button.paa new file mode 100644 index 0000000000..f81a8cef4a Binary files /dev/null and b/addons/dagr/UI/DAGR_Button.paa differ diff --git a/addons/dagr/UI/DAGR_GPS.paa b/addons/dagr/UI/DAGR_GPS.paa new file mode 100644 index 0000000000..b0e05a5a65 Binary files /dev/null and b/addons/dagr/UI/DAGR_GPS.paa differ diff --git a/addons/dagr/UI/DAGR_GPS_SHOW.paa b/addons/dagr/UI/DAGR_GPS_SHOW.paa new file mode 100644 index 0000000000..71f93e5f01 Binary files /dev/null and b/addons/dagr/UI/DAGR_GPS_SHOW.paa differ diff --git a/addons/dagr/UI/DAGR_Icon.paa b/addons/dagr/UI/DAGR_Icon.paa new file mode 100644 index 0000000000..be4afe7b51 Binary files /dev/null and b/addons/dagr/UI/DAGR_Icon.paa differ diff --git a/addons/dagr/UI/DAGR_MENU.paa b/addons/dagr/UI/DAGR_MENU.paa new file mode 100644 index 0000000000..311e2a607a Binary files /dev/null and b/addons/dagr/UI/DAGR_MENU.paa differ diff --git a/addons/dagr/UI/DAGR_PSelection.paa b/addons/dagr/UI/DAGR_PSelection.paa new file mode 100644 index 0000000000..9e1eb679fa Binary files /dev/null and b/addons/dagr/UI/DAGR_PSelection.paa differ diff --git a/addons/dagr/UI/DAGR_Selection.paa b/addons/dagr/UI/DAGR_Selection.paa new file mode 100644 index 0000000000..16ecf82593 Binary files /dev/null and b/addons/dagr/UI/DAGR_Selection.paa differ diff --git a/addons/dagr/UI/DAGR_Vector.paa b/addons/dagr/UI/DAGR_Vector.paa new file mode 100644 index 0000000000..c414cbd7e7 Binary files /dev/null and b/addons/dagr/UI/DAGR_Vector.paa differ diff --git a/addons/dagr/UI/DAGR_WP.paa b/addons/dagr/UI/DAGR_WP.paa new file mode 100644 index 0000000000..e8e541a36f Binary files /dev/null and b/addons/dagr/UI/DAGR_WP.paa differ diff --git a/addons/dagr/XEH_postInit.sqf b/addons/dagr/XEH_postInit.sqf new file mode 100644 index 0000000000..39f2a7ea28 --- /dev/null +++ b/addons/dagr/XEH_postInit.sqf @@ -0,0 +1,33 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +#include "initKeybinds.sqf" + +GVAR(outputPFH) = -1; + +GVAR(run) = false; +GVAR(hidden) = true; +GVAR(menuRun) = false; +GVAR(useDegrees) = true; +GVAR(updateInterval) = 0.5; + +GVAR(numWaypoints) = 0; +GVAR(wpString0) = ""; +GVAR(wpString1) = ""; +GVAR(wpString2) = ""; +GVAR(wpString3) = ""; +GVAR(wpString4) = ""; +GVAR(wp0) = 0; +GVAR(wp1) = 0; +GVAR(wp2) = 0; +GVAR(wp3) = 0; +GVAR(wp4) = 0; + +GVAR(displaySelection) = "DATA"; + +GVAR(vectorConnected) = false; +GVAR(noVectorData) = true; +GVAR(vectorGrid) = "00000000"; + +["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler); diff --git a/addons/dagr/XEH_preInit.sqf b/addons/dagr/XEH_preInit.sqf new file mode 100644 index 0000000000..7c61d71775 --- /dev/null +++ b/addons/dagr/XEH_preInit.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(handleRangeFinderData); +PREP(menuInit); +PREP(outputData); +PREP(outputVector); +PREP(outputWP); +PREP(toggleOverlay); + +ADDON = true; diff --git a/addons/dagr/config.cpp b/addons/dagr/config.cpp new file mode 100644 index 0000000000..9f46660aaa --- /dev/null +++ b/addons/dagr/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_DAGR"}; + weapons[] = {"ACE_DAGR"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_weather"}; + author[] = {"Rosuto", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "Dialog.hpp" +#include "RscTitles.hpp" diff --git a/addons/dagr/functions/fnc_handleRangeFinderData.sqf b/addons/dagr/functions/fnc_handleRangeFinderData.sqf new file mode 100644 index 0000000000..59e10a1711 --- /dev/null +++ b/addons/dagr/functions/fnc_handleRangeFinderData.sqf @@ -0,0 +1,30 @@ +/* + * Author: Rosuto, Ruthberg + * Handles incoming data packets from the Vectronix Vector LRF + * + * Arguments: + * 0: Slope distance (Meters) + * 1: Azimuth (Degrees) + * 2: Inclination (Degrees) + * + * Return Value: + * Nothing + * + * Example: + * [1000, 45, 1] call ace_dagr_fnc_handleRangeFinderData + * + * Public: No + */ +#include "script_component.hpp" + +#define EMP_RF_ACC 5 // Rangefinder Accuracy + +PARAMS_3(_slopeDistance,_azimuth,_inclination); + +if (GVAR(vectorConnected)) then { + GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect); + GVAR(LAZDIST) = _slopeDistance * cos(_inclination); + GVAR(LAZDIST) = floor (GVAR(LAZDIST) / EMP_RF_ACC) * EMP_RF_ACC; + GVAR(LAZHEADING) = _azimuth; + GVAR(noVectorData) = false; +}; diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf new file mode 100644 index 0000000000..739f41df0b --- /dev/null +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -0,0 +1,607 @@ +/* + * Author: Rosuto, Ruthberg + * Creates the DAGR menu dialog + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +#define __dsp (uiNamespace getVariable "DAGR_MENU") +#define __F1 266874 +#define __F2 266875 +#define __F3 266876 +#define __Option0 2668777 +#define __Option1 2668778 +#define __Option2 2668779 +#define __Option3 2668780 +#define __Option4 2668781 +#define __Selection0 2668783 +#define __Selection1 2668784 +#define __Selection2 2668785 +#define __Selection3 2668786 +#define __Selection4 2668787 +#define __mainText 2668782 +#define __PSelection1 2668788 +#define __PSelection2 2668789 +#define __PSelection3 2668790 +#define __PSelection4 2668791 +#define __PSelection5 2668792 +#define __PSelection6 2668793 +#define __PSelection7 2668794 +#define __PSelection8 2668795 + +135471 cutText ["", "PLAIN"]; +closeDialog 0; +createDialog "DAGR_MENU"; + +GVAR(menu) = "main"; +GVAR(selection) = 0; +GVAR(numSelections) = 5; +GVAR(tmpUpdateRate) = GVAR(updateInterval); +GVAR(edit) = false; +GVAR(add) = false; +GVAR(pointer) = 0; +GVAR(digit1) = 0; +GVAR(digit2) = 0; +GVAR(digit3) = 0; +GVAR(digit4) = 0; +GVAR(digit5) = 0; +GVAR(digit6) = 0; +GVAR(digit7) = 0; +GVAR(digit8) = 0; + +GVAR(busy) = false; +GVAR(busyTimer) = 0; + +GVAR(showNoWaypointsFound) = false; +GVAR(showInfoUpdatin) = false; +GVAR(showDeleting) = false; +GVAR(showOutOfSpace) = false; + +GVAR(PWR) = false; +GVAR(menuRun) = true; +[{ + if (!dialog || GVAR(PWR) || !GVAR(menuRun)) exitWith { + closeDialog 266860; + GVAR(menuRun) = false; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + if (GVAR(MENU_B)) then { + GVAR(menu) = "main"; + GVAR(selection) = 0; + GVAR(numSelections) = 5; + }; + + if (!GVAR(add) && !GVAR(edit)) then { + if (GVAR(DOWN)) then { + GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1); + }; + if (GVAR(UP)) then { + GVAR(selection) = (GVAR(numSelections) + GVAR(selection) - 1); + }; + GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 }; + }; + + if (GVAR(LEFT)) then { + GVAR(pointer) = (8 + GVAR(pointer) - 1); + }; + if (GVAR(RIGHT)) then { + GVAR(pointer) = (8 + GVAR(pointer) + 1); + }; + GVAR(pointer) = GVAR(pointer) % 8; + + (__dsp displayCtrl __PSelection1) ctrlSetText ""; + (__dsp displayCtrl __PSelection2) ctrlSetText ""; + (__dsp displayCtrl __PSelection3) ctrlSetText ""; + (__dsp displayCtrl __PSelection4) ctrlSetText ""; + (__dsp displayCtrl __PSelection5) ctrlSetText ""; + (__dsp displayCtrl __PSelection6) ctrlSetText ""; + (__dsp displayCtrl __PSelection7) ctrlSetText ""; + (__dsp displayCtrl __PSelection8) ctrlSetText ""; + + (__dsp displayCtrl __Selection0) ctrlSetText ""; + (__dsp displayCtrl __Selection1) ctrlSetText ""; + (__dsp displayCtrl __Selection2) ctrlSetText ""; + (__dsp displayCtrl __Selection3) ctrlSetText ""; + (__dsp displayCtrl __Selection4) ctrlSetText ""; + + (__dsp displayCtrl __F1) ctrlSetText ""; + (__dsp displayCtrl __F2) ctrlSetText ""; + (__dsp displayCtrl __F3) ctrlSetText ""; + + (__dsp displayCtrl __mainText) ctrlSetText ""; + (__dsp displayCtrl __Option0) ctrlSetText ""; + (__dsp displayCtrl __Option1) ctrlSetText ""; + (__dsp displayCtrl __Option2) ctrlSetText ""; + (__dsp displayCtrl __Option3) ctrlSetText ""; + (__dsp displayCtrl __Option4) ctrlSetText ""; + + switch (GVAR(menu)) do { + case "main": { + if (GVAR(SEL)) then { + switch (GVAR(selection)) do { + case 0: { + GVAR(displaySelection) = "DATA"; + GVAR(vectorConnected) = false; + if (!GVAR(busy)) then { + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + (__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data."; + if (ACE_time - GVAR(busyTimer) > 0.5) then { + (__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data.."; + }; + if (ACE_time - GVAR(busyTimer) > 1.0) then { + (__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data..."; + }; + if (ACE_time - GVAR(busyTimer) > 1.5) then { + (__dsp displayCtrl __mainText) ctrlSetText "Position Acquired"; + }; + if (ACE_time - GVAR(busyTimer) > 3.0) then { + GVAR(busy) = false; + }; + }; + case 1: { + if (GVAR(numWaypoints) < 1) then { + (__dsp displayCtrl __mainText) ctrlSetText "No Waypoints Found"; + if (!GVAR(busy)) then { + GVAR(showNoWaypointsFound) = true; + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + } else { + GVAR(menu) = "goto_wp"; GVAR(numSelections) = GVAR(numWaypoints); GVAR(selection) = 0; + }; + }; + case 2: { GVAR(menu) = "wp_list"; GVAR(numSelections) = GVAR(numWaypoints); GVAR(selection) = 0 }; + case 3: { GVAR(menu) = "connect"; GVAR(numSelections) = 1; }; + case 4: { GVAR(menu) = "options"; GVAR(numSelections) = 2; }; + }; + }; + if (GVAR(busy) && GVAR(showNoWaypointsFound)) then { + if (ACE_time - GVAR(busyTimer) > 2) then { + GVAR(showNoWaypointsFound) = false; + GVAR(busy) = false; + }; + }; + if (!GVAR(busy)) then { + (__dsp displayCtrl __Option0) ctrlSetText "DATA VIEW"; + (__dsp displayCtrl __Option1) ctrlSetText "GOTO WP"; + (__dsp displayCtrl __Option2) ctrlSetText "WP LIST"; + (__dsp displayCtrl __Option3) ctrlSetText "CONNECT TO"; + (__dsp displayCtrl __Option4) ctrlSetText "OPTIONS"; + (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa)); + }; + }; + case "goto_wp": { + if (!GVAR(busy)) then { + (__dsp displayCtrl __Option0) ctrlSetText GVAR(wpString0); + (__dsp displayCtrl __Option1) ctrlSetText GVAR(wpString1); + (__dsp displayCtrl __Option2) ctrlSetText GVAR(wpString2); + (__dsp displayCtrl __Option3) ctrlSetText GVAR(wpString3); + (__dsp displayCtrl __Option4) ctrlSetText GVAR(wpString4); + if (GVAR(numSelections) > 0) then { + (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa)); + }; + }; + if (GVAR(SEL)) then { + GVAR(vectorConnected) = false; + GVAR(displaySelection) = "WP"; + switch (GVAR(selection)) do { + case 0: { DAGR_WP_INFO = GVAR(wp0); }; + case 1: { DAGR_WP_INFO = GVAR(wp1); }; + case 2: { DAGR_WP_INFO = GVAR(wp2); }; + case 3: { DAGR_WP_INFO = GVAR(wp3); }; + case 4: { DAGR_WP_INFO = GVAR(wp4); }; + }; + if (!GVAR(busy)) then { + GVAR(showInfoUpdating) = true; + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + }; + if (GVAR(busy) && GVAR(showInfoUpdating)) then { + (__dsp displayCtrl __mainText) ctrlSetText "Info Update."; + if (ACE_time - GVAR(busyTimer) > 1) then { + (__dsp displayCtrl __mainText) ctrlSetText "Info Update.."; + }; + if (ACE_time - GVAR(busyTimer) > 1.2) then { + (__dsp displayCtrl __mainText) ctrlSetText "Info Update..."; + }; + if (ACE_time - GVAR(busyTimer) > 1.4) then { + (__dsp displayCtrl __mainText) ctrlSetText "Info Updated"; + }; + if (ACE_time - GVAR(busyTimer) > 2.9) then { + GVAR(showInfoUpdating) = false; + GVAR(busy) = false; + }; + }; + }; + case "wp_list": { + if (!GVAR(add) && !GVAR(edit)) then { + if (!GVAR(busy)) then { + (__dsp displayCtrl __Option0) ctrlSetText GVAR(wpString0); + (__dsp displayCtrl __Option1) ctrlSetText GVAR(wpString1); + (__dsp displayCtrl __Option2) ctrlSetText GVAR(wpString2); + (__dsp displayCtrl __Option3) ctrlSetText GVAR(wpString3); + (__dsp displayCtrl __Option4) ctrlSetText GVAR(wpString4); + (__dsp displayCtrl __F1) ctrlSetText "Add"; + (__dsp displayCtrl __F2) ctrlSetText "Edit"; + (__dsp displayCtrl __F3) ctrlSetText "Delete"; + if (GVAR(numSelections) > 0) then { + (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa)); + }; + }; + if (GVAR(F3) && GVAR(numWaypoints) > 0) then { + if (!GVAR(busy)) then { + switch (GVAR(selection)) do { + case 0: { + GVAR(wpString0) = GVAR(wpString1); + GVAR(wp0) = GVAR(wp1); + GVAR(wpString1) = GVAR(wpString2); + GVAR(wp1) = GVAR(wp2); + GVAR(wpString2) = GVAR(wpString3); + GVAR(wp2) = GVAR(wp3); + GVAR(wpString3) = GVAR(wpString4); + GVAR(wp3) = GVAR(wp4); + GVAR(wpString4) = ""; + GVAR(wp4) = ""; + }; + case 1: { + GVAR(wpString1) = GVAR(wpString2); + GVAR(wp1) = GVAR(wp2); + GVAR(wpString2) = GVAR(wpString3); + GVAR(wp2) = GVAR(wp3); + GVAR(wpString3) = GVAR(wpString4); + GVAR(wp3) = GVAR(wp4); + GVAR(wpString4) = ""; + GVAR(wp4) = ""; + }; + case 2: { + GVAR(wpString2) = GVAR(wpString3); + GVAR(wp2) = GVAR(wp3); + GVAR(wpString3) = GVAR(wpString4); + GVAR(wp3) = GVAR(wp4); + GVAR(wpString4) = ""; + GVAR(wp4) = ""; + }; + case 3: { + GVAR(wpString3) = GVAR(wpString4); + GVAR(wp3) = GVAR(wp4); + GVAR(wpString4) = ""; + GVAR(wp4) = ""; + }; + case 4: { + GVAR(wpString4) = ""; + GVAR(wp4) = ""; + }; + }; + GVAR(numWaypoints) = GVAR(numWaypoints) - 1; + GVAR(numSelections) = GVAR(numWaypoints); + GVAR(showDeleting) = true; + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + }; + if (GVAR(busy) && GVAR(showDeleting)) then { + (__dsp displayCtrl __mainText) ctrlSetText "Deleting."; + if (ACE_time - GVAR(busyTimer) > 1) then { + (__dsp displayCtrl __mainText) ctrlSetText "Deleting.."; + }; + if (ACE_time - GVAR(busyTimer) > 1.2) then { + (__dsp displayCtrl __mainText) ctrlSetText "Deleting..."; + }; + if (ACE_time - GVAR(busyTimer) > 1.4) then { + (__dsp displayCtrl __mainText) ctrlSetText "Waypoint Deleted"; + }; + if (ACE_time - GVAR(busyTimer) > 2.9) then { + GVAR(showDeleting) = false; + GVAR(busy) = false; + }; + }; + if (GVAR(F1)) then { + if (GVAR(numWaypoints) == 5) then { + if (!GVAR(busy)) then { + GVAR(showOutOfSpace) = true; + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + } else { + GVAR(digit1) = 0; + GVAR(digit2) = 0; + GVAR(digit3) = 0; + GVAR(digit4) = 0; + GVAR(digit5) = 0; + GVAR(digit6) = 0; + GVAR(digit7) = 0; + GVAR(digit8) = 0; + GVAR(pointer) = 0; + GVAR(add) = true; + }; + }; + if (GVAR(busy) && GVAR(showOutOfSpace)) then { + (__dsp displayCtrl __mainText) ctrlSetText "Out of Space"; + if (ACE_time - GVAR(busyTimer) > 2.5) then { + GVAR(showOutOfSpace) = false; + GVAR(busy) = false; + }; + }; + if (GVAR(F2) && GVAR(numWaypoints) > 0) then { + GVAR(pointer) = 0; + GVAR(edit) = true; + GVAR(add) = false; + switch (GVAR(selection)) do { + case 0: { + GVAR(digit1) = floor (GVAR(wp0) / 10000000); + GVAR(digit2) = floor (GVAR(wp0) / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor (GVAR(wp0) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor (GVAR(wp0) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor (GVAR(wp0) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor (GVAR(wp0) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor (GVAR(wp0) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor (GVAR(wp0) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + case 1: { + GVAR(digit1) = floor (GVAR(wp1) / 10000000); + GVAR(digit2) = floor (GVAR(wp1) / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor (GVAR(wp1) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor (GVAR(wp1) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor (GVAR(wp1) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor (GVAR(wp1) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor (GVAR(wp1) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor (GVAR(wp1) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + case 2: { + GVAR(digit1) = floor (GVAR(wp2) / 10000000); + GVAR(digit2) = floor (GVAR(wp2) / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor (GVAR(wp2) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor (GVAR(wp2) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor (GVAR(wp2) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor (GVAR(wp2) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor (GVAR(wp2) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor (GVAR(wp2) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + case 3: { + GVAR(digit1) = floor (GVAR(wp3) / 10000000); + GVAR(digit2) = floor (GVAR(wp3) / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor (GVAR(wp3) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor (GVAR(wp3) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor (GVAR(wp3) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor (GVAR(wp3) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor (GVAR(wp3) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor (GVAR(wp3) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + case 4: { + GVAR(digit1) = floor (GVAR(wp4) / 10000000); + GVAR(digit2) = floor (GVAR(wp4) / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor (GVAR(wp4) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor (GVAR(wp4) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor (GVAR(wp4) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor (GVAR(wp4) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor (GVAR(wp4) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor (GVAR(wp4) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + }; + }; + } else { + if (!GVAR(busy)) then { + (__dsp displayCtrl __F1) ctrlSetText "Save"; + (__dsp displayCtrl __F2) ctrlSetText "Vector"; + (__dsp displayCtrl __F3) ctrlSetText "Cancel"; + GVAR(output) = str GVAR(digit1) + str GVAR(digit2) + str GVAR(digit3) + str GVAR(digit4) + str GVAR(digit5) + str GVAR(digit6) + str GVAR(digit7) + str GVAR(digit8); + (__dsp displayCtrl __mainText) ctrlSetText GVAR(output); + (__dsp displayCtrl __PSelection1 + GVAR(pointer)) ctrlSetText QUOTE(PATHTOF(UI\DAGR_PSelection.paa)); + }; + if (GVAR(F1)) then { + if (!GVAR(busy)) then { + if (GVAR(add)) then { + switch (GVAR(numWaypoints)) do { + case 0: { GVAR(wpString0) = GVAR(output); GVAR(wp0) = parseNumber GVAR(output); }; + case 1: { GVAR(wpString1) = GVAR(output); GVAR(wp1) = parseNumber GVAR(output); }; + case 2: { GVAR(wpString2) = GVAR(output); GVAR(wp2) = parseNumber GVAR(output); }; + case 3: { GVAR(wpString3) = GVAR(output); GVAR(wp3) = parseNumber GVAR(output); }; + case 4: { GVAR(wpString4) = GVAR(output); GVAR(wp4) = parseNumber GVAR(output); }; + }; + GVAR(numWaypoints) = GVAR(numWaypoints) + 1; + GVAR(numSelections) = GVAR(numWaypoints); + GVAR(selection) = 0; + }; + if (GVAR(edit)) then { + switch (GVAR(selection)) do { + case 0: { GVAR(wpString0) = GVAR(output); GVAR(wp0) = parseNumber GVAR(output); }; + case 1: { GVAR(wpString1) = GVAR(output); GVAR(wp1) = parseNumber GVAR(output); }; + case 2: { GVAR(wpString2) = GVAR(output); GVAR(wp2) = parseNumber GVAR(output); }; + case 3: { GVAR(wpString3) = GVAR(output); GVAR(wp3) = parseNumber GVAR(output); }; + case 4: { GVAR(wpString4) = GVAR(output); GVAR(wp4) = parseNumber GVAR(output); }; + }; + }; + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + (__dsp displayCtrl __F1) ctrlSetText ""; + (__dsp displayCtrl __F2) ctrlSetText ""; + (__dsp displayCtrl __F3) ctrlSetText ""; + (__dsp displayCtrl __mainText) ctrlSetText "Saving."; + if (ACE_time - GVAR(busyTimer) > 1) then { + (__dsp displayCtrl __mainText) ctrlSetText "Saving.."; + }; + if (ACE_time - GVAR(busyTimer) > 1.2) then { + (__dsp displayCtrl __mainText) ctrlSetText "Saving..."; + }; + if (ACE_time - GVAR(busyTimer) > 1.4) then { + (__dsp displayCtrl __mainText) ctrlSetText "Waypoint Saved"; + }; + if (ACE_time - GVAR(busyTimer) > 2.9) then { + GVAR(edit) = false; + GVAR(add) = false; + GVAR(busy) = false; + }; + }; + if (GVAR(F2)) then { + private ["_grid", "_gridVector"]; + _grid = toArray GVAR(vectorGrid); + _grid deleteAt 4; + _grid = toString _grid; + _gridVector = parseNumber _grid; + GVAR(digit1) = floor(_gridVector / 10000000); + GVAR(digit2) = floor(_gridVector / 1000000 - GVAR(digit1) *10); + GVAR(digit3) = floor(_gridVector / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100); + GVAR(digit4) = floor(_gridVector / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000); + GVAR(digit5) = floor(_gridVector / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000); + GVAR(digit6) = floor(_gridVector / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000); + GVAR(digit7) = floor(_gridVector / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000); + GVAR(digit8) = floor(_gridVector - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000); + }; + if (GVAR(F3)) then { + if (!GVAR(busy)) then { + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + } else { + (__dsp displayCtrl __F1) ctrlSetText "Save"; + (__dsp displayCtrl __F2) ctrlSetText "Vector"; + (__dsp displayCtrl __F3) ctrlSetText "Cancel"; + GVAR(output) = str GVAR(digit1) + str GVAR(digit2) + str GVAR(digit3) + str GVAR(digit4) + str GVAR(digit5) + str GVAR(digit6) + str GVAR(digit7) + str GVAR(digit8); + (__dsp displayCtrl __mainText) ctrlSetText GVAR(output); + }; + if (ACE_time - GVAR(busyTimer) > 0.1) then { + GVAR(add) = false; + GVAR(edit) = false; + GVAR(busy) = false; + }; + }; + if (GVAR(UP)) then { + switch (GVAR(pointer) + 1) do { + case 1: { GVAR(digit1) = (10 + GVAR(digit1) + 1) % 10 }; + case 2: { GVAR(digit2) = (10 + GVAR(digit2) + 1) % 10 }; + case 3: { GVAR(digit3) = (10 + GVAR(digit3) + 1) % 10 }; + case 4: { GVAR(digit4) = (10 + GVAR(digit4) + 1) % 10 }; + case 5: { GVAR(digit5) = (10 + GVAR(digit5) + 1) % 10 }; + case 6: { GVAR(digit6) = (10 + GVAR(digit6) + 1) % 10 }; + case 7: { GVAR(digit7) = (10 + GVAR(digit7) + 1) % 10 }; + case 8: { GVAR(digit8) = (10 + GVAR(digit8) + 1) % 10 }; + }; + }; + if (GVAR(DOWN)) then { + switch (GVAR(pointer) + 1) do { + case 1: { GVAR(digit1) = (10 + GVAR(digit1) - 1) % 10 }; + case 2: { GVAR(digit2) = (10 + GVAR(digit2) - 1) % 10 }; + case 3: { GVAR(digit3) = (10 + GVAR(digit3) - 1) % 10 }; + case 4: { GVAR(digit4) = (10 + GVAR(digit4) - 1) % 10 }; + case 5: { GVAR(digit5) = (10 + GVAR(digit5) - 1) % 10 }; + case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 }; + case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 }; + case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 }; + }; + }; + }; + }; + case "connect": { + if (!GVAR(busy)) then { + (__dsp displayCtrl __Option0) ctrlSetText "Vector 21"; + (__dsp displayCtrl __Selection0) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa)); + }; + if (GVAR(SEL)) then { + if (!GVAR(busy)) then { + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + (__dsp displayCtrl __mainText) ctrlSetText "Connecting."; + if (ACE_time - GVAR(busyTimer) > 0.2) then { + (__dsp displayCtrl __mainText) ctrlSetText "Connecting.."; + }; + if (ACE_time - GVAR(busyTimer) > 0.4) then { + (__dsp displayCtrl __mainText) ctrlSetText "Connecting..."; + }; + if (ACE_time - GVAR(busyTimer) > 0.6) then { + if (ACE_player hasWeapon "ACE_Vector") then { + GVAR(displaySelection) = "VECTOR"; + (__dsp displayCtrl __mainText) ctrlSetText "Vector Connected"; + GVAR(vectorConnected) = true; + } else { + (__dsp displayCtrl __mainText) ctrlSetText "No Device Found"; + GVAR(vectorConnected) = false; + }; + }; + if (ACE_time - GVAR(busyTimer) > 3.1) then { + GVAR(busy) = false; + if (GVAR(vectorConnected)) then { + GVAR(menu) = "main"; GVAR(numSelections) = 5; + }; + }; + }; + }; + case "options": { + (__dsp displayCtrl __Option0) ctrlSetText "Signal Delay"; + (__dsp displayCtrl __Option1) ctrlSetText (if (GVAR(useDegrees)) then { "Direction: Deg" } else { "Direction: MIL" }); + (__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa)); + if (GVAR(SEL)) then { + GVAR(vectorConnected) = false; + switch (GVAR(selection)) do { + case 0: { GVAR(menu) = "update_rate"; GVAR(numSelections) = 1; GVAR(tmpUpdateRate) = GVAR(updateInterval); }; + case 1: { GVAR(useDegrees) = !GVAR(useDegrees); }; + }; + } + }; + case "update_rate": { + if (GVAR(F1)) then { + GVAR(updateInterval) = GVAR(tmpUpdateRate); + if (!GVAR(busy)) then { + GVAR(busy) = true; + GVAR(busyTimer) = ACE_time; + }; + (__dsp displayCtrl __mainText) ctrlSetText "Updating."; + if (ACE_time - GVAR(busyTimer) > 0.2) then { + (__dsp displayCtrl __mainText) ctrlSetText "Updating.."; + }; + if (ACE_time - GVAR(busyTimer) > 0.4) then { + (__dsp displayCtrl __mainText) ctrlSetText "Updating..."; + }; + if (ACE_time - GVAR(busyTimer) > 0.6) then { + (__dsp displayCtrl __mainText) ctrlSetText "Update Success"; + }; + if (ACE_time - GVAR(busyTimer) > 2.1) then { + GVAR(busy) = false; + GVAR(menu) = "options"; GVAR(numSelections) = 2; + }; + }; + if (GVAR(F3)) then { + GVAR(menu) = "options"; GVAR(numSelections) = 2; + }; + if (GVAR(DOWN)) then { + GVAR(tmpUpdateRate) = GVAR(tmpUpdateRate) - 0.1; + }; + if (GVAR(UP)) then { + GVAR(tmpUpdateRate) = GVAR(tmpUpdateRate) + 0.1; + }; + GVAR(tmpUpdateRate) = 0.1 max GVAR(tmpUpdateRate) min 2.0; + if (!GVAR(busy)) then { + (__dsp displayCtrl __mainText) ctrlSetText (Str(GVAR(tmpUpdateRate) * 1000) + "ms"); + (__dsp displayCtrl __F1) ctrlSetText "Save"; + (__dsp displayCtrl __F3) ctrlSetText "Cancel"; + }; + }; + }; + + if (!GVAR(busy)) then { + GVAR(F3) = false; + GVAR(F2) = false; + GVAR(F1) = false; + GVAR(MENU_B) = false; + GVAR(SEL) = false; + DAGR_NEXT = false; + GVAR(RIGHT) = false; + GVAR(LEFT) = false; + GVAR(UP) = false; + GVAR(DOWN) = false; + GVAR(PWR) = false; + }; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf new file mode 100644 index 0000000000..ff7429fa0a --- /dev/null +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -0,0 +1,120 @@ +/* + * Author: Rosuto + * DAGR data output loop + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +135471 cutRsc ["DAGR_DISPLAY", "plain down"]; + +#define __display (uiNameSpace getVariable "DAGR_DISPLAY") + +#define __gridControl (__display displayCtrl 266851) +#define __speedControl (__display displayCtrl 266852) +#define __elevationControl (__display displayCtrl 266853) +#define __headingControl (__display displayCtrl 266854) +#define __timeControl (__display displayCtrl 266855) +#define __background (__display displayCtrl 266856) + +__background ctrlSetText QUOTE(PATHTOF(UI\dagr_gps.paa)); + +if (GVAR(outputPFH) != -1) exitWith {}; + +GVAR(outputPFH) = [{ + private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xgrid", "_ygrid", "_xcoord", "_ycoord", "_speed", "_dagrHeading", "_dagrGrid", "_dagrElevation", "_dagrSpeed", "_dagrTime", "_elevation"]; + + // Abort Condition + if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { + GVAR(outputPFH) = -1; + 135471 cutText ["", "PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + // GRID + _pos = getPosASL ACE_player; + + _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); + _gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid"); + _offsetX = getNumber (_gridConfig >> "offsetX"); + _offsetY = getNumber (_gridConfig >> "offsetY"); + _stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX"); + _stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY"); + + if (_stepY >= 0) then { + _pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY]; + }; + + // Incase grids go neg due to 99-00 boundry + if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; + if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; + + _xGrid = toArray Str(round(_pos select 0)); + while {count _xGrid < 5} do { + _xGrid = [48] + _xGrid; + }; + _xGrid resize 4; + _xGrid = toString _xGrid; + _xGrid = parseNumber _xGrid; + + _yGrid = toArray Str(round(_pos select 1)); + while {count _yGrid < 5} do { + _yGrid = [48] + _yGrid; + }; + _yGrid resize 4; + _yGrid = toString _yGrid; + _yGrid = parseNumber _yGrid; + + _xCoord = switch true do { + case (_xGrid >= 1000): { "" + Str(_xGrid) }; + case (_xGrid >= 100): { "0" + Str(_xGrid) }; + case (_xGrid >= 10): { "00" + Str(_xGrid) }; + default { "000" + Str(_xGrid) }; + }; + + _yCoord = switch true do { + case (_yGrid >= 1000): { "" + Str(_yGrid) }; + case (_yGrid >= 100): { "0" + Str(_yGrid) }; + case (_yGrid >= 10): { "00" + Str(_yGrid) }; + default { "000" + Str(_yGrid) }; + }; + + _dagrGrid = _xcoord + " " + _ycoord; + + // SPEED + _speed = speed (vehicle ACE_player); + _speed = floor (_speed * 10) / 10; + _speed = abs(_speed); + _dagrspeed = str _speed + "kph"; + + // Elevation + _elevation = getPosASL ACE_player; + _elevation = floor ((_elevation select 2) + EGVAR(weather,altitude)); + _dagrElevation = str _elevation + "m"; + + // Heading + _dagrHeading = if (!GVAR(useDegrees)) then { + floor (DEG_TO_MIL(direction (vehicle ACE_player))) + } else { + floor (direction (vehicle ACE_player)) + }; + + // Time + _dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; + + // Output + __gridControl ctrlSetText format ["%1", _dagrGrid]; + __speedControl ctrlSetText format ["%1", _dagrSpeed]; + __elevationControl ctrlSetText format ["%1", _dagrElevation]; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 ", _dagrHeading] }); + __timeControl ctrlSetText format ["%1", _dagrTime]; + +}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf new file mode 100644 index 0000000000..660e678a82 --- /dev/null +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -0,0 +1,98 @@ +/* + * Author: Rosuto + * DAGR vector output loop + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; + +135471 cutRsc ["DAGR_DISPLAY", "plain down"]; + +#define __display (uiNameSpace getVariable "DAGR_DISPLAY") + +#define __gridControl (__display displayCtrl 266851) +#define __speedControl (__display displayCtrl 266858) +#define __elevationControl (__display displayCtrl 266853) +#define __headingControl (__display displayCtrl 266854) +#define __timeControl (__display displayCtrl 266855) +#define __background (__display displayCtrl 266856) + +__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); + +if (GVAR(noVectorData)) exitwith {}; + +_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1]; + +// Incase grids go neg due to 99-00 boundry +if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; +if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; + +// Find laser position +_xGrid = toArray Str(round(_pos select 0)); + +while {count _xGrid < 5} do { + _xGrid = [48] + _xGrid; +}; +_xGrid resize 4; +_xGrid = toString _xGrid; +_xGrid = parseNumber _xGrid; + +_yGrid = toArray Str(round(_pos select 1)); +while {count _yGrid < 5} do { + _yGrid = [48] + _yGrid; +}; +_yGrid resize 4; +_yGrid = toString _yGrid; +_yGrid = parseNumber _yGrid; + +_xCoord = switch true do { + case (_xGrid >= 1000): { "" + Str(_xGrid) }; + case (_xGrid >= 100): { "0" + Str(_xGrid) }; + case (_xGrid >= 10): { "00" + Str(_xGrid) }; + default { "000" + Str(_xGrid) }; +}; + +_yCoord = switch true do { + case (_yGrid >= 1000): { "" + Str(_yGrid) }; + case (_yGrid >= 100): { "0" + Str(_yGrid) }; + case (_yGrid >= 10): { "00" + Str(_yGrid) }; + default { "000" + Str(_yGrid) }; +}; + +_dagrGrid = _xCoord + " " + _yCoord; + +// Find target elevation +_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(weather,altitude)); +_dagrElevation = str _elevation + "m"; + +// Time +_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString; + +// Bearing +_bearing = GVAR(LAZHEADING); +if (_bearing >= 360) then {_bearing = _bearing - 360;}; +if (!GVAR(useDegrees)) then {_bearing = DEG_TO_MIL(_bearing)}; +_bearing = floor (_bearing); + +// Distance +_dagrDist = str GVAR(LAZDIST) + "m"; + +// Put grid into variable so DAGR menu can access it +GVAR(vectorGrid) = _dagrGrid; + +// OUTPUT +__gridControl ctrlSetText format ["%1", _dagrGrid]; +__speedControl ctrlSetText format ["%1", _dagrDist]; +__elevationControl ctrlSetText format ["%1", _dagrElevation]; +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1", _bearing] }); +__timeControl ctrlSetText format ["%1", _dagrTime]; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf new file mode 100644 index 0000000000..d1fc2a47f2 --- /dev/null +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -0,0 +1,136 @@ +/* + * Author: Rosuto + * DAGR waypoint output loop + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +135471 cutRsc ["DAGR_DISPLAY", "plain down"]; + +#define __display (uiNameSpace getVariable "DAGR_DISPLAY") + +#define __gridControl (__display displayCtrl 266851) +#define __speedControl (__display displayCtrl 266858) +#define __elevationControl (__display displayCtrl 266857) +#define __headingControl (__display displayCtrl 266854) +#define __timeControl (__display displayCtrl 266859) +#define __background (__display displayCtrl 266856) + +__background ctrlSetText QUOTE(PATHTOF(UI\dagr_wp.paa)); + +if (GVAR(outputPFH) != -1) exitWith {}; + +GVAR(outputPFH) = [{ + private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xGrid", "_yGrid", "_xCoord", "_yCoord", "_dagrHeading", "_dagrGrid", "_bearing", "_MYpos", "_WPpos", "_dagrDistance", "_distance"]; + + // Abort Condition + if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { + GVAR(outputPFH) = -1; + 135471 cutText ["", "PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + // GRID + _pos = getPosASL ACE_player; + + _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); + _gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid"); + _offsetX = getNumber (_gridConfig >> "offsetX"); + _offsetY = getNumber (_gridConfig >> "offsetY"); + _stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX"); + _stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY"); + + if (_stepY >= 0) then { + _pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY]; + }; + + // Incase grids go neg due to 99-00 boundry + if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; + if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; + + _xGrid = toArray Str(round(_pos select 0)); + while {count _xGrid < 5} do { + _xGrid = [48] + _xGrid; + }; + _xGrid resize 4; + _xGrid = toString _xGrid; + _xGrid = parseNumber _xGrid; + + _yGrid = toArray Str(round(_pos select 1)); + while {count _yGrid < 5} do { + _yGrid = [48] + _yGrid; + }; + _yGrid resize 4; + _yGrid = toString _yGrid; + _yGrid = parseNumber _yGrid; + + _xCoord = switch true do { + case (_xGrid >= 1000): { "" + Str(_xGrid) }; + case (_xGrid >= 100): { "0" + Str(_xGrid) }; + case (_xGrid >= 10): { "00" + Str(_xGrid) }; + default { "000" + Str(_xGrid) }; + }; + + _yCoord = switch true do { + case (_yGrid >= 1000): { "" + Str(_yGrid) }; + case (_yGrid >= 100): { "0" + Str(_yGrid) }; + case (_yGrid >= 10): { "00" + Str(_yGrid) }; + default { "000" + Str(_yGrid) }; + }; + + _dagrGrid = _xCoord + " " + _yCoord; + + // WP Grid + _xGrid2 = floor (DAGR_WP_INFO / 10000); + _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; + + _xCoord2 = switch true do { + case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; + case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; + case (_xGrid2 >= 10): { "00" + Str(_xGrid2) }; + default { "000" + Str(_xGrid2) }; + }; + + _yCoord2 = switch true do { + case (_yGrid2 >= 1000): { "" + Str(_yGrid2) }; + case (_yGrid2 >= 100): { "0" + Str(_yGrid2) }; + case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; + default { "000" + Str(_yGrid2) }; + }; + + _dagrGrid2 = _xCoord2 + " " + _yCoord2; + + // Distance + _WPpos = [[_xCoord2, _yCoord2], true] call CBA_fnc_mapGridToPos; + _MYpos = [[_xCoord, _yCoord], true] call CBA_fnc_mapGridToPos; + _distance = _MYpos distance _WPpos; + _distance = floor (_distance * 10) / 10; + _dagrDistance = str _distance + "m"; + + // Heading + _dagrHeading = floor (if (GVAR(useDegrees)) then { + direction (vehicle ACE_player) + } else { + DEG_TO_MIL(direction (vehicle ACE_player)) + }); + + // WP Heading + _bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir); + + // Output + __gridControl ctrlSetText format ["%1", _dagrGrid]; + __speedControl ctrlSetText format ["%1", _bearing]; + __elevationControl ctrlSetText format ["%1", _dagrGrid2]; + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1", _dagrHeading] }); + __timeControl ctrlSetText format ["%1", _dagrDistance]; + +}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_toggleOverlay.sqf b/addons/dagr/functions/fnc_toggleOverlay.sqf new file mode 100644 index 0000000000..1fcb87d0ff --- /dev/null +++ b/addons/dagr/functions/fnc_toggleOverlay.sqf @@ -0,0 +1,54 @@ +/* + * Author: Rosuto, Ruthberg + * Toggles the DAGR overlay + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(run) = !GVAR(run); + +if (GVAR(run)) then { + if (GVAR(menuRun) && dialog) then { + GVAR(menuRun) = false; + closeDialog 0; + }; + GVAR(hidden) = true; + [{ + EXPLODE_1_PVT(_this select 0,_vehicle); + if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith { + GVAR(run) = false; + 135471 cutText ["", "PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + if (cameraView == "GUNNER") then { + if (!GVAR(hidden)) then { + GVAR(hidden) = true; + 135471 cutText ["", "PLAIN"]; + }; + } else { + if (GVAR(hidden)) then { + GVAR(hidden) = false; + switch (toUpper GVAR(displaySelection)) do { + case "WP" : { + call FUNC(outputWP); + }; + case "VECTOR" : { + call FUNC(outputVector); + }; + case "DATA" : { + call FUNC(outputData); + }; + }; + }; + }; + }, 0.1, [vehicle ACE_player]] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/dagr/functions/script_component.hpp b/addons/dagr/functions/script_component.hpp new file mode 100644 index 0000000000..18b02deaee --- /dev/null +++ b/addons/dagr/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\dagr\script_component.hpp" \ No newline at end of file diff --git a/addons/dagr/initKeybinds.sqf b/addons/dagr/initKeybinds.sqf new file mode 100644 index 0000000000..4575401feb --- /dev/null +++ b/addons/dagr/initKeybinds.sqf @@ -0,0 +1,59 @@ + +["ACE3 Equipment", QGVAR(MenuKey), "Configure DAGR", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false}; + + // Statement + if (!GVAR(menuRun)) then { + [] call FUNC(menuInit); + } else { + GVAR(PWR) = true; // Simulate pressing the power button + }; + true +}, +{false}, +[0, [false, true, false]], false] call cba_fnc_addKeybind; // (empty default key) + +["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false}; + + // Statement + [] call FUNC(toggleOverlay); + true +}, +{false}, +[0, [false, false, false]], false] call cba_fnc_addKeybind; // (empty default key) + +//Add deviceKey entry: +private ["_conditonCode", "_toggleCode", "_closeCode"]; +_conditonCode = { + ([ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)); +}; +_toggleCode = { + // Conditions: canInteract + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {}; + + // Statement + [] call FUNC(toggleOverlay); + if (!GVAR(run)) then { + [] call FUNC(menuInit); + }; +}; +_closeCode = { + // Statement + if (GVAR(run)) then { + //If dispaly is open, close it: + [] call FUNC(toggleOverlay); + }; + if (dialog && GVAR(menuRun)) then { + //If dialog is open, close it: + GVAR(menuRun) = false; + closeDialog 0; + }; +}; +["DAGR", QUOTE(PATHTOF(UI\DAGR_Icon.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/dagr/script_component.hpp b/addons/dagr/script_component.hpp new file mode 100644 index 0000000000..f7a723e533 --- /dev/null +++ b/addons/dagr/script_component.hpp @@ -0,0 +1,15 @@ +#define COMPONENT dagr +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_DAGR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_DAGR + #define DEBUG_SETTINGS DEBUG_SETTINGS_DAGR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define DEG_TO_MIL(d) (d / 360 * 6400) +#define MIL_TO_DEG(d) (d / 6400 * 360) diff --git a/addons/dagr/stringtable.xml b/addons/dagr/stringtable.xml new file mode 100644 index 0000000000..7da844d614 --- /dev/null +++ b/addons/dagr/stringtable.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/addons/disarming/CfgVehicles.hpp b/addons/disarming/CfgVehicles.hpp index 381aaed93e..b4a1a4c7dd 100644 --- a/addons/disarming/CfgVehicles.hpp +++ b/addons/disarming/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { class ACE_DisarmInventory { - displayName = "$STR_ACE_Disarming_OpenInventory"; + displayName = CSTRING(OpenInventory); distance = 3.5; condition = QUOTE([ARR_2(_player,_target)] call FUNC(canPlayerDisarmUnit)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(openDisarmDialog)); diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 2cb3e89b5d..5422fd00a6 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -64,11 +64,11 @@ if (isNull _holder) then { if (isNull _holder) exitWith { [_caller, _target, "Debug: Null Holder"] call FUNC(eventTargetFinish); }; -//Make sure only one drop operation at a time (using PFEH system as a queue) +//Make sure only one drop operation at a ACE_time (using PFEH system as a queue) if (_holder getVariable [QGVAR(holderInUse), false]) exitWith { [{ _this call FUNC(disarmDropItems); - }, _this, 0, 0] call EFUNC(common,waitAndExecute); + }, _this] call EFUNC(common,execNextFrame); }; _holder setVariable [QGVAR(holderInUse), true]; @@ -79,7 +79,7 @@ _holderMagazinesStart = magazinesAmmoCargo _holder; { EXPLODE_2_PVT(_x,_xClassname,_xAmmo); - if ((_xClassname in _listOfItemsToRemove) && {!(_xClassname in UNIQUE_MAGAZINES)}) then { + if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then { _holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo]; _target removeMagazine _xClassname; }; @@ -89,7 +89,7 @@ _targetMagazinesEnd = magazinesAmmo _target; _holderMagazinesEnd = magazinesAmmoCargo _holder; //Verify Mags dropped from unit: -if ( ({((_x select 0) in _listOfItemsToRemove) && {!((_x select 0) in UNIQUE_MAGAZINES)}} count _targetMagazinesEnd) != 0) exitWith { +if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish); }; @@ -102,7 +102,7 @@ if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holde //Remove Items, Assigned Items and NVG _holderItemsStart = getitemCargo _holder; -_targetItemsStart = (assignedItems _target) + (items _target); +_targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);}; @@ -132,7 +132,7 @@ _addToCrateCount = []; } forEach _addToCrateClassnames; _holderItemsEnd = getitemCargo _holder; -_targetItemsEnd = (assignedItems _target) + (items _target); +_targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);}; @@ -146,6 +146,16 @@ if ((([_holderItemsEnd select 1] call _fncSumArray) - ([_holderItemsStart select [_caller, _target, "Debug: Items Not Added to Holder"] call FUNC(eventTargetFinish); }; +//Script drop uniforms/vest if empty +if (((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove} && {(uniformItems _target) isEqualTo []}) then { + _holder addItemCargoGlobal [(uniform _target), 1]; + removeUniform _target; +}; +if (((vest _target) != "") && {(vest _target) in _listOfItemsToRemove} && {(vestItems _target) isEqualTo []}) then { + _holder addItemCargoGlobal [(vest _target), 1]; + removeVest _target; +}; + //If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place //So add a dummy item and just remove at the end @@ -168,7 +178,7 @@ if (_holderIsEmpty) then { _needToRemoveVest = ((vest _target) != "") && {(vest _target) in _listOfItemsToRemove}; _needToRemoveUniform = ((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove}; - if ((time < _maxWaitTime) && {[_target] call FUNC(canBeDisarmed)} && {_needToRemoveWeapon || _needToRemoveMagazines || _needToRemoveBackpack}) then { + if ((ACE_time < _maxWaitTime) && {[_target] call FUNC(canBeDisarmed)} && {_needToRemoveWeapon || _needToRemoveMagazines || _needToRemoveBackpack}) then { //action drop weapons (keeps loaded magazine and attachements) { if (_x in _listOfItemsToRemove) then { @@ -224,7 +234,7 @@ if (_holderIsEmpty) then { clearItemCargoGlobal _holder; }; //Verify we didn't timeout waiting on drop action - if (time >= _maxWaitTime) exitWith { + if (ACE_time >= _maxWaitTime) exitWith { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Drop Actions Timeout"] call FUNC(eventTargetFinish); }; @@ -254,4 +264,4 @@ if (_holderIsEmpty) then { [_caller, _target, ""] call FUNC(eventTargetFinish); }; -}, 0.0, [_caller,_target, _listOfItemsToRemove, _holder, _holderIsEmpty, (time + TIME_MAX_WAIT), _doNotDropAmmo, _targetMagazinesEnd]] call CBA_fnc_addPerFrameHandler; +}, 0.0, [_caller,_target, _listOfItemsToRemove, _holder, _holderIsEmpty, (ACE_time + TIME_MAX_WAIT), _doNotDropAmmo, _targetMagazinesEnd]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/disarming/functions/fnc_eventCallerFinish.sqf b/addons/disarming/functions/fnc_eventCallerFinish.sqf index c87cb434b3..d95be98d5f 100644 --- a/addons/disarming/functions/fnc_eventCallerFinish.sqf +++ b/addons/disarming/functions/fnc_eventCallerFinish.sqf @@ -22,4 +22,4 @@ PARAMS_3(_caller,_target,_errorMsg); if (_caller != ACE_player) exitWith {}; systemChat format ["Debug-Caller: Disarm finished from [%1] with code [%2]", _target, _errorMsg]; -diag_log text format ["[ACE_Disarming] %1 - eventCallerFinish: %2", time, _this]; +diag_log text format ["[ACE_Disarming] %1 - eventCallerFinish: %2", ACE_time, _this]; diff --git a/addons/disarming/functions/fnc_eventTargetFinish.sqf b/addons/disarming/functions/fnc_eventTargetFinish.sqf index 8cc67fa486..d702a554a5 100644 --- a/addons/disarming/functions/fnc_eventTargetFinish.sqf +++ b/addons/disarming/functions/fnc_eventTargetFinish.sqf @@ -21,6 +21,6 @@ PARAMS_3(_caller,_target,_errorMsg); if (_errorMsg != "") then { - diag_log text format ["[ACE_Disarming] %1 - eventTargetFinish: %2", time, _this]; + diag_log text format ["[ACE_Disarming] %1 - eventTargetFinish: %2", ACE_time, _this]; ["DisarmDebugCallback", [_caller], [_caller, _target, _errorMsg]] call EFUNC(common,targetEvent); }; diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index a319c006ee..99d4b2d7f2 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -19,7 +19,7 @@ PARAMS_1(_target); private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; -_allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target)); +_allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target); if ((backpack _target) != "") then { _allItems pushBack (backpack _target); diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index 5c809de4a2..b36e53e820 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -28,7 +28,7 @@ private ["_classname", "_count", "_displayName", "_picture"]; _classname = _x; _count = (_itemsCountArray select 1) select _forEachIndex; - if (_classname != DUMMY_ITEM) then { //Don't show the dummy potato + 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)): { @@ -53,8 +53,8 @@ private ["_classname", "_count", "_displayName", "_picture"]; }; _listBoxCtrl lbAdd format ["%1", _displayName]; - _listBoxCtrl lbSetData [_forEachIndex, _classname]; - _listBoxCtrl lbSetPicture [_forEachIndex, _picture]; - _listBoxCtrl lbSetTextRight [_forEachIndex, str _count]; + _listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname]; + _listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture]; + _listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count]; }; } forEach (_itemsCountArray select 0); diff --git a/addons/disarming/script_component.hpp b/addons/disarming/script_component.hpp index d9bec366dc..9a1ef9156b 100644 --- a/addons/disarming/script_component.hpp +++ b/addons/disarming/script_component.hpp @@ -13,4 +13,3 @@ #define DISARM_CONTAINER "GroundWeaponHolder" #define DUMMY_ITEM "ACE_DebugPotato" -#define UNIQUE_MAGAZINES ["ACE_key_customKeyMagazine"] \ No newline at end of file diff --git a/addons/disposable/CfgMagazines.hpp b/addons/disposable/CfgMagazines.hpp index 6265c06f50..484fa36238 100644 --- a/addons/disposable/CfgMagazines.hpp +++ b/addons/disposable/CfgMagazines.hpp @@ -1,10 +1,10 @@ class CfgMagazines { class NLAW_F; class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 1; scopeArsenal = 1; - displayName = "$STR_ACE_Disposable_PreloadedMissileDummy"; + displayName = CSTRING(PreloadedMissileDummy); picture = PATHTOEF(common,UI\blank_CO.paa); weaponPoolAvailable = 0; mass = 0; @@ -13,9 +13,9 @@ class CfgMagazines { count = 0; }; class ACE_UsedTube_F: NLAW_F { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Disposable_UsedTube"; - descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(UsedTube); + descriptionShort = CSTRING(UsedTubeDescription); displayNameShort = "-"; count = 0; weaponPoolAvailable = 0; diff --git a/addons/disposable/CfgWeapons.hpp b/addons/disposable/CfgWeapons.hpp index 965d97521c..0ca6763d63 100644 --- a/addons/disposable/CfgWeapons.hpp +++ b/addons/disposable/CfgWeapons.hpp @@ -7,9 +7,9 @@ class CfgWeapons { class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher scope = 1; ACE_isUsedLauncher = 1; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Disposable_UsedTube"; - descriptionShort = "$STR_ACE_Disposable_UsedTubeDescription"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(UsedTube); + descriptionShort = CSTRING(UsedTubeDescription); magazines[] = {"ACE_FiredMissileDummy"}; // This will disable the used launcher class from being fired again. //picture = ""; @todo //model = ""; @todo diff --git a/addons/disposable/script_component.hpp b/addons/disposable/script_component.hpp index 375e44147d..af1f17bd86 100644 --- a/addons/disposable/script_component.hpp +++ b/addons/disposable/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT disposable -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_ATTACH #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_ATTACH #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/disposable/stringtable.xml b/addons/disposable/stringtable.xml index 625bb6a542..2cbd8b0012 100644 --- a/addons/disposable/stringtable.xml +++ b/addons/disposable/stringtable.xml @@ -10,7 +10,7 @@ Lanzador utilizado Elhasznált kilövőcső Отстрелянная труба - Tubo utilizzato + Tubo usato Tubo utilizado @@ -22,7 +22,7 @@ Lanzador desechable utilizado Elhasznált eldobható rakétavető Отстрелянная одноразовая пусковая установка - Lanciarazzi monouso utilizzato + Lanciarazzi monouso già utilizzato Lança foguetes descartável utilizado @@ -34,8 +34,8 @@ Precargado misil inerte Előtöltött műrakéta Предзаряженная ракетная болванка - Missile stupido precaricato + Missile inerte precaricato Míssel inerte pré-carregado - \ No newline at end of file + diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index ee72dc9aa7..bb413d8240 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -58,7 +58,7 @@ if (_actionID != -1) then { }; _actionID = _unit addAction [ - format ["%1", localize "STR_ACE_Dragging_Drop"], + format ["%1", localize LSTRING(Drop)], QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)), nil, 20, diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index f3a9329d35..3ad1f89f77 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING - systemChat format ["%1 carryObjectPFH running", time]; + systemChat format ["%1 carryObjectPFH running", ACE_time]; #endif private ["_unit", "_target"]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 35f8687ed0..e4b200c4dd 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -49,7 +49,7 @@ if (_actionID != -1) then { }; _actionID = _unit addAction [ - format ["%1", localize "STR_ACE_Dragging_Drop"], + format ["%1", localize LSTRING(Drop)], QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)), nil, 20, diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 8af8e62b90..465107af39 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING - systemChat format ["%1 dragObjectPFH running", time]; + systemChat format ["%1 dragObjectPFH running", ACE_time]; #endif private ["_unit", "_target"]; diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index bc6da1f04d..52c6e5643a 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -14,7 +14,8 @@ */ #include "script_component.hpp" -private ["_object", "_enableCarry", "_position", "_direction"]; +private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); _this resize 4; @@ -48,8 +49,8 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses_carry) = _initializedClasses; -_carryAction = [QGVAR(carry), localize "STR_ACE_Dragging_Carry", "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); -_dropAction = [QGVAR(drop_carry), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); +_carryAction = [QGVAR(carry), localize LSTRING(Carry), "", {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); +_dropAction = [QGVAR(drop_carry), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index da2d0310b4..7745bd2d3e 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -14,7 +14,8 @@ */ #include "script_component.hpp" -private ["_object", "_enableDrag", "_position", "_direction"]; +private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); _this resize 4; @@ -48,8 +49,8 @@ if (_type in _initializedClasses) exitWith {}; _initializedClasses pushBack _type; GVAR(initializedClasses) = _initializedClasses; -_dragAction = [QGVAR(drag), localize "STR_ACE_Dragging_Drag", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction); -_dropAction = [QGVAR(drop), localize "STR_ACE_Dragging_Drop", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction); +_dragAction = [QGVAR(drag), localize LSTRING(Drag), "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction); +_dropAction = [QGVAR(drop), localize LSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index ff201afb02..5521bec375 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -22,11 +22,11 @@ private "_weight"; _weight = [_target] call FUNC(getWeight); if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { - [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); + [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; private "_timer"; -_timer = time + 5; +_timer = ACE_time + 5; // handle objects vs persons if (_target isKindOf "CAManBase") then { @@ -41,12 +41,12 @@ if (_target isKindOf "CAManBase") then { // move a bit closer and adjust direction when trying to pick up a person _target setDir (getDir _unit + 180); - _target setPos (getPos _unit vectorAdd vectorDir _unit); + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit)); [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2, true] call EFUNC(common,doAnimation); [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2, true] call EFUNC(common,doAnimation); - _timer = time + 15; + _timer = ACE_time + 15; } else { @@ -62,7 +62,7 @@ if (_target isKindOf "CAManBase") then { [_unit, _target, true] call EFUNC(common,claim); -// prevents draging and carrying at the same time +// prevents draging and carrying at the same ACE_time _unit setVariable [QGVAR(isCarrying), true, true]; // required for aborting animation diff --git a/addons/dragging/functions/fnc_startCarryPFH.sqf b/addons/dragging/functions/fnc_startCarryPFH.sqf index d98522c5f2..47824a8e76 100644 --- a/addons/dragging/functions/fnc_startCarryPFH.sqf +++ b/addons/dragging/functions/fnc_startCarryPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING - systemChat format ["%1 startCarryPFH running", time]; + systemChat format ["%1 startCarryPFH running", ACE_time]; #endif private ["_unit", "_target", "_timeOut"]; @@ -24,13 +24,13 @@ if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10} // handle persons vs objects if (_target isKindOf "CAManBase") then { - if (time > _timeOut) exitWith { + if (ACE_time > _timeOut) exitWith { [_unit, _target] call FUNC(carryObject); [_this select 1] call CBA_fnc_removePerFrameHandler; }; } else { - if (time > _timeOut) exitWith { + if (ACE_time > _timeOut) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; // drop if in timeout diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index fbf0f4608c..1d4eb9a158 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -22,7 +22,7 @@ private "_weight"; _weight = [_target] call FUNC(getWeight); if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { - [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); + [localize LSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); }; // add a primary weapon if the unit has none. @@ -43,12 +43,12 @@ _unit selectWeapon primaryWeapon _unit; // move a bit closer and adjust direction when trying to pick up a person if (_target isKindOf "CAManBase") then { _target setDir (getDir _unit + 180); - _target setPos (getPos _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); [_target, "AinjPpneMrunSnonWnonDb_grab", 2, true] call EFUNC(common,doAnimation); }; -// prevents draging and carrying at the same time +// prevents draging and carrying at the same ACE_time _unit setVariable [QGVAR(isDragging), true, true]; -[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler; +[FUNC(startDragPFH), 0.2, [_unit, _target, ACE_time + 5]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf index d77a23457e..65cf0a2431 100644 --- a/addons/dragging/functions/fnc_startDragPFH.sqf +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" #ifdef DEBUG_ENABLED_DRAGGING - systemChat format ["%1 startDragPFH running", time]; + systemChat format ["%1 startDragPFH running", ACE_time]; #endif private ["_unit", "_target", "_timeOut"]; @@ -22,8 +22,8 @@ if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10} [_this select 1] call CBA_fnc_removePerFrameHandler; }; -// timeout. Do nothing. Quit. time, because anim length is linked to ingame time. -if (time > _timeOut) exitWith { +// 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; // drop if in timeout diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml index dd2e11f72b..d1eb18d6b4 100644 --- a/addons/dragging/stringtable.xml +++ b/addons/dragging/stringtable.xml @@ -32,7 +32,7 @@ Przedmiot jest zbyt ciężki Objet trop lourd Objeto muito pesado - Non è possibile trascinare l'oggetto a causa del suo peso + L'oggetto pesa troppo Предмет слишком тяжёлый Moc težké Az objektum túl nehéz @@ -45,8 +45,8 @@ Porter Nést Carregar - Trascina Felvevés + Trasporta Нести diff --git a/addons/explosives/ACE_Settings.hpp b/addons/explosives/ACE_Settings.hpp new file mode 100644 index 0000000000..ef6a723d5b --- /dev/null +++ b/addons/explosives/ACE_Settings.hpp @@ -0,0 +1,16 @@ +class ACE_Settings { + class GVAR(RequireSpecialist) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(PunishNonSpecialists) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(ExplodeOnDefuse) { + displayName = CSTRING(ExplodeOnDefuse_DisplayName); + description = CSTRING(ExplodeOnDefuse_Description); + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/explosives/ACE_Triggers.hpp b/addons/explosives/ACE_Triggers.hpp index 9c33246cd8..5df3d005bc 100644 --- a/addons/explosives/ACE_Triggers.hpp +++ b/addons/explosives/ACE_Triggers.hpp @@ -9,45 +9,45 @@ onSetup parameters: 0: STRING - Magazine Classname */ class Command { - displayName = $STR_ACE_Explosives_clacker_displayName; + displayName = CSTRING(clacker_displayName); picture = PATHTOF(Data\UI\Clacker.paa); onPlace = QUOTE(_this call FUNC(AddClacker);false); requires[] = {"ACE_Clacker"}; }; class MK16_Transmitter:Command { - displayName = $STR_ACE_Explosives_MK16_displayName; + displayName = CSTRING(MK16_displayName); picture = PATHTOF(Data\UI\MK16_Reciever_ca.paa); requires[] = {"ACE_M26_Clacker"}; }; class DeadManSwitch:Command { - displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; + displayName = CSTRING(DeadManSwitch_displayName); picture = PATHTOF(Data\UI\DeadmanSwitch.paa); requires[] = {"ACE_DeadManSwitch"}; }; class Cellphone:Command { - displayName = $STR_ACE_Explosives_cellphone_displayName; + displayName = CSTRING(cellphone_displayName); picture = PATHTOF(Data\UI\Cellphone_UI.paa); onPlace = QUOTE(_this call FUNC(addCellphoneIED);false); requires[] = {"ACE_Cellphone"}; }; class PressurePlate { - displayName = $STR_ACE_Explosives_PressurePlate; + 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"; }; class IRSensor { - displayName = $STR_ACE_Explosives_IRSensor; + displayName = CSTRING(IRSensor); picture = PATHTOF(Data\UI\PressurePlate.paa); onPlace = "false"; }; class Timer { - displayName = $STR_ACE_Explosives_timerName; + 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 { - displayName = $STR_ACE_Explosives_TripWire; + displayName = CSTRING(TripWire); picture = PATHTOF(Data\UI\Tripwire.paa); onPlace = "false"; }; diff --git a/addons/explosives/CfgAmmo.hpp b/addons/explosives/CfgAmmo.hpp index fc9e4712dc..8299a979b3 100644 --- a/addons/explosives/CfgAmmo.hpp +++ b/addons/explosives/CfgAmmo.hpp @@ -2,85 +2,119 @@ class CfgAmmo { // All explosive based Ammo classes. These are all listed in case they become required. class Default; - class TimeBombCore:Default { + class TimeBombCore: Default { ACE_DefuseTime = 5; }; /* - class BoundingMineCore:TimeBombCore; - class BoundingMineBase:BoundingMineCore; - class APERSBoundingMine_Range_Ammo:BoundingMineBase; + class BoundingMineCore: TimeBombCore; + class BoundingMineBase: BoundingMineCore; + class APERSBoundingMine_Range_Ammo: BoundingMineBase; class MineCore: TimeBombCore; - class MineBase:MineCore; - class APERSMine_Range_Ammo:MineBase; - class ATMine_Range_Ammo:MineBase; + class MineBase: MineCore; + class APERSMine_Range_Ammo: MineBase; + class ATMine_Range_Ammo: MineBase; - class UnderwaterMine_Range_Ammo:MineBase; - class UnderwaterMineAB_Range_Ammo:UnderwaterMine_Range_Ammo; - class UnderwaterMinePDM_Range_Ammo:UnderwaterMine_Range_Ammo; + class UnderwaterMine_Range_Ammo: MineBase; + class UnderwaterMineAB_Range_Ammo: UnderwaterMine_Range_Ammo; + class UnderwaterMinePDM_Range_Ammo: UnderwaterMine_Range_Ammo; - class DirectionalBombCore:TimeBombCore; - class DirectionalBombBase:DirectionalBombCore; - class APERSTripMine_Wire_Ammo:DirectionalBombBase; + class DirectionalBombCore: TimeBombCore; + class DirectionalBombBase: DirectionalBombCore; + class APERSTripMine_Wire_Ammo: DirectionalBombBase; - class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase; + class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase; class PipeBombCore: TimeBombCore; - class PipeBombBase:PipeBombCore; + class PipeBombBase: PipeBombCore; */ class DirectionalBombBase; - class ClaymoreDirectionalMine_Remote_Ammo:DirectionalBombBase{ + class ClaymoreDirectionalMine_Remote_Ammo: DirectionalBombBase { ACE_Explosive = "ClaymoreDirectionalMine_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; + soundActivation[] = {"", 0, 0, 0}; + soundDeactivation[] = {"", 0, 0, 0}; }; - //class ClaymoreDirectionalMine_Remote_Ammo_Scripted:ClaymoreDirectionalMine_Remote_Ammo; + //class ClaymoreDirectionalMine_Remote_Ammo_Scripted: ClaymoreDirectionalMine_Remote_Ammo; - class SLAMDirectionalMine_Wire_Ammo:DirectionalBombBase{ + class SLAMDirectionalMine_Wire_Ammo: DirectionalBombBase { indirectHitRange = 20; ACE_explodeOnDefuse = 1; }; - class SLAMDirectionalMine_Command_Ammo:SLAMDirectionalMine_Wire_Ammo { + class SLAMDirectionalMine_Command_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "RemoteTrigger"; ACE_explodeOnDefuse = 0; }; - class SLAMDirectionalMine_Timer_Ammo:SLAMDirectionalMine_Wire_Ammo { + class SLAMDirectionalMine_Timer_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "TimeTrigger"; ACE_explodeOnDefuse = 0; }; - class SLAMDirectionalMine_Magnetic_Ammo:SLAMDirectionalMine_Wire_Ammo { + class SLAMDirectionalMine_Magnetic_Ammo: SLAMDirectionalMine_Wire_Ammo { mineTrigger = "MagneticTrigger"; }; class PipeBombBase; - class DemoCharge_Remote_Ammo:PipeBombBase{ + class DemoCharge_Remote_Ammo: PipeBombBase { ACE_Explosive = "DemoCharge_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; + soundActivation[] = {"", 0, 0, 0}; + soundDeactivation[] = {"", 0, 0, 0}; hit = 500; indirectHit = 500; indirectHitRange = 7; }; - class SatchelCharge_Remote_Ammo:PipeBombBase{ + class SatchelCharge_Remote_Ammo: PipeBombBase { ACE_Explosive = "SatchelCharge_Remote_Ammo_Scripted"; - soundActivation[] = {"",0,0,0}; - soundDeactivation[] = {"",0,0,0}; + soundActivation[] = {"", 0, 0, 0}; + soundDeactivation[] = {"", 0, 0, 0}; + }; + + /*class DemoCharge_Remote_Ammo_Scripted: DemoCharge_Remote_Ammo; + class SatchelCharge_Remote_Ammo_Scripted: SatchelCharge_Remote_Ammo;*/ + + class IEDUrbanBig_Remote_Ammo: PipeBombBase { + triggerWhenDestroyed = 1; + ACE_explodeOnDefuse = 0.02; + soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; + }; + class IEDUrbanBig_Command_Ammo: IEDUrbanBig_Remote_Ammo { + mineTrigger = "RemoteTrigger"; + }; + class IEDUrbanBig_Range_Ammo: IEDUrbanBig_Remote_Ammo { + mineTrigger = "RangeTrigger"; + }; + + class IEDUrbanSmall_Remote_Ammo: PipeBombBase { + triggerWhenDestroyed = 1; + ACE_explodeOnDefuse = 0.02; + soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; + }; + class IEDUrbanSmall_Command_Ammo: IEDUrbanSmall_Remote_Ammo { + mineTrigger = "RemoteTrigger"; + }; + class IEDUrbanSmall_Range_Ammo: IEDUrbanSmall_Remote_Ammo { + mineTrigger = "RangeTrigger"; + }; + + class IEDLandBig_Remote_Ammo: PipeBombBase { + triggerWhenDestroyed = 1; + ACE_explodeOnDefuse = 0.02; + soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; + }; + class IEDLandBig_Command_Ammo: IEDLandBig_Remote_Ammo { + mineTrigger = "RemoteTrigger"; + }; + class IEDLandBig_Range_Ammo: IEDLandBig_Remote_Ammo { + mineTrigger = "RangeTrigger"; + }; + + class IEDLandSmall_Remote_Ammo: PipeBombBase { + triggerWhenDestroyed = 1; + ACE_explodeOnDefuse = 0.02; + soundTrigger[] = {"A3\Sounds_F\weapons\mines\mech_trigger_1", 0.8, 1, 40}; + }; + class IEDLandSmall_Command_Ammo: IEDLandSmall_Remote_Ammo { + mineTrigger = "RemoteTrigger"; + }; + class IEDLandSmall_Range_Ammo: IEDLandSmall_Remote_Ammo { + mineTrigger = "RangeTrigger"; }; - /* - class DemoCharge_Remote_Ammo_Scripted:DemoCharge_Remote_Ammo; - class SatchelCharge_Remote_Ammo_Scripted:SatchelCharge_Remote_Ammo; - -TODO: Configure IEDs to use the system. - class IEDLandBig_Remote_Ammo:PipeBombBase{ - triggerWhenDestroyed = 1; -}; -class IEDLandSmall_Remote_Ammo:PipeBombBase{ -triggerWhenDestroyed = 1; -}; -class IEDUrbanBig_Remote_Ammo:PipeBombBase{ -triggerWhenDestroyed = 1; -}; -class IEDUrbanSmall_Remote_Ammo:PipeBombBase{ -triggerWhenDestroyed = 1; -};*/ }; diff --git a/addons/explosives/CfgEventHandlers.hpp b/addons/explosives/CfgEventHandlers.hpp index 8d0b110935..89e3017e8a 100644 --- a/addons/explosives/CfgEventHandlers.hpp +++ b/addons/explosives/CfgEventHandlers.hpp @@ -9,12 +9,19 @@ class Extended_PostInit_EventHandlers { }; }; -/* -TODO: Move the addEventHandlers out of PostInit into here or separate eventHandlers, -to enable them on all units, so unit switching works for explosives properly. -class Extended_Init_EventHandlers { -class CAManBase { -init = ""; -} -} -*/ +class Extended_Killed_EventHandlers { + class CAManBase { + GVAR(killedHandler) = QUOTE(_this call FUNC(onKilled)); + }; +}; + +class Extended_Take_EventHandlers { + class CAManBase { + GVAR(takeHandler) = QUOTE([ARR_3(_this select 0, _this select 1, _this select 2)] call FUNC(onInventoryChanged)); + }; +}; +class Extended_Put_EventHandlers { + class CAManBase { + GVAR(takeHandler) = QUOTE([ARR_3(_this select 1, _this select 0, _this select 2)] call FUNC(onInventoryChanged)); + }; +}; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index b89a207992..39d08917c3 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -1,6 +1,6 @@ class CfgMagazines { class CA_Magazine; - class ATMine_Range_Mag:CA_Magazine{ + class ATMine_Range_Mag: CA_Magazine { ACE_Placeable = 1; useAction = 0; ACE_SetupObject = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. @@ -12,7 +12,7 @@ class CfgMagazines { }; }; }; - class APERSBoundingMine_Range_Mag:ATMine_Range_Mag{ + class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { ACE_SetupObject = "ACE_Explosives_Place_APERSBoundingMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -21,7 +21,7 @@ class CfgMagazines { }; }; }; - class APERSMine_Range_Mag:ATMine_Range_Mag{ + class APERSMine_Range_Mag: ATMine_Range_Mag { ACE_SetupObject = "ACE_Explosives_Place_APERSMine"; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; @@ -30,7 +30,7 @@ class CfgMagazines { }; }; }; - class APERSTripMine_Wire_Mag:ATMine_Range_Mag{ + class APERSTripMine_Wire_Mag: ATMine_Range_Mag { ACE_SetupObject = "ACE_Explosives_Place_APERSTripwireMine"; class ACE_Triggers { SupportedTriggers[] = {"Tripwire"}; @@ -38,20 +38,21 @@ class CfgMagazines { }; }; - class ClaymoreDirectionalMine_Remote_Mag:CA_Magazine{ + class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { ACE_Placeable = 1; useAction = 0; ACE_SetupObject = "ACE_Explosives_Place_Claymore"; ACE_DelayTime = 1.5; class ACE_Triggers { - SupportedTriggers[] = {"Command"}; + SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { - FuseTime = 0.5; + FuseTime = 0.5; }; + class MK16_Transmitter: Command {}; }; }; - class SatchelCharge_Remote_Mag:CA_Magazine{ + class SatchelCharge_Remote_Mag: CA_Magazine { ACE_Placeable = 1; useAction = 0; ACE_SetupObject = "ACE_Explosives_Place_SatchelCharge"; @@ -64,27 +65,27 @@ class CfgMagazines { class Command { FuseTime = 0.5; }; - class MK16_Transmitter:Command{}; - class DeadmanSwitch:Command{}; + class MK16_Transmitter: Command {}; + class DeadmanSwitch: Command {}; }; }; - class DemoCharge_Remote_Mag:SatchelCharge_Remote_Mag{ + class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_DemoCharge"; model = "\A3\Weapons_F\explosives\c4_charge_small_d"; }; - class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag{ + class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { ACE_SetupObject = "ACE_Explosives_Place_SLAM"; class ACE_Triggers { SupportedTriggers[] = {"IRSensor","PressurePlate","Timer","Command"}; class PressurePlate{ - displayName = $STR_ACE_Explosives_SLAME_Magnetic; + displayName = CSTRING(SLAME_Magnetic); digDistance = 0; ammo = "SLAMDirectionalMine_Magnetic_Ammo"; pitch = 90; }; class IRSensor{ - displayName = $STR_ACE_Explosives_SLAME_IRSensor; + displayName = CSTRING(SLAME_IRSensor); }; class Timer { ammo = "SLAMDirectionalMine_Timer_Ammo"; @@ -95,33 +96,64 @@ class CfgMagazines { }; }; }; - + class IEDUrbanBig_Remote_Mag: DemoCharge_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanBig"; class ACE_Triggers { - SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Command { FuseTime = 0.5; + ammo = "IEDUrbanBig_Command_Ammo"; }; - class DeadmanSwitch:Command{}; - class Cellphone:Command{}; - }; + class DeadmanSwitch:Command {}; + class Cellphone:Command {}; + class PressurePlate { + displayName = CSTRING(PressurePlate); + digDistance = 0; + ammo = "IEDUrbanBig_Range_Ammo"; + pitch = 0; + }; + }; }; - class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag{ + + class IEDLandBig_Remote_Mag: IEDUrbanBig_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDLandBig"; + class ACE_Triggers: ACE_Triggers { + class Command: Command { + ammo = "IEDLandBig_Command_Ammo"; + }; + class PressurePlate: PressurePlate { + ammo = "IEDLandBig_Range_Ammo"; + }; + }; }; class IEDUrbanSmall_Remote_Mag: DemoCharge_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDUrbanSmall"; class ACE_Triggers { - SupportedTriggers[] = {"Command","DeadmanSwitch", "Cellphone"}; + SupportedTriggers[] = {"Command", "DeadmanSwitch", "Cellphone", "PressurePlate"}; class Command { FuseTime = 0.5; + ammo = "IEDUrbanSmall_Command_Ammo"; + }; + class DeadmanSwitch: Command {}; + class Cellphone: Command {}; + class PressurePlate { + displayName = CSTRING(PressurePlate); + digDistance = 0; + ammo = "IEDUrbanSmall_Range_Ammo"; + pitch = 0; }; - class DeadmanSwitch:Command{}; - class Cellphone:Command{}; }; }; class IEDLandSmall_Remote_Mag: IEDUrbanSmall_Remote_Mag { ACE_SetupObject = "ACE_Explosives_Place_IEDLandSmall"; + class ACE_Triggers: ACE_Triggers { + class Command: Command { + ammo = "IEDLandSmall_Command_Ammo"; + }; + class PressurePlate: PressurePlate { + ammo = "IEDLandSmall_Range_Ammo"; + }; + }; }; }; diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index b4f7b65a83..239ecd4e17 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -1,44 +1,33 @@ -class Module_F; -class ACE_ModuleExplosive: Module_F { - author = "$STR_ACE_Common_ACETeam"; +class ACE_Module; +class ACE_ModuleExplosive: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Explosive System"; + displayName = CSTRING(Module_DisplayName); function = QUOTE(FUNC(module)); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa); class Arguments { class RequireSpecialist { - displayName = "Require specialists?"; - description = "Require explosive specialists to disable explosives? Default: No"; + displayName = CSTRING(RequireSpecialist_DisplayName); + description = CSTRING(RequireSpecialist_Description); typeName = "BOOL"; - class values { - class Yes { - name = "Yes"; - value = 1; - }; - class No { - default = 1; - name = "No"; - value = 0; - }; - }; + defaultValue = 0; }; class PunishNonSpecialists { - displayName = "Punish non-specialists?"; - description = "Increase the time it takes to complete actions for non-specialists? Default: Yes"; + displayName = CSTRING(PunishNonSpecialists_DisplayName); + description = CSTRING(PunishNonSpecialists_Description); typeName = "BOOL"; - class values { - class Yes { - default = 1; - name = "Yes"; - value = 1; - }; - class No { - name = "No"; - value = 0; - }; - }; + defaultValue = 1; + }; + class ExplodeOnDefuse { + displayName = "$STR_ACE_Explosive_ExplodeOnDefuse_DisplayName"; + description = "$STR_ACE_Explosive_ExplodeOnDefuse_Description"; + typeName = "BOOL"; + defaultValue = 1; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; diff --git a/addons/explosives/CfgVehicles.hpp b/addons/explosives/CfgVehicles.hpp index 30e1ff151d..7a51a7d765 100644 --- a/addons/explosives/CfgVehicles.hpp +++ b/addons/explosives/CfgVehicles.hpp @@ -3,28 +3,28 @@ class CfgVehicles { class CAManBase: Man { class ACE_SelfActions { class ACE_Explosives { - displayName = $STR_ACE_Explosives_Menu; + displayName = CSTRING(Menu); condition = QUOTE(!(_player getVariable [ARR_2('ace_explosives_PlantingExplosive',false)])); statement = ""; - exceptions[] = {"isNotSwimming", "isNotInside"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 4; icon = PATHTOF(UI\Explosives_Menu_ca.paa); hotkey = "X"; //Sub-menu items class ACE_Detonate { - displayName = $STR_ACE_Explosives_Detonate; + displayName = CSTRING(Detonate); condition = QUOTE([_player] call FUNC(canDetonate)); statement = ""; insertChildren = QUOTE([_player] call FUNC(addTransmitterActions);); - exceptions[] = {"isNotSwimming", "isNotInside"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 1; icon = PATHTOF(UI\Explosives_Menu_ca.paa); priority = 2; hotkey = "T"; }; class ACE_Place { - displayName = $STR_ACE_Explosives_Place; + displayName = CSTRING(Place); condition = QUOTE((vehicle _player == _player) and {[_player] call FUNC(hasExplosives)}); statement = ""; insertChildren = QUOTE([_player] call FUNC(addExplosiveActions);); @@ -35,10 +35,10 @@ class CfgVehicles { hotkey = "P"; }; class ACE_Cellphone { - displayName = $STR_ACE_Explosives_cellphone_displayName; + displayName = CSTRING(cellphone_displayName); condition = "('ACE_Cellphone' in (items ace_player))"; statement = "closeDialog 0;createDialog 'Rsc_ACE_PhoneInterface';"; - exceptions[] = {"isNotSwimming", "isNotInside"}; + exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; showDisabled = 0; icon = PATHTOF(Data\UI\Cellphone_UI.paa); priority = 0.8; @@ -65,7 +65,7 @@ class CfgVehicles { distance = 5; condition = "true"; class ACE_Defuse { - displayName = $STR_ACE_Explosives_Defuse; + displayName = CSTRING(Defuse); condition = QUOTE([ARR_2(_player,_target)] call FUNC(canDefuse)); statement = QUOTE([ARR_2(_player,_target)] call FUNC(startDefuse);); exceptions[] = {"isNotSwimming"}; @@ -97,24 +97,24 @@ class CfgVehicles { condition = "true"; class ACE_SetTrigger { selection = ""; - displayName = "$STR_ACE_Explosives_TriggerMenu"; + displayName = CSTRING(TriggerMenu); distance = 4; condition = "true"; statement = ""; insertChildren = QUOTE([ARR_3(_target getVariable QUOTE(QGVAR(class)),_target,_player)] call FUNC(addTriggerActions);); showDisabled = 0; - exceptions[] = {}; + exceptions[] = {"isNotSwimming"}; priority = 5; icon = QUOTE(PATHTOF(UI\Explosives_Menu_ca.paa)); }; class ACE_PickUp { selection = ""; - displayName = "$STR_ACE_Explosives_Pickup"; + displayName = CSTRING(Pickup); distance = 4; condition = "true"; statement = QUOTE([ARR_2(_player,_target getVariable QUOTE(QGVAR(class)))] call EFUNC(common,addToInventory);deleteVehicle _target;); showDisabled = 0; - exceptions[] = {}; + exceptions[] = {"isNotSwimming"}; priority = 5; icon = "\A3\ui_f\data\IGUI\Cfg\Actions\Obsolete\ui_action_takemine_ca.paa"; }; diff --git a/addons/explosives/CfgWeapons.hpp b/addons/explosives/CfgWeapons.hpp index a90b4d515f..7768515953 100644 --- a/addons/explosives/CfgWeapons.hpp +++ b/addons/explosives/CfgWeapons.hpp @@ -9,8 +9,8 @@ class CfgWeapons { class ACE_Clacker: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Explosives_clacker_displayName; - descriptionShort = $STR_ACE_Explosives_clacker_description; + displayName = CSTRING(clacker_displayName); + descriptionShort = CSTRING(clacker_description); picture = PATHTOF(Data\UI\Clacker.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; ACE_Range = 250; @@ -22,14 +22,14 @@ class CfgWeapons { }; }; class ACE_M26_Clacker: ACE_Clacker { - displayName = $STR_ACE_Explosives_M26_displayName; + displayName = CSTRING(M26_displayName); picture = PATHTOF(Data\UI\MK26_Transmitter_ca.paa); ACE_Range = 5000; }; class ACE_DefusalKit: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Explosives_DefusalKit_displayName; - descriptionShort = $STR_ACE_Explosives_DefusalKit_description; + displayName = CSTRING(DefusalKit_displayName); + descriptionShort = CSTRING(DefusalKit_description); picture = PATHTOF(Data\UI\Pliers.paa); model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d"; @@ -40,8 +40,8 @@ class CfgWeapons { }; class ACE_DeadManSwitch: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Explosives_DeadManSwitch_displayName; - descriptionShort = $STR_ACE_Explosives_DeadManSwitch_description; + displayName = CSTRING(DeadManSwitch_displayName); + descriptionShort = CSTRING(DeadManSwitch_description); picture = PATHTOF(Data\UI\DeadmanSwitch.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; ACE_Range = 100; @@ -54,8 +54,8 @@ class CfgWeapons { }; class ACE_Cellphone: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Explosives_cellphone_displayName; - descriptionShort = $STR_ACE_Explosives_cellphone_description; + displayName = CSTRING(cellphone_displayName); + descriptionShort = CSTRING(cellphone_description); picture = PATHTOF(Data\UI\Cellphone_UI.paa); model = "\A3\weapons_F\ammo\mag_univ.p3d"; ACE_Range = 15000; diff --git a/addons/explosives/ExplosivesUI.hpp b/addons/explosives/ExplosivesUI.hpp index 6871f95f92..6e6374af12 100644 --- a/addons/explosives/ExplosivesUI.hpp +++ b/addons/explosives/ExplosivesUI.hpp @@ -15,7 +15,7 @@ class RscEdit; class Rsc_ACE_CallScreen_Edit:RscEdit { canModify = 1; - colorBackground[] = {0,0,0,1}; + colorBackground[] = {0,0,0,0}; colorText[] = {0,0,0,1}; colorDisabled[] = {1,1,1,0.25}; colorSelection[] = { @@ -89,7 +89,7 @@ class RscACE_SelectTimeUI { h = 0.1; y = 0.09; style = ST_CENTER; - text = $STR_ACE_Explosives_Cancel; + text = CSTRING(Cancel); action = "closeDialog 0;"; }; class approveBtn: RscButton { @@ -99,7 +99,7 @@ class RscACE_SelectTimeUI { h = 0.1; w = 0.15; style = ST_CENTER; - text = $STR_ACE_Explosives_SetTime; + text = CSTRING(SetTime); action = "closeDialog 0;"; }; }; @@ -215,7 +215,7 @@ class Rsc_ACE_PhoneInterface { y = 0.676 * safezoneH + safezoneY; w = 0.0309375 * safezoneW; h = 0.033 * safezoneH; - tooltip = "$STR_ACE_Explosives_Phone_AddToSpeedDial"; + tooltip = CSTRING(Phone_AddToSpeedDial); action = QUOTE([ARR_2(ctrlText 1401,ctrlText 1400)] call FUNC(addToSpeedDial);); }; class clear: Rsc_ACE_HiddenButton { @@ -224,7 +224,7 @@ class Rsc_ACE_PhoneInterface { y = 0.445 * safezoneH + safezoneY; w = 0.020625 * safezoneW; h = 0.033 * safezoneH; - tooltip = "$STR_ACE_Explosives_Clear"; + tooltip = CSTRING(Clear); action = QUOTE(ctrlSetText [ARR_2(1400,'')];[ctrlText 1401] call FUNC(removeFromSpeedDial);ctrlSetText [ARR_2(1401,'')];); }; class dial: Rsc_ACE_HiddenButton { @@ -233,7 +233,7 @@ class Rsc_ACE_PhoneInterface { y = 0.445 * safezoneH + safezoneY; w = 0.04125 * safezoneW; h = 0.033 * safezoneH; - tooltip = "$STR_ACE_Explosives_Phone_Dial"; + tooltip = CSTRING(Phone_Dial); action = QUOTE([ARR_2(ace_player,ctrlText 1400)] call FUNC(dialPhone);); }; class up: Rsc_ACE_HiddenButton { @@ -242,7 +242,7 @@ class Rsc_ACE_PhoneInterface { y = 0.445 * safezoneH + safezoneY; w = 0.020625 * safezoneW; h = 0.033 * safezoneH; - tooltip = "$STR_ACE_Explosives_Phone_Up"; + tooltip = CSTRING(Phone_Up); action = QUOTE([true] call FUNC(setSpeedDial)); }; class down: Rsc_ACE_HiddenButton { @@ -251,7 +251,7 @@ class Rsc_ACE_PhoneInterface { y = 0.485 * safezoneH + safezoneY; w = 0.020625 * safezoneW; h = 0.033 * safezoneH; - tooltip = "$STR_ACE_Explosives_Phone_Down"; + tooltip = CSTRING(Phone_Down); action = QUOTE([false] call FUNC(setSpeedDial)); }; class speedDial_Text: RscText { diff --git a/addons/explosives/XEH_postInit.sqf b/addons/explosives/XEH_postInit.sqf index 998f73ccaf..27a4703906 100644 --- a/addons/explosives/XEH_postInit.sqf +++ b/addons/explosives/XEH_postInit.sqf @@ -14,7 +14,11 @@ * Public: No */ #include "script_component.hpp" + if !(hasInterface) exitWith {}; + +["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); + GVAR(PlacedCount) = 0; GVAR(Setup) = objNull; GVAR(pfeh_running) = false; @@ -28,47 +32,3 @@ GVAR(CurrentSpeedDial) = 0; }] call EFUNC(common,addEventHandler); [{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); -player addEventHandler ["Killed", { - private "_deadman"; - call FUNC(place_Cancel); - _deadman = [(_this select 0), "DeadManSwitch"] call FUNC(getPlacedExplosives); - { - [(_this select 0), -1, _x, true] call FUNC(detonateExplosive); - } count _deadman; -}]; -player addEventHandler ["Take", { - private ["_item", "_getter", "_giver", "_config", "_detonators"]; - _item = _this select 2; - _getter = _this select 0; - _giver = _this select 1; - - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; -}]; -player addEventHandler ["Put", { - private ["_item", "_getter", "_giver", "_config"]; - _item = _this select 2; - _getter = _this select 1; - _giver = _this select 0; - - _config = ConfigFile >> "CfgWeapons" >> _item; - if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { - private ["_clackerItems"]; - _clackerItems = _giver getVariable [QGVAR(Clackers), []]; - _getter SetVariable [QGVAR(Clackers), (_getter getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; - - _detonators = [_giver] call FUNC(getDetonators); - if (count _detonators == 0) then { - _giver setVariable [QGVAR(Clackers), nil, true]; - }; - }; -}]; diff --git a/addons/explosives/XEH_preInit.sqf b/addons/explosives/XEH_preInit.sqf index 435624d2a5..b3888e1535 100644 --- a/addons/explosives/XEH_preInit.sqf +++ b/addons/explosives/XEH_preInit.sqf @@ -36,10 +36,16 @@ PREP(handleScrollWheel); PREP(hasExplosives); PREP(hasPlacedExplosives); +PREP(interactEH); + PREP(getDetonators); PREP(getPlacedExplosives); PREP(getSpeedDialExplosive); +PREP(module); + +PREP(onInventoryChanged); +PREP(onKilled); PREP(onLanded); PREP(openTimerSetUI); diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index e77d2bf624..873c4e0dc3 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -40,13 +40,4 @@ class CfgMineTriggers { }; }; -class ACE_Settings { - class GVAR(RequireSpecialist) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(PunishNonSpecialists) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index b25c1e1bcd..d22b15eef4 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -37,8 +37,8 @@ _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> co _clacker = _unit getVariable [QGVAR(Clackers), []]; GVAR(PlacedCount) = GVAR(PlacedCount) + 1; -_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize "STR_ACE_Explosives_DetonateCode", +_clacker pushBack [_explosive, getNumber(_config >> "FuseTime"), format [localize LSTRING(DetonateCode), GVAR(PlacedCount)], _magazineClass, configName ((_this select 3) select (count (_this select 3) - 1))]; _unit setVariable [QGVAR(Clackers), _clacker, true]; -_unit sideChat format [localize "STR_ACE_Explosives_DetonateCode", GVAR(PlacedCount)]; +_unit sideChat format [localize LSTRING(DetonateCode), GVAR(PlacedCount)]; diff --git a/addons/explosives/functions/fnc_defuseExplosive.sqf b/addons/explosives/functions/fnc_defuseExplosive.sqf index 5abfabe60f..e0c7f7c85d 100644 --- a/addons/explosives/functions/fnc_defuseExplosive.sqf +++ b/addons/explosives/functions/fnc_defuseExplosive.sqf @@ -17,14 +17,8 @@ #include "script_component.hpp" EXPLODE_2_PVT(_this,_unit,_explosive); -if (getNumber (ConfigFile >> "CfgAmmo" >> typeof _explosive >> "ACE_explodeOnDefuse") == 1) exitWith { +if (GVAR(ExplodeOnDefuse) && (random 1.0) < getNumber(ConfigFile >> "CfgAmmo" >> typeOf _explosive >> "ACE_explodeOnDefuse")) exitWith { [_unit, -1, [_explosive, 1], true] call FUNC(detonateExplosive); }; -{ - detach _x; - deleteVehicle _x; - false -} count (attachedObjects (_explosive)); - _unit action ["Deactivate", _unit, _explosive]; diff --git a/addons/explosives/functions/fnc_detonateExplosive.sqf b/addons/explosives/functions/fnc_detonateExplosive.sqf index 917c874af6..bfdf4a4b92 100644 --- a/addons/explosives/functions/fnc_detonateExplosive.sqf +++ b/addons/explosives/functions/fnc_detonateExplosive.sqf @@ -7,7 +7,7 @@ * 1: Max range (-1 to ignore) * 2: Explosive * 0: Explosive - * 1: Fuse time + * 1: Fuse ACE_time * * Return Value: * None @@ -26,12 +26,6 @@ _result = true; if (!_ignoreRange && {(_unit distance (_item select 0)) > _range}) exitWith {false}; -_helpers = attachedObjects (_item select 0); -{ - detach _x; - deleteVehicle _x; -} forEach _helpers; - if (getNumber (ConfigFile >> "CfgAmmo" >> typeof (_item select 0) >> "TriggerWhenDestroyed") == 0) then { private ["_exp", "_previousExp"]; _previousExp = _item select 0; diff --git a/addons/explosives/functions/fnc_interactEH.sqf b/addons/explosives/functions/fnc_interactEH.sqf new file mode 100644 index 0000000000..4e916edb82 --- /dev/null +++ b/addons/explosives/functions/fnc_interactEH.sqf @@ -0,0 +1,56 @@ +/* + * Author: PabstMirror + * When interact_menu starts rendering (from "interact_keyDown" event) + * Add defuse helpers to all nearby mines + * + * Arguments: + * Interact Menu Type (0 - world, 1 - self) + * + * Return Value: + * Nothing + * + * Example: + * [0] call ace_explosives_fnc_interactEH + * + * Public: Yes + */ +#include "script_component.hpp" + +PARAMS_1(_interactionType); + +//Ignore self-interaction menu +if (_interactionType != 0) exitWith {}; +//Ignore while mounted: +if ((vehicle ACE_player) != ACE_player) exitWith {}; +//Ignore if we don't have defuse kit +if (!("ACE_DefusalKit" in (items ACE_player))) exitWith {}; + +[{ + PARAMS_2(_args,_pfID); + EXPLODE_3_PVT(_args,_setPosition,_addedDefuseHelpers,_minesHelped); + + if (!EGVAR(interact_menu,keyDown)) then { + TRACE_1("Cleaning Defuse Helpers",(count _addedDefuseHelpers)); + {deleteVehicle _x;} forEach _addedDefuseHelpers; + [_pfID] call CBA_fnc_removePerFrameHandler; + } else { + private ["_defuseHelper"]; + // Prevent Rare Error when ending mission with interact key down: + if (isNull ace_player) exitWith {}; + + //If player moved >5 meters from last pos, then rescan + if (((getPosASL ace_player) distance _setPosition) > 5) then { + { + if (((_x distance ACE_player) < 15) && {!(_x in _minesHelped)}) then { + TRACE_2("Making Defuse Helper",(_x),(typeOf _x)); + _defuseHelper = "ACE_DefuseObject" createVehicleLocal (getPos _x); + _defuseHelper attachTo [_x, [0,0,0]]; + _defuseHelper setVariable [QGVAR(Explosive),_x]; + _addedDefuseHelpers pushBack _defuseHelper; + _minesHelped pushBack _x; + }; + } forEach allMines; + _args set [0, (getPosASL ace_player)]; + }; + }; +}, 0.5, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], []]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/explosives/functions/fnc_module.sqf b/addons/explosives/functions/fnc_module.sqf index 4080b41bde..56225d8ca8 100644 --- a/addons/explosives/functions/fnc_module.sqf +++ b/addons/explosives/functions/fnc_module.sqf @@ -27,5 +27,7 @@ if !(_activated) exitWith {}; 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_onInventoryChanged.sqf b/addons/explosives/functions/fnc_onInventoryChanged.sqf new file mode 100644 index 0000000000..53ebb2464d --- /dev/null +++ b/addons/explosives/functions/fnc_onInventoryChanged.sqf @@ -0,0 +1,35 @@ +/* + * Author: Garth 'L-H' de Wet + * When a take/put event handler fires and a detonator is changed hands. + * Then take "attached" explosives. + * + * Arguments: + * 0: Receiver + * 1: Giver + * 2: Item + * + * Return Value: + * None + * + * Example: + * Handled by CBA + * + * Public: No + */ +#include "script_component.hpp" +private ["_config", "_detonators"]; +PARAMS_3(_receiver,_giver,_item); + +if (_receiver != ace_player) exitWith {}; + +_config = ConfigFile >> "CfgWeapons" >> _item; +if (isClass _config && {getNumber(_config >> "ACE_Detonator") == 1}) then { + private ["_clackerItems"]; + _clackerItems = _giver getVariable [QGVAR(Clackers), []]; + _receiver SetVariable [QGVAR(Clackers), (_receiver getVariable [QGVAR(Clackers), []]) + _clackerItems, true]; + + _detonators = [_giver] call FUNC(getDetonators); + if (count _detonators == 0) then { + _giver setVariable [QGVAR(Clackers), nil, true]; + }; +}; diff --git a/addons/explosives/functions/fnc_onKilled.sqf b/addons/explosives/functions/fnc_onKilled.sqf new file mode 100644 index 0000000000..74775b2e66 --- /dev/null +++ b/addons/explosives/functions/fnc_onKilled.sqf @@ -0,0 +1,26 @@ +/* + * Author: Garth 'L-H' de Wet + * Detonates all attached deadman's switched triggered explosives. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * Handled by CBA + * + * Public: No + */ +#include "script_component.hpp" +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; diff --git a/addons/explosives/functions/fnc_openTimerSetUI.sqf b/addons/explosives/functions/fnc_openTimerSetUI.sqf index e37bef06e3..d08d7444dd 100644 --- a/addons/explosives/functions/fnc_openTimerSetUI.sqf +++ b/addons/explosives/functions/fnc_openTimerSetUI.sqf @@ -38,4 +38,4 @@ DFUNC(SetTimer) = { buttonSetAction [8860, QUOTE(call DFUNC(SetTimer);)]; buttonSetAction [8855, QUOTE(closeDialog 0;)]; -ctrlSetText [8870, format[localize "STR_ACE_Explosives_TimerMenu",0, 30]]; +ctrlSetText [8870, format[localize LSTRING(TimerMenu),0, 30]]; diff --git a/addons/explosives/functions/fnc_placeExplosive.sqf b/addons/explosives/functions/fnc_placeExplosive.sqf index 4bed019d47..68580c2ba0 100644 --- a/addons/explosives/functions/fnc_placeExplosive.sqf +++ b/addons/explosives/functions/fnc_placeExplosive.sqf @@ -25,6 +25,8 @@ private ["_ammo", "_explosive", "_attachedTo", "_expPos", "_magazineTrigger"]; EXPLODE_6_PVT(_this,_unit,_pos,_dir,_magazineClass,_triggerConfig,_triggerSpecificVars); DEFAULT_PARAM(6,_setupPlaceholderObject,objNull); +_unit playActionNow "PutDown"; + _attachedTo = objNull; if (!isNull _setupPlaceholderObject) then { _attachedTo = attachedTo _setupPlaceholderObject; @@ -49,16 +51,8 @@ if (isText(_magazineTrigger >> "ammo")) then { _ammo = getText (_magazineTrigger >> "ammo"); }; _triggerSpecificVars pushBack _triggerConfig; -private ["_defuseHelper"]; -_defuseHelper = createVehicle ["ACE_DefuseObject", _pos, [], 0, "NONE"]; -_defuseHelper setPosATL _pos; _explosive = createVehicle [_ammo, _pos, [], 0, "NONE"]; -_defuseHelper attachTo [_explosive, [0,0,0], ""]; -_defuseHelper setVariable [QGVAR(Explosive),_explosive,true]; - -_expPos = getPosATL _explosive; -_defuseHelper setPosATL (((getPosATL _defuseHelper) vectorAdd (_pos vectorDiff _expPos))); _explosive setPosATL _pos; if (!isNull _attachedTo) then { diff --git a/addons/explosives/functions/fnc_place_Approve.sqf b/addons/explosives/functions/fnc_place_Approve.sqf index f133dbb080..0604045f65 100644 --- a/addons/explosives/functions/fnc_place_Approve.sqf +++ b/addons/explosives/functions/fnc_place_Approve.sqf @@ -37,10 +37,10 @@ if (_dir > 180) then { } else { _dir = 180 + _dir; }; -_setup setVariable [QGVAR(Direction), _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 "MedicOther"; +_player playActionNow "PutDown"; _player removeMagazine (_setup getVariable [QGVAR(Class), ""]); diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index a0aad3d1ab..566ab9c281 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -41,8 +41,8 @@ GVAR(TweakedAngle) = 180; }; }] call CALLSTACK(BIS_fnc_addStackedEventHandler); -[localize "STR_ACE_Explosives_PlaceAction", localize "STR_ACE_Explosives_CancelAction", - localize "STR_ACE_Explosives_ScrollAction"] call EFUNC(interaction,showMouseHint); +[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", diff --git a/addons/explosives/functions/fnc_startDefuse.sqf b/addons/explosives/functions/fnc_startDefuse.sqf index 11ca95f894..251e1e213d 100644 --- a/addons/explosives/functions/fnc_startDefuse.sqf +++ b/addons/explosives/functions/fnc_startDefuse.sqf @@ -59,6 +59,6 @@ if (ACE_player != _unit) then { _isEOD = [_unit] call EFUNC(Common,isEOD); _defuseTime = [_isEOD, _target] call _fnc_DefuseTime; if (_isEOD || {!GVAR(RequireSpecialist)}) then { - [_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize "STR_ACE_Explosives_DefusingExplosive")] call EFUNC(common,progressBar); + [_defuseTime, [_unit,_target], {(_this select 0) call FUNC(defuseExplosive)}, {}, (localize LSTRING(DefusingExplosive))] call EFUNC(common,progressBar); }; }; diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 0c088df962..a2c3612b24 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -368,7 +368,7 @@ Wybierz zapalnik Sélectionner une mise à feu Zvolit Detonátor - Seleziona un Attivatore + Seleziona un attivatore Gyújtóeszköz kiválasztása Selecionar um Gatilho Выберите детонатор @@ -392,7 +392,7 @@ Druckplatte Plaque de pression Nášlapná nástraha - Piastra a Pressione + Piastra a pressione Nyomólap Placa de pressão Нажимная плита @@ -404,7 +404,7 @@ Stolperdraht Fil de détente Nástražný drát - Filo a Inciampo + Filo a inciampo Botlódrót Linha de tração Растяжка @@ -440,7 +440,7 @@ Infrarotsensor (Seitenangriff) Capteur IR (de flanc) IR Značkovač (Výbuch stranou) - Sensore IR (Attacco laterale) + Sensore IR (attacco laterale) Infravörös szenzor (Side Attack) Sensor infravermelho (ataque lateral) ИК сенсор (детонация вбок) @@ -452,7 +452,7 @@ Magnetfeldsensor (Bodenangriff) Capteur magnétique (par le bas) Magnetický Senzor (Výbuch ze spoda) - Sensore Magnetico di Prossimità (Attacco inferiore) + Sensore Magnetico di Prossimità (attacco inferiore) Mágneses mező érzékelő (Bottom Attack) Influência magnética (ataque inferior) Магнитный сенсор (детонация вверх) @@ -462,7 +462,7 @@ Keine Sprengladungen auf diesem Auslöser. Ningún explosivo en el detonador. Pas d'explosif à mettre à feu. - Nessun esplosivo sul sensore. + Nessun esplosivo Žádná výbušnina k odpálení. Nincs robbanóanyag a gyújtóeszközhöz kötve. Brak ładunków na zapalnik. @@ -491,7 +491,7 @@ Robbanóanyagok távoli robbantásához Usado para detonar remotamente o explosivo quando solto. Используется для дистанционного подрыва, после смерти оператора. - Usato per attivare esplosivi al momento del rilascio + Usato per attivare a distanza esplosivi al momento del rilascio Pick up @@ -505,5 +505,64 @@ Raccogli Pegar + + Explosive System + System ładunków wybuchowych + Sistema de explosivos + Sprengstoffsystem + Systém výbušnin + Sistema de explosivos + + + Require specialists? + Wymagaj specjalistów? + ¿Requiere especialista? + Benötigt Sprengstoffexperten? + Vyžadovat specialistu? + Requer especialista? + + + Require explosive specialists to disable explosives? Default: No + Wymagać saperów do rozbrajania ładunków wybuchowych? Domyślnie: Nie + Requiere especialista en explosivos para desactivar explosivos?. Por defecto: No + Benötige Sprengstoffexperte um Sprengladungen zu entschärfen? Standard: Nein + Vyžadovat specialistu na zneškodnění výbušniny? Výchozí: Ne + Requer especialista em explosivos para desativar explosivos? Padrão: Não + + + Punish non-specialists? + Karaj nie-specjalistów? + ¿Penalizar a los no especialistas? + Bestrafe Nicht-Sprengstoffexperten? + Potrestat, pokud není specialista? + Punir não especialistas? + + + Increase the time it takes to complete actions for non-specialists? Default: Yes + Zwiększyć ilość wymaganego czasu do ukończenia akcji dla nie-specjalistów? Domyślnie: Tak + Aumenta el tiempo que lleva completar acciones para los no especialstas?. Por defecto: Si + Entschärfungszeit für Nicht-Sprengstoffexperten erhöhen? Standard: Ja + Zvýšit čas potřebný k dokončení akce pokud není specialista? Výchozí: Ano + Aumentar o tempo necessário para completar ações por não especialistas? Padrão: Sim + + + Explode on defusal? + Explosão no desarmamento? + Eksplozja przy rozbrajaniu? + Explodovat při zneškodňování? + + + Enable certain explosives to explode on defusal? Default: Yes + Ativa certos explosivos para detonar no desarmamento? Padrão: Sim + Spraw, aby niektóre ładunki wybuchowe eksplodowały przy próbie ich rozbrojenia? Domyślnie:Tak + Umožnit u některých výbušnin explozi při pokusu je zneškodnit? Výchozí: Ano + + + + Moduł ten pozwala dostosować opcje związane z ładunkami wybuchowymi, ich podkładaniem oraz rozbrajaniem. + Dieses Modul erlaubt die Einstellungen für Sprengstoffe zu verändern. + Tento modul umoňuje přizpůsobit nastavení týkajících se výbušnin. + Este módulo permite personalizar as definições relacionadas a explosivos. + - + \ No newline at end of file diff --git a/addons/fcs/CfgVehicles.hpp b/addons/fcs/CfgVehicles.hpp index 5f357c9005..10cb868ca0 100644 --- a/addons/fcs/CfgVehicles.hpp +++ b/addons/fcs/CfgVehicles.hpp @@ -25,7 +25,7 @@ class CfgVehicles { class Car: LandVehicle { class ACE_SelfActions { class ResetFCS { - displayName = $STR_ACE_FCS_ResetFCS; + displayName = CSTRING(ResetFCS); condition = QUOTE(call FUNC(canResetFCS)); statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; @@ -38,7 +38,7 @@ class CfgVehicles { class Tank: LandVehicle { class ACE_SelfActions { class ResetFCS { - displayName = $STR_ACE_FCS_ResetFCS; + displayName = CSTRING(ResetFCS); condition = QUOTE(call FUNC(canResetFCS)); statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset);); showDisabled = 0; diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 3338e739e1..f5131dd135 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -1,7 +1,7 @@ #include "script_component.hpp" GVAR(enabled) = false; -GVAR(time) = 0; +GVAR(ACE_time) = 0; GVAR(position) = [0,0,0]; if (!hasInterface) exitWith {}; diff --git a/addons/fcs/functions/fnc_firedEH.sqf b/addons/fcs/functions/fnc_firedEH.sqf index 698a9bef22..31fe38335d 100644 --- a/addons/fcs/functions/fnc_firedEH.sqf +++ b/addons/fcs/functions/fnc_firedEH.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile","_velocityCorrection"]; +private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile", "_sumVelocity"]; _vehicle = _this select 0; _weapon = _this select 1; @@ -43,12 +43,8 @@ _offset = 0; }; } forEach _FCSMagazines; -// Correct velocity for weapons that have initVelocity -// @todo: Take into account negative initVelocities -_velocityCorrection = (vectorMagnitude velocity _projectile) - - getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); -[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, -_velocityCorrection] call EFUNC(common,changeProjectileDirection); +[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection); // Remove the platform velocity if( (vectorMagnitude velocity _vehicle) > 2) then { diff --git a/addons/fcs/functions/fnc_getAngle.sqf b/addons/fcs/functions/fnc_getAngle.sqf index 03024d8b98..91150c110d 100644 --- a/addons/fcs/functions/fnc_getAngle.sqf +++ b/addons/fcs/functions/fnc_getAngle.sqf @@ -19,7 +19,7 @@ #include "script_component.hpp" #define PRECISION 0.1 -private ["_distance","_angleTarget","_maxElev","_initSpeed","_airFriction","_timeToLive","_timeToLive","_simulationStep","_angle","_posTargetX","_posTargetY","_posX","_posY","_velocityX","_velocityY","_velocityMagnitude"]; +private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle1", "_angle2", "_it2", "_f1", "_f2", "_temp", "_it1", "_angle"]; _distance = _this select 0; _angleTarget = _this select 1; @@ -32,7 +32,7 @@ _simulationStep = _this select 6; if (_simulationStep == 0) exitWith {_angleTarget}; FUNC(traceBullet) = { - private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude"]; + private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude", "_i"]; _distance = _this select 0; _angleTarget = _this select 1; diff --git a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf index 31c2540790..899cf0da76 100644 --- a/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf +++ b/addons/fcs/functions/fnc_handleAirBurstAmmunitionPFH.sqf @@ -1,4 +1,7 @@ // by commy2 +#include "script_component.hpp" + +private ["_vehicle", "_projectile", "_zeroing", "_position", "_subMunition"]; _vehicle = _this select 0 select 0; _projectile = _this select 0 select 1; diff --git a/addons/fcs/functions/fnc_keyDown.sqf b/addons/fcs/functions/fnc_keyDown.sqf index 8646ce8468..a56e94bbf1 100644 --- a/addons/fcs/functions/fnc_keyDown.sqf +++ b/addons/fcs/functions/fnc_keyDown.sqf @@ -22,7 +22,7 @@ _distance = call FUNC(getRange); if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; GVAR(Enabled) = true; -GVAR(Time) = time; +GVAR(Time) = ACE_time; if (_distance == 0) then { _distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 433053178b..1e831d6df3 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -12,7 +12,7 @@ #include "script_component.hpp" -private ["_vehicle", "_turret", "_turretConfig", "_distance", "_magazines", "_showHint", "_playSound"]; +private ["_vehicle", "_turret", "_turretConfig", "_distance", "_weapons", "_magazines", "_showHint", "_playSound", "_i"]; _vehicle = _this select 0; _turret = _this select 1; @@ -21,6 +21,7 @@ _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call E _distance = call FUNC(getRange); +_weapons = _vehicle weaponsTurret _turret; _magazines = _vehicle magazinesTurret _turret; if (_distance == 0) then { @@ -31,9 +32,9 @@ if (_distance == 0) then { ] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision }; -private ["_weaponDirection", "_angleTarget"]; - -_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets +private ["_weapon", "_weaponDirection", "_angleTarget"]; +_weapon = _vehicle currentWeaponTurret _turret; +_weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then { _weaponDirection = eyeDirection _vehicle; @@ -55,11 +56,11 @@ if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalcu terminate GVAR(backgroundCalculation); }; -private "_movingAzimuth"; +private ["_movingAzimuth", "_posTarget", "_velocityTarget"]; // MOVING TARGETS _movingAzimuth = 0; -if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { +if (ACE_time - GVAR(ACE_time) > 1 and GVAR(ACE_time) != -1 and count _this < 3) then { // calculate speed of target _posTarget = [ (getPos _vehicle select 0) + _distance * (_weaponDirection select 0), @@ -67,14 +68,14 @@ if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { (getPos _vehicle select 2) + _distance * (_weaponDirection select 2) ]; _velocityTarget = [ - ((_posTarget select 0) - (GVAR(position) select 0)) / (time - GVAR(time)), - ((_posTarget select 1) - (GVAR(position) select 1)) / (time - GVAR(time)), - ((_posTarget select 2) - (GVAR(position) select 2)) / (time - GVAR(time)) + ((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(ACE_time)), + ((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(ACE_time)), + ((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(ACE_time)) ]; - private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"]; + private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"]; - // estimate time to target + // estimate ACE_time to target _magazineType = _vehicle currentMagazineTurret _turret; _ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo"); _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed"); @@ -82,6 +83,14 @@ if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive"); _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep"); + _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); + if (_initSpeedCoef < 0) then { + _initSpeed = _initSpeed * -_initSpeedCoef; + }; + if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; + }; + if (_simulationStep != 0) then { private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"]; @@ -121,7 +130,7 @@ if (time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then { }; }; GVAR(enabled) = false; -GVAR(time) = -1; +GVAR(ACE_time) = -1; private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"]; @@ -138,21 +147,43 @@ _FCSMagazines = []; _FCSElevation = []; { - private "_ammoType"; - - _ammoType = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + private ["_magazine", "_ammoType"]; + _magazine = _x; + _ammoType = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then { private ["_maxElev", "_initSpeed", "_airFriction", "_offset"]; _maxElev = getNumber (_turretConfig >> "maxElev"); - _initSpeed = getNumber (configFile >> "CfgMagazines" >> _x >> "initSpeed"); + _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction"); - + + { + private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"]; + _weapon = _x; + _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); + _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); + { + if (_x != "this") then { + _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); + _weaponMagazines append _muzzleMagazines; + }; + } forEach _muzzles; + if (_magazine in _weaponMagazines) exitWith { + _initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed"); + if (_initSpeedCoef < 0) then { + _initSpeed = _initSpeed * -_initSpeedCoef; + }; + if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; + }; + }; + } forEach _weapons; + _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance]; _offset = parseNumber _offset; - _FCSMagazines = _FCSMagazines + [_x]; + _FCSMagazines = _FCSMagazines + [_magazine]; _FCSElevation = _FCSElevation + [_offset]; }; } forEach _magazines; @@ -177,5 +208,5 @@ if(_playSound) then { }; if(_showHint) then { - [format ["%1: %2", localize "STR_ACE_FCS_ZeroedTo", _distance]] call EFUNC(common,displayTextStructured); + [format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured); }; \ No newline at end of file diff --git a/addons/fcs/functions/fnc_reset.sqf b/addons/fcs/functions/fnc_reset.sqf index a23a759fa3..48e3803c83 100644 --- a/addons/fcs/functions/fnc_reset.sqf +++ b/addons/fcs/functions/fnc_reset.sqf @@ -22,4 +22,4 @@ _turret = _this select 1; [_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], 0] call EFUNC(common,setVariablePublic); [_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], 0] call EFUNC(common,setVariablePublic); -[localize "STR_ACE_FCS_HasBeenReset"] call EFUNC(common,displayTextStructured); +[localize LSTRING(HasBeenReset)] call EFUNC(common,displayTextStructured); diff --git a/addons/fcs/functions/script_component.hpp b/addons/fcs/functions/script_component.hpp index 73e258a3b6..8ada0f7a71 100644 --- a/addons/fcs/functions/script_component.hpp +++ b/addons/fcs/functions/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT fcs -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_FCS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index 96482ddd1c..3b22cb2262 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -1,6 +1,6 @@ // by commy2 -["ACE3 Vehicles", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", +["ACE3 Vehicles", QGVAR(lazeTarget), localize LSTRING(LaseTarget), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -30,7 +30,7 @@ }, [15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key -["ACE3 Vehicles", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", +["ACE3 Vehicles", QGVAR(adjustRangeUp), localize LSTRING(AdjustRangeUp), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -44,7 +44,7 @@ {false}, [201, [false, false, false]], false] call cba_fnc_addKeybind; //PageUp Key -["ACE3 Vehicles", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", +["ACE3 Vehicles", QGVAR(adjustRangDown), localize LSTRING(AdjustRangeDown), { // Conditions: canInteract if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/fcs/script_component.hpp b/addons/fcs/script_component.hpp index 73e258a3b6..8ada0f7a71 100644 --- a/addons/fcs/script_component.hpp +++ b/addons/fcs/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT fcs -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_FCS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_FCS #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/fcs/stringtable.xml b/addons/fcs/stringtable.xml index d62a5d85ea..77d683fc98 100644 --- a/addons/fcs/stringtable.xml +++ b/addons/fcs/stringtable.xml @@ -3,7 +3,7 @@ Lase Target / Measure Distance - Ziel anlasern / Entfernung Messen + Ziel anlasern / Entfernung messen Télémétrer la cible Naświetl cel / Zmierz odległość Označit cíl / Změřit vzdálenost @@ -74,4 +74,4 @@ СУО обнулен. - + \ No newline at end of file diff --git a/addons/flashsuppressors/CfgWeapons.hpp b/addons/flashsuppressors/CfgWeapons.hpp index c070ada18d..198fec7316 100644 --- a/addons/flashsuppressors/CfgWeapons.hpp +++ b/addons/flashsuppressors/CfgWeapons.hpp @@ -230,7 +230,7 @@ class CfgWeapons { class InventoryMuzzleItem_Base_F; class ACE_muzzle_mzls_H: ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_H"; htMin = 1; htMax = 600; @@ -239,7 +239,7 @@ class CfgWeapons { mFact = 1; tBody = 100; scope = 2; - displayName = "$STR_ACE_muzzle_mzls_H"; + displayName = CSTRING(muzzle_mzls_H); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; @@ -283,9 +283,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_B: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_B"; - displayName = "$STR_ACE_muzzle_mzls_B"; + displayName = CSTRING(muzzle_mzls_B); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; @@ -329,9 +329,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_L: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_L"; - displayName = "$STR_ACE_muzzle_mzls_L"; + displayName = CSTRING(muzzle_mzls_L); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_l_F"; @@ -375,9 +375,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_smg_01: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_smg_01"; - displayName = "$STR_ACE_muzzle_mzls_smg_01"; + displayName = CSTRING(muzzle_mzls_smg_01); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; @@ -421,9 +421,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_smg_02: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_smg_02"; - displayName = "$STR_ACE_muzzle_mzls_smg_02"; + displayName = CSTRING(muzzle_mzls_smg_02); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; @@ -467,9 +467,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_338: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_338"; - displayName = "$STR_ACE_muzzle_mzls_338"; + displayName = CSTRING(muzzle_mzls_338); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; @@ -513,9 +513,9 @@ class CfgWeapons { }; class ACE_muzzle_mzls_93mmg: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_muzzle_mzls_93mmg"; - displayName = "$STR_ACE_muzzle_mzls_93mmg"; + displayName = CSTRING(muzzle_mzls_93mmg); picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; model = "\A3\weapons_f\acc\acca_mzls_H_F"; diff --git a/addons/flashsuppressors/config.cpp b/addons/flashsuppressors/config.cpp index 10b9622d17..b8e0c1e120 100644 --- a/addons/flashsuppressors/config.cpp +++ b/addons/flashsuppressors/config.cpp @@ -4,13 +4,13 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = { - "ACE_muzzle_mzls_H", - "ACE_muzzle_mzls_B", - "ACE_muzzle_mzls_L", - "ACE_muzzle_mzls_smg_01", - "ACE_muzzle_mzls_smg_02", - "ACE_muzzle_mzls_338", - "ACE_muzzle_mzls_93mmg" + "ACE_muzzle_mzls_H", + "ACE_muzzle_mzls_B", + "ACE_muzzle_mzls_L", + "ACE_muzzle_mzls_smg_01", + "ACE_muzzle_mzls_smg_02", + "ACE_muzzle_mzls_338", + "ACE_muzzle_mzls_93mmg" }; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; diff --git a/addons/flashsuppressors/stringtable.xml b/addons/flashsuppressors/stringtable.xml index 509c16ddce..f075f1aa34 100644 --- a/addons/flashsuppressors/stringtable.xml +++ b/addons/flashsuppressors/stringtable.xml @@ -1,7 +1,7 @@  - + Flash Suppressor (6.5 mm) Lángrejtő (6,5 mm) Mündungsfeuerdämpfer (6,5 mm) @@ -13,7 +13,7 @@ Пламегаситель (6,5 мм) Bocacha (6,5 mm) - + Flash Suppressor (7.62 mm) Lángrejtő (7,62 mm) Mündungsfeuerdämpfer (7,62 mm) @@ -25,7 +25,7 @@ Пламегаситель (7,62 мм) Bocacha (7,62 mm) - + Flash Suppressor (5.56 mm) Lángrejtő (5,56 mm) Mündungsfeuerdämpfer (5,56 mm) @@ -37,7 +37,7 @@ Пламегаситель (5,56 мм) Bocacha (5,56 mm) - + Flash Suppressor (.45 ACP) Lángrejtő (.45 ACP) Mündungsfeuerdämpfer (.45 ACP) @@ -49,7 +49,7 @@ Пламегаситель (.45 ACP) Bocacha (.45 ACP) - + Flash Suppressor (9 mm) Lángrejtő (9 mm) Mündungsfeuerdämpfer (9 mm) @@ -61,7 +61,7 @@ Пламегаситель (9 мм) Bocacha (9 mm) - + Flash Suppressor (.338) Lángrejtő (.338) Mündungsfeuerdämpfer (.338) @@ -73,7 +73,7 @@ Пламегаситель (.338) Bocacha (.338) - + Flash Suppressor (9.3 mm) Lángrejtő (9,3 mm) Mündungsfeuerdämpfer (9,3 mm) diff --git a/addons/fonts/$NOBIN$ b/addons/fonts/$NOBIN$ new file mode 100644 index 0000000000..e69de29bb2 diff --git a/addons/fonts/$PBOPREFIX$ b/addons/fonts/$PBOPREFIX$ new file mode 100644 index 0000000000..3e0ff77f61 --- /dev/null +++ b/addons/fonts/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\fonts \ No newline at end of file diff --git a/addons/fonts/CfgFontFamilies.hpp b/addons/fonts/CfgFontFamilies.hpp new file mode 100644 index 0000000000..963a35fa8e --- /dev/null +++ b/addons/fonts/CfgFontFamilies.hpp @@ -0,0 +1,39 @@ +class CfgFontFamilies +{ + class PixelSplitterBold + { + fonts[] = { PATHTOF(PixelSplitterBold\PixelSplitterBold6), + PATHTOF(PixelSplitterBold\PixelSplitterBold7), + PATHTOF(PixelSplitterBold\PixelSplitterBold8), + PATHTOF(PixelSplitterBold\PixelSplitterBold9), + PATHTOF(PixelSplitterBold\PixelSplitterBold10), + PATHTOF(PixelSplitterBold\PixelSplitterBold11), + PATHTOF(PixelSplitterBold\PixelSplitterBold12), + PATHTOF(PixelSplitterBold\PixelSplitterBold13), + PATHTOF(PixelSplitterBold\PixelSplitterBold14), + PATHTOF(PixelSplitterBold\PixelSplitterBold15), + PATHTOF(PixelSplitterBold\PixelSplitterBold16), + PATHTOF(PixelSplitterBold\PixelSplitterBold17), + PATHTOF(PixelSplitterBold\PixelSplitterBold18), + PATHTOF(PixelSplitterBold\PixelSplitterBold19), + PATHTOF(PixelSplitterBold\PixelSplitterBold20), + PATHTOF(PixelSplitterBold\PixelSplitterBold21), + PATHTOF(PixelSplitterBold\PixelSplitterBold22), + PATHTOF(PixelSplitterBold\PixelSplitterBold23), + PATHTOF(PixelSplitterBold\PixelSplitterBold24), + PATHTOF(PixelSplitterBold\PixelSplitterBold25), + PATHTOF(PixelSplitterBold\PixelSplitterBold26), + PATHTOF(PixelSplitterBold\PixelSplitterBold27), + PATHTOF(PixelSplitterBold\PixelSplitterBold28), + PATHTOF(PixelSplitterBold\PixelSplitterBold29), + PATHTOF(PixelSplitterBold\PixelSplitterBold30), + PATHTOF(PixelSplitterBold\PixelSplitterBold31), + PATHTOF(PixelSplitterBold\PixelSplitterBold34), + PATHTOF(PixelSplitterBold\PixelSplitterBold35), + PATHTOF(PixelSplitterBold\PixelSplitterBold37), + PATHTOF(PixelSplitterBold\PixelSplitterBold46) + }; + spaceWidth = 0.5; + spacing = 0.065; + }; +}; \ No newline at end of file diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold10-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-01.paa new file mode 100644 index 0000000000..78b43acfc7 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold10-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold10-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold10-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-04.paa new file mode 100644 index 0000000000..e69cde44c0 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold10-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold10.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold10.fxy new file mode 100644 index 0000000000..72d19784a1 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold10.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold11-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-01.paa new file mode 100644 index 0000000000..2bf97b0f27 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold11-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold11-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold11-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-04.paa new file mode 100644 index 0000000000..3380b2bf89 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold11-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold11.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold11.fxy new file mode 100644 index 0000000000..99816f6fb5 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold11.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold12-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-01.paa new file mode 100644 index 0000000000..f501f2593b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold12-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold12-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold12-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-04.paa new file mode 100644 index 0000000000..c4bd46f004 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold12-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold12.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold12.fxy new file mode 100644 index 0000000000..1b3a245879 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold12.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold13-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-01.paa new file mode 100644 index 0000000000..4e9886d86b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold13-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold13-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold13-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-04.paa new file mode 100644 index 0000000000..54b7d03786 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold13-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold13.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold13.fxy new file mode 100644 index 0000000000..d5d1c2b97a Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold13.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold14-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-01.paa new file mode 100644 index 0000000000..38bcc7fec8 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold14-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold14-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold14-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-04.paa new file mode 100644 index 0000000000..b869615414 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold14-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold14.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold14.fxy new file mode 100644 index 0000000000..521aee9cd7 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold14.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold15-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-01.paa new file mode 100644 index 0000000000..2da68e44a4 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold15-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold15-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold15-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-04.paa new file mode 100644 index 0000000000..825cb08bff Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold15-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold15.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold15.fxy new file mode 100644 index 0000000000..24ed35a794 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold15.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold16-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-01.paa new file mode 100644 index 0000000000..c222ecde5d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold16-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold16-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold16-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-04.paa new file mode 100644 index 0000000000..e83ca4db68 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold16-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold16.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold16.fxy new file mode 100644 index 0000000000..160ce95f48 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold16.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold17-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-01.paa new file mode 100644 index 0000000000..a305aeb22b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold17-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold17-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold17-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-04.paa new file mode 100644 index 0000000000..86132e202a Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold17-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold17.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold17.fxy new file mode 100644 index 0000000000..f62a72aa44 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold17.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold18-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-01.paa new file mode 100644 index 0000000000..c8fccc0360 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold18-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold18-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold18-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-04.paa new file mode 100644 index 0000000000..fb1f319d7e Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold18-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold18.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold18.fxy new file mode 100644 index 0000000000..f1daafd800 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold18.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold19-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-01.paa new file mode 100644 index 0000000000..f10f953978 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold19-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold19-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold19-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-04.paa new file mode 100644 index 0000000000..9082ca9be1 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold19-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold19.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold19.fxy new file mode 100644 index 0000000000..7e2f36ddb0 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold19.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold20-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-01.paa new file mode 100644 index 0000000000..cdb9c27a1c Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold20-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold20-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold20-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-04.paa new file mode 100644 index 0000000000..eba8657321 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold20-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold20.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold20.fxy new file mode 100644 index 0000000000..f06b9c5220 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold20.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold21-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-01.paa new file mode 100644 index 0000000000..aef2913981 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold21-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold21-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold21-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-04.paa new file mode 100644 index 0000000000..9138800d94 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold21-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold21.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold21.fxy new file mode 100644 index 0000000000..fd68593304 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold21.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold22-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-01.paa new file mode 100644 index 0000000000..3856a801ce Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold22-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold22-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold22-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-04.paa new file mode 100644 index 0000000000..398cebc35e Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold22-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold22.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold22.fxy new file mode 100644 index 0000000000..51f292d305 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold22.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold23-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-01.paa new file mode 100644 index 0000000000..d47b92788e Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold23-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold23-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold23-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-04.paa new file mode 100644 index 0000000000..ff76bcc7ad Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold23-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold23.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold23.fxy new file mode 100644 index 0000000000..414e8bd522 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold23.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold24-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-01.paa new file mode 100644 index 0000000000..199c484061 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold24-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold24-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold24-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-04.paa new file mode 100644 index 0000000000..2642bc1ec0 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold24-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold24.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold24.fxy new file mode 100644 index 0000000000..5229e497c7 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold24.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold25-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-01.paa new file mode 100644 index 0000000000..bcadccf7d4 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold25-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold25-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold25-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-04.paa new file mode 100644 index 0000000000..2d5dfc2a2f Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold25-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold25.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold25.fxy new file mode 100644 index 0000000000..516cc9609b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold25.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold26-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-01.paa new file mode 100644 index 0000000000..d0e4c2120f Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold26-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold26-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold26-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-04.paa new file mode 100644 index 0000000000..de4f428730 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold26-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold26.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold26.fxy new file mode 100644 index 0000000000..24684f11ff Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold26.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold27-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-01.paa new file mode 100644 index 0000000000..152a4615c1 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold27-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold27-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold27-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-04.paa new file mode 100644 index 0000000000..d2eb7fc7ad Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold27-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold27.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold27.fxy new file mode 100644 index 0000000000..c6659bccaf Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold27.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold28-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-01.paa new file mode 100644 index 0000000000..09f14e9fa0 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold28-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold28-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold28-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-04.paa new file mode 100644 index 0000000000..9226ff30ae Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold28-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold28.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold28.fxy new file mode 100644 index 0000000000..d754c25e3d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold28.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold29-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-01.paa new file mode 100644 index 0000000000..05b0e57646 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold29-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold29-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold29-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-04.paa new file mode 100644 index 0000000000..c2fde72ac5 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold29-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold29.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold29.fxy new file mode 100644 index 0000000000..bd71731362 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold29.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold30-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-01.paa new file mode 100644 index 0000000000..bd0b967fd1 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold30-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold30-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold30-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-04.paa new file mode 100644 index 0000000000..a9dc6e6754 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold30-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold30.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold30.fxy new file mode 100644 index 0000000000..c1a63513ac Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold30.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold31-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-01.paa new file mode 100644 index 0000000000..e17b12e496 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold31-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold31-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold31-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-04.paa new file mode 100644 index 0000000000..fa2db13ffd Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold31-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold31.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold31.fxy new file mode 100644 index 0000000000..50b6284f32 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold31.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold34-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-01.paa new file mode 100644 index 0000000000..5668351dde Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold34-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold34-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold34-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-04.paa new file mode 100644 index 0000000000..e606e0ff53 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold34-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold34.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold34.fxy new file mode 100644 index 0000000000..eef16b2413 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold34.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold35-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-01.paa new file mode 100644 index 0000000000..c86eafbc81 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold35-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold35-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold35-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-04.paa new file mode 100644 index 0000000000..97ca9bae8b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold35-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold35.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold35.fxy new file mode 100644 index 0000000000..362f8a0ffc Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold35.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold37-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-01.paa new file mode 100644 index 0000000000..8d35477181 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold37-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold37-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold37-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-04.paa new file mode 100644 index 0000000000..fa36d3fa73 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold37-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold37.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold37.fxy new file mode 100644 index 0000000000..2bf38a4044 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold37.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold46-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-01.paa new file mode 100644 index 0000000000..23261136b9 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold46-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold46-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold46-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-04.paa new file mode 100644 index 0000000000..5bf7201a9a Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold46-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold46.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold46.fxy new file mode 100644 index 0000000000..a6bd7ea3ba Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold46.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold6-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-01.paa new file mode 100644 index 0000000000..3d2a0e102b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold6-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold6-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold6-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-04.paa new file mode 100644 index 0000000000..454956d448 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold6-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold6.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold6.fxy new file mode 100644 index 0000000000..6feee35d5b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold6.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold7-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-01.paa new file mode 100644 index 0000000000..392f2c7327 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold7-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold7-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold7-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-04.paa new file mode 100644 index 0000000000..896fb3261b Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold7-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold7.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold7.fxy new file mode 100644 index 0000000000..fa26952d21 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold7.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold8-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-01.paa new file mode 100644 index 0000000000..4138867d7e Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold8-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold8-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold8-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-04.paa new file mode 100644 index 0000000000..8972409d37 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold8-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold8.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold8.fxy new file mode 100644 index 0000000000..9deb881e39 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold8.fxy differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold9-01.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-01.paa new file mode 100644 index 0000000000..f450a93e43 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-01.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold9-02.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-02.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-02.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold9-03.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-03.paa new file mode 100644 index 0000000000..06dd11820d Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-03.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold9-04.paa b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-04.paa new file mode 100644 index 0000000000..e6a66810c8 Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold9-04.paa differ diff --git a/addons/fonts/PixelSplitterBold/PixelSplitterBold9.fxy b/addons/fonts/PixelSplitterBold/PixelSplitterBold9.fxy new file mode 100644 index 0000000000..f9f58bb7aa Binary files /dev/null and b/addons/fonts/PixelSplitterBold/PixelSplitterBold9.fxy differ diff --git a/optionals/compat_hlc_wp_mp5/config.cpp b/addons/fonts/config.cpp similarity index 56% rename from optionals/compat_hlc_wp_mp5/config.cpp rename to addons/fonts/config.cpp index 1f4fe78db4..f37dba286c 100644 --- a/optionals/compat_hlc_wp_mp5/config.cpp +++ b/addons/fonts/config.cpp @@ -5,10 +5,11 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"hlcweapons_mp5"}; - author[]={"Ruthberg"}; + requiredAddons[] = {"ace_main"}; + author[] = {"jaynus"}; + authorUrl = "https://github.com/jaynus/"; VERSION_CONFIG; }; }; -#include "CfgWeapons.hpp" +#include "CfgFontFamilies.hpp" diff --git a/addons/fonts/script_component.hpp b/addons/fonts/script_component.hpp new file mode 100644 index 0000000000..a8029b7105 --- /dev/null +++ b/addons/fonts/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT fonts +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FONTS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_FONTS + #define DEBUG_SETTINGS DEBUG_SETTINGS_FONTS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/frag/ACE_Settings.hpp b/addons/frag/ACE_Settings.hpp index b160a127f3..84bba326f0 100644 --- a/addons/frag/ACE_Settings.hpp +++ b/addons/frag/ACE_Settings.hpp @@ -1,8 +1,33 @@ class ACE_Settings { - class GVAR(enabled) { - displayName = "Frag System"; - description = "Enables the shrapnel system for explosives"; + class GVAR(Enabled) { + displayName = CSTRING(EnableFrag); + description = CSTRING(EnableFrag_Desc); typeName = "BOOL"; value = 1; }; + class GVAR(SpallEnabled) { + displayName = CSTRING(EnableSpall); + description = CSTRING(EnableSpall_Desc); + typeName = "BOOL"; + value = 0; + }; + class GVAR(maxTrack) { + displayName = CSTRING(MaxTrack); + description = CSTRING(MaxTrack_Desc); + typeName = "SCALAR"; + value = 500; + }; + class GVAR(MaxTrackPerFrame) { + displayName = CSTRING(MaxTrackPerFrame); + description = CSTRING(MaxTrackPerFrame_Desc); + typeName = "SCALAR"; + value = 50; + }; + + class GVAR(EnableDebugTrace) { + displayName = CSTRING(EnableDebugTrace); + description = CSTRING(EnableDebugTrace_Desc); + typeName = "BOOL"; + value = 0; + }; }; diff --git a/addons/frag/CfgAmmo.hpp b/addons/frag/CfgAmmo.hpp index ac20dabf5e..41734d2806 100644 --- a/addons/frag/CfgAmmo.hpp +++ b/addons/frag/CfgAmmo.hpp @@ -8,8 +8,11 @@ class CfgAmmo { //class ace_arty_105mm_m1_m782_delay: ace_arty_105mm_m1_m782_prox { // GVAR(skip) = 1; //}; + class Bo_GBU12_LGB; class ACE_GBU12 : Bo_GBU12_LGB { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(metal) = 140000; GVAR(charge) = 87000; @@ -23,6 +26,8 @@ class CfgAmmo { class GrenadeBase; class Grenade; class GrenadeHand: Grenade { + GVAR(enabled) = 1; + GVAR(skip) = 0; GVAR(force) = 1; // This is a good high-drag frag type for grenades. @@ -46,6 +51,8 @@ class CfgAmmo { class RocketBase; class R_Hydra_HE: RocketBase { // Source: http://fas.org/man/dod-101/sys/missile/hydra-70.htm + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 3850; GVAR(charge) = 1040; @@ -66,6 +73,8 @@ class CfgAmmo { class BombCore; class Bo_Mk82: BombCore { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(metal) = 140000; GVAR(charge) = 87000; @@ -75,6 +84,8 @@ class CfgAmmo { class G_40mm_HE: GrenadeBase { // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M441 + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_tiny_HD"}; GVAR(metal) = 200; GVAR(charge) = 32; @@ -83,6 +94,8 @@ class CfgAmmo { }; class G_40mm_HEDP: G_40mm_HE { // Source: http://www.inetres.com/gp/military/infantry/grenade/40mm_ammo.html#M433 + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_tiny_HD"}; GVAR(metal) = 200; GVAR(charge) = 45; @@ -107,6 +120,8 @@ class CfgAmmo { class Sh_125mm_HEAT; class Sh_155mm_AMOS: ShellBase { // Source: http://www.globalsecurity.org/military/systems/munitions/m795.htm + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(metal) = 36000; GVAR(charge) = 9979; @@ -115,6 +130,8 @@ class CfgAmmo { }; class Sh_82mm_AMOS : Sh_155mm_AMOS { // Source: http://www.arsenal-bg.com/defense_police/mortar_bombs_82mm.htm + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 3200; GVAR(charge) = 420; @@ -122,6 +139,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; class ModuleOrdnanceMortar_F_Ammo: Sh_82mm_AMOS { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 800; GVAR(charge) = 4200; @@ -129,6 +148,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; class Sh_105mm_HEAT_MP : Sh_125mm_HEAT { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 11400; GVAR(charge) = 7100; @@ -136,6 +157,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; class Sh_120mm_HE : ShellBase { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 23000; GVAR(charge) = 3148; @@ -143,6 +166,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; class Sh_125mm_HE: Sh_120mm_HE { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 16000; GVAR(charge) = 3200; @@ -150,6 +175,8 @@ class CfgAmmo { GVAR(gurney_k) = 1/2; }; class ModuleOrdnanceHowitzer_F_ammo: Sh_155mm_AMOS { + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_large", "ACE_frag_large", "ACE_frag_large_HD", "ACE_frag_large", "ACE_frag_huge", "ACE_frag_huge_HD", "ACE_frag_huge"}; GVAR(metal) = 1950; GVAR(charge) = 15800; @@ -175,6 +202,8 @@ class CfgAmmo { class MissileBase; class Missile_AGM_02_F : MissileBase { // Source: http://fas.org/man/dod-101/sys/smart/agm-65.htm + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 56250; GVAR(charge) = 39000; @@ -183,6 +212,8 @@ class CfgAmmo { }; class M_Hellfire_AT: MissileBase { // Source: http://www.designation-systems.net/dusrm/m-114.html + GVAR(enabled) = 1; + GVAR(classes)[] = {"ACE_frag_medium", "ACE_frag_medium_HD"}; GVAR(metal) = 8000; GVAR(charge) = 2400; @@ -440,4 +471,6 @@ class CfgAmmo { class ACE_frag_spall_huge: ACE_frag_huge { timeToLive = 0.3; }; + + #include "CfgAmmoReflections.hpp" }; diff --git a/addons/frag/CfgAmmoReflections.hpp b/addons/frag/CfgAmmoReflections.hpp new file mode 100644 index 0000000000..f59d67f89a --- /dev/null +++ b/addons/frag/CfgAmmoReflections.hpp @@ -0,0 +1,2522 @@ +//CfgAmmoReflections.hpp + +#define ACE_EXPLOSION_REFLECTION(range, hit) class ace_explosion_reflection_##range##_##hit : ace_explosion_reflection_base { indirectHitRange = range; indirectHit = hit; dangerRadiusHit = range*3; suppressionRadiusHit = range*2; }; +class ace_explosion_reflection_base : Sh_120mm_HE { + CraterWaterEffects = ""; + CraterEffects = ""; + effectsMissile = ""; + ExplosionEffects = ""; + effectFlare = ""; + class HitEffects { + hitWater = ""; + }; + multiSoundHit[] = {}; + explosionTime = 0.0001; + explosive = 1; + soundFakeFall[] = {}; + typicalSpeed = 0; + model = "\A3\Weapons_F\empty.p3d"; + craterShape = "\A3\weapons_f\empty.p3d"; +}; + +ACE_EXPLOSION_REFLECTION(2,10); +ACE_EXPLOSION_REFLECTION(2,20); +ACE_EXPLOSION_REFLECTION(2,30); +ACE_EXPLOSION_REFLECTION(2,40); +ACE_EXPLOSION_REFLECTION(2,50); +ACE_EXPLOSION_REFLECTION(2,60); +ACE_EXPLOSION_REFLECTION(2,70); +ACE_EXPLOSION_REFLECTION(2,80); +ACE_EXPLOSION_REFLECTION(2,90); +ACE_EXPLOSION_REFLECTION(2,100); +ACE_EXPLOSION_REFLECTION(2,110); +ACE_EXPLOSION_REFLECTION(2,120); +ACE_EXPLOSION_REFLECTION(2,130); +ACE_EXPLOSION_REFLECTION(2,140); +ACE_EXPLOSION_REFLECTION(2,150); +ACE_EXPLOSION_REFLECTION(2,160); +ACE_EXPLOSION_REFLECTION(2,170); +ACE_EXPLOSION_REFLECTION(2,180); +ACE_EXPLOSION_REFLECTION(2,190); +ACE_EXPLOSION_REFLECTION(2,200); +ACE_EXPLOSION_REFLECTION(2,210); +ACE_EXPLOSION_REFLECTION(2,220); +ACE_EXPLOSION_REFLECTION(2,230); +ACE_EXPLOSION_REFLECTION(2,240); +ACE_EXPLOSION_REFLECTION(2,250); +ACE_EXPLOSION_REFLECTION(2,260); +ACE_EXPLOSION_REFLECTION(2,270); +ACE_EXPLOSION_REFLECTION(2,280); +ACE_EXPLOSION_REFLECTION(2,290); +ACE_EXPLOSION_REFLECTION(2,300); +ACE_EXPLOSION_REFLECTION(2,310); +ACE_EXPLOSION_REFLECTION(2,320); +ACE_EXPLOSION_REFLECTION(2,330); +ACE_EXPLOSION_REFLECTION(2,340); +ACE_EXPLOSION_REFLECTION(2,350); +ACE_EXPLOSION_REFLECTION(2,360); +ACE_EXPLOSION_REFLECTION(2,370); +ACE_EXPLOSION_REFLECTION(2,380); +ACE_EXPLOSION_REFLECTION(2,390); +ACE_EXPLOSION_REFLECTION(2,400); +ACE_EXPLOSION_REFLECTION(2,410); +ACE_EXPLOSION_REFLECTION(2,420); +ACE_EXPLOSION_REFLECTION(2,430); +ACE_EXPLOSION_REFLECTION(2,440); +ACE_EXPLOSION_REFLECTION(2,450); +ACE_EXPLOSION_REFLECTION(2,460); +ACE_EXPLOSION_REFLECTION(2,470); +ACE_EXPLOSION_REFLECTION(2,480); +ACE_EXPLOSION_REFLECTION(2,490); +ACE_EXPLOSION_REFLECTION(2,500); +ACE_EXPLOSION_REFLECTION(4,10); +ACE_EXPLOSION_REFLECTION(4,20); +ACE_EXPLOSION_REFLECTION(4,30); +ACE_EXPLOSION_REFLECTION(4,40); +ACE_EXPLOSION_REFLECTION(4,50); +ACE_EXPLOSION_REFLECTION(4,60); +ACE_EXPLOSION_REFLECTION(4,70); +ACE_EXPLOSION_REFLECTION(4,80); +ACE_EXPLOSION_REFLECTION(4,90); +ACE_EXPLOSION_REFLECTION(4,100); +ACE_EXPLOSION_REFLECTION(4,110); +ACE_EXPLOSION_REFLECTION(4,120); +ACE_EXPLOSION_REFLECTION(4,130); +ACE_EXPLOSION_REFLECTION(4,140); +ACE_EXPLOSION_REFLECTION(4,150); +ACE_EXPLOSION_REFLECTION(4,160); +ACE_EXPLOSION_REFLECTION(4,170); +ACE_EXPLOSION_REFLECTION(4,180); +ACE_EXPLOSION_REFLECTION(4,190); +ACE_EXPLOSION_REFLECTION(4,200); +ACE_EXPLOSION_REFLECTION(4,210); +ACE_EXPLOSION_REFLECTION(4,220); +ACE_EXPLOSION_REFLECTION(4,230); +ACE_EXPLOSION_REFLECTION(4,240); +ACE_EXPLOSION_REFLECTION(4,250); +ACE_EXPLOSION_REFLECTION(4,260); +ACE_EXPLOSION_REFLECTION(4,270); +ACE_EXPLOSION_REFLECTION(4,280); +ACE_EXPLOSION_REFLECTION(4,290); +ACE_EXPLOSION_REFLECTION(4,300); +ACE_EXPLOSION_REFLECTION(4,310); +ACE_EXPLOSION_REFLECTION(4,320); +ACE_EXPLOSION_REFLECTION(4,330); +ACE_EXPLOSION_REFLECTION(4,340); +ACE_EXPLOSION_REFLECTION(4,350); +ACE_EXPLOSION_REFLECTION(4,360); +ACE_EXPLOSION_REFLECTION(4,370); +ACE_EXPLOSION_REFLECTION(4,380); +ACE_EXPLOSION_REFLECTION(4,390); +ACE_EXPLOSION_REFLECTION(4,400); +ACE_EXPLOSION_REFLECTION(4,410); +ACE_EXPLOSION_REFLECTION(4,420); +ACE_EXPLOSION_REFLECTION(4,430); +ACE_EXPLOSION_REFLECTION(4,440); +ACE_EXPLOSION_REFLECTION(4,450); +ACE_EXPLOSION_REFLECTION(4,460); +ACE_EXPLOSION_REFLECTION(4,470); +ACE_EXPLOSION_REFLECTION(4,480); +ACE_EXPLOSION_REFLECTION(4,490); +ACE_EXPLOSION_REFLECTION(4,500); +ACE_EXPLOSION_REFLECTION(6,10); +ACE_EXPLOSION_REFLECTION(6,20); +ACE_EXPLOSION_REFLECTION(6,30); +ACE_EXPLOSION_REFLECTION(6,40); +ACE_EXPLOSION_REFLECTION(6,50); +ACE_EXPLOSION_REFLECTION(6,60); +ACE_EXPLOSION_REFLECTION(6,70); +ACE_EXPLOSION_REFLECTION(6,80); +ACE_EXPLOSION_REFLECTION(6,90); +ACE_EXPLOSION_REFLECTION(6,100); +ACE_EXPLOSION_REFLECTION(6,110); +ACE_EXPLOSION_REFLECTION(6,120); +ACE_EXPLOSION_REFLECTION(6,130); +ACE_EXPLOSION_REFLECTION(6,140); +ACE_EXPLOSION_REFLECTION(6,150); +ACE_EXPLOSION_REFLECTION(6,160); +ACE_EXPLOSION_REFLECTION(6,170); +ACE_EXPLOSION_REFLECTION(6,180); +ACE_EXPLOSION_REFLECTION(6,190); +ACE_EXPLOSION_REFLECTION(6,200); +ACE_EXPLOSION_REFLECTION(6,210); +ACE_EXPLOSION_REFLECTION(6,220); +ACE_EXPLOSION_REFLECTION(6,230); +ACE_EXPLOSION_REFLECTION(6,240); +ACE_EXPLOSION_REFLECTION(6,250); +ACE_EXPLOSION_REFLECTION(6,260); +ACE_EXPLOSION_REFLECTION(6,270); +ACE_EXPLOSION_REFLECTION(6,280); +ACE_EXPLOSION_REFLECTION(6,290); +ACE_EXPLOSION_REFLECTION(6,300); +ACE_EXPLOSION_REFLECTION(6,310); +ACE_EXPLOSION_REFLECTION(6,320); +ACE_EXPLOSION_REFLECTION(6,330); +ACE_EXPLOSION_REFLECTION(6,340); +ACE_EXPLOSION_REFLECTION(6,350); +ACE_EXPLOSION_REFLECTION(6,360); +ACE_EXPLOSION_REFLECTION(6,370); +ACE_EXPLOSION_REFLECTION(6,380); +ACE_EXPLOSION_REFLECTION(6,390); +ACE_EXPLOSION_REFLECTION(6,400); +ACE_EXPLOSION_REFLECTION(6,410); +ACE_EXPLOSION_REFLECTION(6,420); +ACE_EXPLOSION_REFLECTION(6,430); +ACE_EXPLOSION_REFLECTION(6,440); +ACE_EXPLOSION_REFLECTION(6,450); +ACE_EXPLOSION_REFLECTION(6,460); +ACE_EXPLOSION_REFLECTION(6,470); +ACE_EXPLOSION_REFLECTION(6,480); +ACE_EXPLOSION_REFLECTION(6,490); +ACE_EXPLOSION_REFLECTION(6,500); +ACE_EXPLOSION_REFLECTION(8,10); +ACE_EXPLOSION_REFLECTION(8,20); +ACE_EXPLOSION_REFLECTION(8,30); +ACE_EXPLOSION_REFLECTION(8,40); +ACE_EXPLOSION_REFLECTION(8,50); +ACE_EXPLOSION_REFLECTION(8,60); +ACE_EXPLOSION_REFLECTION(8,70); +ACE_EXPLOSION_REFLECTION(8,80); +ACE_EXPLOSION_REFLECTION(8,90); +ACE_EXPLOSION_REFLECTION(8,100); +ACE_EXPLOSION_REFLECTION(8,110); +ACE_EXPLOSION_REFLECTION(8,120); +ACE_EXPLOSION_REFLECTION(8,130); +ACE_EXPLOSION_REFLECTION(8,140); +ACE_EXPLOSION_REFLECTION(8,150); +ACE_EXPLOSION_REFLECTION(8,160); +ACE_EXPLOSION_REFLECTION(8,170); +ACE_EXPLOSION_REFLECTION(8,180); +ACE_EXPLOSION_REFLECTION(8,190); +ACE_EXPLOSION_REFLECTION(8,200); +ACE_EXPLOSION_REFLECTION(8,210); +ACE_EXPLOSION_REFLECTION(8,220); +ACE_EXPLOSION_REFLECTION(8,230); +ACE_EXPLOSION_REFLECTION(8,240); +ACE_EXPLOSION_REFLECTION(8,250); +ACE_EXPLOSION_REFLECTION(8,260); +ACE_EXPLOSION_REFLECTION(8,270); +ACE_EXPLOSION_REFLECTION(8,280); +ACE_EXPLOSION_REFLECTION(8,290); +ACE_EXPLOSION_REFLECTION(8,300); +ACE_EXPLOSION_REFLECTION(8,310); +ACE_EXPLOSION_REFLECTION(8,320); +ACE_EXPLOSION_REFLECTION(8,330); +ACE_EXPLOSION_REFLECTION(8,340); +ACE_EXPLOSION_REFLECTION(8,350); +ACE_EXPLOSION_REFLECTION(8,360); +ACE_EXPLOSION_REFLECTION(8,370); +ACE_EXPLOSION_REFLECTION(8,380); +ACE_EXPLOSION_REFLECTION(8,390); +ACE_EXPLOSION_REFLECTION(8,400); +ACE_EXPLOSION_REFLECTION(8,410); +ACE_EXPLOSION_REFLECTION(8,420); +ACE_EXPLOSION_REFLECTION(8,430); +ACE_EXPLOSION_REFLECTION(8,440); +ACE_EXPLOSION_REFLECTION(8,450); +ACE_EXPLOSION_REFLECTION(8,460); +ACE_EXPLOSION_REFLECTION(8,470); +ACE_EXPLOSION_REFLECTION(8,480); +ACE_EXPLOSION_REFLECTION(8,490); +ACE_EXPLOSION_REFLECTION(8,500); +ACE_EXPLOSION_REFLECTION(10,10); +ACE_EXPLOSION_REFLECTION(10,20); +ACE_EXPLOSION_REFLECTION(10,30); +ACE_EXPLOSION_REFLECTION(10,40); +ACE_EXPLOSION_REFLECTION(10,50); +ACE_EXPLOSION_REFLECTION(10,60); +ACE_EXPLOSION_REFLECTION(10,70); +ACE_EXPLOSION_REFLECTION(10,80); +ACE_EXPLOSION_REFLECTION(10,90); +ACE_EXPLOSION_REFLECTION(10,100); +ACE_EXPLOSION_REFLECTION(10,110); +ACE_EXPLOSION_REFLECTION(10,120); +ACE_EXPLOSION_REFLECTION(10,130); +ACE_EXPLOSION_REFLECTION(10,140); +ACE_EXPLOSION_REFLECTION(10,150); +ACE_EXPLOSION_REFLECTION(10,160); +ACE_EXPLOSION_REFLECTION(10,170); +ACE_EXPLOSION_REFLECTION(10,180); +ACE_EXPLOSION_REFLECTION(10,190); +ACE_EXPLOSION_REFLECTION(10,200); +ACE_EXPLOSION_REFLECTION(10,210); +ACE_EXPLOSION_REFLECTION(10,220); +ACE_EXPLOSION_REFLECTION(10,230); +ACE_EXPLOSION_REFLECTION(10,240); +ACE_EXPLOSION_REFLECTION(10,250); +ACE_EXPLOSION_REFLECTION(10,260); +ACE_EXPLOSION_REFLECTION(10,270); +ACE_EXPLOSION_REFLECTION(10,280); +ACE_EXPLOSION_REFLECTION(10,290); +ACE_EXPLOSION_REFLECTION(10,300); +ACE_EXPLOSION_REFLECTION(10,310); +ACE_EXPLOSION_REFLECTION(10,320); +ACE_EXPLOSION_REFLECTION(10,330); +ACE_EXPLOSION_REFLECTION(10,340); +ACE_EXPLOSION_REFLECTION(10,350); +ACE_EXPLOSION_REFLECTION(10,360); +ACE_EXPLOSION_REFLECTION(10,370); +ACE_EXPLOSION_REFLECTION(10,380); +ACE_EXPLOSION_REFLECTION(10,390); +ACE_EXPLOSION_REFLECTION(10,400); +ACE_EXPLOSION_REFLECTION(10,410); +ACE_EXPLOSION_REFLECTION(10,420); +ACE_EXPLOSION_REFLECTION(10,430); +ACE_EXPLOSION_REFLECTION(10,440); +ACE_EXPLOSION_REFLECTION(10,450); +ACE_EXPLOSION_REFLECTION(10,460); +ACE_EXPLOSION_REFLECTION(10,470); +ACE_EXPLOSION_REFLECTION(10,480); +ACE_EXPLOSION_REFLECTION(10,490); +ACE_EXPLOSION_REFLECTION(10,500); +ACE_EXPLOSION_REFLECTION(12,10); +ACE_EXPLOSION_REFLECTION(12,20); +ACE_EXPLOSION_REFLECTION(12,30); +ACE_EXPLOSION_REFLECTION(12,40); +ACE_EXPLOSION_REFLECTION(12,50); +ACE_EXPLOSION_REFLECTION(12,60); +ACE_EXPLOSION_REFLECTION(12,70); +ACE_EXPLOSION_REFLECTION(12,80); +ACE_EXPLOSION_REFLECTION(12,90); +ACE_EXPLOSION_REFLECTION(12,100); +ACE_EXPLOSION_REFLECTION(12,110); +ACE_EXPLOSION_REFLECTION(12,120); +ACE_EXPLOSION_REFLECTION(12,130); +ACE_EXPLOSION_REFLECTION(12,140); +ACE_EXPLOSION_REFLECTION(12,150); +ACE_EXPLOSION_REFLECTION(12,160); +ACE_EXPLOSION_REFLECTION(12,170); +ACE_EXPLOSION_REFLECTION(12,180); +ACE_EXPLOSION_REFLECTION(12,190); +ACE_EXPLOSION_REFLECTION(12,200); +ACE_EXPLOSION_REFLECTION(12,210); +ACE_EXPLOSION_REFLECTION(12,220); +ACE_EXPLOSION_REFLECTION(12,230); +ACE_EXPLOSION_REFLECTION(12,240); +ACE_EXPLOSION_REFLECTION(12,250); +ACE_EXPLOSION_REFLECTION(12,260); +ACE_EXPLOSION_REFLECTION(12,270); +ACE_EXPLOSION_REFLECTION(12,280); +ACE_EXPLOSION_REFLECTION(12,290); +ACE_EXPLOSION_REFLECTION(12,300); +ACE_EXPLOSION_REFLECTION(12,310); +ACE_EXPLOSION_REFLECTION(12,320); +ACE_EXPLOSION_REFLECTION(12,330); +ACE_EXPLOSION_REFLECTION(12,340); +ACE_EXPLOSION_REFLECTION(12,350); +ACE_EXPLOSION_REFLECTION(12,360); +ACE_EXPLOSION_REFLECTION(12,370); +ACE_EXPLOSION_REFLECTION(12,380); +ACE_EXPLOSION_REFLECTION(12,390); +ACE_EXPLOSION_REFLECTION(12,400); +ACE_EXPLOSION_REFLECTION(12,410); +ACE_EXPLOSION_REFLECTION(12,420); +ACE_EXPLOSION_REFLECTION(12,430); +ACE_EXPLOSION_REFLECTION(12,440); +ACE_EXPLOSION_REFLECTION(12,450); +ACE_EXPLOSION_REFLECTION(12,460); +ACE_EXPLOSION_REFLECTION(12,470); +ACE_EXPLOSION_REFLECTION(12,480); +ACE_EXPLOSION_REFLECTION(12,490); +ACE_EXPLOSION_REFLECTION(12,500); +ACE_EXPLOSION_REFLECTION(14,10); +ACE_EXPLOSION_REFLECTION(14,20); +ACE_EXPLOSION_REFLECTION(14,30); +ACE_EXPLOSION_REFLECTION(14,40); +ACE_EXPLOSION_REFLECTION(14,50); +ACE_EXPLOSION_REFLECTION(14,60); +ACE_EXPLOSION_REFLECTION(14,70); +ACE_EXPLOSION_REFLECTION(14,80); +ACE_EXPLOSION_REFLECTION(14,90); +ACE_EXPLOSION_REFLECTION(14,100); +ACE_EXPLOSION_REFLECTION(14,110); +ACE_EXPLOSION_REFLECTION(14,120); +ACE_EXPLOSION_REFLECTION(14,130); +ACE_EXPLOSION_REFLECTION(14,140); +ACE_EXPLOSION_REFLECTION(14,150); +ACE_EXPLOSION_REFLECTION(14,160); +ACE_EXPLOSION_REFLECTION(14,170); +ACE_EXPLOSION_REFLECTION(14,180); +ACE_EXPLOSION_REFLECTION(14,190); +ACE_EXPLOSION_REFLECTION(14,200); +ACE_EXPLOSION_REFLECTION(14,210); +ACE_EXPLOSION_REFLECTION(14,220); +ACE_EXPLOSION_REFLECTION(14,230); +ACE_EXPLOSION_REFLECTION(14,240); +ACE_EXPLOSION_REFLECTION(14,250); +ACE_EXPLOSION_REFLECTION(14,260); +ACE_EXPLOSION_REFLECTION(14,270); +ACE_EXPLOSION_REFLECTION(14,280); +ACE_EXPLOSION_REFLECTION(14,290); +ACE_EXPLOSION_REFLECTION(14,300); +ACE_EXPLOSION_REFLECTION(14,310); +ACE_EXPLOSION_REFLECTION(14,320); +ACE_EXPLOSION_REFLECTION(14,330); +ACE_EXPLOSION_REFLECTION(14,340); +ACE_EXPLOSION_REFLECTION(14,350); +ACE_EXPLOSION_REFLECTION(14,360); +ACE_EXPLOSION_REFLECTION(14,370); +ACE_EXPLOSION_REFLECTION(14,380); +ACE_EXPLOSION_REFLECTION(14,390); +ACE_EXPLOSION_REFLECTION(14,400); +ACE_EXPLOSION_REFLECTION(14,410); +ACE_EXPLOSION_REFLECTION(14,420); +ACE_EXPLOSION_REFLECTION(14,430); +ACE_EXPLOSION_REFLECTION(14,440); +ACE_EXPLOSION_REFLECTION(14,450); +ACE_EXPLOSION_REFLECTION(14,460); +ACE_EXPLOSION_REFLECTION(14,470); +ACE_EXPLOSION_REFLECTION(14,480); +ACE_EXPLOSION_REFLECTION(14,490); +ACE_EXPLOSION_REFLECTION(14,500); +ACE_EXPLOSION_REFLECTION(16,10); +ACE_EXPLOSION_REFLECTION(16,20); +ACE_EXPLOSION_REFLECTION(16,30); +ACE_EXPLOSION_REFLECTION(16,40); +ACE_EXPLOSION_REFLECTION(16,50); +ACE_EXPLOSION_REFLECTION(16,60); +ACE_EXPLOSION_REFLECTION(16,70); +ACE_EXPLOSION_REFLECTION(16,80); +ACE_EXPLOSION_REFLECTION(16,90); +ACE_EXPLOSION_REFLECTION(16,100); +ACE_EXPLOSION_REFLECTION(16,110); +ACE_EXPLOSION_REFLECTION(16,120); +ACE_EXPLOSION_REFLECTION(16,130); +ACE_EXPLOSION_REFLECTION(16,140); +ACE_EXPLOSION_REFLECTION(16,150); +ACE_EXPLOSION_REFLECTION(16,160); +ACE_EXPLOSION_REFLECTION(16,170); +ACE_EXPLOSION_REFLECTION(16,180); +ACE_EXPLOSION_REFLECTION(16,190); +ACE_EXPLOSION_REFLECTION(16,200); +ACE_EXPLOSION_REFLECTION(16,210); +ACE_EXPLOSION_REFLECTION(16,220); +ACE_EXPLOSION_REFLECTION(16,230); +ACE_EXPLOSION_REFLECTION(16,240); +ACE_EXPLOSION_REFLECTION(16,250); +ACE_EXPLOSION_REFLECTION(16,260); +ACE_EXPLOSION_REFLECTION(16,270); +ACE_EXPLOSION_REFLECTION(16,280); +ACE_EXPLOSION_REFLECTION(16,290); +ACE_EXPLOSION_REFLECTION(16,300); +ACE_EXPLOSION_REFLECTION(16,310); +ACE_EXPLOSION_REFLECTION(16,320); +ACE_EXPLOSION_REFLECTION(16,330); +ACE_EXPLOSION_REFLECTION(16,340); +ACE_EXPLOSION_REFLECTION(16,350); +ACE_EXPLOSION_REFLECTION(16,360); +ACE_EXPLOSION_REFLECTION(16,370); +ACE_EXPLOSION_REFLECTION(16,380); +ACE_EXPLOSION_REFLECTION(16,390); +ACE_EXPLOSION_REFLECTION(16,400); +ACE_EXPLOSION_REFLECTION(16,410); +ACE_EXPLOSION_REFLECTION(16,420); +ACE_EXPLOSION_REFLECTION(16,430); +ACE_EXPLOSION_REFLECTION(16,440); +ACE_EXPLOSION_REFLECTION(16,450); +ACE_EXPLOSION_REFLECTION(16,460); +ACE_EXPLOSION_REFLECTION(16,470); +ACE_EXPLOSION_REFLECTION(16,480); +ACE_EXPLOSION_REFLECTION(16,490); +ACE_EXPLOSION_REFLECTION(16,500); +ACE_EXPLOSION_REFLECTION(18,10); +ACE_EXPLOSION_REFLECTION(18,20); +ACE_EXPLOSION_REFLECTION(18,30); +ACE_EXPLOSION_REFLECTION(18,40); +ACE_EXPLOSION_REFLECTION(18,50); +ACE_EXPLOSION_REFLECTION(18,60); +ACE_EXPLOSION_REFLECTION(18,70); +ACE_EXPLOSION_REFLECTION(18,80); +ACE_EXPLOSION_REFLECTION(18,90); +ACE_EXPLOSION_REFLECTION(18,100); +ACE_EXPLOSION_REFLECTION(18,110); +ACE_EXPLOSION_REFLECTION(18,120); +ACE_EXPLOSION_REFLECTION(18,130); +ACE_EXPLOSION_REFLECTION(18,140); +ACE_EXPLOSION_REFLECTION(18,150); +ACE_EXPLOSION_REFLECTION(18,160); +ACE_EXPLOSION_REFLECTION(18,170); +ACE_EXPLOSION_REFLECTION(18,180); +ACE_EXPLOSION_REFLECTION(18,190); +ACE_EXPLOSION_REFLECTION(18,200); +ACE_EXPLOSION_REFLECTION(18,210); +ACE_EXPLOSION_REFLECTION(18,220); +ACE_EXPLOSION_REFLECTION(18,230); +ACE_EXPLOSION_REFLECTION(18,240); +ACE_EXPLOSION_REFLECTION(18,250); +ACE_EXPLOSION_REFLECTION(18,260); +ACE_EXPLOSION_REFLECTION(18,270); +ACE_EXPLOSION_REFLECTION(18,280); +ACE_EXPLOSION_REFLECTION(18,290); +ACE_EXPLOSION_REFLECTION(18,300); +ACE_EXPLOSION_REFLECTION(18,310); +ACE_EXPLOSION_REFLECTION(18,320); +ACE_EXPLOSION_REFLECTION(18,330); +ACE_EXPLOSION_REFLECTION(18,340); +ACE_EXPLOSION_REFLECTION(18,350); +ACE_EXPLOSION_REFLECTION(18,360); +ACE_EXPLOSION_REFLECTION(18,370); +ACE_EXPLOSION_REFLECTION(18,380); +ACE_EXPLOSION_REFLECTION(18,390); +ACE_EXPLOSION_REFLECTION(18,400); +ACE_EXPLOSION_REFLECTION(18,410); +ACE_EXPLOSION_REFLECTION(18,420); +ACE_EXPLOSION_REFLECTION(18,430); +ACE_EXPLOSION_REFLECTION(18,440); +ACE_EXPLOSION_REFLECTION(18,450); +ACE_EXPLOSION_REFLECTION(18,460); +ACE_EXPLOSION_REFLECTION(18,470); +ACE_EXPLOSION_REFLECTION(18,480); +ACE_EXPLOSION_REFLECTION(18,490); +ACE_EXPLOSION_REFLECTION(18,500); +ACE_EXPLOSION_REFLECTION(20,10); +ACE_EXPLOSION_REFLECTION(20,20); +ACE_EXPLOSION_REFLECTION(20,30); +ACE_EXPLOSION_REFLECTION(20,40); +ACE_EXPLOSION_REFLECTION(20,50); +ACE_EXPLOSION_REFLECTION(20,60); +ACE_EXPLOSION_REFLECTION(20,70); +ACE_EXPLOSION_REFLECTION(20,80); +ACE_EXPLOSION_REFLECTION(20,90); +ACE_EXPLOSION_REFLECTION(20,100); +ACE_EXPLOSION_REFLECTION(20,110); +ACE_EXPLOSION_REFLECTION(20,120); +ACE_EXPLOSION_REFLECTION(20,130); +ACE_EXPLOSION_REFLECTION(20,140); +ACE_EXPLOSION_REFLECTION(20,150); +ACE_EXPLOSION_REFLECTION(20,160); +ACE_EXPLOSION_REFLECTION(20,170); +ACE_EXPLOSION_REFLECTION(20,180); +ACE_EXPLOSION_REFLECTION(20,190); +ACE_EXPLOSION_REFLECTION(20,200); +ACE_EXPLOSION_REFLECTION(20,210); +ACE_EXPLOSION_REFLECTION(20,220); +ACE_EXPLOSION_REFLECTION(20,230); +ACE_EXPLOSION_REFLECTION(20,240); +ACE_EXPLOSION_REFLECTION(20,250); +ACE_EXPLOSION_REFLECTION(20,260); +ACE_EXPLOSION_REFLECTION(20,270); +ACE_EXPLOSION_REFLECTION(20,280); +ACE_EXPLOSION_REFLECTION(20,290); +ACE_EXPLOSION_REFLECTION(20,300); +ACE_EXPLOSION_REFLECTION(20,310); +ACE_EXPLOSION_REFLECTION(20,320); +ACE_EXPLOSION_REFLECTION(20,330); +ACE_EXPLOSION_REFLECTION(20,340); +ACE_EXPLOSION_REFLECTION(20,350); +ACE_EXPLOSION_REFLECTION(20,360); +ACE_EXPLOSION_REFLECTION(20,370); +ACE_EXPLOSION_REFLECTION(20,380); +ACE_EXPLOSION_REFLECTION(20,390); +ACE_EXPLOSION_REFLECTION(20,400); +ACE_EXPLOSION_REFLECTION(20,410); +ACE_EXPLOSION_REFLECTION(20,420); +ACE_EXPLOSION_REFLECTION(20,430); +ACE_EXPLOSION_REFLECTION(20,440); +ACE_EXPLOSION_REFLECTION(20,450); +ACE_EXPLOSION_REFLECTION(20,460); +ACE_EXPLOSION_REFLECTION(20,470); +ACE_EXPLOSION_REFLECTION(20,480); +ACE_EXPLOSION_REFLECTION(20,490); +ACE_EXPLOSION_REFLECTION(20,500); +ACE_EXPLOSION_REFLECTION(22,10); +ACE_EXPLOSION_REFLECTION(22,20); +ACE_EXPLOSION_REFLECTION(22,30); +ACE_EXPLOSION_REFLECTION(22,40); +ACE_EXPLOSION_REFLECTION(22,50); +ACE_EXPLOSION_REFLECTION(22,60); +ACE_EXPLOSION_REFLECTION(22,70); +ACE_EXPLOSION_REFLECTION(22,80); +ACE_EXPLOSION_REFLECTION(22,90); +ACE_EXPLOSION_REFLECTION(22,100); +ACE_EXPLOSION_REFLECTION(22,110); +ACE_EXPLOSION_REFLECTION(22,120); +ACE_EXPLOSION_REFLECTION(22,130); +ACE_EXPLOSION_REFLECTION(22,140); +ACE_EXPLOSION_REFLECTION(22,150); +ACE_EXPLOSION_REFLECTION(22,160); +ACE_EXPLOSION_REFLECTION(22,170); +ACE_EXPLOSION_REFLECTION(22,180); +ACE_EXPLOSION_REFLECTION(22,190); +ACE_EXPLOSION_REFLECTION(22,200); +ACE_EXPLOSION_REFLECTION(22,210); +ACE_EXPLOSION_REFLECTION(22,220); +ACE_EXPLOSION_REFLECTION(22,230); +ACE_EXPLOSION_REFLECTION(22,240); +ACE_EXPLOSION_REFLECTION(22,250); +ACE_EXPLOSION_REFLECTION(22,260); +ACE_EXPLOSION_REFLECTION(22,270); +ACE_EXPLOSION_REFLECTION(22,280); +ACE_EXPLOSION_REFLECTION(22,290); +ACE_EXPLOSION_REFLECTION(22,300); +ACE_EXPLOSION_REFLECTION(22,310); +ACE_EXPLOSION_REFLECTION(22,320); +ACE_EXPLOSION_REFLECTION(22,330); +ACE_EXPLOSION_REFLECTION(22,340); +ACE_EXPLOSION_REFLECTION(22,350); +ACE_EXPLOSION_REFLECTION(22,360); +ACE_EXPLOSION_REFLECTION(22,370); +ACE_EXPLOSION_REFLECTION(22,380); +ACE_EXPLOSION_REFLECTION(22,390); +ACE_EXPLOSION_REFLECTION(22,400); +ACE_EXPLOSION_REFLECTION(22,410); +ACE_EXPLOSION_REFLECTION(22,420); +ACE_EXPLOSION_REFLECTION(22,430); +ACE_EXPLOSION_REFLECTION(22,440); +ACE_EXPLOSION_REFLECTION(22,450); +ACE_EXPLOSION_REFLECTION(22,460); +ACE_EXPLOSION_REFLECTION(22,470); +ACE_EXPLOSION_REFLECTION(22,480); +ACE_EXPLOSION_REFLECTION(22,490); +ACE_EXPLOSION_REFLECTION(22,500); +ACE_EXPLOSION_REFLECTION(24,10); +ACE_EXPLOSION_REFLECTION(24,20); +ACE_EXPLOSION_REFLECTION(24,30); +ACE_EXPLOSION_REFLECTION(24,40); +ACE_EXPLOSION_REFLECTION(24,50); +ACE_EXPLOSION_REFLECTION(24,60); +ACE_EXPLOSION_REFLECTION(24,70); +ACE_EXPLOSION_REFLECTION(24,80); +ACE_EXPLOSION_REFLECTION(24,90); +ACE_EXPLOSION_REFLECTION(24,100); +ACE_EXPLOSION_REFLECTION(24,110); +ACE_EXPLOSION_REFLECTION(24,120); +ACE_EXPLOSION_REFLECTION(24,130); +ACE_EXPLOSION_REFLECTION(24,140); +ACE_EXPLOSION_REFLECTION(24,150); +ACE_EXPLOSION_REFLECTION(24,160); +ACE_EXPLOSION_REFLECTION(24,170); +ACE_EXPLOSION_REFLECTION(24,180); +ACE_EXPLOSION_REFLECTION(24,190); +ACE_EXPLOSION_REFLECTION(24,200); +ACE_EXPLOSION_REFLECTION(24,210); +ACE_EXPLOSION_REFLECTION(24,220); +ACE_EXPLOSION_REFLECTION(24,230); +ACE_EXPLOSION_REFLECTION(24,240); +ACE_EXPLOSION_REFLECTION(24,250); +ACE_EXPLOSION_REFLECTION(24,260); +ACE_EXPLOSION_REFLECTION(24,270); +ACE_EXPLOSION_REFLECTION(24,280); +ACE_EXPLOSION_REFLECTION(24,290); +ACE_EXPLOSION_REFLECTION(24,300); +ACE_EXPLOSION_REFLECTION(24,310); +ACE_EXPLOSION_REFLECTION(24,320); +ACE_EXPLOSION_REFLECTION(24,330); +ACE_EXPLOSION_REFLECTION(24,340); +ACE_EXPLOSION_REFLECTION(24,350); +ACE_EXPLOSION_REFLECTION(24,360); +ACE_EXPLOSION_REFLECTION(24,370); +ACE_EXPLOSION_REFLECTION(24,380); +ACE_EXPLOSION_REFLECTION(24,390); +ACE_EXPLOSION_REFLECTION(24,400); +ACE_EXPLOSION_REFLECTION(24,410); +ACE_EXPLOSION_REFLECTION(24,420); +ACE_EXPLOSION_REFLECTION(24,430); +ACE_EXPLOSION_REFLECTION(24,440); +ACE_EXPLOSION_REFLECTION(24,450); +ACE_EXPLOSION_REFLECTION(24,460); +ACE_EXPLOSION_REFLECTION(24,470); +ACE_EXPLOSION_REFLECTION(24,480); +ACE_EXPLOSION_REFLECTION(24,490); +ACE_EXPLOSION_REFLECTION(24,500); +ACE_EXPLOSION_REFLECTION(26,10); +ACE_EXPLOSION_REFLECTION(26,20); +ACE_EXPLOSION_REFLECTION(26,30); +ACE_EXPLOSION_REFLECTION(26,40); +ACE_EXPLOSION_REFLECTION(26,50); +ACE_EXPLOSION_REFLECTION(26,60); +ACE_EXPLOSION_REFLECTION(26,70); +ACE_EXPLOSION_REFLECTION(26,80); +ACE_EXPLOSION_REFLECTION(26,90); +ACE_EXPLOSION_REFLECTION(26,100); +ACE_EXPLOSION_REFLECTION(26,110); +ACE_EXPLOSION_REFLECTION(26,120); +ACE_EXPLOSION_REFLECTION(26,130); +ACE_EXPLOSION_REFLECTION(26,140); +ACE_EXPLOSION_REFLECTION(26,150); +ACE_EXPLOSION_REFLECTION(26,160); +ACE_EXPLOSION_REFLECTION(26,170); +ACE_EXPLOSION_REFLECTION(26,180); +ACE_EXPLOSION_REFLECTION(26,190); +ACE_EXPLOSION_REFLECTION(26,200); +ACE_EXPLOSION_REFLECTION(26,210); +ACE_EXPLOSION_REFLECTION(26,220); +ACE_EXPLOSION_REFLECTION(26,230); +ACE_EXPLOSION_REFLECTION(26,240); +ACE_EXPLOSION_REFLECTION(26,250); +ACE_EXPLOSION_REFLECTION(26,260); +ACE_EXPLOSION_REFLECTION(26,270); +ACE_EXPLOSION_REFLECTION(26,280); +ACE_EXPLOSION_REFLECTION(26,290); +ACE_EXPLOSION_REFLECTION(26,300); +ACE_EXPLOSION_REFLECTION(26,310); +ACE_EXPLOSION_REFLECTION(26,320); +ACE_EXPLOSION_REFLECTION(26,330); +ACE_EXPLOSION_REFLECTION(26,340); +ACE_EXPLOSION_REFLECTION(26,350); +ACE_EXPLOSION_REFLECTION(26,360); +ACE_EXPLOSION_REFLECTION(26,370); +ACE_EXPLOSION_REFLECTION(26,380); +ACE_EXPLOSION_REFLECTION(26,390); +ACE_EXPLOSION_REFLECTION(26,400); +ACE_EXPLOSION_REFLECTION(26,410); +ACE_EXPLOSION_REFLECTION(26,420); +ACE_EXPLOSION_REFLECTION(26,430); +ACE_EXPLOSION_REFLECTION(26,440); +ACE_EXPLOSION_REFLECTION(26,450); +ACE_EXPLOSION_REFLECTION(26,460); +ACE_EXPLOSION_REFLECTION(26,470); +ACE_EXPLOSION_REFLECTION(26,480); +ACE_EXPLOSION_REFLECTION(26,490); +ACE_EXPLOSION_REFLECTION(26,500); +ACE_EXPLOSION_REFLECTION(28,10); +ACE_EXPLOSION_REFLECTION(28,20); +ACE_EXPLOSION_REFLECTION(28,30); +ACE_EXPLOSION_REFLECTION(28,40); +ACE_EXPLOSION_REFLECTION(28,50); +ACE_EXPLOSION_REFLECTION(28,60); +ACE_EXPLOSION_REFLECTION(28,70); +ACE_EXPLOSION_REFLECTION(28,80); +ACE_EXPLOSION_REFLECTION(28,90); +ACE_EXPLOSION_REFLECTION(28,100); +ACE_EXPLOSION_REFLECTION(28,110); +ACE_EXPLOSION_REFLECTION(28,120); +ACE_EXPLOSION_REFLECTION(28,130); +ACE_EXPLOSION_REFLECTION(28,140); +ACE_EXPLOSION_REFLECTION(28,150); +ACE_EXPLOSION_REFLECTION(28,160); +ACE_EXPLOSION_REFLECTION(28,170); +ACE_EXPLOSION_REFLECTION(28,180); +ACE_EXPLOSION_REFLECTION(28,190); +ACE_EXPLOSION_REFLECTION(28,200); +ACE_EXPLOSION_REFLECTION(28,210); +ACE_EXPLOSION_REFLECTION(28,220); +ACE_EXPLOSION_REFLECTION(28,230); +ACE_EXPLOSION_REFLECTION(28,240); +ACE_EXPLOSION_REFLECTION(28,250); +ACE_EXPLOSION_REFLECTION(28,260); +ACE_EXPLOSION_REFLECTION(28,270); +ACE_EXPLOSION_REFLECTION(28,280); +ACE_EXPLOSION_REFLECTION(28,290); +ACE_EXPLOSION_REFLECTION(28,300); +ACE_EXPLOSION_REFLECTION(28,310); +ACE_EXPLOSION_REFLECTION(28,320); +ACE_EXPLOSION_REFLECTION(28,330); +ACE_EXPLOSION_REFLECTION(28,340); +ACE_EXPLOSION_REFLECTION(28,350); +ACE_EXPLOSION_REFLECTION(28,360); +ACE_EXPLOSION_REFLECTION(28,370); +ACE_EXPLOSION_REFLECTION(28,380); +ACE_EXPLOSION_REFLECTION(28,390); +ACE_EXPLOSION_REFLECTION(28,400); +ACE_EXPLOSION_REFLECTION(28,410); +ACE_EXPLOSION_REFLECTION(28,420); +ACE_EXPLOSION_REFLECTION(28,430); +ACE_EXPLOSION_REFLECTION(28,440); +ACE_EXPLOSION_REFLECTION(28,450); +ACE_EXPLOSION_REFLECTION(28,460); +ACE_EXPLOSION_REFLECTION(28,470); +ACE_EXPLOSION_REFLECTION(28,480); +ACE_EXPLOSION_REFLECTION(28,490); +ACE_EXPLOSION_REFLECTION(28,500); +ACE_EXPLOSION_REFLECTION(30,10); +ACE_EXPLOSION_REFLECTION(30,20); +ACE_EXPLOSION_REFLECTION(30,30); +ACE_EXPLOSION_REFLECTION(30,40); +ACE_EXPLOSION_REFLECTION(30,50); +ACE_EXPLOSION_REFLECTION(30,60); +ACE_EXPLOSION_REFLECTION(30,70); +ACE_EXPLOSION_REFLECTION(30,80); +ACE_EXPLOSION_REFLECTION(30,90); +ACE_EXPLOSION_REFLECTION(30,100); +ACE_EXPLOSION_REFLECTION(30,110); +ACE_EXPLOSION_REFLECTION(30,120); +ACE_EXPLOSION_REFLECTION(30,130); +ACE_EXPLOSION_REFLECTION(30,140); +ACE_EXPLOSION_REFLECTION(30,150); +ACE_EXPLOSION_REFLECTION(30,160); +ACE_EXPLOSION_REFLECTION(30,170); +ACE_EXPLOSION_REFLECTION(30,180); +ACE_EXPLOSION_REFLECTION(30,190); +ACE_EXPLOSION_REFLECTION(30,200); +ACE_EXPLOSION_REFLECTION(30,210); +ACE_EXPLOSION_REFLECTION(30,220); +ACE_EXPLOSION_REFLECTION(30,230); +ACE_EXPLOSION_REFLECTION(30,240); +ACE_EXPLOSION_REFLECTION(30,250); +ACE_EXPLOSION_REFLECTION(30,260); +ACE_EXPLOSION_REFLECTION(30,270); +ACE_EXPLOSION_REFLECTION(30,280); +ACE_EXPLOSION_REFLECTION(30,290); +ACE_EXPLOSION_REFLECTION(30,300); +ACE_EXPLOSION_REFLECTION(30,310); +ACE_EXPLOSION_REFLECTION(30,320); +ACE_EXPLOSION_REFLECTION(30,330); +ACE_EXPLOSION_REFLECTION(30,340); +ACE_EXPLOSION_REFLECTION(30,350); +ACE_EXPLOSION_REFLECTION(30,360); +ACE_EXPLOSION_REFLECTION(30,370); +ACE_EXPLOSION_REFLECTION(30,380); +ACE_EXPLOSION_REFLECTION(30,390); +ACE_EXPLOSION_REFLECTION(30,400); +ACE_EXPLOSION_REFLECTION(30,410); +ACE_EXPLOSION_REFLECTION(30,420); +ACE_EXPLOSION_REFLECTION(30,430); +ACE_EXPLOSION_REFLECTION(30,440); +ACE_EXPLOSION_REFLECTION(30,450); +ACE_EXPLOSION_REFLECTION(30,460); +ACE_EXPLOSION_REFLECTION(30,470); +ACE_EXPLOSION_REFLECTION(30,480); +ACE_EXPLOSION_REFLECTION(30,490); +ACE_EXPLOSION_REFLECTION(30,500); +ACE_EXPLOSION_REFLECTION(32,10); +ACE_EXPLOSION_REFLECTION(32,20); +ACE_EXPLOSION_REFLECTION(32,30); +ACE_EXPLOSION_REFLECTION(32,40); +ACE_EXPLOSION_REFLECTION(32,50); +ACE_EXPLOSION_REFLECTION(32,60); +ACE_EXPLOSION_REFLECTION(32,70); +ACE_EXPLOSION_REFLECTION(32,80); +ACE_EXPLOSION_REFLECTION(32,90); +ACE_EXPLOSION_REFLECTION(32,100); +ACE_EXPLOSION_REFLECTION(32,110); +ACE_EXPLOSION_REFLECTION(32,120); +ACE_EXPLOSION_REFLECTION(32,130); +ACE_EXPLOSION_REFLECTION(32,140); +ACE_EXPLOSION_REFLECTION(32,150); +ACE_EXPLOSION_REFLECTION(32,160); +ACE_EXPLOSION_REFLECTION(32,170); +ACE_EXPLOSION_REFLECTION(32,180); +ACE_EXPLOSION_REFLECTION(32,190); +ACE_EXPLOSION_REFLECTION(32,200); +ACE_EXPLOSION_REFLECTION(32,210); +ACE_EXPLOSION_REFLECTION(32,220); +ACE_EXPLOSION_REFLECTION(32,230); +ACE_EXPLOSION_REFLECTION(32,240); +ACE_EXPLOSION_REFLECTION(32,250); +ACE_EXPLOSION_REFLECTION(32,260); +ACE_EXPLOSION_REFLECTION(32,270); +ACE_EXPLOSION_REFLECTION(32,280); +ACE_EXPLOSION_REFLECTION(32,290); +ACE_EXPLOSION_REFLECTION(32,300); +ACE_EXPLOSION_REFLECTION(32,310); +ACE_EXPLOSION_REFLECTION(32,320); +ACE_EXPLOSION_REFLECTION(32,330); +ACE_EXPLOSION_REFLECTION(32,340); +ACE_EXPLOSION_REFLECTION(32,350); +ACE_EXPLOSION_REFLECTION(32,360); +ACE_EXPLOSION_REFLECTION(32,370); +ACE_EXPLOSION_REFLECTION(32,380); +ACE_EXPLOSION_REFLECTION(32,390); +ACE_EXPLOSION_REFLECTION(32,400); +ACE_EXPLOSION_REFLECTION(32,410); +ACE_EXPLOSION_REFLECTION(32,420); +ACE_EXPLOSION_REFLECTION(32,430); +ACE_EXPLOSION_REFLECTION(32,440); +ACE_EXPLOSION_REFLECTION(32,450); +ACE_EXPLOSION_REFLECTION(32,460); +ACE_EXPLOSION_REFLECTION(32,470); +ACE_EXPLOSION_REFLECTION(32,480); +ACE_EXPLOSION_REFLECTION(32,490); +ACE_EXPLOSION_REFLECTION(32,500); +ACE_EXPLOSION_REFLECTION(34,10); +ACE_EXPLOSION_REFLECTION(34,20); +ACE_EXPLOSION_REFLECTION(34,30); +ACE_EXPLOSION_REFLECTION(34,40); +ACE_EXPLOSION_REFLECTION(34,50); +ACE_EXPLOSION_REFLECTION(34,60); +ACE_EXPLOSION_REFLECTION(34,70); +ACE_EXPLOSION_REFLECTION(34,80); +ACE_EXPLOSION_REFLECTION(34,90); +ACE_EXPLOSION_REFLECTION(34,100); +ACE_EXPLOSION_REFLECTION(34,110); +ACE_EXPLOSION_REFLECTION(34,120); +ACE_EXPLOSION_REFLECTION(34,130); +ACE_EXPLOSION_REFLECTION(34,140); +ACE_EXPLOSION_REFLECTION(34,150); +ACE_EXPLOSION_REFLECTION(34,160); +ACE_EXPLOSION_REFLECTION(34,170); +ACE_EXPLOSION_REFLECTION(34,180); +ACE_EXPLOSION_REFLECTION(34,190); +ACE_EXPLOSION_REFLECTION(34,200); +ACE_EXPLOSION_REFLECTION(34,210); +ACE_EXPLOSION_REFLECTION(34,220); +ACE_EXPLOSION_REFLECTION(34,230); +ACE_EXPLOSION_REFLECTION(34,240); +ACE_EXPLOSION_REFLECTION(34,250); +ACE_EXPLOSION_REFLECTION(34,260); +ACE_EXPLOSION_REFLECTION(34,270); +ACE_EXPLOSION_REFLECTION(34,280); +ACE_EXPLOSION_REFLECTION(34,290); +ACE_EXPLOSION_REFLECTION(34,300); +ACE_EXPLOSION_REFLECTION(34,310); +ACE_EXPLOSION_REFLECTION(34,320); +ACE_EXPLOSION_REFLECTION(34,330); +ACE_EXPLOSION_REFLECTION(34,340); +ACE_EXPLOSION_REFLECTION(34,350); +ACE_EXPLOSION_REFLECTION(34,360); +ACE_EXPLOSION_REFLECTION(34,370); +ACE_EXPLOSION_REFLECTION(34,380); +ACE_EXPLOSION_REFLECTION(34,390); +ACE_EXPLOSION_REFLECTION(34,400); +ACE_EXPLOSION_REFLECTION(34,410); +ACE_EXPLOSION_REFLECTION(34,420); +ACE_EXPLOSION_REFLECTION(34,430); +ACE_EXPLOSION_REFLECTION(34,440); +ACE_EXPLOSION_REFLECTION(34,450); +ACE_EXPLOSION_REFLECTION(34,460); +ACE_EXPLOSION_REFLECTION(34,470); +ACE_EXPLOSION_REFLECTION(34,480); +ACE_EXPLOSION_REFLECTION(34,490); +ACE_EXPLOSION_REFLECTION(34,500); +ACE_EXPLOSION_REFLECTION(36,10); +ACE_EXPLOSION_REFLECTION(36,20); +ACE_EXPLOSION_REFLECTION(36,30); +ACE_EXPLOSION_REFLECTION(36,40); +ACE_EXPLOSION_REFLECTION(36,50); +ACE_EXPLOSION_REFLECTION(36,60); +ACE_EXPLOSION_REFLECTION(36,70); +ACE_EXPLOSION_REFLECTION(36,80); +ACE_EXPLOSION_REFLECTION(36,90); +ACE_EXPLOSION_REFLECTION(36,100); +ACE_EXPLOSION_REFLECTION(36,110); +ACE_EXPLOSION_REFLECTION(36,120); +ACE_EXPLOSION_REFLECTION(36,130); +ACE_EXPLOSION_REFLECTION(36,140); +ACE_EXPLOSION_REFLECTION(36,150); +ACE_EXPLOSION_REFLECTION(36,160); +ACE_EXPLOSION_REFLECTION(36,170); +ACE_EXPLOSION_REFLECTION(36,180); +ACE_EXPLOSION_REFLECTION(36,190); +ACE_EXPLOSION_REFLECTION(36,200); +ACE_EXPLOSION_REFLECTION(36,210); +ACE_EXPLOSION_REFLECTION(36,220); +ACE_EXPLOSION_REFLECTION(36,230); +ACE_EXPLOSION_REFLECTION(36,240); +ACE_EXPLOSION_REFLECTION(36,250); +ACE_EXPLOSION_REFLECTION(36,260); +ACE_EXPLOSION_REFLECTION(36,270); +ACE_EXPLOSION_REFLECTION(36,280); +ACE_EXPLOSION_REFLECTION(36,290); +ACE_EXPLOSION_REFLECTION(36,300); +ACE_EXPLOSION_REFLECTION(36,310); +ACE_EXPLOSION_REFLECTION(36,320); +ACE_EXPLOSION_REFLECTION(36,330); +ACE_EXPLOSION_REFLECTION(36,340); +ACE_EXPLOSION_REFLECTION(36,350); +ACE_EXPLOSION_REFLECTION(36,360); +ACE_EXPLOSION_REFLECTION(36,370); +ACE_EXPLOSION_REFLECTION(36,380); +ACE_EXPLOSION_REFLECTION(36,390); +ACE_EXPLOSION_REFLECTION(36,400); +ACE_EXPLOSION_REFLECTION(36,410); +ACE_EXPLOSION_REFLECTION(36,420); +ACE_EXPLOSION_REFLECTION(36,430); +ACE_EXPLOSION_REFLECTION(36,440); +ACE_EXPLOSION_REFLECTION(36,450); +ACE_EXPLOSION_REFLECTION(36,460); +ACE_EXPLOSION_REFLECTION(36,470); +ACE_EXPLOSION_REFLECTION(36,480); +ACE_EXPLOSION_REFLECTION(36,490); +ACE_EXPLOSION_REFLECTION(36,500); +ACE_EXPLOSION_REFLECTION(38,10); +ACE_EXPLOSION_REFLECTION(38,20); +ACE_EXPLOSION_REFLECTION(38,30); +ACE_EXPLOSION_REFLECTION(38,40); +ACE_EXPLOSION_REFLECTION(38,50); +ACE_EXPLOSION_REFLECTION(38,60); +ACE_EXPLOSION_REFLECTION(38,70); +ACE_EXPLOSION_REFLECTION(38,80); +ACE_EXPLOSION_REFLECTION(38,90); +ACE_EXPLOSION_REFLECTION(38,100); +ACE_EXPLOSION_REFLECTION(38,110); +ACE_EXPLOSION_REFLECTION(38,120); +ACE_EXPLOSION_REFLECTION(38,130); +ACE_EXPLOSION_REFLECTION(38,140); +ACE_EXPLOSION_REFLECTION(38,150); +ACE_EXPLOSION_REFLECTION(38,160); +ACE_EXPLOSION_REFLECTION(38,170); +ACE_EXPLOSION_REFLECTION(38,180); +ACE_EXPLOSION_REFLECTION(38,190); +ACE_EXPLOSION_REFLECTION(38,200); +ACE_EXPLOSION_REFLECTION(38,210); +ACE_EXPLOSION_REFLECTION(38,220); +ACE_EXPLOSION_REFLECTION(38,230); +ACE_EXPLOSION_REFLECTION(38,240); +ACE_EXPLOSION_REFLECTION(38,250); +ACE_EXPLOSION_REFLECTION(38,260); +ACE_EXPLOSION_REFLECTION(38,270); +ACE_EXPLOSION_REFLECTION(38,280); +ACE_EXPLOSION_REFLECTION(38,290); +ACE_EXPLOSION_REFLECTION(38,300); +ACE_EXPLOSION_REFLECTION(38,310); +ACE_EXPLOSION_REFLECTION(38,320); +ACE_EXPLOSION_REFLECTION(38,330); +ACE_EXPLOSION_REFLECTION(38,340); +ACE_EXPLOSION_REFLECTION(38,350); +ACE_EXPLOSION_REFLECTION(38,360); +ACE_EXPLOSION_REFLECTION(38,370); +ACE_EXPLOSION_REFLECTION(38,380); +ACE_EXPLOSION_REFLECTION(38,390); +ACE_EXPLOSION_REFLECTION(38,400); +ACE_EXPLOSION_REFLECTION(38,410); +ACE_EXPLOSION_REFLECTION(38,420); +ACE_EXPLOSION_REFLECTION(38,430); +ACE_EXPLOSION_REFLECTION(38,440); +ACE_EXPLOSION_REFLECTION(38,450); +ACE_EXPLOSION_REFLECTION(38,460); +ACE_EXPLOSION_REFLECTION(38,470); +ACE_EXPLOSION_REFLECTION(38,480); +ACE_EXPLOSION_REFLECTION(38,490); +ACE_EXPLOSION_REFLECTION(38,500); +ACE_EXPLOSION_REFLECTION(40,10); +ACE_EXPLOSION_REFLECTION(40,20); +ACE_EXPLOSION_REFLECTION(40,30); +ACE_EXPLOSION_REFLECTION(40,40); +ACE_EXPLOSION_REFLECTION(40,50); +ACE_EXPLOSION_REFLECTION(40,60); +ACE_EXPLOSION_REFLECTION(40,70); +ACE_EXPLOSION_REFLECTION(40,80); +ACE_EXPLOSION_REFLECTION(40,90); +ACE_EXPLOSION_REFLECTION(40,100); +ACE_EXPLOSION_REFLECTION(40,110); +ACE_EXPLOSION_REFLECTION(40,120); +ACE_EXPLOSION_REFLECTION(40,130); +ACE_EXPLOSION_REFLECTION(40,140); +ACE_EXPLOSION_REFLECTION(40,150); +ACE_EXPLOSION_REFLECTION(40,160); +ACE_EXPLOSION_REFLECTION(40,170); +ACE_EXPLOSION_REFLECTION(40,180); +ACE_EXPLOSION_REFLECTION(40,190); +ACE_EXPLOSION_REFLECTION(40,200); +ACE_EXPLOSION_REFLECTION(40,210); +ACE_EXPLOSION_REFLECTION(40,220); +ACE_EXPLOSION_REFLECTION(40,230); +ACE_EXPLOSION_REFLECTION(40,240); +ACE_EXPLOSION_REFLECTION(40,250); +ACE_EXPLOSION_REFLECTION(40,260); +ACE_EXPLOSION_REFLECTION(40,270); +ACE_EXPLOSION_REFLECTION(40,280); +ACE_EXPLOSION_REFLECTION(40,290); +ACE_EXPLOSION_REFLECTION(40,300); +ACE_EXPLOSION_REFLECTION(40,310); +ACE_EXPLOSION_REFLECTION(40,320); +ACE_EXPLOSION_REFLECTION(40,330); +ACE_EXPLOSION_REFLECTION(40,340); +ACE_EXPLOSION_REFLECTION(40,350); +ACE_EXPLOSION_REFLECTION(40,360); +ACE_EXPLOSION_REFLECTION(40,370); +ACE_EXPLOSION_REFLECTION(40,380); +ACE_EXPLOSION_REFLECTION(40,390); +ACE_EXPLOSION_REFLECTION(40,400); +ACE_EXPLOSION_REFLECTION(40,410); +ACE_EXPLOSION_REFLECTION(40,420); +ACE_EXPLOSION_REFLECTION(40,430); +ACE_EXPLOSION_REFLECTION(40,440); +ACE_EXPLOSION_REFLECTION(40,450); +ACE_EXPLOSION_REFLECTION(40,460); +ACE_EXPLOSION_REFLECTION(40,470); +ACE_EXPLOSION_REFLECTION(40,480); +ACE_EXPLOSION_REFLECTION(40,490); +ACE_EXPLOSION_REFLECTION(40,500); +ACE_EXPLOSION_REFLECTION(42,10); +ACE_EXPLOSION_REFLECTION(42,20); +ACE_EXPLOSION_REFLECTION(42,30); +ACE_EXPLOSION_REFLECTION(42,40); +ACE_EXPLOSION_REFLECTION(42,50); +ACE_EXPLOSION_REFLECTION(42,60); +ACE_EXPLOSION_REFLECTION(42,70); +ACE_EXPLOSION_REFLECTION(42,80); +ACE_EXPLOSION_REFLECTION(42,90); +ACE_EXPLOSION_REFLECTION(42,100); +ACE_EXPLOSION_REFLECTION(42,110); +ACE_EXPLOSION_REFLECTION(42,120); +ACE_EXPLOSION_REFLECTION(42,130); +ACE_EXPLOSION_REFLECTION(42,140); +ACE_EXPLOSION_REFLECTION(42,150); +ACE_EXPLOSION_REFLECTION(42,160); +ACE_EXPLOSION_REFLECTION(42,170); +ACE_EXPLOSION_REFLECTION(42,180); +ACE_EXPLOSION_REFLECTION(42,190); +ACE_EXPLOSION_REFLECTION(42,200); +ACE_EXPLOSION_REFLECTION(42,210); +ACE_EXPLOSION_REFLECTION(42,220); +ACE_EXPLOSION_REFLECTION(42,230); +ACE_EXPLOSION_REFLECTION(42,240); +ACE_EXPLOSION_REFLECTION(42,250); +ACE_EXPLOSION_REFLECTION(42,260); +ACE_EXPLOSION_REFLECTION(42,270); +ACE_EXPLOSION_REFLECTION(42,280); +ACE_EXPLOSION_REFLECTION(42,290); +ACE_EXPLOSION_REFLECTION(42,300); +ACE_EXPLOSION_REFLECTION(42,310); +ACE_EXPLOSION_REFLECTION(42,320); +ACE_EXPLOSION_REFLECTION(42,330); +ACE_EXPLOSION_REFLECTION(42,340); +ACE_EXPLOSION_REFLECTION(42,350); +ACE_EXPLOSION_REFLECTION(42,360); +ACE_EXPLOSION_REFLECTION(42,370); +ACE_EXPLOSION_REFLECTION(42,380); +ACE_EXPLOSION_REFLECTION(42,390); +ACE_EXPLOSION_REFLECTION(42,400); +ACE_EXPLOSION_REFLECTION(42,410); +ACE_EXPLOSION_REFLECTION(42,420); +ACE_EXPLOSION_REFLECTION(42,430); +ACE_EXPLOSION_REFLECTION(42,440); +ACE_EXPLOSION_REFLECTION(42,450); +ACE_EXPLOSION_REFLECTION(42,460); +ACE_EXPLOSION_REFLECTION(42,470); +ACE_EXPLOSION_REFLECTION(42,480); +ACE_EXPLOSION_REFLECTION(42,490); +ACE_EXPLOSION_REFLECTION(42,500); +ACE_EXPLOSION_REFLECTION(44,10); +ACE_EXPLOSION_REFLECTION(44,20); +ACE_EXPLOSION_REFLECTION(44,30); +ACE_EXPLOSION_REFLECTION(44,40); +ACE_EXPLOSION_REFLECTION(44,50); +ACE_EXPLOSION_REFLECTION(44,60); +ACE_EXPLOSION_REFLECTION(44,70); +ACE_EXPLOSION_REFLECTION(44,80); +ACE_EXPLOSION_REFLECTION(44,90); +ACE_EXPLOSION_REFLECTION(44,100); +ACE_EXPLOSION_REFLECTION(44,110); +ACE_EXPLOSION_REFLECTION(44,120); +ACE_EXPLOSION_REFLECTION(44,130); +ACE_EXPLOSION_REFLECTION(44,140); +ACE_EXPLOSION_REFLECTION(44,150); +ACE_EXPLOSION_REFLECTION(44,160); +ACE_EXPLOSION_REFLECTION(44,170); +ACE_EXPLOSION_REFLECTION(44,180); +ACE_EXPLOSION_REFLECTION(44,190); +ACE_EXPLOSION_REFLECTION(44,200); +ACE_EXPLOSION_REFLECTION(44,210); +ACE_EXPLOSION_REFLECTION(44,220); +ACE_EXPLOSION_REFLECTION(44,230); +ACE_EXPLOSION_REFLECTION(44,240); +ACE_EXPLOSION_REFLECTION(44,250); +ACE_EXPLOSION_REFLECTION(44,260); +ACE_EXPLOSION_REFLECTION(44,270); +ACE_EXPLOSION_REFLECTION(44,280); +ACE_EXPLOSION_REFLECTION(44,290); +ACE_EXPLOSION_REFLECTION(44,300); +ACE_EXPLOSION_REFLECTION(44,310); +ACE_EXPLOSION_REFLECTION(44,320); +ACE_EXPLOSION_REFLECTION(44,330); +ACE_EXPLOSION_REFLECTION(44,340); +ACE_EXPLOSION_REFLECTION(44,350); +ACE_EXPLOSION_REFLECTION(44,360); +ACE_EXPLOSION_REFLECTION(44,370); +ACE_EXPLOSION_REFLECTION(44,380); +ACE_EXPLOSION_REFLECTION(44,390); +ACE_EXPLOSION_REFLECTION(44,400); +ACE_EXPLOSION_REFLECTION(44,410); +ACE_EXPLOSION_REFLECTION(44,420); +ACE_EXPLOSION_REFLECTION(44,430); +ACE_EXPLOSION_REFLECTION(44,440); +ACE_EXPLOSION_REFLECTION(44,450); +ACE_EXPLOSION_REFLECTION(44,460); +ACE_EXPLOSION_REFLECTION(44,470); +ACE_EXPLOSION_REFLECTION(44,480); +ACE_EXPLOSION_REFLECTION(44,490); +ACE_EXPLOSION_REFLECTION(44,500); +ACE_EXPLOSION_REFLECTION(46,10); +ACE_EXPLOSION_REFLECTION(46,20); +ACE_EXPLOSION_REFLECTION(46,30); +ACE_EXPLOSION_REFLECTION(46,40); +ACE_EXPLOSION_REFLECTION(46,50); +ACE_EXPLOSION_REFLECTION(46,60); +ACE_EXPLOSION_REFLECTION(46,70); +ACE_EXPLOSION_REFLECTION(46,80); +ACE_EXPLOSION_REFLECTION(46,90); +ACE_EXPLOSION_REFLECTION(46,100); +ACE_EXPLOSION_REFLECTION(46,110); +ACE_EXPLOSION_REFLECTION(46,120); +ACE_EXPLOSION_REFLECTION(46,130); +ACE_EXPLOSION_REFLECTION(46,140); +ACE_EXPLOSION_REFLECTION(46,150); +ACE_EXPLOSION_REFLECTION(46,160); +ACE_EXPLOSION_REFLECTION(46,170); +ACE_EXPLOSION_REFLECTION(46,180); +ACE_EXPLOSION_REFLECTION(46,190); +ACE_EXPLOSION_REFLECTION(46,200); +ACE_EXPLOSION_REFLECTION(46,210); +ACE_EXPLOSION_REFLECTION(46,220); +ACE_EXPLOSION_REFLECTION(46,230); +ACE_EXPLOSION_REFLECTION(46,240); +ACE_EXPLOSION_REFLECTION(46,250); +ACE_EXPLOSION_REFLECTION(46,260); +ACE_EXPLOSION_REFLECTION(46,270); +ACE_EXPLOSION_REFLECTION(46,280); +ACE_EXPLOSION_REFLECTION(46,290); +ACE_EXPLOSION_REFLECTION(46,300); +ACE_EXPLOSION_REFLECTION(46,310); +ACE_EXPLOSION_REFLECTION(46,320); +ACE_EXPLOSION_REFLECTION(46,330); +ACE_EXPLOSION_REFLECTION(46,340); +ACE_EXPLOSION_REFLECTION(46,350); +ACE_EXPLOSION_REFLECTION(46,360); +ACE_EXPLOSION_REFLECTION(46,370); +ACE_EXPLOSION_REFLECTION(46,380); +ACE_EXPLOSION_REFLECTION(46,390); +ACE_EXPLOSION_REFLECTION(46,400); +ACE_EXPLOSION_REFLECTION(46,410); +ACE_EXPLOSION_REFLECTION(46,420); +ACE_EXPLOSION_REFLECTION(46,430); +ACE_EXPLOSION_REFLECTION(46,440); +ACE_EXPLOSION_REFLECTION(46,450); +ACE_EXPLOSION_REFLECTION(46,460); +ACE_EXPLOSION_REFLECTION(46,470); +ACE_EXPLOSION_REFLECTION(46,480); +ACE_EXPLOSION_REFLECTION(46,490); +ACE_EXPLOSION_REFLECTION(46,500); +ACE_EXPLOSION_REFLECTION(48,10); +ACE_EXPLOSION_REFLECTION(48,20); +ACE_EXPLOSION_REFLECTION(48,30); +ACE_EXPLOSION_REFLECTION(48,40); +ACE_EXPLOSION_REFLECTION(48,50); +ACE_EXPLOSION_REFLECTION(48,60); +ACE_EXPLOSION_REFLECTION(48,70); +ACE_EXPLOSION_REFLECTION(48,80); +ACE_EXPLOSION_REFLECTION(48,90); +ACE_EXPLOSION_REFLECTION(48,100); +ACE_EXPLOSION_REFLECTION(48,110); +ACE_EXPLOSION_REFLECTION(48,120); +ACE_EXPLOSION_REFLECTION(48,130); +ACE_EXPLOSION_REFLECTION(48,140); +ACE_EXPLOSION_REFLECTION(48,150); +ACE_EXPLOSION_REFLECTION(48,160); +ACE_EXPLOSION_REFLECTION(48,170); +ACE_EXPLOSION_REFLECTION(48,180); +ACE_EXPLOSION_REFLECTION(48,190); +ACE_EXPLOSION_REFLECTION(48,200); +ACE_EXPLOSION_REFLECTION(48,210); +ACE_EXPLOSION_REFLECTION(48,220); +ACE_EXPLOSION_REFLECTION(48,230); +ACE_EXPLOSION_REFLECTION(48,240); +ACE_EXPLOSION_REFLECTION(48,250); +ACE_EXPLOSION_REFLECTION(48,260); +ACE_EXPLOSION_REFLECTION(48,270); +ACE_EXPLOSION_REFLECTION(48,280); +ACE_EXPLOSION_REFLECTION(48,290); +ACE_EXPLOSION_REFLECTION(48,300); +ACE_EXPLOSION_REFLECTION(48,310); +ACE_EXPLOSION_REFLECTION(48,320); +ACE_EXPLOSION_REFLECTION(48,330); +ACE_EXPLOSION_REFLECTION(48,340); +ACE_EXPLOSION_REFLECTION(48,350); +ACE_EXPLOSION_REFLECTION(48,360); +ACE_EXPLOSION_REFLECTION(48,370); +ACE_EXPLOSION_REFLECTION(48,380); +ACE_EXPLOSION_REFLECTION(48,390); +ACE_EXPLOSION_REFLECTION(48,400); +ACE_EXPLOSION_REFLECTION(48,410); +ACE_EXPLOSION_REFLECTION(48,420); +ACE_EXPLOSION_REFLECTION(48,430); +ACE_EXPLOSION_REFLECTION(48,440); +ACE_EXPLOSION_REFLECTION(48,450); +ACE_EXPLOSION_REFLECTION(48,460); +ACE_EXPLOSION_REFLECTION(48,470); +ACE_EXPLOSION_REFLECTION(48,480); +ACE_EXPLOSION_REFLECTION(48,490); +ACE_EXPLOSION_REFLECTION(48,500); +ACE_EXPLOSION_REFLECTION(50,10); +ACE_EXPLOSION_REFLECTION(50,20); +ACE_EXPLOSION_REFLECTION(50,30); +ACE_EXPLOSION_REFLECTION(50,40); +ACE_EXPLOSION_REFLECTION(50,50); +ACE_EXPLOSION_REFLECTION(50,60); +ACE_EXPLOSION_REFLECTION(50,70); +ACE_EXPLOSION_REFLECTION(50,80); +ACE_EXPLOSION_REFLECTION(50,90); +ACE_EXPLOSION_REFLECTION(50,100); +ACE_EXPLOSION_REFLECTION(50,110); +ACE_EXPLOSION_REFLECTION(50,120); +ACE_EXPLOSION_REFLECTION(50,130); +ACE_EXPLOSION_REFLECTION(50,140); +ACE_EXPLOSION_REFLECTION(50,150); +ACE_EXPLOSION_REFLECTION(50,160); +ACE_EXPLOSION_REFLECTION(50,170); +ACE_EXPLOSION_REFLECTION(50,180); +ACE_EXPLOSION_REFLECTION(50,190); +ACE_EXPLOSION_REFLECTION(50,200); +ACE_EXPLOSION_REFLECTION(50,210); +ACE_EXPLOSION_REFLECTION(50,220); +ACE_EXPLOSION_REFLECTION(50,230); +ACE_EXPLOSION_REFLECTION(50,240); +ACE_EXPLOSION_REFLECTION(50,250); +ACE_EXPLOSION_REFLECTION(50,260); +ACE_EXPLOSION_REFLECTION(50,270); +ACE_EXPLOSION_REFLECTION(50,280); +ACE_EXPLOSION_REFLECTION(50,290); +ACE_EXPLOSION_REFLECTION(50,300); +ACE_EXPLOSION_REFLECTION(50,310); +ACE_EXPLOSION_REFLECTION(50,320); +ACE_EXPLOSION_REFLECTION(50,330); +ACE_EXPLOSION_REFLECTION(50,340); +ACE_EXPLOSION_REFLECTION(50,350); +ACE_EXPLOSION_REFLECTION(50,360); +ACE_EXPLOSION_REFLECTION(50,370); +ACE_EXPLOSION_REFLECTION(50,380); +ACE_EXPLOSION_REFLECTION(50,390); +ACE_EXPLOSION_REFLECTION(50,400); +ACE_EXPLOSION_REFLECTION(50,410); +ACE_EXPLOSION_REFLECTION(50,420); +ACE_EXPLOSION_REFLECTION(50,430); +ACE_EXPLOSION_REFLECTION(50,440); +ACE_EXPLOSION_REFLECTION(50,450); +ACE_EXPLOSION_REFLECTION(50,460); +ACE_EXPLOSION_REFLECTION(50,470); +ACE_EXPLOSION_REFLECTION(50,480); +ACE_EXPLOSION_REFLECTION(50,490); +ACE_EXPLOSION_REFLECTION(50,500); +ACE_EXPLOSION_REFLECTION(52,10); +ACE_EXPLOSION_REFLECTION(52,20); +ACE_EXPLOSION_REFLECTION(52,30); +ACE_EXPLOSION_REFLECTION(52,40); +ACE_EXPLOSION_REFLECTION(52,50); +ACE_EXPLOSION_REFLECTION(52,60); +ACE_EXPLOSION_REFLECTION(52,70); +ACE_EXPLOSION_REFLECTION(52,80); +ACE_EXPLOSION_REFLECTION(52,90); +ACE_EXPLOSION_REFLECTION(52,100); +ACE_EXPLOSION_REFLECTION(52,110); +ACE_EXPLOSION_REFLECTION(52,120); +ACE_EXPLOSION_REFLECTION(52,130); +ACE_EXPLOSION_REFLECTION(52,140); +ACE_EXPLOSION_REFLECTION(52,150); +ACE_EXPLOSION_REFLECTION(52,160); +ACE_EXPLOSION_REFLECTION(52,170); +ACE_EXPLOSION_REFLECTION(52,180); +ACE_EXPLOSION_REFLECTION(52,190); +ACE_EXPLOSION_REFLECTION(52,200); +ACE_EXPLOSION_REFLECTION(52,210); +ACE_EXPLOSION_REFLECTION(52,220); +ACE_EXPLOSION_REFLECTION(52,230); +ACE_EXPLOSION_REFLECTION(52,240); +ACE_EXPLOSION_REFLECTION(52,250); +ACE_EXPLOSION_REFLECTION(52,260); +ACE_EXPLOSION_REFLECTION(52,270); +ACE_EXPLOSION_REFLECTION(52,280); +ACE_EXPLOSION_REFLECTION(52,290); +ACE_EXPLOSION_REFLECTION(52,300); +ACE_EXPLOSION_REFLECTION(52,310); +ACE_EXPLOSION_REFLECTION(52,320); +ACE_EXPLOSION_REFLECTION(52,330); +ACE_EXPLOSION_REFLECTION(52,340); +ACE_EXPLOSION_REFLECTION(52,350); +ACE_EXPLOSION_REFLECTION(52,360); +ACE_EXPLOSION_REFLECTION(52,370); +ACE_EXPLOSION_REFLECTION(52,380); +ACE_EXPLOSION_REFLECTION(52,390); +ACE_EXPLOSION_REFLECTION(52,400); +ACE_EXPLOSION_REFLECTION(52,410); +ACE_EXPLOSION_REFLECTION(52,420); +ACE_EXPLOSION_REFLECTION(52,430); +ACE_EXPLOSION_REFLECTION(52,440); +ACE_EXPLOSION_REFLECTION(52,450); +ACE_EXPLOSION_REFLECTION(52,460); +ACE_EXPLOSION_REFLECTION(52,470); +ACE_EXPLOSION_REFLECTION(52,480); +ACE_EXPLOSION_REFLECTION(52,490); +ACE_EXPLOSION_REFLECTION(52,500); +ACE_EXPLOSION_REFLECTION(54,10); +ACE_EXPLOSION_REFLECTION(54,20); +ACE_EXPLOSION_REFLECTION(54,30); +ACE_EXPLOSION_REFLECTION(54,40); +ACE_EXPLOSION_REFLECTION(54,50); +ACE_EXPLOSION_REFLECTION(54,60); +ACE_EXPLOSION_REFLECTION(54,70); +ACE_EXPLOSION_REFLECTION(54,80); +ACE_EXPLOSION_REFLECTION(54,90); +ACE_EXPLOSION_REFLECTION(54,100); +ACE_EXPLOSION_REFLECTION(54,110); +ACE_EXPLOSION_REFLECTION(54,120); +ACE_EXPLOSION_REFLECTION(54,130); +ACE_EXPLOSION_REFLECTION(54,140); +ACE_EXPLOSION_REFLECTION(54,150); +ACE_EXPLOSION_REFLECTION(54,160); +ACE_EXPLOSION_REFLECTION(54,170); +ACE_EXPLOSION_REFLECTION(54,180); +ACE_EXPLOSION_REFLECTION(54,190); +ACE_EXPLOSION_REFLECTION(54,200); +ACE_EXPLOSION_REFLECTION(54,210); +ACE_EXPLOSION_REFLECTION(54,220); +ACE_EXPLOSION_REFLECTION(54,230); +ACE_EXPLOSION_REFLECTION(54,240); +ACE_EXPLOSION_REFLECTION(54,250); +ACE_EXPLOSION_REFLECTION(54,260); +ACE_EXPLOSION_REFLECTION(54,270); +ACE_EXPLOSION_REFLECTION(54,280); +ACE_EXPLOSION_REFLECTION(54,290); +ACE_EXPLOSION_REFLECTION(54,300); +ACE_EXPLOSION_REFLECTION(54,310); +ACE_EXPLOSION_REFLECTION(54,320); +ACE_EXPLOSION_REFLECTION(54,330); +ACE_EXPLOSION_REFLECTION(54,340); +ACE_EXPLOSION_REFLECTION(54,350); +ACE_EXPLOSION_REFLECTION(54,360); +ACE_EXPLOSION_REFLECTION(54,370); +ACE_EXPLOSION_REFLECTION(54,380); +ACE_EXPLOSION_REFLECTION(54,390); +ACE_EXPLOSION_REFLECTION(54,400); +ACE_EXPLOSION_REFLECTION(54,410); +ACE_EXPLOSION_REFLECTION(54,420); +ACE_EXPLOSION_REFLECTION(54,430); +ACE_EXPLOSION_REFLECTION(54,440); +ACE_EXPLOSION_REFLECTION(54,450); +ACE_EXPLOSION_REFLECTION(54,460); +ACE_EXPLOSION_REFLECTION(54,470); +ACE_EXPLOSION_REFLECTION(54,480); +ACE_EXPLOSION_REFLECTION(54,490); +ACE_EXPLOSION_REFLECTION(54,500); +ACE_EXPLOSION_REFLECTION(56,10); +ACE_EXPLOSION_REFLECTION(56,20); +ACE_EXPLOSION_REFLECTION(56,30); +ACE_EXPLOSION_REFLECTION(56,40); +ACE_EXPLOSION_REFLECTION(56,50); +ACE_EXPLOSION_REFLECTION(56,60); +ACE_EXPLOSION_REFLECTION(56,70); +ACE_EXPLOSION_REFLECTION(56,80); +ACE_EXPLOSION_REFLECTION(56,90); +ACE_EXPLOSION_REFLECTION(56,100); +ACE_EXPLOSION_REFLECTION(56,110); +ACE_EXPLOSION_REFLECTION(56,120); +ACE_EXPLOSION_REFLECTION(56,130); +ACE_EXPLOSION_REFLECTION(56,140); +ACE_EXPLOSION_REFLECTION(56,150); +ACE_EXPLOSION_REFLECTION(56,160); +ACE_EXPLOSION_REFLECTION(56,170); +ACE_EXPLOSION_REFLECTION(56,180); +ACE_EXPLOSION_REFLECTION(56,190); +ACE_EXPLOSION_REFLECTION(56,200); +ACE_EXPLOSION_REFLECTION(56,210); +ACE_EXPLOSION_REFLECTION(56,220); +ACE_EXPLOSION_REFLECTION(56,230); +ACE_EXPLOSION_REFLECTION(56,240); +ACE_EXPLOSION_REFLECTION(56,250); +ACE_EXPLOSION_REFLECTION(56,260); +ACE_EXPLOSION_REFLECTION(56,270); +ACE_EXPLOSION_REFLECTION(56,280); +ACE_EXPLOSION_REFLECTION(56,290); +ACE_EXPLOSION_REFLECTION(56,300); +ACE_EXPLOSION_REFLECTION(56,310); +ACE_EXPLOSION_REFLECTION(56,320); +ACE_EXPLOSION_REFLECTION(56,330); +ACE_EXPLOSION_REFLECTION(56,340); +ACE_EXPLOSION_REFLECTION(56,350); +ACE_EXPLOSION_REFLECTION(56,360); +ACE_EXPLOSION_REFLECTION(56,370); +ACE_EXPLOSION_REFLECTION(56,380); +ACE_EXPLOSION_REFLECTION(56,390); +ACE_EXPLOSION_REFLECTION(56,400); +ACE_EXPLOSION_REFLECTION(56,410); +ACE_EXPLOSION_REFLECTION(56,420); +ACE_EXPLOSION_REFLECTION(56,430); +ACE_EXPLOSION_REFLECTION(56,440); +ACE_EXPLOSION_REFLECTION(56,450); +ACE_EXPLOSION_REFLECTION(56,460); +ACE_EXPLOSION_REFLECTION(56,470); +ACE_EXPLOSION_REFLECTION(56,480); +ACE_EXPLOSION_REFLECTION(56,490); +ACE_EXPLOSION_REFLECTION(56,500); +ACE_EXPLOSION_REFLECTION(58,10); +ACE_EXPLOSION_REFLECTION(58,20); +ACE_EXPLOSION_REFLECTION(58,30); +ACE_EXPLOSION_REFLECTION(58,40); +ACE_EXPLOSION_REFLECTION(58,50); +ACE_EXPLOSION_REFLECTION(58,60); +ACE_EXPLOSION_REFLECTION(58,70); +ACE_EXPLOSION_REFLECTION(58,80); +ACE_EXPLOSION_REFLECTION(58,90); +ACE_EXPLOSION_REFLECTION(58,100); +ACE_EXPLOSION_REFLECTION(58,110); +ACE_EXPLOSION_REFLECTION(58,120); +ACE_EXPLOSION_REFLECTION(58,130); +ACE_EXPLOSION_REFLECTION(58,140); +ACE_EXPLOSION_REFLECTION(58,150); +ACE_EXPLOSION_REFLECTION(58,160); +ACE_EXPLOSION_REFLECTION(58,170); +ACE_EXPLOSION_REFLECTION(58,180); +ACE_EXPLOSION_REFLECTION(58,190); +ACE_EXPLOSION_REFLECTION(58,200); +ACE_EXPLOSION_REFLECTION(58,210); +ACE_EXPLOSION_REFLECTION(58,220); +ACE_EXPLOSION_REFLECTION(58,230); +ACE_EXPLOSION_REFLECTION(58,240); +ACE_EXPLOSION_REFLECTION(58,250); +ACE_EXPLOSION_REFLECTION(58,260); +ACE_EXPLOSION_REFLECTION(58,270); +ACE_EXPLOSION_REFLECTION(58,280); +ACE_EXPLOSION_REFLECTION(58,290); +ACE_EXPLOSION_REFLECTION(58,300); +ACE_EXPLOSION_REFLECTION(58,310); +ACE_EXPLOSION_REFLECTION(58,320); +ACE_EXPLOSION_REFLECTION(58,330); +ACE_EXPLOSION_REFLECTION(58,340); +ACE_EXPLOSION_REFLECTION(58,350); +ACE_EXPLOSION_REFLECTION(58,360); +ACE_EXPLOSION_REFLECTION(58,370); +ACE_EXPLOSION_REFLECTION(58,380); +ACE_EXPLOSION_REFLECTION(58,390); +ACE_EXPLOSION_REFLECTION(58,400); +ACE_EXPLOSION_REFLECTION(58,410); +ACE_EXPLOSION_REFLECTION(58,420); +ACE_EXPLOSION_REFLECTION(58,430); +ACE_EXPLOSION_REFLECTION(58,440); +ACE_EXPLOSION_REFLECTION(58,450); +ACE_EXPLOSION_REFLECTION(58,460); +ACE_EXPLOSION_REFLECTION(58,470); +ACE_EXPLOSION_REFLECTION(58,480); +ACE_EXPLOSION_REFLECTION(58,490); +ACE_EXPLOSION_REFLECTION(58,500); +ACE_EXPLOSION_REFLECTION(60,10); +ACE_EXPLOSION_REFLECTION(60,20); +ACE_EXPLOSION_REFLECTION(60,30); +ACE_EXPLOSION_REFLECTION(60,40); +ACE_EXPLOSION_REFLECTION(60,50); +ACE_EXPLOSION_REFLECTION(60,60); +ACE_EXPLOSION_REFLECTION(60,70); +ACE_EXPLOSION_REFLECTION(60,80); +ACE_EXPLOSION_REFLECTION(60,90); +ACE_EXPLOSION_REFLECTION(60,100); +ACE_EXPLOSION_REFLECTION(60,110); +ACE_EXPLOSION_REFLECTION(60,120); +ACE_EXPLOSION_REFLECTION(60,130); +ACE_EXPLOSION_REFLECTION(60,140); +ACE_EXPLOSION_REFLECTION(60,150); +ACE_EXPLOSION_REFLECTION(60,160); +ACE_EXPLOSION_REFLECTION(60,170); +ACE_EXPLOSION_REFLECTION(60,180); +ACE_EXPLOSION_REFLECTION(60,190); +ACE_EXPLOSION_REFLECTION(60,200); +ACE_EXPLOSION_REFLECTION(60,210); +ACE_EXPLOSION_REFLECTION(60,220); +ACE_EXPLOSION_REFLECTION(60,230); +ACE_EXPLOSION_REFLECTION(60,240); +ACE_EXPLOSION_REFLECTION(60,250); +ACE_EXPLOSION_REFLECTION(60,260); +ACE_EXPLOSION_REFLECTION(60,270); +ACE_EXPLOSION_REFLECTION(60,280); +ACE_EXPLOSION_REFLECTION(60,290); +ACE_EXPLOSION_REFLECTION(60,300); +ACE_EXPLOSION_REFLECTION(60,310); +ACE_EXPLOSION_REFLECTION(60,320); +ACE_EXPLOSION_REFLECTION(60,330); +ACE_EXPLOSION_REFLECTION(60,340); +ACE_EXPLOSION_REFLECTION(60,350); +ACE_EXPLOSION_REFLECTION(60,360); +ACE_EXPLOSION_REFLECTION(60,370); +ACE_EXPLOSION_REFLECTION(60,380); +ACE_EXPLOSION_REFLECTION(60,390); +ACE_EXPLOSION_REFLECTION(60,400); +ACE_EXPLOSION_REFLECTION(60,410); +ACE_EXPLOSION_REFLECTION(60,420); +ACE_EXPLOSION_REFLECTION(60,430); +ACE_EXPLOSION_REFLECTION(60,440); +ACE_EXPLOSION_REFLECTION(60,450); +ACE_EXPLOSION_REFLECTION(60,460); +ACE_EXPLOSION_REFLECTION(60,470); +ACE_EXPLOSION_REFLECTION(60,480); +ACE_EXPLOSION_REFLECTION(60,490); +ACE_EXPLOSION_REFLECTION(60,500); +ACE_EXPLOSION_REFLECTION(62,10); +ACE_EXPLOSION_REFLECTION(62,20); +ACE_EXPLOSION_REFLECTION(62,30); +ACE_EXPLOSION_REFLECTION(62,40); +ACE_EXPLOSION_REFLECTION(62,50); +ACE_EXPLOSION_REFLECTION(62,60); +ACE_EXPLOSION_REFLECTION(62,70); +ACE_EXPLOSION_REFLECTION(62,80); +ACE_EXPLOSION_REFLECTION(62,90); +ACE_EXPLOSION_REFLECTION(62,100); +ACE_EXPLOSION_REFLECTION(62,110); +ACE_EXPLOSION_REFLECTION(62,120); +ACE_EXPLOSION_REFLECTION(62,130); +ACE_EXPLOSION_REFLECTION(62,140); +ACE_EXPLOSION_REFLECTION(62,150); +ACE_EXPLOSION_REFLECTION(62,160); +ACE_EXPLOSION_REFLECTION(62,170); +ACE_EXPLOSION_REFLECTION(62,180); +ACE_EXPLOSION_REFLECTION(62,190); +ACE_EXPLOSION_REFLECTION(62,200); +ACE_EXPLOSION_REFLECTION(62,210); +ACE_EXPLOSION_REFLECTION(62,220); +ACE_EXPLOSION_REFLECTION(62,230); +ACE_EXPLOSION_REFLECTION(62,240); +ACE_EXPLOSION_REFLECTION(62,250); +ACE_EXPLOSION_REFLECTION(62,260); +ACE_EXPLOSION_REFLECTION(62,270); +ACE_EXPLOSION_REFLECTION(62,280); +ACE_EXPLOSION_REFLECTION(62,290); +ACE_EXPLOSION_REFLECTION(62,300); +ACE_EXPLOSION_REFLECTION(62,310); +ACE_EXPLOSION_REFLECTION(62,320); +ACE_EXPLOSION_REFLECTION(62,330); +ACE_EXPLOSION_REFLECTION(62,340); +ACE_EXPLOSION_REFLECTION(62,350); +ACE_EXPLOSION_REFLECTION(62,360); +ACE_EXPLOSION_REFLECTION(62,370); +ACE_EXPLOSION_REFLECTION(62,380); +ACE_EXPLOSION_REFLECTION(62,390); +ACE_EXPLOSION_REFLECTION(62,400); +ACE_EXPLOSION_REFLECTION(62,410); +ACE_EXPLOSION_REFLECTION(62,420); +ACE_EXPLOSION_REFLECTION(62,430); +ACE_EXPLOSION_REFLECTION(62,440); +ACE_EXPLOSION_REFLECTION(62,450); +ACE_EXPLOSION_REFLECTION(62,460); +ACE_EXPLOSION_REFLECTION(62,470); +ACE_EXPLOSION_REFLECTION(62,480); +ACE_EXPLOSION_REFLECTION(62,490); +ACE_EXPLOSION_REFLECTION(62,500); +ACE_EXPLOSION_REFLECTION(64,10); +ACE_EXPLOSION_REFLECTION(64,20); +ACE_EXPLOSION_REFLECTION(64,30); +ACE_EXPLOSION_REFLECTION(64,40); +ACE_EXPLOSION_REFLECTION(64,50); +ACE_EXPLOSION_REFLECTION(64,60); +ACE_EXPLOSION_REFLECTION(64,70); +ACE_EXPLOSION_REFLECTION(64,80); +ACE_EXPLOSION_REFLECTION(64,90); +ACE_EXPLOSION_REFLECTION(64,100); +ACE_EXPLOSION_REFLECTION(64,110); +ACE_EXPLOSION_REFLECTION(64,120); +ACE_EXPLOSION_REFLECTION(64,130); +ACE_EXPLOSION_REFLECTION(64,140); +ACE_EXPLOSION_REFLECTION(64,150); +ACE_EXPLOSION_REFLECTION(64,160); +ACE_EXPLOSION_REFLECTION(64,170); +ACE_EXPLOSION_REFLECTION(64,180); +ACE_EXPLOSION_REFLECTION(64,190); +ACE_EXPLOSION_REFLECTION(64,200); +ACE_EXPLOSION_REFLECTION(64,210); +ACE_EXPLOSION_REFLECTION(64,220); +ACE_EXPLOSION_REFLECTION(64,230); +ACE_EXPLOSION_REFLECTION(64,240); +ACE_EXPLOSION_REFLECTION(64,250); +ACE_EXPLOSION_REFLECTION(64,260); +ACE_EXPLOSION_REFLECTION(64,270); +ACE_EXPLOSION_REFLECTION(64,280); +ACE_EXPLOSION_REFLECTION(64,290); +ACE_EXPLOSION_REFLECTION(64,300); +ACE_EXPLOSION_REFLECTION(64,310); +ACE_EXPLOSION_REFLECTION(64,320); +ACE_EXPLOSION_REFLECTION(64,330); +ACE_EXPLOSION_REFLECTION(64,340); +ACE_EXPLOSION_REFLECTION(64,350); +ACE_EXPLOSION_REFLECTION(64,360); +ACE_EXPLOSION_REFLECTION(64,370); +ACE_EXPLOSION_REFLECTION(64,380); +ACE_EXPLOSION_REFLECTION(64,390); +ACE_EXPLOSION_REFLECTION(64,400); +ACE_EXPLOSION_REFLECTION(64,410); +ACE_EXPLOSION_REFLECTION(64,420); +ACE_EXPLOSION_REFLECTION(64,430); +ACE_EXPLOSION_REFLECTION(64,440); +ACE_EXPLOSION_REFLECTION(64,450); +ACE_EXPLOSION_REFLECTION(64,460); +ACE_EXPLOSION_REFLECTION(64,470); +ACE_EXPLOSION_REFLECTION(64,480); +ACE_EXPLOSION_REFLECTION(64,490); +ACE_EXPLOSION_REFLECTION(64,500); +ACE_EXPLOSION_REFLECTION(66,10); +ACE_EXPLOSION_REFLECTION(66,20); +ACE_EXPLOSION_REFLECTION(66,30); +ACE_EXPLOSION_REFLECTION(66,40); +ACE_EXPLOSION_REFLECTION(66,50); +ACE_EXPLOSION_REFLECTION(66,60); +ACE_EXPLOSION_REFLECTION(66,70); +ACE_EXPLOSION_REFLECTION(66,80); +ACE_EXPLOSION_REFLECTION(66,90); +ACE_EXPLOSION_REFLECTION(66,100); +ACE_EXPLOSION_REFLECTION(66,110); +ACE_EXPLOSION_REFLECTION(66,120); +ACE_EXPLOSION_REFLECTION(66,130); +ACE_EXPLOSION_REFLECTION(66,140); +ACE_EXPLOSION_REFLECTION(66,150); +ACE_EXPLOSION_REFLECTION(66,160); +ACE_EXPLOSION_REFLECTION(66,170); +ACE_EXPLOSION_REFLECTION(66,180); +ACE_EXPLOSION_REFLECTION(66,190); +ACE_EXPLOSION_REFLECTION(66,200); +ACE_EXPLOSION_REFLECTION(66,210); +ACE_EXPLOSION_REFLECTION(66,220); +ACE_EXPLOSION_REFLECTION(66,230); +ACE_EXPLOSION_REFLECTION(66,240); +ACE_EXPLOSION_REFLECTION(66,250); +ACE_EXPLOSION_REFLECTION(66,260); +ACE_EXPLOSION_REFLECTION(66,270); +ACE_EXPLOSION_REFLECTION(66,280); +ACE_EXPLOSION_REFLECTION(66,290); +ACE_EXPLOSION_REFLECTION(66,300); +ACE_EXPLOSION_REFLECTION(66,310); +ACE_EXPLOSION_REFLECTION(66,320); +ACE_EXPLOSION_REFLECTION(66,330); +ACE_EXPLOSION_REFLECTION(66,340); +ACE_EXPLOSION_REFLECTION(66,350); +ACE_EXPLOSION_REFLECTION(66,360); +ACE_EXPLOSION_REFLECTION(66,370); +ACE_EXPLOSION_REFLECTION(66,380); +ACE_EXPLOSION_REFLECTION(66,390); +ACE_EXPLOSION_REFLECTION(66,400); +ACE_EXPLOSION_REFLECTION(66,410); +ACE_EXPLOSION_REFLECTION(66,420); +ACE_EXPLOSION_REFLECTION(66,430); +ACE_EXPLOSION_REFLECTION(66,440); +ACE_EXPLOSION_REFLECTION(66,450); +ACE_EXPLOSION_REFLECTION(66,460); +ACE_EXPLOSION_REFLECTION(66,470); +ACE_EXPLOSION_REFLECTION(66,480); +ACE_EXPLOSION_REFLECTION(66,490); +ACE_EXPLOSION_REFLECTION(66,500); +ACE_EXPLOSION_REFLECTION(68,10); +ACE_EXPLOSION_REFLECTION(68,20); +ACE_EXPLOSION_REFLECTION(68,30); +ACE_EXPLOSION_REFLECTION(68,40); +ACE_EXPLOSION_REFLECTION(68,50); +ACE_EXPLOSION_REFLECTION(68,60); +ACE_EXPLOSION_REFLECTION(68,70); +ACE_EXPLOSION_REFLECTION(68,80); +ACE_EXPLOSION_REFLECTION(68,90); +ACE_EXPLOSION_REFLECTION(68,100); +ACE_EXPLOSION_REFLECTION(68,110); +ACE_EXPLOSION_REFLECTION(68,120); +ACE_EXPLOSION_REFLECTION(68,130); +ACE_EXPLOSION_REFLECTION(68,140); +ACE_EXPLOSION_REFLECTION(68,150); +ACE_EXPLOSION_REFLECTION(68,160); +ACE_EXPLOSION_REFLECTION(68,170); +ACE_EXPLOSION_REFLECTION(68,180); +ACE_EXPLOSION_REFLECTION(68,190); +ACE_EXPLOSION_REFLECTION(68,200); +ACE_EXPLOSION_REFLECTION(68,210); +ACE_EXPLOSION_REFLECTION(68,220); +ACE_EXPLOSION_REFLECTION(68,230); +ACE_EXPLOSION_REFLECTION(68,240); +ACE_EXPLOSION_REFLECTION(68,250); +ACE_EXPLOSION_REFLECTION(68,260); +ACE_EXPLOSION_REFLECTION(68,270); +ACE_EXPLOSION_REFLECTION(68,280); +ACE_EXPLOSION_REFLECTION(68,290); +ACE_EXPLOSION_REFLECTION(68,300); +ACE_EXPLOSION_REFLECTION(68,310); +ACE_EXPLOSION_REFLECTION(68,320); +ACE_EXPLOSION_REFLECTION(68,330); +ACE_EXPLOSION_REFLECTION(68,340); +ACE_EXPLOSION_REFLECTION(68,350); +ACE_EXPLOSION_REFLECTION(68,360); +ACE_EXPLOSION_REFLECTION(68,370); +ACE_EXPLOSION_REFLECTION(68,380); +ACE_EXPLOSION_REFLECTION(68,390); +ACE_EXPLOSION_REFLECTION(68,400); +ACE_EXPLOSION_REFLECTION(68,410); +ACE_EXPLOSION_REFLECTION(68,420); +ACE_EXPLOSION_REFLECTION(68,430); +ACE_EXPLOSION_REFLECTION(68,440); +ACE_EXPLOSION_REFLECTION(68,450); +ACE_EXPLOSION_REFLECTION(68,460); +ACE_EXPLOSION_REFLECTION(68,470); +ACE_EXPLOSION_REFLECTION(68,480); +ACE_EXPLOSION_REFLECTION(68,490); +ACE_EXPLOSION_REFLECTION(68,500); +ACE_EXPLOSION_REFLECTION(70,10); +ACE_EXPLOSION_REFLECTION(70,20); +ACE_EXPLOSION_REFLECTION(70,30); +ACE_EXPLOSION_REFLECTION(70,40); +ACE_EXPLOSION_REFLECTION(70,50); +ACE_EXPLOSION_REFLECTION(70,60); +ACE_EXPLOSION_REFLECTION(70,70); +ACE_EXPLOSION_REFLECTION(70,80); +ACE_EXPLOSION_REFLECTION(70,90); +ACE_EXPLOSION_REFLECTION(70,100); +ACE_EXPLOSION_REFLECTION(70,110); +ACE_EXPLOSION_REFLECTION(70,120); +ACE_EXPLOSION_REFLECTION(70,130); +ACE_EXPLOSION_REFLECTION(70,140); +ACE_EXPLOSION_REFLECTION(70,150); +ACE_EXPLOSION_REFLECTION(70,160); +ACE_EXPLOSION_REFLECTION(70,170); +ACE_EXPLOSION_REFLECTION(70,180); +ACE_EXPLOSION_REFLECTION(70,190); +ACE_EXPLOSION_REFLECTION(70,200); +ACE_EXPLOSION_REFLECTION(70,210); +ACE_EXPLOSION_REFLECTION(70,220); +ACE_EXPLOSION_REFLECTION(70,230); +ACE_EXPLOSION_REFLECTION(70,240); +ACE_EXPLOSION_REFLECTION(70,250); +ACE_EXPLOSION_REFLECTION(70,260); +ACE_EXPLOSION_REFLECTION(70,270); +ACE_EXPLOSION_REFLECTION(70,280); +ACE_EXPLOSION_REFLECTION(70,290); +ACE_EXPLOSION_REFLECTION(70,300); +ACE_EXPLOSION_REFLECTION(70,310); +ACE_EXPLOSION_REFLECTION(70,320); +ACE_EXPLOSION_REFLECTION(70,330); +ACE_EXPLOSION_REFLECTION(70,340); +ACE_EXPLOSION_REFLECTION(70,350); +ACE_EXPLOSION_REFLECTION(70,360); +ACE_EXPLOSION_REFLECTION(70,370); +ACE_EXPLOSION_REFLECTION(70,380); +ACE_EXPLOSION_REFLECTION(70,390); +ACE_EXPLOSION_REFLECTION(70,400); +ACE_EXPLOSION_REFLECTION(70,410); +ACE_EXPLOSION_REFLECTION(70,420); +ACE_EXPLOSION_REFLECTION(70,430); +ACE_EXPLOSION_REFLECTION(70,440); +ACE_EXPLOSION_REFLECTION(70,450); +ACE_EXPLOSION_REFLECTION(70,460); +ACE_EXPLOSION_REFLECTION(70,470); +ACE_EXPLOSION_REFLECTION(70,480); +ACE_EXPLOSION_REFLECTION(70,490); +ACE_EXPLOSION_REFLECTION(70,500); +ACE_EXPLOSION_REFLECTION(72,10); +ACE_EXPLOSION_REFLECTION(72,20); +ACE_EXPLOSION_REFLECTION(72,30); +ACE_EXPLOSION_REFLECTION(72,40); +ACE_EXPLOSION_REFLECTION(72,50); +ACE_EXPLOSION_REFLECTION(72,60); +ACE_EXPLOSION_REFLECTION(72,70); +ACE_EXPLOSION_REFLECTION(72,80); +ACE_EXPLOSION_REFLECTION(72,90); +ACE_EXPLOSION_REFLECTION(72,100); +ACE_EXPLOSION_REFLECTION(72,110); +ACE_EXPLOSION_REFLECTION(72,120); +ACE_EXPLOSION_REFLECTION(72,130); +ACE_EXPLOSION_REFLECTION(72,140); +ACE_EXPLOSION_REFLECTION(72,150); +ACE_EXPLOSION_REFLECTION(72,160); +ACE_EXPLOSION_REFLECTION(72,170); +ACE_EXPLOSION_REFLECTION(72,180); +ACE_EXPLOSION_REFLECTION(72,190); +ACE_EXPLOSION_REFLECTION(72,200); +ACE_EXPLOSION_REFLECTION(72,210); +ACE_EXPLOSION_REFLECTION(72,220); +ACE_EXPLOSION_REFLECTION(72,230); +ACE_EXPLOSION_REFLECTION(72,240); +ACE_EXPLOSION_REFLECTION(72,250); +ACE_EXPLOSION_REFLECTION(72,260); +ACE_EXPLOSION_REFLECTION(72,270); +ACE_EXPLOSION_REFLECTION(72,280); +ACE_EXPLOSION_REFLECTION(72,290); +ACE_EXPLOSION_REFLECTION(72,300); +ACE_EXPLOSION_REFLECTION(72,310); +ACE_EXPLOSION_REFLECTION(72,320); +ACE_EXPLOSION_REFLECTION(72,330); +ACE_EXPLOSION_REFLECTION(72,340); +ACE_EXPLOSION_REFLECTION(72,350); +ACE_EXPLOSION_REFLECTION(72,360); +ACE_EXPLOSION_REFLECTION(72,370); +ACE_EXPLOSION_REFLECTION(72,380); +ACE_EXPLOSION_REFLECTION(72,390); +ACE_EXPLOSION_REFLECTION(72,400); +ACE_EXPLOSION_REFLECTION(72,410); +ACE_EXPLOSION_REFLECTION(72,420); +ACE_EXPLOSION_REFLECTION(72,430); +ACE_EXPLOSION_REFLECTION(72,440); +ACE_EXPLOSION_REFLECTION(72,450); +ACE_EXPLOSION_REFLECTION(72,460); +ACE_EXPLOSION_REFLECTION(72,470); +ACE_EXPLOSION_REFLECTION(72,480); +ACE_EXPLOSION_REFLECTION(72,490); +ACE_EXPLOSION_REFLECTION(72,500); +ACE_EXPLOSION_REFLECTION(74,10); +ACE_EXPLOSION_REFLECTION(74,20); +ACE_EXPLOSION_REFLECTION(74,30); +ACE_EXPLOSION_REFLECTION(74,40); +ACE_EXPLOSION_REFLECTION(74,50); +ACE_EXPLOSION_REFLECTION(74,60); +ACE_EXPLOSION_REFLECTION(74,70); +ACE_EXPLOSION_REFLECTION(74,80); +ACE_EXPLOSION_REFLECTION(74,90); +ACE_EXPLOSION_REFLECTION(74,100); +ACE_EXPLOSION_REFLECTION(74,110); +ACE_EXPLOSION_REFLECTION(74,120); +ACE_EXPLOSION_REFLECTION(74,130); +ACE_EXPLOSION_REFLECTION(74,140); +ACE_EXPLOSION_REFLECTION(74,150); +ACE_EXPLOSION_REFLECTION(74,160); +ACE_EXPLOSION_REFLECTION(74,170); +ACE_EXPLOSION_REFLECTION(74,180); +ACE_EXPLOSION_REFLECTION(74,190); +ACE_EXPLOSION_REFLECTION(74,200); +ACE_EXPLOSION_REFLECTION(74,210); +ACE_EXPLOSION_REFLECTION(74,220); +ACE_EXPLOSION_REFLECTION(74,230); +ACE_EXPLOSION_REFLECTION(74,240); +ACE_EXPLOSION_REFLECTION(74,250); +ACE_EXPLOSION_REFLECTION(74,260); +ACE_EXPLOSION_REFLECTION(74,270); +ACE_EXPLOSION_REFLECTION(74,280); +ACE_EXPLOSION_REFLECTION(74,290); +ACE_EXPLOSION_REFLECTION(74,300); +ACE_EXPLOSION_REFLECTION(74,310); +ACE_EXPLOSION_REFLECTION(74,320); +ACE_EXPLOSION_REFLECTION(74,330); +ACE_EXPLOSION_REFLECTION(74,340); +ACE_EXPLOSION_REFLECTION(74,350); +ACE_EXPLOSION_REFLECTION(74,360); +ACE_EXPLOSION_REFLECTION(74,370); +ACE_EXPLOSION_REFLECTION(74,380); +ACE_EXPLOSION_REFLECTION(74,390); +ACE_EXPLOSION_REFLECTION(74,400); +ACE_EXPLOSION_REFLECTION(74,410); +ACE_EXPLOSION_REFLECTION(74,420); +ACE_EXPLOSION_REFLECTION(74,430); +ACE_EXPLOSION_REFLECTION(74,440); +ACE_EXPLOSION_REFLECTION(74,450); +ACE_EXPLOSION_REFLECTION(74,460); +ACE_EXPLOSION_REFLECTION(74,470); +ACE_EXPLOSION_REFLECTION(74,480); +ACE_EXPLOSION_REFLECTION(74,490); +ACE_EXPLOSION_REFLECTION(74,500); +ACE_EXPLOSION_REFLECTION(76,10); +ACE_EXPLOSION_REFLECTION(76,20); +ACE_EXPLOSION_REFLECTION(76,30); +ACE_EXPLOSION_REFLECTION(76,40); +ACE_EXPLOSION_REFLECTION(76,50); +ACE_EXPLOSION_REFLECTION(76,60); +ACE_EXPLOSION_REFLECTION(76,70); +ACE_EXPLOSION_REFLECTION(76,80); +ACE_EXPLOSION_REFLECTION(76,90); +ACE_EXPLOSION_REFLECTION(76,100); +ACE_EXPLOSION_REFLECTION(76,110); +ACE_EXPLOSION_REFLECTION(76,120); +ACE_EXPLOSION_REFLECTION(76,130); +ACE_EXPLOSION_REFLECTION(76,140); +ACE_EXPLOSION_REFLECTION(76,150); +ACE_EXPLOSION_REFLECTION(76,160); +ACE_EXPLOSION_REFLECTION(76,170); +ACE_EXPLOSION_REFLECTION(76,180); +ACE_EXPLOSION_REFLECTION(76,190); +ACE_EXPLOSION_REFLECTION(76,200); +ACE_EXPLOSION_REFLECTION(76,210); +ACE_EXPLOSION_REFLECTION(76,220); +ACE_EXPLOSION_REFLECTION(76,230); +ACE_EXPLOSION_REFLECTION(76,240); +ACE_EXPLOSION_REFLECTION(76,250); +ACE_EXPLOSION_REFLECTION(76,260); +ACE_EXPLOSION_REFLECTION(76,270); +ACE_EXPLOSION_REFLECTION(76,280); +ACE_EXPLOSION_REFLECTION(76,290); +ACE_EXPLOSION_REFLECTION(76,300); +ACE_EXPLOSION_REFLECTION(76,310); +ACE_EXPLOSION_REFLECTION(76,320); +ACE_EXPLOSION_REFLECTION(76,330); +ACE_EXPLOSION_REFLECTION(76,340); +ACE_EXPLOSION_REFLECTION(76,350); +ACE_EXPLOSION_REFLECTION(76,360); +ACE_EXPLOSION_REFLECTION(76,370); +ACE_EXPLOSION_REFLECTION(76,380); +ACE_EXPLOSION_REFLECTION(76,390); +ACE_EXPLOSION_REFLECTION(76,400); +ACE_EXPLOSION_REFLECTION(76,410); +ACE_EXPLOSION_REFLECTION(76,420); +ACE_EXPLOSION_REFLECTION(76,430); +ACE_EXPLOSION_REFLECTION(76,440); +ACE_EXPLOSION_REFLECTION(76,450); +ACE_EXPLOSION_REFLECTION(76,460); +ACE_EXPLOSION_REFLECTION(76,470); +ACE_EXPLOSION_REFLECTION(76,480); +ACE_EXPLOSION_REFLECTION(76,490); +ACE_EXPLOSION_REFLECTION(76,500); +ACE_EXPLOSION_REFLECTION(78,10); +ACE_EXPLOSION_REFLECTION(78,20); +ACE_EXPLOSION_REFLECTION(78,30); +ACE_EXPLOSION_REFLECTION(78,40); +ACE_EXPLOSION_REFLECTION(78,50); +ACE_EXPLOSION_REFLECTION(78,60); +ACE_EXPLOSION_REFLECTION(78,70); +ACE_EXPLOSION_REFLECTION(78,80); +ACE_EXPLOSION_REFLECTION(78,90); +ACE_EXPLOSION_REFLECTION(78,100); +ACE_EXPLOSION_REFLECTION(78,110); +ACE_EXPLOSION_REFLECTION(78,120); +ACE_EXPLOSION_REFLECTION(78,130); +ACE_EXPLOSION_REFLECTION(78,140); +ACE_EXPLOSION_REFLECTION(78,150); +ACE_EXPLOSION_REFLECTION(78,160); +ACE_EXPLOSION_REFLECTION(78,170); +ACE_EXPLOSION_REFLECTION(78,180); +ACE_EXPLOSION_REFLECTION(78,190); +ACE_EXPLOSION_REFLECTION(78,200); +ACE_EXPLOSION_REFLECTION(78,210); +ACE_EXPLOSION_REFLECTION(78,220); +ACE_EXPLOSION_REFLECTION(78,230); +ACE_EXPLOSION_REFLECTION(78,240); +ACE_EXPLOSION_REFLECTION(78,250); +ACE_EXPLOSION_REFLECTION(78,260); +ACE_EXPLOSION_REFLECTION(78,270); +ACE_EXPLOSION_REFLECTION(78,280); +ACE_EXPLOSION_REFLECTION(78,290); +ACE_EXPLOSION_REFLECTION(78,300); +ACE_EXPLOSION_REFLECTION(78,310); +ACE_EXPLOSION_REFLECTION(78,320); +ACE_EXPLOSION_REFLECTION(78,330); +ACE_EXPLOSION_REFLECTION(78,340); +ACE_EXPLOSION_REFLECTION(78,350); +ACE_EXPLOSION_REFLECTION(78,360); +ACE_EXPLOSION_REFLECTION(78,370); +ACE_EXPLOSION_REFLECTION(78,380); +ACE_EXPLOSION_REFLECTION(78,390); +ACE_EXPLOSION_REFLECTION(78,400); +ACE_EXPLOSION_REFLECTION(78,410); +ACE_EXPLOSION_REFLECTION(78,420); +ACE_EXPLOSION_REFLECTION(78,430); +ACE_EXPLOSION_REFLECTION(78,440); +ACE_EXPLOSION_REFLECTION(78,450); +ACE_EXPLOSION_REFLECTION(78,460); +ACE_EXPLOSION_REFLECTION(78,470); +ACE_EXPLOSION_REFLECTION(78,480); +ACE_EXPLOSION_REFLECTION(78,490); +ACE_EXPLOSION_REFLECTION(78,500); +ACE_EXPLOSION_REFLECTION(80,10); +ACE_EXPLOSION_REFLECTION(80,20); +ACE_EXPLOSION_REFLECTION(80,30); +ACE_EXPLOSION_REFLECTION(80,40); +ACE_EXPLOSION_REFLECTION(80,50); +ACE_EXPLOSION_REFLECTION(80,60); +ACE_EXPLOSION_REFLECTION(80,70); +ACE_EXPLOSION_REFLECTION(80,80); +ACE_EXPLOSION_REFLECTION(80,90); +ACE_EXPLOSION_REFLECTION(80,100); +ACE_EXPLOSION_REFLECTION(80,110); +ACE_EXPLOSION_REFLECTION(80,120); +ACE_EXPLOSION_REFLECTION(80,130); +ACE_EXPLOSION_REFLECTION(80,140); +ACE_EXPLOSION_REFLECTION(80,150); +ACE_EXPLOSION_REFLECTION(80,160); +ACE_EXPLOSION_REFLECTION(80,170); +ACE_EXPLOSION_REFLECTION(80,180); +ACE_EXPLOSION_REFLECTION(80,190); +ACE_EXPLOSION_REFLECTION(80,200); +ACE_EXPLOSION_REFLECTION(80,210); +ACE_EXPLOSION_REFLECTION(80,220); +ACE_EXPLOSION_REFLECTION(80,230); +ACE_EXPLOSION_REFLECTION(80,240); +ACE_EXPLOSION_REFLECTION(80,250); +ACE_EXPLOSION_REFLECTION(80,260); +ACE_EXPLOSION_REFLECTION(80,270); +ACE_EXPLOSION_REFLECTION(80,280); +ACE_EXPLOSION_REFLECTION(80,290); +ACE_EXPLOSION_REFLECTION(80,300); +ACE_EXPLOSION_REFLECTION(80,310); +ACE_EXPLOSION_REFLECTION(80,320); +ACE_EXPLOSION_REFLECTION(80,330); +ACE_EXPLOSION_REFLECTION(80,340); +ACE_EXPLOSION_REFLECTION(80,350); +ACE_EXPLOSION_REFLECTION(80,360); +ACE_EXPLOSION_REFLECTION(80,370); +ACE_EXPLOSION_REFLECTION(80,380); +ACE_EXPLOSION_REFLECTION(80,390); +ACE_EXPLOSION_REFLECTION(80,400); +ACE_EXPLOSION_REFLECTION(80,410); +ACE_EXPLOSION_REFLECTION(80,420); +ACE_EXPLOSION_REFLECTION(80,430); +ACE_EXPLOSION_REFLECTION(80,440); +ACE_EXPLOSION_REFLECTION(80,450); +ACE_EXPLOSION_REFLECTION(80,460); +ACE_EXPLOSION_REFLECTION(80,470); +ACE_EXPLOSION_REFLECTION(80,480); +ACE_EXPLOSION_REFLECTION(80,490); +ACE_EXPLOSION_REFLECTION(80,500); +ACE_EXPLOSION_REFLECTION(82,10); +ACE_EXPLOSION_REFLECTION(82,20); +ACE_EXPLOSION_REFLECTION(82,30); +ACE_EXPLOSION_REFLECTION(82,40); +ACE_EXPLOSION_REFLECTION(82,50); +ACE_EXPLOSION_REFLECTION(82,60); +ACE_EXPLOSION_REFLECTION(82,70); +ACE_EXPLOSION_REFLECTION(82,80); +ACE_EXPLOSION_REFLECTION(82,90); +ACE_EXPLOSION_REFLECTION(82,100); +ACE_EXPLOSION_REFLECTION(82,110); +ACE_EXPLOSION_REFLECTION(82,120); +ACE_EXPLOSION_REFLECTION(82,130); +ACE_EXPLOSION_REFLECTION(82,140); +ACE_EXPLOSION_REFLECTION(82,150); +ACE_EXPLOSION_REFLECTION(82,160); +ACE_EXPLOSION_REFLECTION(82,170); +ACE_EXPLOSION_REFLECTION(82,180); +ACE_EXPLOSION_REFLECTION(82,190); +ACE_EXPLOSION_REFLECTION(82,200); +ACE_EXPLOSION_REFLECTION(82,210); +ACE_EXPLOSION_REFLECTION(82,220); +ACE_EXPLOSION_REFLECTION(82,230); +ACE_EXPLOSION_REFLECTION(82,240); +ACE_EXPLOSION_REFLECTION(82,250); +ACE_EXPLOSION_REFLECTION(82,260); +ACE_EXPLOSION_REFLECTION(82,270); +ACE_EXPLOSION_REFLECTION(82,280); +ACE_EXPLOSION_REFLECTION(82,290); +ACE_EXPLOSION_REFLECTION(82,300); +ACE_EXPLOSION_REFLECTION(82,310); +ACE_EXPLOSION_REFLECTION(82,320); +ACE_EXPLOSION_REFLECTION(82,330); +ACE_EXPLOSION_REFLECTION(82,340); +ACE_EXPLOSION_REFLECTION(82,350); +ACE_EXPLOSION_REFLECTION(82,360); +ACE_EXPLOSION_REFLECTION(82,370); +ACE_EXPLOSION_REFLECTION(82,380); +ACE_EXPLOSION_REFLECTION(82,390); +ACE_EXPLOSION_REFLECTION(82,400); +ACE_EXPLOSION_REFLECTION(82,410); +ACE_EXPLOSION_REFLECTION(82,420); +ACE_EXPLOSION_REFLECTION(82,430); +ACE_EXPLOSION_REFLECTION(82,440); +ACE_EXPLOSION_REFLECTION(82,450); +ACE_EXPLOSION_REFLECTION(82,460); +ACE_EXPLOSION_REFLECTION(82,470); +ACE_EXPLOSION_REFLECTION(82,480); +ACE_EXPLOSION_REFLECTION(82,490); +ACE_EXPLOSION_REFLECTION(82,500); +ACE_EXPLOSION_REFLECTION(84,10); +ACE_EXPLOSION_REFLECTION(84,20); +ACE_EXPLOSION_REFLECTION(84,30); +ACE_EXPLOSION_REFLECTION(84,40); +ACE_EXPLOSION_REFLECTION(84,50); +ACE_EXPLOSION_REFLECTION(84,60); +ACE_EXPLOSION_REFLECTION(84,70); +ACE_EXPLOSION_REFLECTION(84,80); +ACE_EXPLOSION_REFLECTION(84,90); +ACE_EXPLOSION_REFLECTION(84,100); +ACE_EXPLOSION_REFLECTION(84,110); +ACE_EXPLOSION_REFLECTION(84,120); +ACE_EXPLOSION_REFLECTION(84,130); +ACE_EXPLOSION_REFLECTION(84,140); +ACE_EXPLOSION_REFLECTION(84,150); +ACE_EXPLOSION_REFLECTION(84,160); +ACE_EXPLOSION_REFLECTION(84,170); +ACE_EXPLOSION_REFLECTION(84,180); +ACE_EXPLOSION_REFLECTION(84,190); +ACE_EXPLOSION_REFLECTION(84,200); +ACE_EXPLOSION_REFLECTION(84,210); +ACE_EXPLOSION_REFLECTION(84,220); +ACE_EXPLOSION_REFLECTION(84,230); +ACE_EXPLOSION_REFLECTION(84,240); +ACE_EXPLOSION_REFLECTION(84,250); +ACE_EXPLOSION_REFLECTION(84,260); +ACE_EXPLOSION_REFLECTION(84,270); +ACE_EXPLOSION_REFLECTION(84,280); +ACE_EXPLOSION_REFLECTION(84,290); +ACE_EXPLOSION_REFLECTION(84,300); +ACE_EXPLOSION_REFLECTION(84,310); +ACE_EXPLOSION_REFLECTION(84,320); +ACE_EXPLOSION_REFLECTION(84,330); +ACE_EXPLOSION_REFLECTION(84,340); +ACE_EXPLOSION_REFLECTION(84,350); +ACE_EXPLOSION_REFLECTION(84,360); +ACE_EXPLOSION_REFLECTION(84,370); +ACE_EXPLOSION_REFLECTION(84,380); +ACE_EXPLOSION_REFLECTION(84,390); +ACE_EXPLOSION_REFLECTION(84,400); +ACE_EXPLOSION_REFLECTION(84,410); +ACE_EXPLOSION_REFLECTION(84,420); +ACE_EXPLOSION_REFLECTION(84,430); +ACE_EXPLOSION_REFLECTION(84,440); +ACE_EXPLOSION_REFLECTION(84,450); +ACE_EXPLOSION_REFLECTION(84,460); +ACE_EXPLOSION_REFLECTION(84,470); +ACE_EXPLOSION_REFLECTION(84,480); +ACE_EXPLOSION_REFLECTION(84,490); +ACE_EXPLOSION_REFLECTION(84,500); +ACE_EXPLOSION_REFLECTION(86,10); +ACE_EXPLOSION_REFLECTION(86,20); +ACE_EXPLOSION_REFLECTION(86,30); +ACE_EXPLOSION_REFLECTION(86,40); +ACE_EXPLOSION_REFLECTION(86,50); +ACE_EXPLOSION_REFLECTION(86,60); +ACE_EXPLOSION_REFLECTION(86,70); +ACE_EXPLOSION_REFLECTION(86,80); +ACE_EXPLOSION_REFLECTION(86,90); +ACE_EXPLOSION_REFLECTION(86,100); +ACE_EXPLOSION_REFLECTION(86,110); +ACE_EXPLOSION_REFLECTION(86,120); +ACE_EXPLOSION_REFLECTION(86,130); +ACE_EXPLOSION_REFLECTION(86,140); +ACE_EXPLOSION_REFLECTION(86,150); +ACE_EXPLOSION_REFLECTION(86,160); +ACE_EXPLOSION_REFLECTION(86,170); +ACE_EXPLOSION_REFLECTION(86,180); +ACE_EXPLOSION_REFLECTION(86,190); +ACE_EXPLOSION_REFLECTION(86,200); +ACE_EXPLOSION_REFLECTION(86,210); +ACE_EXPLOSION_REFLECTION(86,220); +ACE_EXPLOSION_REFLECTION(86,230); +ACE_EXPLOSION_REFLECTION(86,240); +ACE_EXPLOSION_REFLECTION(86,250); +ACE_EXPLOSION_REFLECTION(86,260); +ACE_EXPLOSION_REFLECTION(86,270); +ACE_EXPLOSION_REFLECTION(86,280); +ACE_EXPLOSION_REFLECTION(86,290); +ACE_EXPLOSION_REFLECTION(86,300); +ACE_EXPLOSION_REFLECTION(86,310); +ACE_EXPLOSION_REFLECTION(86,320); +ACE_EXPLOSION_REFLECTION(86,330); +ACE_EXPLOSION_REFLECTION(86,340); +ACE_EXPLOSION_REFLECTION(86,350); +ACE_EXPLOSION_REFLECTION(86,360); +ACE_EXPLOSION_REFLECTION(86,370); +ACE_EXPLOSION_REFLECTION(86,380); +ACE_EXPLOSION_REFLECTION(86,390); +ACE_EXPLOSION_REFLECTION(86,400); +ACE_EXPLOSION_REFLECTION(86,410); +ACE_EXPLOSION_REFLECTION(86,420); +ACE_EXPLOSION_REFLECTION(86,430); +ACE_EXPLOSION_REFLECTION(86,440); +ACE_EXPLOSION_REFLECTION(86,450); +ACE_EXPLOSION_REFLECTION(86,460); +ACE_EXPLOSION_REFLECTION(86,470); +ACE_EXPLOSION_REFLECTION(86,480); +ACE_EXPLOSION_REFLECTION(86,490); +ACE_EXPLOSION_REFLECTION(86,500); +ACE_EXPLOSION_REFLECTION(88,10); +ACE_EXPLOSION_REFLECTION(88,20); +ACE_EXPLOSION_REFLECTION(88,30); +ACE_EXPLOSION_REFLECTION(88,40); +ACE_EXPLOSION_REFLECTION(88,50); +ACE_EXPLOSION_REFLECTION(88,60); +ACE_EXPLOSION_REFLECTION(88,70); +ACE_EXPLOSION_REFLECTION(88,80); +ACE_EXPLOSION_REFLECTION(88,90); +ACE_EXPLOSION_REFLECTION(88,100); +ACE_EXPLOSION_REFLECTION(88,110); +ACE_EXPLOSION_REFLECTION(88,120); +ACE_EXPLOSION_REFLECTION(88,130); +ACE_EXPLOSION_REFLECTION(88,140); +ACE_EXPLOSION_REFLECTION(88,150); +ACE_EXPLOSION_REFLECTION(88,160); +ACE_EXPLOSION_REFLECTION(88,170); +ACE_EXPLOSION_REFLECTION(88,180); +ACE_EXPLOSION_REFLECTION(88,190); +ACE_EXPLOSION_REFLECTION(88,200); +ACE_EXPLOSION_REFLECTION(88,210); +ACE_EXPLOSION_REFLECTION(88,220); +ACE_EXPLOSION_REFLECTION(88,230); +ACE_EXPLOSION_REFLECTION(88,240); +ACE_EXPLOSION_REFLECTION(88,250); +ACE_EXPLOSION_REFLECTION(88,260); +ACE_EXPLOSION_REFLECTION(88,270); +ACE_EXPLOSION_REFLECTION(88,280); +ACE_EXPLOSION_REFLECTION(88,290); +ACE_EXPLOSION_REFLECTION(88,300); +ACE_EXPLOSION_REFLECTION(88,310); +ACE_EXPLOSION_REFLECTION(88,320); +ACE_EXPLOSION_REFLECTION(88,330); +ACE_EXPLOSION_REFLECTION(88,340); +ACE_EXPLOSION_REFLECTION(88,350); +ACE_EXPLOSION_REFLECTION(88,360); +ACE_EXPLOSION_REFLECTION(88,370); +ACE_EXPLOSION_REFLECTION(88,380); +ACE_EXPLOSION_REFLECTION(88,390); +ACE_EXPLOSION_REFLECTION(88,400); +ACE_EXPLOSION_REFLECTION(88,410); +ACE_EXPLOSION_REFLECTION(88,420); +ACE_EXPLOSION_REFLECTION(88,430); +ACE_EXPLOSION_REFLECTION(88,440); +ACE_EXPLOSION_REFLECTION(88,450); +ACE_EXPLOSION_REFLECTION(88,460); +ACE_EXPLOSION_REFLECTION(88,470); +ACE_EXPLOSION_REFLECTION(88,480); +ACE_EXPLOSION_REFLECTION(88,490); +ACE_EXPLOSION_REFLECTION(88,500); +ACE_EXPLOSION_REFLECTION(90,10); +ACE_EXPLOSION_REFLECTION(90,20); +ACE_EXPLOSION_REFLECTION(90,30); +ACE_EXPLOSION_REFLECTION(90,40); +ACE_EXPLOSION_REFLECTION(90,50); +ACE_EXPLOSION_REFLECTION(90,60); +ACE_EXPLOSION_REFLECTION(90,70); +ACE_EXPLOSION_REFLECTION(90,80); +ACE_EXPLOSION_REFLECTION(90,90); +ACE_EXPLOSION_REFLECTION(90,100); +ACE_EXPLOSION_REFLECTION(90,110); +ACE_EXPLOSION_REFLECTION(90,120); +ACE_EXPLOSION_REFLECTION(90,130); +ACE_EXPLOSION_REFLECTION(90,140); +ACE_EXPLOSION_REFLECTION(90,150); +ACE_EXPLOSION_REFLECTION(90,160); +ACE_EXPLOSION_REFLECTION(90,170); +ACE_EXPLOSION_REFLECTION(90,180); +ACE_EXPLOSION_REFLECTION(90,190); +ACE_EXPLOSION_REFLECTION(90,200); +ACE_EXPLOSION_REFLECTION(90,210); +ACE_EXPLOSION_REFLECTION(90,220); +ACE_EXPLOSION_REFLECTION(90,230); +ACE_EXPLOSION_REFLECTION(90,240); +ACE_EXPLOSION_REFLECTION(90,250); +ACE_EXPLOSION_REFLECTION(90,260); +ACE_EXPLOSION_REFLECTION(90,270); +ACE_EXPLOSION_REFLECTION(90,280); +ACE_EXPLOSION_REFLECTION(90,290); +ACE_EXPLOSION_REFLECTION(90,300); +ACE_EXPLOSION_REFLECTION(90,310); +ACE_EXPLOSION_REFLECTION(90,320); +ACE_EXPLOSION_REFLECTION(90,330); +ACE_EXPLOSION_REFLECTION(90,340); +ACE_EXPLOSION_REFLECTION(90,350); +ACE_EXPLOSION_REFLECTION(90,360); +ACE_EXPLOSION_REFLECTION(90,370); +ACE_EXPLOSION_REFLECTION(90,380); +ACE_EXPLOSION_REFLECTION(90,390); +ACE_EXPLOSION_REFLECTION(90,400); +ACE_EXPLOSION_REFLECTION(90,410); +ACE_EXPLOSION_REFLECTION(90,420); +ACE_EXPLOSION_REFLECTION(90,430); +ACE_EXPLOSION_REFLECTION(90,440); +ACE_EXPLOSION_REFLECTION(90,450); +ACE_EXPLOSION_REFLECTION(90,460); +ACE_EXPLOSION_REFLECTION(90,470); +ACE_EXPLOSION_REFLECTION(90,480); +ACE_EXPLOSION_REFLECTION(90,490); +ACE_EXPLOSION_REFLECTION(90,500); +ACE_EXPLOSION_REFLECTION(92,10); +ACE_EXPLOSION_REFLECTION(92,20); +ACE_EXPLOSION_REFLECTION(92,30); +ACE_EXPLOSION_REFLECTION(92,40); +ACE_EXPLOSION_REFLECTION(92,50); +ACE_EXPLOSION_REFLECTION(92,60); +ACE_EXPLOSION_REFLECTION(92,70); +ACE_EXPLOSION_REFLECTION(92,80); +ACE_EXPLOSION_REFLECTION(92,90); +ACE_EXPLOSION_REFLECTION(92,100); +ACE_EXPLOSION_REFLECTION(92,110); +ACE_EXPLOSION_REFLECTION(92,120); +ACE_EXPLOSION_REFLECTION(92,130); +ACE_EXPLOSION_REFLECTION(92,140); +ACE_EXPLOSION_REFLECTION(92,150); +ACE_EXPLOSION_REFLECTION(92,160); +ACE_EXPLOSION_REFLECTION(92,170); +ACE_EXPLOSION_REFLECTION(92,180); +ACE_EXPLOSION_REFLECTION(92,190); +ACE_EXPLOSION_REFLECTION(92,200); +ACE_EXPLOSION_REFLECTION(92,210); +ACE_EXPLOSION_REFLECTION(92,220); +ACE_EXPLOSION_REFLECTION(92,230); +ACE_EXPLOSION_REFLECTION(92,240); +ACE_EXPLOSION_REFLECTION(92,250); +ACE_EXPLOSION_REFLECTION(92,260); +ACE_EXPLOSION_REFLECTION(92,270); +ACE_EXPLOSION_REFLECTION(92,280); +ACE_EXPLOSION_REFLECTION(92,290); +ACE_EXPLOSION_REFLECTION(92,300); +ACE_EXPLOSION_REFLECTION(92,310); +ACE_EXPLOSION_REFLECTION(92,320); +ACE_EXPLOSION_REFLECTION(92,330); +ACE_EXPLOSION_REFLECTION(92,340); +ACE_EXPLOSION_REFLECTION(92,350); +ACE_EXPLOSION_REFLECTION(92,360); +ACE_EXPLOSION_REFLECTION(92,370); +ACE_EXPLOSION_REFLECTION(92,380); +ACE_EXPLOSION_REFLECTION(92,390); +ACE_EXPLOSION_REFLECTION(92,400); +ACE_EXPLOSION_REFLECTION(92,410); +ACE_EXPLOSION_REFLECTION(92,420); +ACE_EXPLOSION_REFLECTION(92,430); +ACE_EXPLOSION_REFLECTION(92,440); +ACE_EXPLOSION_REFLECTION(92,450); +ACE_EXPLOSION_REFLECTION(92,460); +ACE_EXPLOSION_REFLECTION(92,470); +ACE_EXPLOSION_REFLECTION(92,480); +ACE_EXPLOSION_REFLECTION(92,490); +ACE_EXPLOSION_REFLECTION(92,500); +ACE_EXPLOSION_REFLECTION(94,10); +ACE_EXPLOSION_REFLECTION(94,20); +ACE_EXPLOSION_REFLECTION(94,30); +ACE_EXPLOSION_REFLECTION(94,40); +ACE_EXPLOSION_REFLECTION(94,50); +ACE_EXPLOSION_REFLECTION(94,60); +ACE_EXPLOSION_REFLECTION(94,70); +ACE_EXPLOSION_REFLECTION(94,80); +ACE_EXPLOSION_REFLECTION(94,90); +ACE_EXPLOSION_REFLECTION(94,100); +ACE_EXPLOSION_REFLECTION(94,110); +ACE_EXPLOSION_REFLECTION(94,120); +ACE_EXPLOSION_REFLECTION(94,130); +ACE_EXPLOSION_REFLECTION(94,140); +ACE_EXPLOSION_REFLECTION(94,150); +ACE_EXPLOSION_REFLECTION(94,160); +ACE_EXPLOSION_REFLECTION(94,170); +ACE_EXPLOSION_REFLECTION(94,180); +ACE_EXPLOSION_REFLECTION(94,190); +ACE_EXPLOSION_REFLECTION(94,200); +ACE_EXPLOSION_REFLECTION(94,210); +ACE_EXPLOSION_REFLECTION(94,220); +ACE_EXPLOSION_REFLECTION(94,230); +ACE_EXPLOSION_REFLECTION(94,240); +ACE_EXPLOSION_REFLECTION(94,250); +ACE_EXPLOSION_REFLECTION(94,260); +ACE_EXPLOSION_REFLECTION(94,270); +ACE_EXPLOSION_REFLECTION(94,280); +ACE_EXPLOSION_REFLECTION(94,290); +ACE_EXPLOSION_REFLECTION(94,300); +ACE_EXPLOSION_REFLECTION(94,310); +ACE_EXPLOSION_REFLECTION(94,320); +ACE_EXPLOSION_REFLECTION(94,330); +ACE_EXPLOSION_REFLECTION(94,340); +ACE_EXPLOSION_REFLECTION(94,350); +ACE_EXPLOSION_REFLECTION(94,360); +ACE_EXPLOSION_REFLECTION(94,370); +ACE_EXPLOSION_REFLECTION(94,380); +ACE_EXPLOSION_REFLECTION(94,390); +ACE_EXPLOSION_REFLECTION(94,400); +ACE_EXPLOSION_REFLECTION(94,410); +ACE_EXPLOSION_REFLECTION(94,420); +ACE_EXPLOSION_REFLECTION(94,430); +ACE_EXPLOSION_REFLECTION(94,440); +ACE_EXPLOSION_REFLECTION(94,450); +ACE_EXPLOSION_REFLECTION(94,460); +ACE_EXPLOSION_REFLECTION(94,470); +ACE_EXPLOSION_REFLECTION(94,480); +ACE_EXPLOSION_REFLECTION(94,490); +ACE_EXPLOSION_REFLECTION(94,500); +ACE_EXPLOSION_REFLECTION(96,10); +ACE_EXPLOSION_REFLECTION(96,20); +ACE_EXPLOSION_REFLECTION(96,30); +ACE_EXPLOSION_REFLECTION(96,40); +ACE_EXPLOSION_REFLECTION(96,50); +ACE_EXPLOSION_REFLECTION(96,60); +ACE_EXPLOSION_REFLECTION(96,70); +ACE_EXPLOSION_REFLECTION(96,80); +ACE_EXPLOSION_REFLECTION(96,90); +ACE_EXPLOSION_REFLECTION(96,100); +ACE_EXPLOSION_REFLECTION(96,110); +ACE_EXPLOSION_REFLECTION(96,120); +ACE_EXPLOSION_REFLECTION(96,130); +ACE_EXPLOSION_REFLECTION(96,140); +ACE_EXPLOSION_REFLECTION(96,150); +ACE_EXPLOSION_REFLECTION(96,160); +ACE_EXPLOSION_REFLECTION(96,170); +ACE_EXPLOSION_REFLECTION(96,180); +ACE_EXPLOSION_REFLECTION(96,190); +ACE_EXPLOSION_REFLECTION(96,200); +ACE_EXPLOSION_REFLECTION(96,210); +ACE_EXPLOSION_REFLECTION(96,220); +ACE_EXPLOSION_REFLECTION(96,230); +ACE_EXPLOSION_REFLECTION(96,240); +ACE_EXPLOSION_REFLECTION(96,250); +ACE_EXPLOSION_REFLECTION(96,260); +ACE_EXPLOSION_REFLECTION(96,270); +ACE_EXPLOSION_REFLECTION(96,280); +ACE_EXPLOSION_REFLECTION(96,290); +ACE_EXPLOSION_REFLECTION(96,300); +ACE_EXPLOSION_REFLECTION(96,310); +ACE_EXPLOSION_REFLECTION(96,320); +ACE_EXPLOSION_REFLECTION(96,330); +ACE_EXPLOSION_REFLECTION(96,340); +ACE_EXPLOSION_REFLECTION(96,350); +ACE_EXPLOSION_REFLECTION(96,360); +ACE_EXPLOSION_REFLECTION(96,370); +ACE_EXPLOSION_REFLECTION(96,380); +ACE_EXPLOSION_REFLECTION(96,390); +ACE_EXPLOSION_REFLECTION(96,400); +ACE_EXPLOSION_REFLECTION(96,410); +ACE_EXPLOSION_REFLECTION(96,420); +ACE_EXPLOSION_REFLECTION(96,430); +ACE_EXPLOSION_REFLECTION(96,440); +ACE_EXPLOSION_REFLECTION(96,450); +ACE_EXPLOSION_REFLECTION(96,460); +ACE_EXPLOSION_REFLECTION(96,470); +ACE_EXPLOSION_REFLECTION(96,480); +ACE_EXPLOSION_REFLECTION(96,490); +ACE_EXPLOSION_REFLECTION(96,500); +ACE_EXPLOSION_REFLECTION(98,10); +ACE_EXPLOSION_REFLECTION(98,20); +ACE_EXPLOSION_REFLECTION(98,30); +ACE_EXPLOSION_REFLECTION(98,40); +ACE_EXPLOSION_REFLECTION(98,50); +ACE_EXPLOSION_REFLECTION(98,60); +ACE_EXPLOSION_REFLECTION(98,70); +ACE_EXPLOSION_REFLECTION(98,80); +ACE_EXPLOSION_REFLECTION(98,90); +ACE_EXPLOSION_REFLECTION(98,100); +ACE_EXPLOSION_REFLECTION(98,110); +ACE_EXPLOSION_REFLECTION(98,120); +ACE_EXPLOSION_REFLECTION(98,130); +ACE_EXPLOSION_REFLECTION(98,140); +ACE_EXPLOSION_REFLECTION(98,150); +ACE_EXPLOSION_REFLECTION(98,160); +ACE_EXPLOSION_REFLECTION(98,170); +ACE_EXPLOSION_REFLECTION(98,180); +ACE_EXPLOSION_REFLECTION(98,190); +ACE_EXPLOSION_REFLECTION(98,200); +ACE_EXPLOSION_REFLECTION(98,210); +ACE_EXPLOSION_REFLECTION(98,220); +ACE_EXPLOSION_REFLECTION(98,230); +ACE_EXPLOSION_REFLECTION(98,240); +ACE_EXPLOSION_REFLECTION(98,250); +ACE_EXPLOSION_REFLECTION(98,260); +ACE_EXPLOSION_REFLECTION(98,270); +ACE_EXPLOSION_REFLECTION(98,280); +ACE_EXPLOSION_REFLECTION(98,290); +ACE_EXPLOSION_REFLECTION(98,300); +ACE_EXPLOSION_REFLECTION(98,310); +ACE_EXPLOSION_REFLECTION(98,320); +ACE_EXPLOSION_REFLECTION(98,330); +ACE_EXPLOSION_REFLECTION(98,340); +ACE_EXPLOSION_REFLECTION(98,350); +ACE_EXPLOSION_REFLECTION(98,360); +ACE_EXPLOSION_REFLECTION(98,370); +ACE_EXPLOSION_REFLECTION(98,380); +ACE_EXPLOSION_REFLECTION(98,390); +ACE_EXPLOSION_REFLECTION(98,400); +ACE_EXPLOSION_REFLECTION(98,410); +ACE_EXPLOSION_REFLECTION(98,420); +ACE_EXPLOSION_REFLECTION(98,430); +ACE_EXPLOSION_REFLECTION(98,440); +ACE_EXPLOSION_REFLECTION(98,450); +ACE_EXPLOSION_REFLECTION(98,460); +ACE_EXPLOSION_REFLECTION(98,470); +ACE_EXPLOSION_REFLECTION(98,480); +ACE_EXPLOSION_REFLECTION(98,490); +ACE_EXPLOSION_REFLECTION(98,500); +ACE_EXPLOSION_REFLECTION(100,10); +ACE_EXPLOSION_REFLECTION(100,20); +ACE_EXPLOSION_REFLECTION(100,30); +ACE_EXPLOSION_REFLECTION(100,40); +ACE_EXPLOSION_REFLECTION(100,50); +ACE_EXPLOSION_REFLECTION(100,60); +ACE_EXPLOSION_REFLECTION(100,70); +ACE_EXPLOSION_REFLECTION(100,80); +ACE_EXPLOSION_REFLECTION(100,90); +ACE_EXPLOSION_REFLECTION(100,100); +ACE_EXPLOSION_REFLECTION(100,110); +ACE_EXPLOSION_REFLECTION(100,120); +ACE_EXPLOSION_REFLECTION(100,130); +ACE_EXPLOSION_REFLECTION(100,140); +ACE_EXPLOSION_REFLECTION(100,150); +ACE_EXPLOSION_REFLECTION(100,160); +ACE_EXPLOSION_REFLECTION(100,170); +ACE_EXPLOSION_REFLECTION(100,180); +ACE_EXPLOSION_REFLECTION(100,190); +ACE_EXPLOSION_REFLECTION(100,200); +ACE_EXPLOSION_REFLECTION(100,210); +ACE_EXPLOSION_REFLECTION(100,220); +ACE_EXPLOSION_REFLECTION(100,230); +ACE_EXPLOSION_REFLECTION(100,240); +ACE_EXPLOSION_REFLECTION(100,250); +ACE_EXPLOSION_REFLECTION(100,260); +ACE_EXPLOSION_REFLECTION(100,270); +ACE_EXPLOSION_REFLECTION(100,280); +ACE_EXPLOSION_REFLECTION(100,290); +ACE_EXPLOSION_REFLECTION(100,300); +ACE_EXPLOSION_REFLECTION(100,310); +ACE_EXPLOSION_REFLECTION(100,320); +ACE_EXPLOSION_REFLECTION(100,330); +ACE_EXPLOSION_REFLECTION(100,340); +ACE_EXPLOSION_REFLECTION(100,350); +ACE_EXPLOSION_REFLECTION(100,360); +ACE_EXPLOSION_REFLECTION(100,370); +ACE_EXPLOSION_REFLECTION(100,380); +ACE_EXPLOSION_REFLECTION(100,390); +ACE_EXPLOSION_REFLECTION(100,400); +ACE_EXPLOSION_REFLECTION(100,410); +ACE_EXPLOSION_REFLECTION(100,420); +ACE_EXPLOSION_REFLECTION(100,430); +ACE_EXPLOSION_REFLECTION(100,440); +ACE_EXPLOSION_REFLECTION(100,450); +ACE_EXPLOSION_REFLECTION(100,460); +ACE_EXPLOSION_REFLECTION(100,470); +ACE_EXPLOSION_REFLECTION(100,480); +ACE_EXPLOSION_REFLECTION(100,490); +ACE_EXPLOSION_REFLECTION(100,500); + diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 6c8d64d1fb..95c921df64 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -1,5 +1,12 @@ #include "script_component.hpp" +if(GVAR(EnableDebugTrace) && !isMultiplayer) then { + GVAR(traceFrags) = true; + GVAR(autoTrace) = true; +}; + if(isServer) then { [QGVAR(frag_eh), { _this call FUNC(frago); }] call ace_common_fnc_addEventHandler; -}; \ No newline at end of file +}; + +[FUNC(masterPFH), 0, []] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/frag/XEH_preInit.sqf b/addons/frag/XEH_preInit.sqf index 906a696ebf..cdd9342ffd 100644 --- a/addons/frag/XEH_preInit.sqf +++ b/addons/frag/XEH_preInit.sqf @@ -6,18 +6,16 @@ PREP(doSpall); PREP(fired); PREP(frago); PREP(spallTrack); -PREP(trackFragRound); GVAR(blackList) = []; GVAR(traceFrags) = false; -GVAR(trackedObjects) = []; GVAR(TOTALFRAGS) = 0; GVAR(spallHPData) = []; GVAR(spallIsTrackingCount) = 0; -GVAR(autoTrace) = true; +GVAR(autoTrace) = false; GVAR(traceID) = -1; GVAR(traces) = []; GVAR(tracesStarted) = false; @@ -32,4 +30,22 @@ PREP(startTracing); PREP(stopTracing); PREP(trackTrace); +// New tracking mechanisms +PREP(masterPFH); +PREP(pfhRound); +PREP(addPfhRound); +PREP(removePfhRound); // THIS SHOULD ABE USED SPARINGLY + +// Explosive Reflection +GVAR(replacedBisArtyWrapper) = true; +PREP(findReflections); +PREP(doExplosions); +PREP(doReflections); + + +GVAR(lastIterationIndex) = 0; +GVAR(objects) = []; +GVAR(objectTypes) = []; +GVAR(arguments) = []; + ADDON = true; diff --git a/addons/frag/functions/fnc_addPfhRound.sqf b/addons/frag/functions/fnc_addPfhRound.sqf new file mode 100644 index 0000000000..1fae55278e --- /dev/null +++ b/addons/frag/functions/fnc_addPfhRound.sqf @@ -0,0 +1,75 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +private ["_enabled","_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"]; +PARAMS_3(_gun,_type,_round); + +if (!GVAR(enabled)) exitWith {}; + +//_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled)); +//if(_enabled < 1) exitWith {}; + +if(_round in GVAR(blackList)) exitWith { + GVAR(blackList) = GVAR(blackList) - [_round]; +}; + +// Exit on max track +if( (count GVAR(objects)) > GVAR(MaxTrack)) exitWith { }; + +_doFragTrack = false; +if(_gun == ACE_player) then { + _doFragTrack = true; +} else { + if((gunner _gun) == ACE_player) then { + _doFragTrack = true; + } else { + if(local _gun && {!(isPlayer (gunner _gun))} && {!(isPlayer _gun)}) then { + _doFragTrack = true; + }; + }; +}; +if(GVAR(SpallEnabled)) then { + if(GVAR(spallIsTrackingCount) <= 0) then { + GVAR(spallHPData) = []; + }; + if(GVAR(spallIsTrackingCount) > 5) then { + // ACE_player sideChat "LIMT!"; + _doSpall = false; + } else { + GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) + 1; + }; +}; +// ACE_player sideChat format["c: %1", GVAR(spallIsTrackingCount)]; + +if(GVAR(autoTrace)) then { + [ACE_player, _round, [1,0,0,1]] call FUNC(addTrack); +}; + +// We only do the single track object check here. +// We should do an {!(_round in GVAR(objects))} +// But we leave that out here for optimization. So this cannot be a framework function +// Otherwise, it should only be added once and from the FiredEH +if(_doFragTrack && alive _round) then { + _spallTrack = []; + _spallTrackID = []; + + private["_args"]; + _args = [_round, (getPosASL _round), (velocity _round), _type, diag_frameno, _gun, _doSpall, _spallTrack, _spallTrackID, + (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip))), + (getNumber (configFile >> "CfgAmmo" >> _type >> "explosive")), + (getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange")), + (getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(force))), + (getNumber(configFile >> "CfgAmmo" >> _type >> "indirecthit")*(sqrt((getNumber (configFile >> "CfgAmmo" >> _type >> "indirectHitRange"))))) + ]; + TRACE_1("Initializing track", _round); + GVAR(objects) pushBack _round; + GVAR(arguments) pushBack _args; + + if(_doSpall) then { + [_round, 1, _spallTrack, _spallTrackID] call FUNC(spallTrack); + }; + // ACE_player sideChat "WTF2"; +}; + + + diff --git a/addons/frag/functions/fnc_addTrack.sqf b/addons/frag/functions/fnc_addTrack.sqf index d4a4272a9c..32dec890c9 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, time]] call cba_fnc_addPerFrameHandler; +[DFUNC(trackTrace), 0, [_obj, _index, ACE_time]] call cba_fnc_addPerFrameHandler; diff --git a/addons/frag/functions/fnc_doExplosions.sqf b/addons/frag/functions/fnc_doExplosions.sqf new file mode 100644 index 0000000000..749c4bd2ec --- /dev/null +++ b/addons/frag/functions/fnc_doExplosions.sqf @@ -0,0 +1,26 @@ +//fnc_doExplosions.sqf +#include "script_component.hpp" + +private ["_params", "_explosions", "_index", "_i", "_exp", "_refExp", "_bpos", "_hit", "_distance", "_indirectHitRange", "_depth"]; +_params = _this select 0; +_explosions = _params select 0; +_index = _params select 1; +for "_i" from _index to ((_index+2) min (count _explosions)) do { + _exp = _explosions select _i; + _refExp = _exp select 0; + _bpos = _exp select 1; + _hit = _exp select 2; + _distance = _exp select 3; + _indirectHitRange = _exp select 4; + _depth = _exp select 5; + _refExp createVehicle (ASLtoATL _bpos); + // if(_hit >= 150 && _distance > _indirectHitRange) then { + // [_bpos, _refExp, _depth] call FUNC(doReflections); + // }; +}; +_index = _index + 2; +if(_index >= (count _explosions)) then { + [(_this select 1)] call cba_fnc_removePerFrameHandler; +} else { + _params set[1, _index]; +}; diff --git a/addons/frag/functions/fnc_doReflections.sqf b/addons/frag/functions/fnc_doReflections.sqf new file mode 100644 index 0000000000..911203dc5f --- /dev/null +++ b/addons/frag/functions/fnc_doReflections.sqf @@ -0,0 +1,22 @@ +//fnc_doReflections.sqf +#include "script_component.hpp" + +private ["_pos", "_ammo", "_depth", "_hit", "_range", "_hitFactor", "_indirectHitRange", "_indirectHit", "_testParams"]; + +_pos = _this select 0; +_ammo = _this select 1; +_depth = 1; +if(count _this > 2) then { + _depth = _this select 2; +}; +// TEST_ICONS pushBack [_pos, format["EXP!", _hit, _range, _hitFactor]]; +if(_depth <= 2) then { + _indirectHitRange = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHitRange"); + _indirectHit = getNumber(configFile >> "CfgAmmo" >> _ammo >> "indirectHit"); + + + + + _testParams = [_pos, [_indirectHitRange, _indirectHit], [], [], -4, _depth, 0]; + [DFUNC(findReflections), 0, _testParams] call cba_fnc_addPerFrameHandler; +}; diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 990fb80f8d..1e8e87bcb3 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -1,17 +1,10 @@ //fnc_doSpall.sqf #include "script_component.hpp" -#ifdef DEBUG_MODE_FULL - GVAR(traceFrags) = true; -#endif // ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; -private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", - "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", - "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", - "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", - "_fragment", "_index", "_hitData", "_fragTypes", "_fragType", "_foundObjects"]; + +private ["_params", "_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"]; _params = _this select 0; -[(_this select 1)] call cba_fnc_removePerFrameHandler; _hitData = _params select 0; _initialData = GVAR(spallHPData) select (_hitData select 0); _hpData = (_hitData select 1) select (_params select 1); @@ -127,6 +120,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { [ACE_player, _fragment, [1,0.5,0,1]] call FUNC(addTrack); }; @@ -148,6 +142,7 @@ if(_alive || {_caliber >= 2.5} || {(_explosive > 0 && {_idh >= 1})}) then { _fragment = (_fragTypes select _fragType) createVehicleLocal [0,0,10000]; _fragment setPosASL _spallPos; _fragment setVelocity _spallFragVect; + if(GVAR(traceFrags)) then { [ACE_player, _fragment, [1,0,0,1]] call FUNC(addTrack); }; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf new file mode 100644 index 0000000000..75c4ee2ae6 --- /dev/null +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -0,0 +1,130 @@ +//fnc_findReflections.sqf +#include "script_component.hpp" + +private ["_split", "_radi", "_params", "_pos", "_explosiveInfo", "_los", "_nlos", "_zIndex", "_depth", "_indirectHitRange", + "_indirectHit", "_distanceCount", "_lastPos", "_test", "_vec", "_testPos", "_buckets", "_excludes", "_bucketIndex", "_bucketPos", + "_bucketList", "_c", "_index", "_blist", "_avgX", "_avgY", "_avgZ", "_bpos", "_distance", "_hitFactor", "_hit", "_range", "_refExp", + "_rand", "_i", "_x", "_res", "_forEachIndex", "_explosions", "_can", "_dirvec"]; + + +_params = _this select 0; +_pos = _params select 0; +_explosiveInfo = _params select 1; +_los = _params select 2; +_nlos = _params select 3; +_zIndex = _params select 4; +_depth = _params select 5; +_rand = _params select 6; + +_split = 15; +_radi = (360/_split*_depth); + +// player sideChat format["p: %1", _explosiveInfo]; +_indirectHitRange = _explosiveInfo select 0; +_indirectHit = _explosiveInfo select 1; +_distanceCount = (floor _indirectHitRange*4) min 100; + +if(_zIndex < 5) then { + _lastPos = _pos; + _zAng = _zIndex*20+2; + if(_zAng > 80) then { + _radi = 1; + _zAng = 90; + }; + for "_i" from 0 to _radi do { + _test = true; + _vec = [1, ((_i*_split)+_rand) mod 360, _zAng] call cba_fnc_polar2vect; + for "_x" from 1 to _distanceCount do { + _testPos = _pos vectorAdd (_vec vectorMultiply _x); + // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; + _res = lineIntersectsWith [_pos, _testPos]; + if(count _res > 0) exitWith { + _test = false; + _nlos pushBack _lastPos; + // { + // _x addEventHandler ["HandleDamage", { diag_log text format["this: %1", _this]; }]; + // } forEach _res; + // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; + // TEST_PAIRS pushBack [_pos, _lastPos, [1,0,0,1]]; + + }; + // if(terrainIntersectASL [_pos, _testPos]) exitWith {}; + _lastPos = _testPos; + }; + }; + _params set[4, _zIndex+1]; +} else { + _depth = _depth + 1; + _buckets = []; + _excludes = []; + _bucketIndex = 0; + _bucketPos = nil; + _bucketList = nil; + _c = 0; + while { count(_nlos) != count(_excludes) && _c < (count _nlos) } do { + scopeName "mainSearch"; + { + if(!(_forEachIndex in _excludes)) then { + _index = _buckets pushBack [_x, [_x]]; + _excludes pushBack _forEachIndex; + _bucketPos = _x; + _bucketList = (_buckets select _index) select 1; + breakTo "mainSearch"; + }; + } forEach _nlos; + { + if(!(_forEachIndex in _excludes)) then { + _testPos = _x; + if(_testPos vectorDistanceSqr _bucketPos <= 30) then { + _bucketList pushBack _x; + _excludes pushBack _forEachIndex; + }; + }; + } forEach _nlos; + _c = _c + 1; + }; + + // player sideChat format["c: %1", count _buckets]; + _explosions = []; + { + _blist = _x select 1; + _avgX = 0; + _avgY = 0; + _avgZ = 0; + + { + _avgX = _avgX + (_x select 0); + _avgY = _avgY + (_x select 1); + _avgZ = _avgZ + (_x select 2); + } forEach _blist; + _c = count _blist; + _bpos = [_avgX/_c, _avgY/_c, _avgZ/_c]; + + _distance = _pos vectorDistance _bpos; + _hitFactor = 1-(((_distance/(_indirectHitRange*4)) min 1) max 0); + // _hitFactor = 1/(_distance^2); + _hit = _indirectHit*_hitFactor; + _hit = (floor (_hit/4)) min 500; + _hit = _hit - (_hit%10); + _range = (floor (_indirectHitRange-(_distance/4))) min 100; + _range = _range - (_range%2); + + if(_hit >= 10 && _range > 0) then { + // TEST_ICONS pushBack [_bpos, format["h: %1, r: %2, hf: %3 d: %4 ihr: %5", _hit, _range, _hitFactor, _distance, _indirectHitRange*4]]; + // TEST_PAIRS pushBack [_pos, _bpos, [1,0,0,1]]; + _refExp = format["ace_explosion_reflection_%1_%2", _range, _hit]; + // _refExp createVehicle (ASLtoATL _bpos); + // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _bpos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; + + _explosions pushBack [_refExp, _bpos, _hit, _distance, _indirectHitRange/4, _depth]; + + }; + if(count _explosions > (_radi*2)/_depth) exitWith {}; + } forEach _buckets; + // _can = "Land_Bricks_V4_F" createVehicle (ASLtoATL _pos); + // _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; + [(_this select 1)] call cba_fnc_removePerFrameHandler; +}; diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 7ed717c2b8..a7c5577cb9 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -1,6 +1,6 @@ #include "script_component.hpp" -private ["_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"]; +private ["_enabled", "_gun", "_type", "_round", "_doFragTrack", "_doSpall", "_spallTrack", "_spallTrackID"]; if (!GVAR(enabled)) exitWith {}; @@ -8,10 +8,14 @@ _gun = _this select 0; _type = _this select 4; _round = _this select 6; +_enabled = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(enabled)); +if(_enabled < 1) exitWith {}; + if(_round in GVAR(blackList)) exitWith { GVAR(blackList) = GVAR(blackList) - [_round]; }; + _doFragTrack = false; if(_gun == ACE_player) then { _doFragTrack = true; @@ -46,7 +50,7 @@ if(_doFragTrack && alive _round) then { GVAR(trackedObjects) pushBack _round; _spallTrack = []; _spallTrackID = []; - [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; + [DFUNC(trackFragRound), 0, [_round, (getPosASL _round), (velocity _round), _type, ACE_time, _gun, _doSpall, _spallTrack, _spallTrackID]] call cba_fnc_addPerFrameHandler; if(_doSpall) then { [_round, 2, _spallTrack, _spallTrackID] call FUNC(spallTrack); }; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index de7c6986d9..e8d0f0ffa6 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -8,14 +8,9 @@ if(!isServer) exitWith { }; -// _startTime = diag_tickTime; -private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", - "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", - "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", - "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", - "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", - "_sectorSize", "_sectorOffset", "_randomDir", "_endTime"]; +// _startTime = ACE_diagTime; +private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; _round = _this select 0; _lastPos = _this select 1; @@ -111,8 +106,9 @@ _fragArcs set[360, 0]; ACE_player sideChat format["_fragRange: %1", _fragRange]; ACE_player sideChat format["_objects: %1", _objects]; #endif -_doRandom = false; +_doRandom = true; if(_isArmed && (count _objects) > 0) then { + [_lastPos, _shellType] call FUNC(doReflections); { //if(random(1) > 0.5) then { _target = _x; @@ -167,11 +163,8 @@ if(_isArmed && (count _objects) > 0) then { _fragObj setPosASL _lastPos; _fragObj setVectorDir _vec; _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif if(GVAR(traceFrags)) then { + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; [ACE_player, _fragObj, [1,0,0,1]] call FUNC(addTrack); }; _fragCount = _fragCount + 1; @@ -185,7 +178,7 @@ if(_isArmed && (count _objects) > 0) then { if(_fragCount > MAX_FRAG_COUNT) exitWith {}; } forEach _objects; if(_fragCount > MAX_FRAG_COUNT) exitWith {}; - _randomCount = (ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0; + _randomCount = ((ceil((MAX_FRAG_COUNT-_fragCount)*0.1)) max 0)+20; _sectorSize = 360 / (_randomCount max 1); // _doRandom = false; if(_doRandom) then { @@ -204,19 +197,18 @@ if(_isArmed && (count _objects) > 0) then { _fragObj setPosASL _lastPos; _fragObj setVectorDir _vec; _fragObj setVelocity _vel; - #ifdef DEBUG_MODE_FULL - GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; - GVAR(traceFrags) = true; - #endif + if(GVAR(traceFrags)) then { + GVAR(TOTALFRAGS) = GVAR(TOTALFRAGS) + 1; [ACE_player, _fragObj, [1,0.5,0,1]] call FUNC(addTrack); }; _fragCount = _fragCount + 1; }; }; + }; // #ifdef DEBUG_MODE_FULL // ACE_player sideChat format["total frags: %1", GVAR(TOTALFRAGS)]; // ACE_player sideChat format["tracks: %1", (count GVAR(trackedObjects))]; // #endif -// _endTime = diag_tickTime; +// _endTime = ACE_diagTime; diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf new file mode 100644 index 0000000000..4e81c4c609 --- /dev/null +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -0,0 +1,58 @@ +/* + * Author: jaynus + * + * Master single PFH abstraction for all rounds being tracked by frag/spall + * + * Arguments: + * + * + * Return Value: + * None + */ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +//PARAMS_2(_pfhArgs,_handle); + +if (!GVAR(enabled)) exitWith {}; + +private["_gcIndex"]; +_gcIndex = []; + +_iter = 0; +while { (count GVAR(objects)) > 0 && { _iter < GVAR(MaxTrackPerFrame) } } do { + private["_object", "_args"]; + if(GVAR(lastIterationIndex) >= (count GVAR(objects))) then { + GVAR(lastIterationIndex) = 0; + }; + _object = GVAR(objects) select GVAR(lastIterationIndex); + + if(!isNil "_object") then { + if(isNull _object) then { + _gcIndex pushBack GVAR(lastIterationIndex); + } else { + _args = GVAR(arguments) select GVAR(lastIterationIndex); + + if(!(_args call FUNC(pfhRound))) then { + _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false + }; + // If its not alive anymore, remove it from the queue, it already ran once on dead + if(!alive _object) then { + _gcIndex pushBack GVAR(lastIterationIndex); + }; + }; + }; + _iter = _iter + 1; + GVAR(lastIterationIndex) = GVAR(lastIterationIndex) + 1; +}; + +// clean up dead object references +private["_deletionCount", "_deleteIndex"]; +_deletionCount = 0; +{ + TRACE_1("GC Projectile", _x); + _deleteIndex = _x - _deletionCount; + GVAR(objects) deleteAt _deleteIndex; + GVAR(arguments) deleteAt _deleteIndex; + + _deletionCount = _deletionCount + 1; +} forEach _gcIndex; \ No newline at end of file diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf new file mode 100644 index 0000000000..2c0d8944e7 --- /dev/null +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -0,0 +1,49 @@ +#include "script_component.hpp" +private ["_round", "_lastPos", "_lastVel", "_type", "_firedFrame", "_doSpall", "_spallTrack", "_foundObjectHPIds", "_skip", "_explosive", "_indirectRange", "_force", "_fragPower"]; +_round = _this select 0; +_lastPos = _this select 1; +_lastVel = _this select 2; +_type = _this select 3; +_firedFrame = _this select 4; +_doSpall = _this select 6; +_spallTrack = _this select 7; +_foundObjectHPIds = _this select 8; +_skip = _this select 9; +_explosive = _this select 10; +_indirectRange = _this select 11; +_force = _this select 12; +_fragPower = _this select 13; + +if(_round in GVAR(blackList)) exitWith { + false +}; + +if (!alive _round) then { + if((diag_frameno - _firedFrame) > 1) then { + if(_skip == 0) then { + if((_explosive > 0.5 && {_indirectRange >= 4.5} && {_fragPower >= 35}) || {_force == 1} ) then { + [QGVAR(frag_eh), _this] call ace_common_fnc_serverEvent; + }; + }; + }; + if(_doSpall) then { + GVAR(spallIsTrackingCount) = GVAR(spallIsTrackingCount) - 1; + // diag_log text format["F: %1", _foundObjectHPIds]; + { + if(!isNil "_x") then { + _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; + }; + } forEach _spallTrack; + }; +} else { + + _params set[1, (getPosASL _round)]; + _params set[2, (velocity _round)]; + if(_doSpall) then { + private["_scale"]; + _scale = ( (count GVAR(objects)) / GVAR(MaxTrackPerFrame) ) max 0.1; + [_round, _scale, _spallTrack, _foundObjectHPIds] call FUNC(spallTrack); + }; +}; + +true \ No newline at end of file diff --git a/addons/frag/functions/fnc_removePfhRound.sqf b/addons/frag/functions/fnc_removePfhRound.sqf new file mode 100644 index 0000000000..7fe3994d55 --- /dev/null +++ b/addons/frag/functions/fnc_removePfhRound.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +// THIS FUNCTION SHOULD NOT BE USED BECAUSE IT CAUSES AN SEARCH AND REBUILD + +if(_round in GVAR(blackList)) then { + GVAR(blackList) = GVAR(blackList) - [_round]; +}; + +GVAR(objects) = GVAR(objects) - [_round]; \ No newline at end of file diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index 4b7a06bc65..afe4bc1931 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -22,7 +22,7 @@ if (count _intersectsWith > 0) then { if(!(_x in _foundObjects)) then { // diag_log text format["Adding HP: %1", _x]; _index = (count GVAR(spallHPData)); - _hpId = _x addEventHandler ["hitPart", format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; + _hpId = _x addEventHandler ["hitPart", compile format["[%1, _this] call " + QUOTE(FUNC(spallHP)), _index]]; _foundObjects set[(count _foundObjects), _x]; _foundObjectHPIds set[(count _foundObjectHPIds), _hpId]; _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; diff --git a/addons/frag/functions/fnc_trackFragRound.sqf b/addons/frag/functions/fnc_trackFragRound.sqf index 8db68c99e8..e6a24f62bd 100644 --- a/addons/frag/functions/fnc_trackFragRound.sqf +++ b/addons/frag/functions/fnc_trackFragRound.sqf @@ -13,7 +13,7 @@ _foundObjectHPIds = _params select 8; if (!alive _round) then { [_this select 1] call cba_fnc_removePerFrameHandler; - if(_time != time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { + if(_time != ACE_time && {_round in GVAR(trackedObjects)} && {!(_round in GVAR(blackList))}) then { GVAR(trackedObjects) = GVAR(trackedObjects) - [_round]; _skip = getNumber (configFile >> "CfgAmmo" >> _type >> QGVAR(skip)); if(_skip == 0) then { diff --git a/addons/frag/script_component.hpp b/addons/frag/script_component.hpp index 3740ed23fa..78e13c7863 100644 --- a/addons/frag/script_component.hpp +++ b/addons/frag/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT frag -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" //#define DEBUG_ENABLED_FRAG @@ -11,6 +11,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_FRAG #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define ACE_TRACE_DRAW_INC 1 \ No newline at end of file diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index cfc28f9c4e..9fdb89ba87 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -1,17 +1,84 @@  - - Disable Fragmentation - Keine Schrapnelle - Zakázat fragmentaci granátů - Desactivar fragmentación - Wyłącz fragmentację odłamków - Выключить разлёт осколков - Désactive la fragmentation - Repeszek letiltása - Disattiva la frammentazione - Desabilitar Fragmentação + + Fragmentation Simulation + Symulacja fragmentacji + Simulación de fragmentación + Splittersimulation + Simulace fragmentace + Simulação de fragmentação + + + Enable the ACE Fragmentation Simulation + Activa la simulación de fragmentación ACE + Aktywuje symulację fragmentacji ACE + Aktiviere die ACE-Splittersimulation + Povolit ACE simulaci fragmentace + Ativa a simulação de fragmentação do ACE + + + Spalling Simulation + Simulación de astillamiento + Symulacja odprysków + Explosionssimulation + Simulace úlomků + Simulação de estilhaços + + + Enable the ACE Spalling Simulation + Activa la simulación de astillamiento ACE + Aktywuje symulację odprysków ACE + Aktiviere ACE-Explosionssimulation + Povolit ACE simulaci úlomků + Ativa a simulação de estilhaços do ACE + + + Maximum Projectiles Tracked + Máximos proyectiles rastreados + Maks. liczba śledzonych pocisków + Maximalzahl der verfolgten Projektile + Maximální počet sledovaných projektilů + Máximo de projéteis rastreados + + + This setting controls the maximum amount of projectiles the fragmentation and spalling system will track at any given time. If more projectiles are fired, they will not be tracked. Lower this setting if you do not want FPS drops at high-count projectile scenarios ( >200 rounds in the air at once) + Este ajuste controla la cantidad máxima de proyectiles del sistema de fragmentación y astillamiento de los que se hará un seguimiento en cualquier momento dado. Si se disparan más proyectiles, no serán rastreados. Baja esta opción si no deseas una bajada de FPS en escenarios con muchos proyectiles (>200 proyectiles en el aire a la vez) + To ustawienie kontroluje maksymalną ilość pocisków, jakie fragmentacja i odpryski symulują w danym momencie. Jeżeli więcej pocisków będzie wystrzelonych, wtedy nie będą one śledzone. Zmniejsz tą opcję jeżeli nie chcesz odczuwać spadków FPS podczas ciężkiej wymiany ognia (więcej niż 200 pocisków w powietrzu na raz). + Diese Einstellung steuert die maximale Anzahl an Projektilen, die das Splitter- und Explosionssystem gleichzeitig verfolgen wird. Wenn mehr Projektile abgefeuert werden, werden sie nicht verfolgt werden. Diese Einstellung zu verringern, kann FPS-Einbrüche bei Szenarien mit vielen Projektilen verhindern (>200 Objekte gleichzeitig in der Luft) + Toto nastavení kontroluje maximální množství projektilů z fragmentace a úlomků, která jsou sledována v dané době. Pokud je vystřeleno více projektilů, tak nebudou sledovány. Snižte toto nastavení pokud si nepřejete propady FPS v situacích, kde je velké množství projektilů ( >200 nábojů najednou ve vzduchu) + Esta definição controla a quantidade máxima de projéteis que o sistema de fragmentação e estilhaçamento irá acompanhar em qualquer momento. Se mais projéteis são disparados, eles não serão rastreados. Diminua essa configuração se você não quiser que o FPS caia em cenários com alta contagem de projéteis (> 200 projéteis no ar ao mesmo tempo) + + + Maximum Projectiles Per Frame + Máximos proyectiles por cuadro + Maximale Anzahl an Projektilen pro Frame + Maks. liczba pocisków na klatkę + Maximální počet projektilů ze jeden snímek + Projéteis máximos por quadro + + + The number of spall track calculations to perform in any given frame. This helps spread the FPS impact of tracking spall rounds across multiple frames, limiting its impact even further. + Ilość obliczeń wykonywanych przez symulację odprysków w danej klatce. Ta opcja pomaga rozprzestrzenić obliczenia odprysków na więcej klatek, zmniejszając spadek FPS jeszcze bardziej. + Gibt die Anzahl der Explosionverfolgungsberechnungen an, die gleichzeitig ausgeführt werden. Das kann dabei helfen den FPS-Einfluss abzuschwächen, wenn Teile über mehrere Frames hinweg verfolgt werden. + El número de cálculos de esquirlas que se hará en cualquier cuadro. Esto ayuda a dispersar el impacto en FPS del seguimiento de esquirlas de balas a través de múltiples cuadros, lo que limita aún más su impacto. + Počet úlomků v daném snímku. Toto pomáhá rozšířit FPS dopad sledovaného úlomku napříč více snímky, omezuje jeho vliv ještě více. + O número de cálculos por estilhaço rastreado para executar em qualquer quadro. Isso ajuda a distribuir o impacto no FPS do rastreamento de estilhaço em vários quadros, o que limita o seu impacto ainda mais. + + + (SP Only) Frag/Spall Debug Tracing + (Solo SP) Seguimiento de depuración de Fragmentación/Astillamiento + (Tylko SP) Wizualny debug odł./odpr. + (Pouze SP) Debug sledování Frag/Úlomků + (Somente SP) Depuração de fragmentação e estilhaços traçantes + + + (SP Only) Requires a mission/editor restart. Enables visual tracing of fragmentation and spalling rounds in SP game mode only. + (Solo SP) Requiere un reinicio misión/editor. Permite el seguimiento visual de la fragmentación y astillamientos de los proyectiles en modo SP. + (Tylko SP) Wymaga restartu misji/edytora. Aktywuje wizualne śledzenie odłamków oraz odprysków w trybie gry Single Player. + (nur SP) Splitter-/Explosions-Debugging + (Pouze SP) Vyžaduje restart mise/editoru. Aktivuje vizuální stopování fragmentace a úlomů pouze v režimu jednoho hráče. + (Somente SP) Requer um reinício de missão / editor. Habilita o rastreamento visual de projéteis de fragmentação e estilhaçamento apenas no modo de jogo SP. \ No newline at end of file diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 29a4859651..a4cb047629 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -17,16 +17,16 @@ private ["_interval", "_player", "_newVel", "_accel", "_currentGForce", "_averag EXPLODE_2_PVT(_this,_params,_pfhId); -_interval = time - GVAR(lastUpdateTime); +_interval = ACE_time - GVAR(lastUpdateTime); -// Update the g-forces at constant game time intervals +// Update the g-forces at constant game ACE_time intervals if (_interval < INTERVAL) exitWith {}; if (isNull ACE_player) exitWith {}; if !(alive ACE_player) exitWith {}; -GVAR(lastUpdateTime) = time; +GVAR(lastUpdateTime) = ACE_time; /*if !(vehicle ACE_player isKindOf "Air") exitWith { GVAR(GForces) = []; diff --git a/addons/gforces/script_component.hpp b/addons/gforces/script_component.hpp index cf665c21ec..ab3289842d 100644 --- a/addons/gforces/script_component.hpp +++ b/addons/gforces/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT gforces -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_GFORCES #define DEBUG_MODE_FULL @@ -9,7 +9,7 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define AVERAGEDURATION 6 #define INTERVAL 0.20 diff --git a/addons/goggles/ACE_Settings.hpp b/addons/goggles/ACE_Settings.hpp new file mode 100644 index 0000000000..6b3faa1823 --- /dev/null +++ b/addons/goggles/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(showInThirdPerson) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(ShowInThirdPerson); + }; +}; diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf index a6fe7c415f..088ccc477a 100644 --- a/addons/goggles/XEH_postInit.sqf +++ b/addons/goggles/XEH_postInit.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" if (!hasInterface) exitWith {}; -["ACE3 Common", QGVAR(wipeGlasses), localize "STR_ACE_Goggles_WipeGlasses", +["ACE3 Common", QGVAR(wipeGlasses), localize LSTRING(WipeGlasses), { if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { call FUNC(clearGlasses); @@ -47,6 +47,8 @@ GVAR(DustHandler) = -1; GVAR(RainDrops) = objNull; GVAR(RainActive) = false; GVAR(RainLastLevel) = 0; +GVAR(surfaceCache) = ""; +GVAR(surfaceCacheIsDust) = false; FUNC(CheckGlasses) = { if (GVAR(Current) != (goggles ace_player)) then { diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index 7e8afe4d3d..c557827e17 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -243,14 +243,7 @@ class SniperCloud { ACE_Goggles_BulletCount = 1; }; -class ACE_Settings { - class GVAR(showInThirdPerson) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Goggles_ShowInThirdPerson"; - }; -}; +#include "ACE_Settings.hpp" class CfgCloudlets { class Default; diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf index 197b50b30d..17824253ff 100644 --- a/addons/goggles/functions/fnc_applyDust.sqf +++ b/addons/goggles/functions/fnc_applyDust.sqf @@ -38,7 +38,7 @@ if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA GVAR(DustHandler) = -1; }; GVAR(DustHandler) = [{ - if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { + if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then { SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); private "_amount"; _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); diff --git a/addons/goggles/functions/fnc_dustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf index 9624fc21b3..44475d1acc 100644 --- a/addons/goggles/functions/fnc_dustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -15,7 +15,7 @@ * Public: No */ #include "script_component.hpp" -private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType", "_unit"]; +private ["_bullets", "_position", "_surface", "_weapon", "_cloudType", "_unit"]; EXPLODE_2_PVT(_this,_unit,_weapon); if (_unit != ace_player) exitWith {true}; _cloudType = ""; @@ -39,22 +39,24 @@ if (surfaceIsWater _position) exitWith {}; if ((_position select 2) > 0.2) exitWith {}; _surface = surfaceType _position; -_surface = ([_surface, "#"] call CBA_fnc_split) select 1; -_found = false; -_found = getNumber (ConfigFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; +if (_surface != GVAR(surfaceCache)) then { + GVAR(surfaceCache) = _surface; + _surface = ([_surface, "#"] call CBA_fnc_split) select 1; + GVAR(surfaceCacheIsDust) = getNumber (ConfigFile >> "CfgSurfaces" >> _surface >> "dust") >= 0.1; +}; -if (!_found) exitWith {}; +if (!GVAR(surfaceCacheIsDust)) exitWith {}; _bullets = GETDUSTT(DBULLETS); -if ((diag_tickTime - GETDUSTT(DTIME)) > 1) then { +if ((ACE_diagTime - GETDUSTT(DTIME)) > 1) then { _bullets = 0; }; _bullets = _bullets + 1; SETDUST(DBULLETS,_bullets); -SETDUST(DTIME,diag_tickTime); +SETDUST(DTIME,ACE_diagTime); if (GETDUSTT(DAMOUNT) < 2) then { private "_bulletsRequired"; diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index 0c74f33940..61f20eb935 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -3,6 +3,7 @@ class CfgAmmo { class FlareBase: FlareCore { intensity = 20000; flareSize = 12; + timeToLive = 60; }; class F_40mm_White: FlareBase { intensity = 40000; @@ -10,7 +11,7 @@ class CfgAmmo { }; class F_20mm_White: FlareBase { intensity = 20000; - flareSize = 12; + flareSize = 6; }; class F_Signal_Green: FlareBase { intensity = 20000; @@ -19,6 +20,7 @@ class CfgAmmo { class Flare_82mm_AMOS_White: FlareCore { intensity = 80000; flareSize = 12; + timeToLive = 60; }; class F_20mm_Red: F_20mm_White {}; diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp index 23eb4cb759..31e80dc545 100644 --- a/addons/grenades/CfgMagazines.hpp +++ b/addons/grenades/CfgMagazines.hpp @@ -9,50 +9,50 @@ class CfgMagazines { initSpeed = 22; }; class ACE_HandFlare_White: ACE_HandFlare_Base { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; ammo = "ACE_F_Hand_White"; - displayname = "$STR_ACE_Grenades_M127A1_White_Name"; - descriptionshort = "$STR_ACE_Grenades_M127A1_White_Description"; - displayNameShort = "$STR_ACE_Grenades_M127A1_White_NameShort"; + displayname = CSTRING(M127A1_White_Name); + descriptionshort = CSTRING(M127A1_White_Description); + displayNameShort = CSTRING(M127A1_White_NameShort); model = "\A3\weapons_f\ammo\flare_white"; picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; }; class ACE_HandFlare_Red: ACE_HandFlare_Base { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; ammo = "ACE_F_Hand_Red"; - displayname = "$STR_ACE_Grenades_M127A1_Red_Name"; - descriptionshort = "$STR_ACE_Grenades_M127A1_Red_Description"; - displayNameShort = "$STR_ACE_Grenades_M127A1_Red_NameShort"; + displayname = CSTRING(M127A1_Red_Name); + descriptionshort = CSTRING(M127A1_Red_Description); + displayNameShort = CSTRING(M127A1_Red_NameShort); model = "\A3\weapons_f\ammo\flare_red"; picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; }; class ACE_HandFlare_Green: ACE_HandFlare_Base { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; ammo = "ACE_F_Hand_Green"; - displayname = "$STR_ACE_Grenades_M127A1_Green_Name"; - descriptionshort = "$STR_ACE_Grenades_M127A1_Green_Description"; - displayNameShort = "$STR_ACE_Grenades_M127A1_Green_NameShort"; + displayname = CSTRING(M127A1_Green_Name); + descriptionshort = CSTRING(M127A1_Green_Description); + displayNameShort = CSTRING(M127A1_Green_NameShort); model = "\A3\weapons_f\ammo\flare_green"; picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; }; class ACE_HandFlare_Yellow: ACE_HandFlare_Base { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; ammo = "ACE_F_Hand_Yellow"; - displayname = "$STR_ACE_Grenades_M127A1_Yellow_Name"; - descriptionshort = "$STR_ACE_Grenades_M127A1_Yellow_Description"; - displayNameShort = "$STR_ACE_Grenades_M127A1_Yellow_NameShort"; + displayname = CSTRING(M127A1_Yellow_Name); + descriptionshort = CSTRING(M127A1_Yellow_Description); + displayNameShort = CSTRING(M127A1_Yellow_NameShort); model = "\A3\weapons_f\ammo\flare_yellow"; picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; }; class ACE_M84: HandGrenade { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "ACE_G_M84"; - displayname = "$STR_ACE_Grenades_M84_Name"; - descriptionshort = "$STR_ACE_Grenades_M84_Description"; + displayname = CSTRING(M84_Name); + descriptionshort = CSTRING(M84_Description); displayNameShort = "M84"; mass = 4; model = PATHTOF(models\ACE_m84.p3d); @@ -61,12 +61,12 @@ class CfgMagazines { class 3Rnd_UGL_FlareGreen_F; class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "F_40mm_Green"; initSpeed = 120; }; class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); ammo = "F_40mm_Red"; initSpeed = 120; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 63516407f3..b1559c6cfe 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -10,7 +10,7 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds -["ACE3 Weapons", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", +["ACE3 Weapons", QGVAR(switchGrenadeMode), localize LSTRING(SwitchGrenadeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 9be24bcc47..50dc7cd288 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -103,7 +103,7 @@ _affected = _grenade nearEntities ["CAManBase", 20]; GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; - //PARTIALRECOVERY - start decreasing effect over time + //PARTIALRECOVERY - start decreasing effect over ACE_time [{ PARAMS_1(_strength); GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; diff --git a/addons/grenades/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf index 7663e790f6..913906b8f8 100644 --- a/addons/grenades/functions/fnc_nextMode.sqf +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -31,11 +31,11 @@ if (_mode == 3) then { }; _hint = [ -localize "STR_ACE_Grenades_NormalThrow", -localize "STR_ACE_Grenades_HighThrow", -localize "STR_ACE_Grenades_PreciseThrow", -localize "STR_ACE_Grenades_RollGrenade", -localize "STR_ACE_Grenades_DropGrenade" +localize LSTRING(NormalThrow), +localize LSTRING(HighThrow), +localize LSTRING(PreciseThrow), +localize LSTRING(RollGrenade), +localize LSTRING(DropGrenade) ] select _mode; [_hint] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/ACE_Settings.hpp b/addons/hearing/ACE_Settings.hpp new file mode 100644 index 0000000000..c0f69dda65 --- /dev/null +++ b/addons/hearing/ACE_Settings.hpp @@ -0,0 +1,20 @@ +class ACE_Settings { + class GVAR(EnableCombatDeafness) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(EarplugsVolume) { + value = 0.5; + typeName = "SCALAR"; + }; + class GVAR(UnconsciousnessVolume) { + value = 0.4; + typeName = "SCALAR"; + }; + class GVAR(DisableEarRinging) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(DisableEarRinging); + }; +}; diff --git a/addons/hearing/CfgSounds.hpp b/addons/hearing/CfgSounds.hpp index ac64f42c4e..2d757041be 100644 --- a/addons/hearing/CfgSounds.hpp +++ b/addons/hearing/CfgSounds.hpp @@ -11,4 +11,12 @@ class CfgSounds { sound[] = {QUOTE(PATHTOF(sounds\ACE_earringing_heavy.wav)),8,1.7}; titles[] = {}; }; + class ACE_Combat_Deafness { + sound[] = {QUOTE(PATHTOF(sounds\deafness.ogg)),3,1}; + titles[] = {}; + }; + class ACE_Ring_Backblast { + sound[] = {QUOTE(PATHTOF(sounds\backblast_ring.ogg)),1,1}; + titles[] = {}; + }; }; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 6c77255384..1cf06910b0 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -4,9 +4,9 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class ACE_PutInEarplugs { - displayName = "$STR_ACE_Hearing_EarPlugs_On"; + displayName = CSTRING(EarPlugs_On); condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} ); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(putInEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -14,9 +14,9 @@ class CfgVehicles { hotkey = "E"; }; class ACE_RemoveEarplugs { - displayName = "$STR_ACE_Hearing_EarPlugs_Off"; + displayName = CSTRING(EarPlugs_Off); condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) ); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE( [_player] call FUNC(removeEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -93,26 +93,25 @@ class CfgVehicles { }; }; - - class Module_F; - class ACE_ModuleHearing: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleHearing: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Hearing"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleHearing); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa); class Arguments { class EnableCombatDeafness { - displayName = "Enable combat deafness?"; - description = "Enable combat deafness?"; + displayName = CSTRING(CombatDeafness_DisplayName); + description = CSTRING(CombatDeafness_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; default = 1; }; - class No { name = "No"; value = 0; }; - }; + defaultValue = 1; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; }; diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index e70cc62c25..adcdb2217b 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -3,8 +3,8 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_EarPlugs: ACE_ItemCore { - displayName = "$STR_ACE_Hearing_EarPlugs_Name"; - descriptionShort = "$STR_ACE_Hearing_EarPlugs_Description"; + displayName = CSTRING(EarPlugs_Name); + descriptionShort = CSTRING(EarPlugs_Description); model = PATHTOF(ACE_earplugs.p3d); picture = PATHTOF(UI\ACE_earplugs_x_ca.paa); scope = 2; @@ -12,4 +12,39 @@ class CfgWeapons { mass = 1; }; }; + + class H_HelmetB; + class H_HelmetCrew_B: H_HelmetB { + GVAR(protection) = 1; + GVAR(lowerVolume) = 0.80; + }; + class H_HelmetCrew_0: H_HelmetCrew_B {}; + class H_HelmetCrew_I: H_HelmetCrew_B {}; + + class H_CrewHelmetHeli_B: H_HelmetB { + GVAR(protection) = 0.75; + GVAR(lowerVolume) = 0.70; + }; + class H_CrewHelmetHeli_O: H_CrewHelmetHeli_B {}; + class H_CrewHelmetHeli_I: H_CrewHelmetHeli_B {}; + + class H_PilotHelmetHeli_B: H_HelmetB { + GVAR(protection) = 0.75; + GVAR(lowerVolume) = 0.70; + }; + class H_PilotHelmetHeli_O: H_PilotHelmetHeli_B {}; + class H_PilotHelmetHeli_I: H_PilotHelmetHeli_B {}; + + class H_PilotHelmetFighter_B: H_HelmetB { + GVAR(protection) = 1; + GVAR(lowerVolume) = 0.80; + }; + class H_PilotHelmetFighter_O: H_PilotHelmetFighter_B {}; + class H_PilotHelmetFighter_I: H_PilotHelmetFighter_B {}; + + class H_Cap_headphones: H_HelmetB { + GVAR(protection) = 0.5; + GVAR(lowerVolume) = 0.60; + }; + class H_Cap_marshal: H_Cap_headphones {}; }; diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 7b584f8397..ad7fddcd98 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -6,9 +6,30 @@ GVAR(currentDeafness) = 0; GVAR(newStrength) = 0; GVAR(playerVehAttenuation) = 1; +GVAR(beep) = false; +GVAR(beep2) = false; +GVAR(time2) = 0; +GVAR(time3) = 0; +GVAR(time4) = 0; +GVAR(earRingingPFH) = -1; + // Spawn volume updating process [FUNC(updateVolume), 0.1, [] ] call CBA_fnc_addPerFrameHandler; //Update veh attunation when player veh changes ["playerVehicleChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); ["playerTurretChanged", {_this call FUNC(updatePlayerVehAttenuation);}] call EFUNC(common,addEventHandler); + +//Reset deafness on respawn (or remote control player switch) +["playerChanged", { + ACE_player setVariable [QGVAR(dv), 0]; + ACE_player setVariable [QGVAR(prior), 0]; + ACE_player setvariable [QGVAR(deaf), false]; + GVAR(beep) = false; + GVAR(beep2) = false; + GVAR(time2) = 0; + GVAR(time3) = 0; + GVAR(time4) = 0; + GVAR(currentDeafness) = 0; + GVAR(newStrength) = 0; +}] call EFUNC(common,addEventhandler); diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 0813d0648e..5d130e589a 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { units[] = {}; weapons[] = {"ACE_EarPlugs"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interaction"}; - author[] = {"KoffeinFlummi", "esteldunedain", "HopeJ", "commy2"}; + requiredAddons[] = {"ace_interaction", "A3_Characters_F", "A3_Characters_F_Kart"}; + author[] = {"KoffeinFlummi", "esteldunedain", "HopeJ", "commy2", "Rocko", "Rommel", "Ruthberg"}; authorUrl = "https://github.com/KoffeinFlummi/"; VERSION_CONFIG; }; @@ -22,23 +22,4 @@ class CfgPatches { #include "CfgAmmo.hpp" -class ACE_Settings { - class GVAR(EnableCombatDeafness) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(EarplugsVolume) { - value = 0.5; - typeName = "SCALAR"; - }; - class GVAR(UnconsciousnessVolume) { - value = 0.4; - typeName = "SCALAR"; - }; - class GVAR(DisableEarRinging) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Hearing_DisableEarRinging"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 455de07fd9..62ed4518e2 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -15,9 +15,12 @@ */ #include "script_component.hpp" -private ["_unit", "_launcher"]; +PARAMS_1(_unit); -_unit = _this select 0; +// Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios) +if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {}; + +private ["_launcher"]; // add earplugs if the soldier has a rocket launcher _launcher = secondaryWeapon _unit; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 2460e0fd5c..74e2768c4c 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -1,56 +1,101 @@ /* - * Author: KoffeinFlummi, commy2 - * Creates ear ringing effect with set strength. + * Author: KoffeinFlummi, commy2, Rocko, Rommel, Ruthberg + * Ear ringing PFH * * Arguments: - * 0: Unit (player) + * 0: unit * 1: strength of ear ringing (Number between 0 and 1) * * Return Value: * None * * Example: - * [clientExplosionEvent] call ace_hearing_fnc_earRinging + * [_unit, _strength] call ace_hearing_fnc_earRinging * * Public: No */ #include "script_component.hpp" -private ["_unit", "_strength"]; +if (GVAR(DisableEarRinging)) exitWith {}; -_unit = _this select 0; -_strength = _this select 1; +PARAMS_2(_unit,_strength); + +if (isNull _unit) exitWith {}; +if (_strength < 0.05) exitWith {}; if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { _strength = _strength / 4; }; -GVAR(newStrength) = GVAR(newStrength) max _strength; - -if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {}; - - -if (GVAR(DisableEarRinging)) exitWith {}; - -if (_strength > 0.75) exitWith { - playSound "ACE_EarRinging_Heavy"; - GVAR(isEarRingingPlaying) = true; - [ - {GVAR(isEarRingingPlaying) = false;}, [], 7.0, 0.25 - ] call EFUNC(common,waitAndExecute); -}; -if (_strength > 0.5) exitWith { - playSound "ACE_EarRinging_Medium"; - GVAR(isEarRingingPlaying) = true; - [ - {GVAR(isEarRingingPlaying) = false;}, [], 5.0, 0.25 - ] call EFUNC(common,waitAndExecute); -}; -if (_strength > 0.2) exitWith { - playSound "ACE_EarRinging_Weak"; - GVAR(isEarRingingPlaying) = true; - GVAR(isEarRingingPlaying) = true; - [ - {GVAR(isEarRingingPlaying) = false;}, [], 3.0, 0.25 - ] call EFUNC(common,waitAndExecute); +//headgear hearing protection +if(headgear _unit != "") then { + private ["_protection"]; + _protection = (getNumber (configFile >> "CfgWeapons" >> (headgear _unit) >> QGVAR(protection))) min 1; + if(_protection > 0) then { + _strength = _strength * (1 - _protection); + }; }; + +_unit setVariable [QGVAR(dv), (_unit getVariable [QGVAR(dv), 0]) + _strength]; + +if (GVAR(earRingingPFH) != -1) exitWith {}; + +GVAR(earRingingPFH) = [{ + EXPLODE_1_PVT(_this select 0,_unit); + private ["_prior"]; + _prior = (_unit getvariable [QGVAR(dv), 0]) min 20; + + if (!alive _unit || _prior <= 0) exitWith { + _unit setVariable [QGVAR(dv), 0]; + _unit setVariable [QGVAR(prior), 0]; + GVAR(beep) = false; + GVAR(beep2) = false; + GVAR(time2) = 0; + GVAR(time3) = 0; + GVAR(time4) = 0; + GVAR(earRingingPFH) = -1; + [_this select 1] call cba_fnc_removePerFrameHandler; + }; + + if (((_unit getvariable [QGVAR(dv), 0]) - (_unit getvariable [QGVAR(prior), 0])) > 2) then { + if (ACE_time > GVAR(time3)) then { + GVAR(beep2) = false; + }; + if (!GVAR(beep2)) then { + playSound "ACE_Combat_Deafness"; + GVAR(beep2) = true; + GVAR(time3) = ACE_time + 5; + }; + }; + + _unit setvariable [QGVAR(prior), _prior]; + GVAR(volume) = (1 - (_prior / 20)) max 0; + + if (_prior > 19.75) then { + _unit setvariable [QGVAR(deaf), true]; + } else { + _unit setvariable [QGVAR(deaf), false]; + }; + + if ((_unit getvariable [QGVAR(deaf), false]) && {ACE_time > GVAR(time4)}) then { + playSound "ACE_Combat_Deafness"; + GVAR(beep2) = true; + GVAR(time3) = ACE_time + 10; + GVAR(time4) = ACE_time + 30; + }; + + // Hearing takes longer to return to normal after it hits rock bottom + _unit setvariable [QGVAR(dv), _prior - (0.5 * (GVAR(volume) max 0.1))]; + + if (_prior > 10) then { + //check if the ringing is already being played + if (ACE_time > GVAR(time2)) then { + GVAR(beep) = false; + }; + if (!GVAR(beep)) then { + playSound "ACE_Ring_Backblast"; + GVAR(time2) = ACE_time + 22; + GVAR(beep) = true; + }; + }; +}, 1, [_unit]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index b213a1304a..cb9202618f 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -1,5 +1,5 @@ /* - * Author: KoffeinFlummi, commy2 + * Author: KoffeinFlummi, commy2, Ruthberg * Handles deafness due to explosions going off near the player. * * Arguments: @@ -16,12 +16,10 @@ */ #include "script_component.hpp" -private ["_unit", "_damage", "_strength"]; +PARAMS_2(_unit,_damage); -_unit = _this select 0; -_damage = _this select 1; - -_strength = (_damage * 2) min 1; +private ["_strength"]; +_strength = 0 max _damage; if (_strength < 0.01) exitWith {}; [{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index b456b3b872..4164f81b33 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -private ["_silencer", "_audibleFireCoef", "_audibleFire", "_loudness", "_strength", "_vehAttenuation"]; +private ["_silencer", "_audibleFireCoef", "_loudness", "_strength", "_vehAttenuation", "_magazine", "_muzzles", "_weaponMagazines", "_muzzleMagazines", "_ammoType", "_initSpeed", "_ammoConfig", "_caliber", "_parentClasses"]; PARAMS_7(_object,_firer,_distance,_weapon,_muzzle,_mode,_ammo); @@ -30,10 +30,11 @@ if (!GVAR(enableCombatDeafness)) exitWith {}; //Only run if firedNear object is player or player's vehicle: if ((ACE_player != _object) && {(vehicle ACE_player) != _object}) exitWith {}; if (_weapon in ["Throw", "Put"]) exitWith {}; +if (_distance > 50) exitWith {}; _vehAttenuation = if ((ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player}) then {1} else {GVAR(playerVehAttenuation)}; -if (_distance < 1) then {_distance = 1;}; +_distance = 1 max _distance; _silencer = switch (_weapon) do { case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; @@ -47,10 +48,51 @@ if (_silencer != "") then { _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); }; -_audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); +_weaponMagazines = missionNamespace getVariable [format[QEGVAR(common,weaponMagazines_%1),_weapon], []]; +if (count _weaponMagazines == 0) then { + _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); + _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); + { + if (_x != "this") then { + _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); + _weaponMagazines append _muzzleMagazines; + }; + } forEach _muzzles; + { + _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); + _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; + } forEach _weaponMagazines; + missionNamespace setVariable [format[QEGVAR(common,weaponMagazines_%1),_weapon], _weaponMagazines]; +}; -_loudness = _audibleFireCoef * _audibleFire / 64; -_strength = _vehAttenuation * (_loudness - (_loudness/50 * _distance)); // linear drop off +_magazine = ""; +{ + EXPLODE_2_PVT(_x,_magazineType,_ammoType) + if (_ammoType == _ammo) exitWith { + _magazine = _magazineType; + }; +} forEach _weaponMagazines; + +if (_magazine == "") exitWith {}; + +_initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); +_ammoConfig = (configFile >> "CfgAmmo" >> _ammo); +_parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; +_caliber = getNumber(_ammoConfig >> "ACE_caliber"); +_caliber = switch (true) do { + case ("ShellBase" in _parentClasses): { 80 }; + case ("RocketBase" in _parentClasses): { 200 }; + case ("MissileBase" in _parentClasses): { 600 }; + case ("SubmunitionBase" in _parentClasses): { 80 }; + default { + if (_caliber <= 0) then { 6.5 } else { _caliber }; + }; +}; +_loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) * _audibleFireCoef / 5; +_strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off + +//systemChat format["%1 : %2 : %3", _strength, _initSpeed, _parentClasses]; +//systemChat format["%1 : %2 : %3", _weapon, _magazine, _initSpeed]; if (_strength < 0.01) exitWith {}; diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index b02a19d5bc..e979360945 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -22,7 +22,7 @@ _player removeItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", true, true]; -[localize "STR_ACE_Hearing_EarPlugs_Are_On"] call EFUNC(common,displayTextStructured); +[localize LSTRING(EarPlugs_Are_On)] call EFUNC(common,displayTextStructured); -/*// No Ear Plugs in inventory, telling user -[localize "STR_ACE_Hearing_NoPlugs"] call EFUNC(common,displayTextStructured);*/ +/*// No Earplugs in inventory, telling user +[localize LSTRING(NoPlugs)] call EFUNC(common,displayTextStructured);*/ diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index e2d0b68d51..bee3517235 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -18,7 +18,7 @@ PARAMS_1(_player); if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full - [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); + [localize LSTRING(Inventory_Full)] call EFUNC(common,displayTextStructured); }; // Plugs already in and removing them. @@ -26,4 +26,4 @@ _player addItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", false, true]; -[localize "STR_ACE_Hearing_EarPlugs_Are_Off"] call EFUNC(common,displayTextStructured); +[localize LSTRING(EarPlugs_Are_Off)] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf index a7285d5e2b..7d48ca7b34 100644 --- a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf +++ b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +private ["_effectType", "_newAttenuation", "_turretConfig", "_turretPath", "_vehicle"]; + _vehicle = vehicle ACE_player; if (isNull _vehicle) exitWith {}; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index a0ca6af457..5502f38bf4 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,5 +1,5 @@ /* - * Author: commy2 and esteldunedain + * Author: commy2 and esteldunedain and Ruthberg * Updates and applys the current deafness. Called every 0.1 sec from a PFEH. * * Arguments: @@ -15,19 +15,16 @@ */ #include "script_component.hpp" -#define STRENGHTODEAFNESS 3 -#define MAXDEAFNESS 1.1 - private ["_recoverRate", "_volume"]; // Exit if combat deafness is disabled if !(GVAR(enableCombatDeafness)) exitWith {}; // Check if new noises increase deafness -if (GVAR(newStrength) * STRENGHTODEAFNESS > GVAR(currentDeafness)) then { - GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; +GVAR(newStrength) = (((ACE_player getvariable [QGVAR(dv), 0]) min 20) / 20) ^ 2; +if (GVAR(newStrength) > GVAR(currentDeafness)) then { + GVAR(currentDeafness) = GVAR(newStrength); }; -GVAR(newStrength) = 0; // Recover rate is slower if deafness is severe _recoverRate = 0.01; @@ -38,7 +35,7 @@ if (GVAR(currentDeafness) > 0.7) then { }; }; -// Deafness recovers with time +// Deafness recovers with ACE_time GVAR(currentDeafness) = GVAR(currentDeafness) - _recoverRate max 0; // needed until Bohemia fixes playSound to actually use the second argument @@ -49,6 +46,15 @@ if ([ACE_player] call FUNC(hasEarPlugsIn)) then { _volume = _volume min GVAR(EarplugsVolume); }; +// Headgear can reduce hearing +if(headgear ACE_player != "") then { + private ["_lowerVolume"]; + _lowerVolume = (getNumber (configFile >> "CfgWeapons" >> (headgear ACE_player) >> QGVAR(lowerVolume))) min 1; + if(_lowerVolume > 0) then { + _volume = _volume min (1 - _lowerVolume); + }; +}; + // Reduce volume if player is unconscious if (ACE_player getVariable ["ACE_isUnconscious", false]) then { _volume = _volume min GVAR(UnconsciousnessVolume); diff --git a/addons/hearing/script_component.hpp b/addons/hearing/script_component.hpp index 6d4df68370..089bce86eb 100644 --- a/addons/hearing/script_component.hpp +++ b/addons/hearing/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT hearing -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_HEARING #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_HEARING #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/hearing/sounds/backblast_ring.ogg b/addons/hearing/sounds/backblast_ring.ogg new file mode 100644 index 0000000000..8d6207e326 Binary files /dev/null and b/addons/hearing/sounds/backblast_ring.ogg differ diff --git a/addons/hearing/sounds/deafness.ogg b/addons/hearing/sounds/deafness.ogg new file mode 100644 index 0000000000..52314e374e Binary files /dev/null and b/addons/hearing/sounds/deafness.ogg differ diff --git a/addons/hearing/sounds/flashbang_ring.ogg b/addons/hearing/sounds/flashbang_ring.ogg new file mode 100644 index 0000000000..0374cb413c Binary files /dev/null and b/addons/hearing/sounds/flashbang_ring.ogg differ diff --git a/addons/hearing/sounds/muzzleblast_ring1.ogg b/addons/hearing/sounds/muzzleblast_ring1.ogg new file mode 100644 index 0000000000..c164e93c02 Binary files /dev/null and b/addons/hearing/sounds/muzzleblast_ring1.ogg differ diff --git a/addons/hearing/sounds/muzzleblast_ring2.ogg b/addons/hearing/sounds/muzzleblast_ring2.ogg new file mode 100644 index 0000000000..3b6331e011 Binary files /dev/null and b/addons/hearing/sounds/muzzleblast_ring2.ogg differ diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index f13947d095..dbd063b752 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -2,7 +2,7 @@ - Ear Plugs + Earplugs Ohrenstöpsel Tapones para los oídos Stopery do uszu @@ -14,7 +14,7 @@ Tappi auricolari - Protective Ear Plugs allow the wearer to be near loud weaponry without damage to his hearing. + Protective Earplugs allow the wearer to be near loud weaponry without damage to his hearing. Schützende Ohrenstöpsel, die es dem Träger ermöglichen, sich in der Nähe lauter Waffen aufzuhalten ohne Gehörschäden davonzutragen.. Los tapones para los oídos permiten al usuario operar armamento ruidoso sin sufrir pérdida de audición. Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu. @@ -74,7 +74,7 @@ Levati i tappi auricolari - You have no ear plugs + You have no earplugs Keine Ohrenstöpsel im Inventar No tienes tapones para los oídos Nie masz stoperów @@ -106,8 +106,39 @@ Vypnout pískání v uších Wyłącz dzwonienie w uszach Fülcsengés letiltása - Disabilita il ronzio + Disabilita i fischi nelle orecchie Desabilitar zumbido de ouvidos + + Hearing + Słuch + Audición + Gehör + Sluch + Audição + + + Enable combat deafness? + Wł. głuchotę bojową + ¿Habilitar sordera de combate? + Aktiviere Taubheit im Gefecht? + Povolit ztrátu sluchu? + Ativar surdez em combate? + + + Enable combat deafness? + 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? + Povolit ztrátu sluchu? + Ativar surdez em combate? + + + + 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. + \ No newline at end of file diff --git a/addons/hitreactions/ACE_Settings.hpp b/addons/hitreactions/ACE_Settings.hpp new file mode 100644 index 0000000000..adbbdacaf2 --- /dev/null +++ b/addons/hitreactions/ACE_Settings.hpp @@ -0,0 +1,7 @@ +class ACE_Settings { + class GVAR(minDamageToTrigger) { + //Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely. + typeName = "SCALAR"; + value = 0.1; + }; +}; diff --git a/addons/hitreactions/config.cpp b/addons/hitreactions/config.cpp index 33d2665311..77b68b77f5 100644 --- a/addons/hitreactions/config.cpp +++ b/addons/hitreactions/config.cpp @@ -12,4 +12,5 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" diff --git a/addons/hitreactions/functions/fnc_fallDown.sqf b/addons/hitreactions/functions/fnc_fallDown.sqf index fdad970950..b979d09a4f 100644 --- a/addons/hitreactions/functions/fnc_fallDown.sqf +++ b/addons/hitreactions/functions/fnc_fallDown.sqf @@ -10,6 +10,9 @@ _damage = _this select 2; // don't fall on collision damage if (_unit == _firer) exitWith {}; +//Exit if system disabled: +if (GVAR(minDamageToTrigger) == -1) exitWith {}; + // cam shake for player if (_unit == ACE_player) then { addCamShake [3, 5, _damage + random 10]; @@ -27,13 +30,16 @@ if (_vehicle isKindOf "StaticWeapon") exitwith { }; // don't fall after minor damage -if (_damage < 0.1) exitWith {}; +if (_damage < GVAR(minDamageToTrigger)) exitWith {}; // play sound if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then { [_unit] call EFUNC(medical,playInjuredSound); }; +//Don't do animations if in a vehicle (looks weird and animations never reset): +if (_vehicle != _unit) exitWith {}; + // this checks most things, so it doesn't mess with being inside vehicles or while dragging etc. if !([_unit, _vehicle] call EFUNC(common,canInteractWith)) exitWith {}; diff --git a/addons/huntir/$PBOPREFIX$ b/addons/huntir/$PBOPREFIX$ new file mode 100644 index 0000000000..b19f9d28e8 --- /dev/null +++ b/addons/huntir/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\huntir \ No newline at end of file diff --git a/addons/huntir/CfgAmmo.hpp b/addons/huntir/CfgAmmo.hpp new file mode 100644 index 0000000000..fac4d6fe60 --- /dev/null +++ b/addons/huntir/CfgAmmo.hpp @@ -0,0 +1,45 @@ +class CfgAmmo { + class FlareBase; + class F_HuntIR: FlareBase { + model = PATHTOF(data\ace_m1070_armed.p3d); + lightColor[] = {0, 0, 0, 0}; + smokeColor[] = {0, 0, 0, 0}; + timeToLive = 6; + }; + + class ShellBase; + class ACE_HuntIR_Propell: ShellBase { + supersonicCrackNear[] = {"",0.316228,1,50}; + supersonicCrackFar[] = {"",0.223872,1,150}; + CraterEffects = ""; + CraterWaterEffects = ""; + ExplosionEffects = "ACE_HuntIR_Propell_Fx"; + visibleFire = 1; + audibleFire = 1; + dangerRadiusHit = -1; + suppressionRadiusHit = 0; + soundHit1[] = {"",3.16228,1,2000}; + soundHit2[] = {"",3.16228,1,2000}; + soundHit3[] = {"",3.16228,1,2000}; + soundHit4[] = {"",3.16228,1,2000}; + soundHit5[] = {"",3.16228,1,2000}; + soundHit6[] = {"",3.16228,1,2000}; + soundHit7[] = {"",3.16228,1,2000}; + soundHit8[] = {"",3.16228,1,2000}; + multiSoundHit[] = {}; + class HitEffects {}; + soundFakeFall0[] = {"",3.16228,1,1000}; + soundFakeFall1[] = {"",3.16228,1,1000}; + soundFakeFall2[] = {"",3.16228,1,1000}; + soundFakeFall3[] = {"",3.16228,1,1000}; + soundFakeFall[] = {}; + hit = 0; + indirectHit = 0; + indirectHitRange = 0; + explosive = 1; + model = "\A3\weapons_f\empty"; + airFriction = 0; + timeToLive = 1; + explosionTime = 0.001; + }; +}; diff --git a/addons/huntir/CfgCloudlets.hpp b/addons/huntir/CfgCloudlets.hpp new file mode 100644 index 0000000000..4ff0ff2f6f --- /dev/null +++ b/addons/huntir/CfgCloudlets.hpp @@ -0,0 +1,92 @@ +class ACE_HuntIR_Propell_Fx { + class ACE_HuntIR_ExploAmmoFlash { + simulation = "particles"; + type = "ACE_HuntIR_ExploAmmoFlash"; + position[] = { 0, 0, 0 }; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + class ACE_HuntIR_ExploAmmoSmoke { + simulation = "particles"; + type = "ACE_HuntIR_ExploAmmoSmoke"; + position[] = { 0, 0, 0 }; + intensity = 1; + interval = 1; + lifeTime = 0.8; + }; +}; + +class CfgCloudlets { + class Default; + class ACE_HuntIR_ExploAmmoFlash: Default { + interval = 0.1; + circleRadius = 0; + circleVelocity[] = { 0, 0, 0 }; + particleShape = "\A3\data_f\ParticleEffects\Universal\Universal"; + particleFSNtieth = 16; + particleFSIndex = 0; + particleFSFrameCount = 32; + particleFSLoop = 0; + angleVar = 1; + animationName = ""; + particleType = "Billboard"; + timerPeriod = 1; + lifeTime = 0.5; + moveVelocity[] = { 0, 1, 0 }; + rotationVelocity = 1; + weight = 10; + volume = 7.9; + rubbing = 0.1; + size[] = { "0.0125 * intensity + 0.25", "0.0125 * intensity + 0.125" }; + color[] = { { 1, 1, 1, -1 }, { 1, 1, 1, 0 } }; + animationSpeed[] = { 2 }; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 0.2; + onTimerScript = ""; + beforeDestroyScript = ""; + lifeTimeVar = 0; + positionVar[] = { 0, 0.1, 0 }; + MoveVelocityVar[] = { 0.2, 0.5, 0.2 }; + rotationVelocityVar = 1; + sizeVar = 0.5; + colorVar[] = { 0, 0, 0, 0 }; + randomDirectionPeriodVar = 0; + randomDirectionIntensityVar = 0; + }; + class ACE_HuntIR_ExploAmmoSmoke: Default { + interval = "0.02 * interval + 0.02"; + circleRadius = 0; + circleVelocity[] = { 0, 0, 0 }; + particleShape = "\A3\data_f\ParticleEffects\Universal\Universal"; + particleFSNtieth = 16; + particleFSIndex = 7; + particleFSFrameCount = 48; + particleFSLoop = 1; + angleVar = 1; + animationName = ""; + particleType = "Billboard"; + timerPeriod = 1; + lifeTime = 0.25; + moveVelocity[] = { 0, 1, 0 }; + rotationVelocity = 1; + weight = 0.053; + volume = 0.04; + rubbing = 0.2; + size[] = { "0.0125 * intensity + 0.25", "0.0125 * intensity + 1.25", "0.0125 * intensity + 2.75", "0.0125 * intensity + 3.75" }; + color[] = { { 0.6, 0.6, 0.6, 1 }, { 0.7, 0.7, 0.7, 0.5 }, { 0.78, 0.78, 0.78, 0.25 } }; + animationSpeed[] = { 1.7, 0.6, 0.4, 0.3, 0.3 }; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 0.2; + onTimerScript = ""; + beforeDestroyScript = ""; + lifeTimeVar = 2; + positionVar[] = { 0.5, 0.3, 0.5 }; + MoveVelocityVar[] = { 1.5, 2, 1.5 }; + rotationVelocityVar = 1; + sizeVar = 0.5; + colorVar[] = { 0, 0, 0, 0 }; + randomDirectionPeriodVar = 0; + randomDirectionIntensityVar = 0; + }; +}; diff --git a/addons/huntir/CfgEventhandlers.hpp b/addons/huntir/CfgEventhandlers.hpp new file mode 100644 index 0000000000..308df09c1b --- /dev/null +++ b/addons/huntir/CfgEventhandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + +class Extended_FiredBIS_EventHandlers { + class CAManBase { + class ADDON { + clientFiredBIS = QUOTE(_this call FUNC(handleFired)); + }; + }; +}; \ No newline at end of file diff --git a/addons/huntir/CfgMagazines.hpp b/addons/huntir/CfgMagazines.hpp new file mode 100644 index 0000000000..c11f81a98c --- /dev/null +++ b/addons/huntir/CfgMagazines.hpp @@ -0,0 +1,11 @@ + +class CfgMagazines { + class 1Rnd_HE_Grenade_shell; + class ACE_HuntIR_M203: 1Rnd_HE_Grenade_shell { + displayName = CSTRING(magazine_displayName); + displayNameShort = "HuntIR"; + descriptionShort = ""; + picture = PATHTOF(data\m_m1070_ca.paa); + ammo = "F_HuntIR"; + }; +}; diff --git a/addons/huntir/CfgVehicles.hpp b/addons/huntir/CfgVehicles.hpp new file mode 100644 index 0000000000..bc8ed4fc83 --- /dev/null +++ b/addons/huntir/CfgVehicles.hpp @@ -0,0 +1,98 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(open) { + displayName = CSTRING(activateMonitor); + condition = QUOTE([ARR_2(ACE_player,'ACE_HuntIR_monitor')] call EFUNC(common,hasItem)); + statement = QUOTE(call FUNC(huntir)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_huntir_monitor_ca.paa); + exceptions[] = {}; + }; + }; + }; + }; + + class Parachute_02_base_F; + class ACE_HuntIR: Parachute_02_base_F { + author = ECSTRING(common,ACETeam); + castDriverShadow = 0; + destrType = "DestructDefault"; + displayName = "HuntIR"; + model = PATHTOF(data\huntir.p3d); + scope = 1; + soundCrash[] = {"", db-30, 1 }; + soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80}; + soundLandCrash[] = {"", db-30, 1 }; + soundWaterCrash[] = {"", db10, 1 }; + class HitPoints { + class HitEngine { + armor = 0; + material = -1; + name = ""; + visual = ""; + radius = 0; + passThrough = 0; + explosionShielding = 0; + }; + class HitParachute { + armor = 0.0001; + material = -1; + name = "parachute"; + visual = ""; + radius = 0.2; + passThrough = 1; + explosionShielding = 0; + }; + class HitCamera { + armor = 0.001; + material = -1; + name = "camera"; + visual = ""; + radius = 0.025; + passThrough = 1; + explosionShielding = 1; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_HuntIR_monitor: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(monitor_displayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_HuntIR_monitor { + name = "ACE_HuntIR_monitor"; + count = 1; + }; + }; + }; + + class ReammoBox_F; + class ACE_HuntIR_Box: ReammoBox_F { + model = PATHTOF(data\ace_huntirbox.p3d); + displayName = $STR_DN_ACE_HUNTIRBOX; + class TransportItems { + MACRO_ADDITEM(ACE_HuntIR_monitor,5); + }; + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HuntIR_M203,20); + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_HuntIR_monitor,5); + }; + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HuntIR_M203,20); + }; + }; +}; diff --git a/addons/huntir/CfgWeapons.hpp b/addons/huntir/CfgWeapons.hpp new file mode 100644 index 0000000000..6ff271d604 --- /dev/null +++ b/addons/huntir/CfgWeapons.hpp @@ -0,0 +1,34 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_HuntIR_monitor: ACE_ItemCore { + scope = 2; + displayName = CSTRING(monitor_displayName); + picture = PATHTOF(UI\w_huntir_monitor_ca.paa); + descriptionShort = CSTRING(monitor_displayName); + model = PATHTOF(data\ace_huntir_monitor.p3d); + + class ItemInfo: InventoryItem_Base_F { + mass = 20; + }; + }; + + class GrenadeLauncher; + class UGL_F: GrenadeLauncher { + magazines[] += {"ACE_HuntIR_M203"}; + }; + class GL_3GL_F: UGL_F { + //magazines[] += {"ACE_HuntIR_M203"}; + magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell","ACE_HuntIR_M203"}; + }; + + class Rifle_Base_F; + class arifle_MX_Base_F: Rifle_Base_F { + class GL_3GL_F: UGL_F { + //magazines[] += {"ACE_HuntIR_M203"}; + magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell","ACE_HuntIR_M203"}; + }; + }; +}; diff --git a/addons/huntir/Dialog.hpp b/addons/huntir/Dialog.hpp new file mode 100644 index 0000000000..97058394a5 --- /dev/null +++ b/addons/huntir/Dialog.hpp @@ -0,0 +1,401 @@ +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0c +#define ST_TYPE 0xF0 +#define ST_SINGLE 0 +#define ST_MULTI 16 +#define ST_TITLE_BAR 32 +#define ST_PICTURE 48 +#define ST_FRAME 64 +#define ST_BACKGROUND 80 +#define ST_GROUP_BOX 96 +#define ST_GROUP_BOX2 112 +#define ST_HUD_BACKGROUND 128 +#define ST_TILE_PICTURE 144 +#define ST_WITH_RECT 160 +#define ST_LINE 176 +#define FontM "PuristaMedium" +#define __XA SafeZoneXAbs +#define __X SafeZoneX +#define __Y SafeZoneY +#define __WA SafeZoneWAbs +#define __W SafeZoneW +#define __H SafeZoneH + +class ace_huntir_cam_dialog { + idd = 18880; + movingEnable = true; + controlsBackground[] = { }; + objects[] = { }; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + CAM_BG, + CAM_HEIGHT, + CAM_ALT, + CAM_No, + CAM_NO_x, + CAM_TIME_REMAIN, + CAM_TIME, + CAM_ZOOM, + ZOOM_X, + CAM_POS, + CAM_POS_X, + CAM_DIR, + CAM_DIR_x + }; + + class TOP_BORDER { + idc = -1; + type = CT_STATIC; + style = ST_CENTER; + x = __XA; + y = __Y; + w = __WA; + h = 0.08; + font = FontM; + sizeEx = 0.04; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = {0,0,0,1}; + text = ""; + blinkingPeriod = 0; + }; + class BOTTOM_BORDER: TOP_BORDER { + y = __Y + __H - 0.05; + h = 0.05; + }; + class LEFT_BORDER: TOP_BORDER { + w = (abs(__XA) - abs(__X)) + 0.05; + h = __H; + }; + class RIGHT_BORDER: TOP_BORDER { + x = __X + __W - 0.05; + w = (__WA - __W) + 0.05; + h = __H; + }; + class HELP_DIALOG { + idc = -1; + type = CT_BUTTON; + style = ST_CENTER; + font = FontM; + sizeEx = 0.025; + colorText[] = { 1, 1, 1, 1 }; + colorFocused[] = { 0.31, 0.31, 0.31, 0.31 }; + colorDisabled[] = { 0, 0, 1, 0.7 }; + colorBackground[] = { 0, 0, 0, 0 }; + colorBackgroundDisabled[] = { 1, 1, 1, 0.5 }; + colorBackgroundActive[] = { 0.5, 0.5, 0.5, 0.5 }; + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + colorShadow[] = { 0, 0, 0, 0.5 }; + colorBorder[] = { 0, 0, 0, 0 }; + borderSize = 0; + soundEnter[] = { "", 0, 1 }; + soundPush[] = { "buttonpushed.ogg", 0.1, 1 }; + soundClick[] = { "", 0, 1 }; + soundEscape[] = { "", 0, 1 }; + x = __X + (2*0.8); y = __Y + 0.045; + w = 0.05; h = 0.02; + text = CSTRING(HELP); + action = "createDialog 'ace_huntir_help_dialog'"; + }; + class CAM_BG { + idc = -1; + type = 0; + style = 48; + colorText[ ]={ 1,1,1,1 }; + colorBackground[ ]={ 0.4,0.4,0.4,1 }; + font = "PuristaMedium"; + sizeEx = 0.021; + lineSpacing = 1; + x = __X; + y = __Y + 0.08; + w = __W; + h = __H + 0.2; + border = 0; + text = PATHTOF(UI\ace_huntir_monitor_on.paa); + }; + class CAM_HEIGHT { + type = CT_STATIC; + idc = 1; + style = ST_LEFT; + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + font = FontM; + sizeEx = 0.02; + x = __X + 0.42; + y = __Y + 0.32; + w = 0.08; + h = 0.04; + text = ""; + blinkingPeriod = 0; + }; + class CAM_ALT: CAM_HEIGHT { + x = __X + 0.35; + text = CSTRING(ALT); + }; + class CAM_No: CAM_HEIGHT { + x = __X + __W - 0.64; + text = CSTRING(CAM); + }; + class CAM_NO_x: CAM_HEIGHT { + idc = 2; + x = __X + __W - 0.56; + y = __Y + 0.32; + text = ""; + }; + class CAM_TIME: CAM_HEIGHT { + x = __X + 0.35; + y = __Y + __H - 0.65; + w = 0.12; + text = CSTRING(TIME); + }; + class CAM_TIME_REMAIN: CAM_TIME { + idc = 3; + x = __X + 0.46; + text = ""; + }; + class CAM_ZOOM: CAM_No { + y = __Y + 0.36; + text = "Zoom:"; + }; + class ZOOM_X: CAM_ZOOM { + idc = 4; + x = __X + __W - 0.56; + text = ""; + }; + class CAM_POS: CAM_HEIGHT { + x = __X + 0.35; + y = __Y + 0.36; + text = "GPS Pos:"; + }; + class CAM_POS_X: CAM_POS { + idc = 5; + x = __X + 0.42; + w = 0.16; + text = ""; + }; + class CAM_DIR: CAM_POS { + y = __Y + 0.4; + text = ""; //"Az:"; + }; + class CAM_DIR_x: CAM_DIR { + idc = 6; + x = __X + 0.42; + w = 0.16; + text = ""; + }; +}; + +class ace_huntir_cam_dialog_inactive: ace_huntir_cam_dialog { + idd = 18881; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + //PRESS_HELP, + CAM_BG, + SEARCHING_CAM + }; + + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class PRESS_HELP { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.2); + y = __Y + 0.06; + w = 0.4; + h = 0.02; + font = FontM; + sizeEx = 0.02; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + text = ""; + blinkingPeriod = 0; + }; + class HELP_DIALOG { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.2); + y = __Y + 0.03; + w = 0.4; + h = 0.02; + font = FontM; + sizeEx = 0.02; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + text = CSTRING(ESC); + blinkingPeriod = 0; + }; + class CAM_BG: CAM_BG {}; + class SEARCHING_CAM { + idc = 1; + type = CT_STATIC; + style = ST_LEFT; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + x = __X + (__W/2) - 0.07; + y = __Y + (__H/2); + w = 0.6; + h = 0.08; + font = FontM; + sizeEx = 0.04; + text = ""; + blinkingPeriod = 0; + }; +}; + +class ace_huntir_cam_dialog_off: ace_huntir_cam_dialog_inactive { + idd = 18882; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + //PRESS_HELP, + CAM_BG + }; + + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class PRESS_HELP: PRESS_HELP {}; + class HELP_DIALOG: HELP_DIALOG {}; + class CAM_BG: CAM_BG { text = PATHTOF(UI\ace_huntir_monitor_off.paa); }; +}; +//ACTIVE PARA CAMERA DIALOG +class ace_huntir_help_dialog: ace_huntir_cam_dialog { + idd = -1; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + CAM_BG, + CAM_HEIGHT, + CAM_ALT, + CAM_TIME_REMAIN, + CAM_TIME, + CAM_ZOOM, + ZOOM_X, + CAM_POS, + CAM_POS_x, + CAM_No, + CAM_No_X, + CAM_DIR, + CAM_DIR_x, + HELP0, + HELP1, + HELP2, + HELP3, + HELP4, + HELP5, + HELP6 + }; + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class CAM_BG: CAM_BG {}; + class CAM_HEIGHT: CAM_HEIGHT {}; + class CAM_ALT: CAM_ALT {}; + class CAM_No: CAM_No {}; + class CAM_NO_x: CAM_NO_x {}; + class CAM_TIME_REMAIN: CAM_TIME_REMAIN {}; + class CAM_TIME: CAM_TIME {}; + class CAM_ZOOM: CAM_ZOOM {}; + class ZOOM_X: ZOOM_X {}; + class CAM_POS: CAM_POS {}; + class CAM_POS_X: CAM_POS_X {}; + class CAM_DIR: CAM_DIR {}; + class CAM_DIR_x: CAM_DIR_x {}; + class HELP0 { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.3); + y = __Y + 0.03; + w = 0.4; + h = 0.03; + font = FontM; + sizeEx = 0.022; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = {0,0,0,1}; + text = CSTRING(HELP_EXIT); + blinkingPeriod = 0; + }; + class HELP1: HELP0 { + y = __Y + 0.06; + text = CSTRING(HELP_ZOOM); + }; + class HELP2: HELP0 { + y = __Y + 0.09; + text = CSTRING(HELP_CAM); + }; + class HELP3: HELP0 { + y = __Y + 0.12; + text = CSTRING(HELP_ROT); + }; + class HELP4: HELP0 { + y = __Y + 0.15; + text = CSTRING(HELP_ELV); + }; + class HELP5: HELP0 { + y = __Y + 0.18; + text = CSTRING(HELP_MOD); + }; + class HELP6: HELP0 { + y = __Y + 0.21; + text = CSTRING(HELP_RES); + }; +}; diff --git a/addons/huntir/RscTitles.hpp b/addons/huntir/RscTitles.hpp new file mode 100644 index 0000000000..de94f17a5e --- /dev/null +++ b/addons/huntir/RscTitles.hpp @@ -0,0 +1,41 @@ +#define __FONTHEIGHT 0.02 + +class RscTitles { + class ace_huntir_cam_rose { + idd=-1; + movingEnable = true; + fadein = 0; + fadeout = 1; + duration = 1e+011; + name="ace_huntir_cam_rose"; + onLoad = "uiNamespace setVariable ['ace_huntir_cam_rose', _this select 0]"; + class controls { + class CHAR_N { + type = 0; + idc = 64432; + style = 0; + x = 0.497;y = 0.297;w = 0.2;h = 0.2; + font = "PuristaMedium"; + sizeEx = __FONTHEIGHT; + colorText[] = {1, 1, 1, 1}; + colorBackground[]={0,0,0,0}; + text = "N"; + }; + class CHAR_E: CHAR_N { + idc = 64433; + x = 0.697;y = 0.497; + text = "E"; + }; + class CHAR_S: CHAR_N { + idc = 64434; + x = 0.497;y = 0.697; + text = "S"; + }; + class CHAR_W: CHAR_N { + idc = 64435; + x = 0.297;y = 0.497; + text = "W"; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/huntir/UI/ace_huntir_monitor_off.paa b/addons/huntir/UI/ace_huntir_monitor_off.paa new file mode 100644 index 0000000000..be37d17b99 Binary files /dev/null and b/addons/huntir/UI/ace_huntir_monitor_off.paa differ diff --git a/addons/huntir/UI/ace_huntir_monitor_on.paa b/addons/huntir/UI/ace_huntir_monitor_on.paa new file mode 100644 index 0000000000..a2941a8b94 Binary files /dev/null and b/addons/huntir/UI/ace_huntir_monitor_on.paa differ diff --git a/addons/huntir/UI/w_huntir_monitor_ca.paa b/addons/huntir/UI/w_huntir_monitor_ca.paa new file mode 100644 index 0000000000..7ecb6f1338 Binary files /dev/null and b/addons/huntir/UI/w_huntir_monitor_ca.paa differ diff --git a/addons/huntir/XEH_postInit.sqf b/addons/huntir/XEH_postInit.sqf new file mode 100644 index 0000000000..c5526500ac --- /dev/null +++ b/addons/huntir/XEH_postInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +GVAR(ZOOM) = 0; +GVAR(NV) = 0; +GVAR(IRON) = false; +GVAR(TI) = 0; +GVAR(cur_cam) = 0; +GVAR(ROTATE) = 0; +GVAR(ELEVAT) = 0.01; diff --git a/addons/huntir/XEH_preInit.sqf b/addons/huntir/XEH_preInit.sqf new file mode 100644 index 0000000000..0ae45c1540 --- /dev/null +++ b/addons/huntir/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cam); +PREP(handleFired); +PREP(huntir); +PREP(huntirCompass); +PREP(keypressed); + +ADDON = true; diff --git a/addons/huntir/config.cpp b/addons/huntir/config.cpp new file mode 100644 index 0000000000..5fb106ad2d --- /dev/null +++ b/addons/huntir/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_HuntIR", "ACE_HuntIRBox"}; + weapons[] = {"ACE_HuntIR_monitor"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Norrin", "Rocko", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" +#include "CfgCloudlets.hpp" +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "Dialog.hpp" +#include "RscTitles.hpp" diff --git a/addons/huntir/data/ace_huntir_monitor.p3d b/addons/huntir/data/ace_huntir_monitor.p3d new file mode 100644 index 0000000000..059e7050ed Binary files /dev/null and b/addons/huntir/data/ace_huntir_monitor.p3d differ diff --git a/addons/huntir/data/ace_huntirbox.p3d b/addons/huntir/data/ace_huntirbox.p3d new file mode 100644 index 0000000000..d26bd85c22 Binary files /dev/null and b/addons/huntir/data/ace_huntirbox.p3d differ diff --git a/addons/huntir/data/ace_m1070.p3d b/addons/huntir/data/ace_m1070.p3d new file mode 100644 index 0000000000..e110e6291d Binary files /dev/null and b/addons/huntir/data/ace_m1070.p3d differ diff --git a/addons/huntir/data/ace_m1070_armed.p3d b/addons/huntir/data/ace_m1070_armed.p3d new file mode 100644 index 0000000000..cf4da73533 Binary files /dev/null and b/addons/huntir/data/ace_m1070_armed.p3d differ diff --git a/addons/huntir/data/bedna_ammo2.rvmat b/addons/huntir/data/bedna_ammo2.rvmat new file mode 100644 index 0000000000..b56d21c650 --- /dev/null +++ b/addons/huntir/data/bedna_ammo2.rvmat @@ -0,0 +1,31 @@ +ambient[] = {1.0, 1.0, 1.0, 1.0}; +diffuse[] = {1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; +emmisive[] = {0.0, 0.0, 0.0, 1.0}; +specular[] = {1.0, 1.0, 1.0, 1.0}; +specularPower = 71.9; +PixelShaderID = "NormalMapSpecularDIMap"; +VertexShaderID = "NormalMap"; +class Stage1 { + texture = "z\ace\addons\huntir\data\bedna_ammo2_nohq.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage2 { + texture = "z\ace\addons\huntir\data\bedna_ammo2_smdi.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class StageTI { + texture = "z\ace\addons\apl\data\default_vehicle_ti_ca.paa"; +}; diff --git a/addons/huntir/data/bedna_ammo2_co.paa b/addons/huntir/data/bedna_ammo2_co.paa new file mode 100644 index 0000000000..fa759b6140 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_co.paa differ diff --git a/addons/huntir/data/bedna_ammo2_nohq.paa b/addons/huntir/data/bedna_ammo2_nohq.paa new file mode 100644 index 0000000000..4df88e4b91 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_nohq.paa differ diff --git a/addons/huntir/data/bedna_ammo2_smdi.paa b/addons/huntir/data/bedna_ammo2_smdi.paa new file mode 100644 index 0000000000..60fc404720 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_smdi.paa differ diff --git a/addons/huntir/data/camchute_co.paa b/addons/huntir/data/camchute_co.paa new file mode 100644 index 0000000000..9d927ccce1 Binary files /dev/null and b/addons/huntir/data/camchute_co.paa differ diff --git a/addons/huntir/data/huntir.p3d b/addons/huntir/data/huntir.p3d new file mode 100644 index 0000000000..a1c5b94e99 Binary files /dev/null and b/addons/huntir/data/huntir.p3d differ diff --git a/addons/huntir/data/huntir_monitor_co.paa b/addons/huntir/data/huntir_monitor_co.paa new file mode 100644 index 0000000000..7ecb6f1338 Binary files /dev/null and b/addons/huntir/data/huntir_monitor_co.paa differ diff --git a/addons/huntir/data/m_M1070_ca.paa b/addons/huntir/data/m_M1070_ca.paa new file mode 100644 index 0000000000..e3d342ccf0 Binary files /dev/null and b/addons/huntir/data/m_M1070_ca.paa differ diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf new file mode 100644 index 0000000000..264c0c74b6 --- /dev/null +++ b/addons/huntir/functions/fnc_cam.sqf @@ -0,0 +1,147 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * Handles HuntIR camera + * + * Arguments: + * 0: HuntIR + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_huntIR); + +GVAR(huntIR) = _huntIR; +GVAR(pos) = getPosVisual GVAR(huntIR); + +GVAR(ZOOM) = 0; +GVAR(NV) = 0; +GVAR(TI) = 0; +GVAR(cur_cam) = 0; +GVAR(ROTATE) = 0; +GVAR(ELEVAT) = 0.01; + +HUNTIR_BACKGROUND_LAYER_ID cutText["","PLAIN"]; + +closedialog 0; +createDialog "ace_huntir_cam_dialog"; +uiNameSpace setVariable ["ace_huntir_monitor", findDisplay 18880]; +(uiNameSpace getVariable "ace_huntir_monitor") displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; + +ctrlSetText [4, "0X"]; + +GVAR(logic) = "Logic" createVehicleLocal [0, 0, 0]; +GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); +GVAR(logic) setVectorUp [0.001, 0.001, 1]; + +GVAR(cam) = "camera" camCreate GVAR(pos); +GVAR(cam) camSetTarget GVAR(logic); +GVAR(cam) cameraEffect ["internal", "BACK"]; +GVAR(cam) camSetRelPos [0, 0, 2]; +GVAR(cam) camCommit 0; +showCinemaBorder false; +camUseNVG false; + +GVAR(pphandle) = ppEffectCreate ["colorCorrections", 135522]; +GVAR(pphandle) ppEffectAdjust [1, 1, 0, [0.01, 0.02, 0.04, 0.01], [0.87, 1.08, 1.196, 0.3], [0.399, 0.287, 0.014, 0.0]]; +GVAR(pphandle) ppEffectCommit 0; +GVAR(pphandle) ppEffectEnable true; + +GVAR(stop) = false; +call FUNC(huntirCompass); + +GVAR(no_cams) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; +{ + GVAR(no_cams) set [_forEachIndex, [(getPosVisual ACE_player) vectorDistance (getPosVisual _x), _x]]; +} forEach GVAR(no_cams); +GVAR(no_cams) sort true; +{ + GVAR(no_cams) set [_forEachIndex, _x select 1]; +} forEach GVAR(no_cams); +[{ + GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; + { + 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); + { + if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then { + GVAR(no_cams) deleteAt _forEachIndex; + if (_forEachIndex < GVAR(cur_cam)) then { + GVAR(cur_cam) = GVAR(cur_cam) - 1; + }; + }; + } 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); + + GVAR(NV) = 0; + setAperture -1; + closedialog 0; + titletext [" ", "BLACK IN", 4]; + ACE_player switchCamera "INTERNAL"; + GVAR(cam) CameraEffect ["Terminate", "Back"]; + CamDestroy GVAR(cam); + deleteVehicle GVAR(logic); + if (player != ACE_player) then { + player remoteControl ACE_player; + }; + }; + + switch (GVAR(ZOOM)) do { + case 0: { + GVAR(cam) camsetFOV 0.7; + GVAR(cam) camSetFocus [GVAR(pos) select 2, 1]; + }; + case 1: { + GVAR(cam) camsetFOV 0.35; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/2, 1]; + }; + case 2: { + GVAR(cam) camsetFOV 0.17; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/4, 1]; + }; + case 3: { + GVAR(cam) camsetFOV 0.1; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/8, 1]; + }; + }; + + 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]; + GVAR(cam) CameraEffect ["internal", "BACK"]; + _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); + _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); + GVAR(cam) camSetRelPos [_cam_coord_x, _cam_coord_y, 2]; + GVAR(cam) camCommit 0; + + ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]]; + ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]]; + _cam_time = ACE_time - (GVAR(huntIR) getVariable [QGVAR(startTime), ACE_time]); + ctrlSetText [3, format["%1 s", round(_cam_time)]]; + _cam_pos = getPosVisual GVAR(huntIR); + _cam_pos = format ["X = %1, Y = %2", round (_cam_pos select 0), round (_cam_pos select 1)]; + ctrlSetText [5, _cam_pos]; + ctrlSetText [6, ""]; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf new file mode 100644 index 0000000000..23c7df04f0 --- /dev/null +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -0,0 +1,50 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * Handles HuntIR projectiles + * + * 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: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + +if (_ammo != "F_HuntIR") exitWith {}; + +[{ + PARAMS_1(_projectile); + "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); + [{ + PARAMS_1(_position); + private ["_huntir"]; + _huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"]; + _huntir setPosATL _position; + _huntir setVariable [QGVAR(startTime), ACE_time, true]; + [{ + EXPLODE_1_PVT(_this select 0,_huntir); + if (isNull _huntir) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + private ["_parachuteDamage", "_velocity"]; + _parachuteDamage = _huntir getHitPointDamage "HitParachute"; + if (_parachuteDamage > 0) then { + _velocity = velocity _huntir; + _velocity set [2, -1 min -20 * sqrt(_parachuteDamage)]; + _huntir setVelocity _velocity; + _huntir setVectorUp [0, 0, 1]; + }; + }, 0, [_huntir]] call CBA_fnc_addPerFrameHandler; + }, [getPosATL _projectile vectorAdd [0, 0, 50]], 2, 0] call EFUNC(common,waitAndExecute); +}, [_projectile], 5, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf new file mode 100644 index 0000000000..f8aed93880 --- /dev/null +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -0,0 +1,93 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * HuntIR monitor system + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +#define __TYPE_WRITER_DELAY 0.05 + +if ((ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand") then { + ACE_player playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +HUNTIR_BACKGROUND_LAYER_ID cutText ["", "BLACK", 0]; +createDialog "ace_huntir_cam_dialog_off"; + +[{ + if (!dialog) exitWith { + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN", 0]; + }; + closeDialog 0; + createDialog "ace_huntir_cam_dialog_inactive"; + uiNameSpace setVariable ["ace_huntir_monitor", findDisplay 18881]; + [{ + GVAR(startTime) = ACE_time; + GVAR(done) = false; + GVAR(connectionDelay) = 5; + GVAR(state) = "searching"; + GVAR(message) = []; + GVAR(messageSearching) = toArray "Searching....."; + GVAR(messageConnecting) = toArray "Connecting....."; + [{ + 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 { + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + }; + }; + switch (GVAR(state)) do { + case "searching": { + if (count GVAR(message) < count GVAR(messageSearching)) then { + GVAR(message) pushBack (GVAR(messageSearching) select (count GVAR(message))); + ctrlSetText [1, toString GVAR(message)]; + } else { + GVAR(message) = []; + if (_elapsedTime > 10) then { + GVAR(state) = "noGDS"; + }; + if (_elapsedTime > 5 && {{_x getHitPointDamage "HitCamera" < 0.25} count _nearestHuntIRs > 0}) then { + GVAR(state) = "connecting"; + }; + }; + }; + case "connecting": { + if (count GVAR(message) < count GVAR(messageConnecting)) then { + GVAR(message) pushBack (GVAR(messageConnecting) select (count GVAR(message))); + ctrlSetText [1, toString GVAR(message)]; + } else { + GVAR(message) = []; + GVAR(connectionDelay) = GVAR(connectionDelay) - 1; + if (GVAR(connectionDelay) <= 0) then { + GVAR(done) = true; + GVAR(state) = "connected"; + }; + }; + }; + case "noGDS": { + ctrlSetText [1, "No GDS System detected"]; + [{ + GVAR(done) = true; + closedialog 0; + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + }, [], 3, 0] call EFUNC(common,waitAndExecute); + }; + }; + }, __TYPE_WRITER_DELAY, []] call CBA_fnc_addPerFrameHandler; + }, [], 0.5, 0] call EFUNC(common,waitAndExecute); +}, [], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/huntir/functions/fnc_huntirCompass.sqf b/addons/huntir/functions/fnc_huntirCompass.sqf new file mode 100644 index 0000000000..30fcf45900 --- /dev/null +++ b/addons/huntir/functions/fnc_huntirCompass.sqf @@ -0,0 +1,88 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * HuntIR monitor compass + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; + +#define __DSP (uiNamespace getVariable "ace_huntir_cam_rose") +#define __CHAR_N (__DSP displayCtrl 64432) +#define __CHAR_E (__DSP displayCtrl 64433) +#define __CHAR_S (__DSP displayCtrl 64434) +#define __CHAR_W (__DSP displayCtrl 64435) + +#define __OFFSET_X 0.003 +#define __OFFSET_Y 0.003 +#define __WIDTH 0.1 +#define __HEIGHT 0.1 +#define __RADIUS 0.05 +#define __CENTER_X 0.70 +#define __CENTER_Y 0.65 + +private ["_fnc_correctIt"]; + +_fnc_correctIt = { + PARAMS_2(_pos,_dir); + if (_dir >= 270 || {_dir <= 90}) then { + _pos set [1, (_pos select 1) + __OFFSET_Y] + }; + if (_dir >= 0 && {_dir <= 180}) then { + _pos set [0, (_pos select 0) - __OFFSET_X] + }; + if (_dir >= 90 && {_dir <= 270}) then { + _pos set [1, (_pos select 1) - __OFFSET_Y] + }; + if (_dir >= 180 && {_dir <= 360}) then { + _pos set [0, (_pos select 0) + __OFFSET_X] + }; + _pos +}; + +HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; + +[{ + EXPLODE_1_PVT(_this select 0,_fnc_correctIt); + + if (GVAR(stop)) exitWith { + HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"]; + [_this select 1] 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; + __CHAR_N ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_N ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 90)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 90)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_W ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_W ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 180)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 180)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_S ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_S ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 270)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 270)); + _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/huntir/functions/fnc_keyPressed.sqf b/addons/huntir/functions/fnc_keyPressed.sqf new file mode 100644 index 0000000000..509dcb9de5 --- /dev/null +++ b/addons/huntir/functions/fnc_keyPressed.sqf @@ -0,0 +1,113 @@ +/* + * Author: Norrin, Rocko + * Handles the HuntIR monitor key interaction + * + * Arguments: + * 0: ? + * 1: keycode + * + * Return Value: + * handled? + * + * Example: + * [] call ace_huntir_fnc_keyPressed + * + * Public: No + */ +#include "script_component.hpp" + +private ["_ret"]; +_ret = false; + +switch (_this select 1) do { + // A = Lower zoom level + case 30: { + if (GVAR(ZOOM) > 0) then { + GVAR(ZOOM) = GVAR(ZOOM) - 1; + }; + switch (GVAR(ZOOM)) do { + case 0: { ctrlSetText [4, "0X"];}; + case 1: { ctrlSetText [4, "2X"];}; + case 2: { ctrlSetText [4, "4X"];}; + case 3: { ctrlSetText [4, "8X"];}; + }; + _ret = true; + }; + // D = Increase zoom level + case 32: { + if (GVAR(ZOOM) < 3) then { + GVAR(ZOOM) = GVAR(ZOOM) + 1; + }; + switch (GVAR(ZOOM)) do { + case 0: { ctrlSetText [4, "0X"];}; + case 1: { ctrlSetText [4, "2X"];}; + case 2: { ctrlSetText [4, "4X"];}; + case 3: { ctrlSetText [4, "8X"];}; + }; + _ret = true; + }; + //N key ( Toggle NV and TI modes ) + case 49: { + if (GVAR(NV) == 0) then { + setAperture -1; + camUseNVG true; + GVAR(NV) = 1; + if (!GVAR(IRON)) then { + GVAR(IRON) = true; + }; + } else { + setAperture -1; + camUseNVG false; + GVAR(NV) = 0; + GVAR(IRON) = false; + }; + _ret = true; + }; + // S = Next camera + case 31: { + GVAR(cur_cam) = GVAR(cur_cam) + 1; + _ret = true; + }; + // W = Previous camera + case 17: { + GVAR(cur_cam) = GVAR(cur_cam) - 1; + _ret = true; + }; + // Rotate camera anticlockwise + case 203: { + GVAR(ROTATE) = GVAR(ROTATE) - 3; + _ret = true; + }; + // Rotate camera clockwise + case 205: { + GVAR(ROTATE) = GVAR(ROTATE) + 3; + _ret = true; + }; + // Raise camera + case 200: { + if (GVAR(ELEVAT) < 4.01) then { + GVAR(ELEVAT) = GVAR(ELEVAT) + 0.12; + }; + _ret = true; + }; + // Lower camera + case 208: { + if (GVAR(ELEVAT) > -3.99) then { + GVAR(ELEVAT) = GVAR(ELEVAT) - 0.12; + }; + _ret = true; + }; + // Reset camera + case 19: { + GVAR(ROTATE) = 0; + GVAR(ELEVAT) = 0.01; + GVAR(ZOOM) = 0; + ctrlSetText [4, "0X"]; + GVAR(NV) = 0; + camUseNVG false; + setAperture -1; + _ret = true; + }; +}; + +_ret diff --git a/addons/huntir/functions/script_component.hpp b/addons/huntir/functions/script_component.hpp new file mode 100644 index 0000000000..29e0fbff41 --- /dev/null +++ b/addons/huntir/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\huntir\script_component.hpp" \ No newline at end of file diff --git a/addons/huntir/script_component.hpp b/addons/huntir/script_component.hpp new file mode 100644 index 0000000000..9f99437f67 --- /dev/null +++ b/addons/huntir/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT huntir +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_HUNTIR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_HUNTIR + #define DEBUG_SETTINGS DEBUG_SETTINGS_HUNTIR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define HUNTIR_BACKGROUND_LAYER_ID 13521 +#define HUNTIR_CAM_ROSE_LAYER_ID 13522 + +#define HUNTIR_MAX_TRANSMISSION_RANGE 1600 diff --git a/addons/huntir/stringtable.xml b/addons/huntir/stringtable.xml new file mode 100644 index 0000000000..79f9a778e1 --- /dev/null +++ b/addons/huntir/stringtable.xml @@ -0,0 +1,197 @@ + + + + + HuntIR Transport Box + HuntIR Transportkiste + HuntIR Transport Box + Trasnportní bedna HuntIR + Ящик с HuntIR + HuntIR Transport Box + Skrzynia HuntIR + HuntIR Transport Box + HuntIR Transport Box + Caixa de transporte do HuntIR + + + HuntIR Round + HuntIR Granate + HuntIR Round + HuntIR Round + HuntIR снаряд + HuntIR Round + Nabój HuntIR + Munition HuntIR + HuntIR lövedék + Cartucho HuntIR + + + HuntIR monitor + HuntIR Monitor + HuntIR monitor + HuntIR monitor + HuntIR монитор + HuntIR monitor + Odbiornik HuntIR + Ecran HuntIR + HuntIR monitor + Monitor HuntIR + + + Activate HuntIR monitor + HuntIR Monitor aktivieren + Activate HuntIR monitor + Zapnout HuntIR monitor + Включить HuntIR монитор + Activate HuntIR monitor + Włącz odbiornik HuntIR + Allumer écran HuntIR + HuntIR monitor aktiválása + Ativar monitor do HuntIR + + + Camera: + Kamera: + Camera: + Kamera: + Камера: + Camera: + Kamera: + Caméra: + Kamera: + Câmera: + + + Altitude: + Höhe: + Altitude: + Výška: + Высота: + Altitude: + Wysokość: + Altitude: + Magasság: + Altitude: + + + Recording Time: + Aufnahmezeit: + Recording Time: + Čas nahrávání: + Время записи: + Recording Time: + Czas nagrywania: + Temps d'enregistrement: + Felvételi idő: + Tempo de gravação: + + + Press ESC to quit camera + Zum Verlassen ESC drücken + Press ESC to quit camera + Stiskni ESC pro opustění kamery + Нажмите ESC чтобы выйти из режима камеры + Press ESC to quit camera + Wciśnij ESC by wyjść z widoku kamery + Appuyer sur ESC pour quitter camera + Nyomj ESC-ket a kamerából való kilépéshez + Pressione ESC para sair da câmera + + + Help + Hilfe + Help + Pomoc + Помощь + Help + Pomoc + Aide + Súgó + Ajuda + + + A/D - Cycle zoom + A/D - Zoom + A/D - Cycle zoom + A/D - Změna přiblížení + A/D - Приближение + A/D - Cycle zoom + A/D - powiększenie + A/D - Changement zoom + A/D - Nagyítás + A/D - Troca zoom + + + W/S - Select camera + W/S - Wähle Kamera + W/S - Select camera + W/S - Výběr kamery + W/S - Выбрать камеру + W/S - Select camera + W/S - wybór kamery + W/S - Sélectionner caméra + W/S - Kamera váltás + W/S - Seleciona câmera + + + Left/Right - Rotate camera + Links/Rechts - Rotiere Kamera + Left/Right - Rotate camera + Levá/Pravá - Rotace kamery + Влево/Вправо - Вращать камеру + Left/Right - Rotate camera + Lewo/Prawo - obrót kamery w poziomie + Gauche/Droite - Rotation caméra + Jobb/Bal - Kamera forgatás + Esquerda/Direita - Rotaciona câmera + + + Up/Down - Elevate/lower camera + Hoch/Runter - Neige Kamera + Up/Down - Elevate/lower camera + Nahoru/Dolu - Zvýšít/snížit úhel pohledu kamery + Вверх/Вниз - Поднять/Опустить камеру + Up/Down - Elevate/lower camera + Góra/Dół - obrót kamery w pionie + Haut/Bas - Monter/descendre caméra + Fel/Le - Kamera döntése/süllyesztése + Acima/Abaixo - Eleva/Abaixa a câmera + + + N - Cycle IT modes + N - Sichtmodi + N - Cycle IT modes + N - Změna režimů kamery + N - Режимы камеры + N - Cycle IT modes + N - wybór trybu IT + N - Changement de modes IT + N - Hőkép módok + N - Troca modo IT + + + R - Reset camera + R - Reset + R - Reset camera + R - Reset kamery + R - Сбросить настройки камеры + R - Reset camera + R - resetuj kamerę + R - Reset caméra + R - Kamera visszaállítása + R - Redefine a câmera + + + Esc - Exit help + ESC - Hilfe verlassen + Esc - Exit help + Esc - Ukončit pomoc + Esc - Выйти из помощи + Esc - Exit help + Esc - wyjście z ekranu Pomocy + Esc - Sortir de l'aide + Exit - Kilépés a súgóból + Esc - Sai do Ajuda + + + \ No newline at end of file diff --git a/addons/interact_menu/ACE_Settings.hpp b/addons/interact_menu/ACE_Settings.hpp new file mode 100644 index 0000000000..ea4d4699ed --- /dev/null +++ b/addons/interact_menu/ACE_Settings.hpp @@ -0,0 +1,86 @@ +class ACE_Settings { + class GVAR(AlwaysUseCursorSelfInteraction) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(AlwaysUseCursorSelfInteraction); + }; + class GVAR(cursorKeepCentered) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(cursorKeepCentered); + description = CSTRING(cursorKeepCenteredDescription); + }; + class GVAR(AlwaysUseCursorInteraction) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(AlwaysUseCursorInteraction); + }; + class GVAR(UseListMenu) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(UseListMenu); + }; + class GVAR(colorTextMax) { + value[] = {1, 1, 1, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(ColorTextMax); + }; + class GVAR(colorTextMin) { + value[] = {1, 1, 1, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(ColorTextMin); + }; + class GVAR(colorShadowMax) { + value[] = {0, 0, 0, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(ColorShadowMax); + }; + class GVAR(colorShadowMin) { + value[] = {0, 0, 0, 0.25}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(ColorShadowMin); + }; + class GVAR(textSize) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(textSize); + values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + }; + class GVAR(shadowSetting) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(shadowSetting); + description = CSTRING(shadowSettingDescription); + values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", CSTRING(shadowOutline)}; + }; + class GVAR(actionOnKeyRelease) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(ActionOnKeyRelease); + }; + class GVAR(menuBackground) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(background); + values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(backgroundBlur), CSTRING(backgroundBlack)}; + }; + class GVAR(addBuildingActions) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(addBuildingActions); + description = CSTRING(addBuildingActionsDescription); + }; +}; diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index d13813b92e..7705f3fcd2 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -1,47 +1,41 @@ class GVAR(cursorMenu) { idd = 91919; - movingEnable = false; + access = 0; + movingEnable = 0; + enableSimulation = 1; onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]); onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),false)]); - objects[] = {}; - /*class controlsBackground { - class Background { - idc = 91920; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0.5}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - };*/ - class controls { - class Canvas { - idc = 91921; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; +}; +class RscTitles { + class GVAR(menuBackground) { + idd = -1; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuBackground)),_this select 0)]); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuBackground)),displayNull)]); + fadeIn = 0.25; + fadeOut = 0.25; + movingEnable = false; + duration = 10e10; + name = QGVAR(menuBackground); + class controls {}; + class controlsBackground { + class background { + idc = -1; + moving = 0; + font = "TahomaB"; + text = ""; + sizeEx = 0; + lineSpacing = 0; + access = 0; + type = 0; + style = 0; + size = 1; + colorBackground[] = {0, 0, 0, 0.65}; + colorText[] = {0, 0, 0, 0}; + x = "safezoneX"; + y = "safezoneY"; + w = "safezoneW"; + h = "safezoneH"; + }; }; }; }; diff --git a/addons/interact_menu/XEH_clientInit.sqf b/addons/interact_menu/XEH_clientInit.sqf index bbd2b74263..cbc28e66b4 100644 --- a/addons/interact_menu/XEH_clientInit.sqf +++ b/addons/interact_menu/XEH_clientInit.sqf @@ -3,6 +3,9 @@ if (!hasInterface) exitWith {}; +GVAR(cachedBuildingTypes) = []; +GVAR(cachedBuildingActionPairs) = []; + GVAR(ParsedTextCached) = []; //Setup text/shadow/size/color settings matrix @@ -17,6 +20,9 @@ GVAR(ParsedTextCached) = []; // Install the render EH on the main display addMissionEventHandler ["Draw3D", DFUNC(render)]; +//Add Actions to Houses: +["interactMenuOpened", {_this call FUNC(userActions_addHouseActions)}] call EFUNC(common,addEventHandler); + // 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 { @@ -28,19 +34,15 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; }; -["ACE3 Common", QGVAR(InteractKey), (localize "STR_ACE_Interact_Menu_InteractKey"), +["ACE3 Common", QGVAR(InteractKey), (localize LSTRING(InteractKey)), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [0] call FUNC(keyDown) },{[0,false] call FUNC(keyUp)}, [219, [false, false, false]], false] call cba_fnc_addKeybind; //Left Windows Key -["ACE3 Common", QGVAR(SelfInteractKey), (localize "STR_ACE_Interact_Menu_SelfInteractKey"), +["ACE3 Common", QGVAR(SelfInteractKey), (localize LSTRING(SelfInteractKey)), { - // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement [1] call FUNC(keyDown) },{[1,false] call FUNC(keyUp)}, @@ -62,3 +64,21 @@ addMissionEventHandler ["Draw3D", DFUNC(render)]; // disable firing while the interact menu is is is opened ["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventHandler); + +// background options +["interactMenuOpened", { + if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), true] call EFUNC(common,blurScreen);}; + if (GVAR(menuBackground)==2) then {0 cutRsc[QGVAR(menuBackground), "PLAIN", 1, false];}; +}] call EFUNC(common,addEventHandler); +["interactMenuClosed", { + if (GVAR(menuBackground)==1) then {[QGVAR(menuBackground), false] call EFUNC(common,blurScreen);}; + if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;}; +}] call EFUNC(common,addEventHandler); + +// Let key work with zeus open (not perfect, enables all added hotkeys in zeus interface rather than only menu) +["zeusDisplayChanged",{ + if (_this select 1) then { + (finddisplay 312) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (finddisplay 312) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 7e86646b79..c656ab9056 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(addActionToClass); PREP(addActionToObject); PREP(compileMenu); PREP(compileMenuSelfAction); +PREP(compileMenuZeus); PREP(collectActiveActionTree); PREP(createAction); PREP(ctrlSetParsedTextCached); @@ -24,13 +25,30 @@ PREP(renderMenu); PREP(renderSelector); PREP(setupTextColors); PREP(splitPath); +PREP(userActions_addHouseActions); +PREP(userActions_getHouseActions); + +// Event handlers for all interact menu controls +DFUNC(handleMouseMovement) = { + if (GVAR(cursorKeepCentered)) then { + GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; + setMousePosition [0.5, 0.5]; + } else { + GVAR(cursorPos) = [_this select 1, _this select 2, 0]; + }; +}; +DFUNC(handleMouseButtonDown) = { + if !(GVAR(actionOnKeyRelease)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; +}; GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(keyDownTime) = 0; GVAR(openedMenuType) = -1; -GVAR(lastTime) = diag_tickTime; +GVAR(lastTime) = ACE_diagTime; GVAR(rotationAngle) = 0; GVAR(selectedAction) = [[],[]]; @@ -46,12 +64,21 @@ GVAR(lastPath) = []; GVAR(expanded) = false; -GVAR(startHoverTime) = diag_tickTime; -GVAR(expandedTime) = diag_tickTime; +GVAR(startHoverTime) = ACE_diagTime; +GVAR(expandedTime) = ACE_diagTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; +GVAR(collectedActionPoints) = []; GVAR(foundActions) = []; GVAR(lastTimeSearchedActions) = -1000; + +// Init CAManBase menus +["CAManBase"] call FUNC(compileMenu); +["CAManBase"] call FUNC(compileMenuSelfAction); + +// Init zeus menu +[] call FUNC(compileMenuZeus); + ADDON = true; diff --git a/addons/interact_menu/config.cpp b/addons/interact_menu/config.cpp index 52f2f6b9f9..8909c3d685 100644 --- a/addons/interact_menu/config.cpp +++ b/addons/interact_menu/config.cpp @@ -18,79 +18,8 @@ class CfgPatches { #include "CursorMenus.hpp" -class ACE_Settings { - class GVAR(AlwaysUseCursorSelfInteraction) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorSelfInteraction"; - }; - class GVAR(cursorKeepCentered) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_cursorKeepCentered"; - description = "$STR_ACE_Interact_cursorKeepCenteredDescription"; - }; - class GVAR(AlwaysUseCursorInteraction) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_AlwaysUseCursorInteraction"; - }; - class GVAR(UseListMenu) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_UseListMenu"; - }; - class GVAR(colorTextMax) { - value[] = {1, 1, 1, 1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorTextMax"; - }; - class GVAR(colorTextMin) { - value[] = {1, 1, 1, 0.25}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorTextMin"; - }; - class GVAR(colorShadowMax) { - value[] = {0, 0, 0, 1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorShadowMax"; - }; - class GVAR(colorShadowMin) { - value[] = {0, 0, 0, 0.25}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ColorShadowMin"; - }; - class GVAR(textSize) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_textSize"; - values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; - }; - class GVAR(shadowSetting) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_shadowSetting"; - description = "$STR_ACE_Interact_shadowSettingDescription"; - values[] = {"$STR_A3_OPTIONS_DISABLED", "$STR_A3_OPTIONS_ENABLED", "$STR_ACE_Interact_shadowOutline"}; - }; - class GVAR(actionOnKeyRelease) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Interact_Menu_ActionOnKeyRelease"; - }; -}; +#include "ACE_Settings.hpp" class ACE_Extensions { - extensions[] += {"ace_break_line"}; + extensions[] += {"ace_break_line", "ace_parse_imagepath"}; }; diff --git a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf index 6abcebf47e..62d9ca1094 100644 --- a/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf +++ b/addons/interact_menu/functions/fnc_collectActiveActionTree.sqf @@ -67,12 +67,12 @@ if !({} isEqualTo (_origActionData select 5)) then { if (count _pPath == count _fullPath && {_pPath isEqualTo _fullPath}) then { - _action = [_object, _action, _fullPath] call FUNC(collectActiveActionTree); + _action = [_object, [_actionData,[]], _fullPath] call FUNC(collectActiveActionTree); if ((count _action) > 0) then { _activeChildren pushBack _action; }; }; -} forEach GVAR(objectActions); +} forEach GVAR(objectActionList); // If the original action has no statement, and no children, don't display it diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 7b995375b7..cf4db7aab1 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -14,10 +14,12 @@ EXPLODE_1_PVT(_this,_target); -private ["_objectType","_actionsVarName"]; +private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; +_isMan = false; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; + _isMan = _target isKindOf "CAManBase"; }; _actionsVarName = format [QGVAR(Act_%1), _objectType]; @@ -26,12 +28,12 @@ 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", "_i"]; + private ["_actions", "_displayName", "_distance", "_icon", "_statement", "_position", "_condition", "_showDisabled", "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; - for "_i" from 0 to (count _actionsCfg) - 1 do { - _entryCfg = _actionsCfg select _i; + { + _entryCfg = _x; if(isClass _entryCfg) then { _displayName = getText (_entryCfg >> "displayName"); _distance = getNumber (_entryCfg >> "distance"); @@ -67,7 +69,12 @@ _recurseFnc = { _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; - _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + _runOnHover = false; + if (isText (_entryCfg >> "runOnHover")) then { + _runOnHover = compile getText (_entryCfg >> "runOnHover"); + } else { + _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + }; _condition = compile _condition; _children = [_entryCfg] call _recurseFnc; @@ -83,21 +90,27 @@ _recurseFnc = { [], _position, _distance, - [_showDisabled,_enableInside,_canCollapse,_runOnHover], + [_showDisabled,_enableInside,_canCollapse,_runOnHover, false], _modifierFunction ], _children ]; _actions pushBack _entry; }; - }; + } forEach (configProperties [_actionsCfg, "isClass _x", true]); _actions }; -private "_actionsCfg"; +private ["_actionsCfg","_actions"]; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions"; -missionNamespace setVariable [_actionsVarName, [_actionsCfg] call _recurseFnc]; +// If the classname inherits from CAManBase, just copy it's menu without recompiling a new one +_actions = if (_isMan) then { + + (missionNamespace getVariable QGVAR(Act_CAManBase)) +} else { + [_actionsCfg] call _recurseFnc +}; +missionNamespace setVariable [_actionsVarName, _actions]; /* [ diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index e767c3525d..a34c45f504 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -14,10 +14,12 @@ EXPLODE_1_PVT(_this,_target); -private ["_objectType","_actionsVarName", "_canCollapse", "_children", "_enableInside", "_entry", "_entryCfg", "_i", "_insertChildren", "_modifierFunction", "_runOnHover"]; +private ["_objectType","_actionsVarName","_isMan"]; _objectType = _target; +_isMan = false; if (typeName _target == "OBJECT") then { _objectType = typeOf _target; + _isMan = _target isKindOf "CAManBase"; }; _actionsVarName = format [QGVAR(SelfAct_%1), _objectType]; @@ -31,8 +33,8 @@ _recurseFnc = { EXPLODE_1_PVT(_this,_actionsCfg); _actions = []; - for "_i" from 0 to (count _actionsCfg) - 1 do { - _entryCfg = _actionsCfg select _i; + { + _entryCfg = _x; if(isClass _entryCfg) then { _displayName = getText (_entryCfg >> "displayName"); @@ -51,7 +53,12 @@ _recurseFnc = { _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; - _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + _runOnHover = true; + if (isText (_entryCfg >> "runOnHover")) then { + _runOnHover = compile getText (_entryCfg >> "runOnHover"); + } else { + _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + }; _condition = compile _condition; _children = [_entryCfg] call _recurseFnc; @@ -67,30 +74,30 @@ _recurseFnc = { {}, [0,0,0], 10, //distace - [_showDisabled,_enableInside,_canCollapse,_runOnHover], + [_showDisabled,_enableInside,_canCollapse,_runOnHover, true], _modifierFunction ], _children ]; _actions pushBack _entry; }; - }; + } forEach (configProperties [_actionsCfg, "isClass _x", true]); _actions }; -private "_actionsCfg"; +private ["_actionsCfg","_actions"]; _actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions"; private ["_baseDisplayName", "_baseIcon"]; _baseDisplayName = ""; _baseIcon = ""; if (_objectType isKindOf "CAManBase") then { - _baseDisplayName = localize "STR_ACE_Interact_Menu_SelfActionsRoot"; + _baseDisplayName = localize LSTRING(SelfActionsRoot); _baseIcon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; } else { _baseDisplayName = getText (configFile >> "CfgVehicles" >> _objectType >> "displayName"); //Alt would be to just use a static text, if veh names end up being too long: - // _baseDisplayName = localize "STR_ACE_Interact_Menu_VehicleActionsRoot"; + // _baseDisplayName = localize LSTRING(VehicleActionsRoot); //Pull the icon from the vehicle's config: _baseIcon = getText (configFile >> "CfgVehicles" >> _objectType >> "Icon"); @@ -100,26 +107,31 @@ if (_objectType isKindOf "CAManBase") then { }; }; -// Create a master action to base on self action -_actions = [ +// If the classname inherits from CAManBase, just copy it's menu without recompiling a new one +_actions = if (_isMan) then { + + (missionNamespace getVariable QGVAR(SelfAct_CAManBase)) +} else { + // Create a master action to base on self action [ [ - "ACE_SelfActions", - _baseDisplayName, - _baseIcon, - { - // Dummy statement so it's not collapsed when there's no available actions - true - }, - {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering"]] call EFUNC(common,canInteractWith)}, - {}, - {}, - "Spine3", - 10, - [false,true,false] - ], - [_actionsCfg] call _recurseFnc + [ + "ACE_SelfActions", + _baseDisplayName, + _baseIcon, + { + // Dummy statement so it's not collapsed when there's no available actions + true + }, + {[ACE_player, _target, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)}, + {}, + {}, + "Spine3", + 10, + [false,true,false] + ], + [_actionsCfg] call _recurseFnc + ] ] -]; +}; missionNamespace setVariable [_actionsVarName, _actions]; diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf new file mode 100644 index 0000000000..9dc212ac40 --- /dev/null +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -0,0 +1,94 @@ +/* + * Author: SilentSpike + * Compile the zeus action menu (only to be done once) + * + * Argument: + * nil + * + * Return value: + * None + * + * Public: No + */ +#include "script_component.hpp"; + +// Exit if the action menu is already compiled for zeus +if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; + +private "_recurseFnc"; +_recurseFnc = { + private ["_actions", "_displayName", "_icon", "_statement", "_condition", "_showDisabled", + "_enableInside", "_canCollapse", "_runOnHover", "_children", "_entry", "_entryCfg", "_insertChildren", "_modifierFunction"]; + EXPLODE_1_PVT(_this,_actionsCfg); + _actions = []; + + { + _entryCfg = _x; + if(isClass _entryCfg) then { + _displayName = getText (_entryCfg >> "displayName"); + + _icon = getText (_entryCfg >> "icon"); + _statement = compile (getText (_entryCfg >> "statement")); + + _condition = getText (_entryCfg >> "condition"); + if (_condition == "") then {_condition = "true"}; + + _insertChildren = compile (getText (_entryCfg >> "insertChildren")); + _modifierFunction = compile (getText (_entryCfg >> "modifierFunction")); + + _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; + _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; + _canCollapse = (getNumber (_entryCfg >> "canCollapse")) > 0; + _runOnHover = true; + if (isText (_entryCfg >> "runOnHover")) then { + _runOnHover = compile getText (_entryCfg >> "runOnHover"); + } else { + _runOnHover = (getNumber (_entryCfg >> "runOnHover")) > 0; + }; + + _condition = compile _condition; + _children = [_entryCfg] call _recurseFnc; + + _entry = [ + [ + configName _entryCfg, + _displayName, + _icon, + _statement, + _condition, + _insertChildren, + {}, + [0,0,0], + 10, //distace + [_showDisabled,_enableInside,_canCollapse,_runOnHover], + _modifierFunction + ], + _children + ]; + _actions pushBack _entry; + }; + } forEach (configProperties [_actionsCfg, "isClass _x", true]); + _actions +}; + +private ["_actionsCfg"]; +_actionsCfg = configFile >> "ACE_ZeusActions"; + +// Create a master action to base zeus actions on +GVAR(ZeusActions) = [ + [ + [ + "ACE_ZeusActions", + localize LSTRING(ZeusActionsRoot), + "\A3\Ui_F_Curator\Data\Logos\arma3_zeus_icon_ca.paa", + {true}, + {true}, + {}, + {}, + {[0,0,0]}, + 10, + [false,true,false] + ], + [_actionsCfg] call _recurseFnc + ] +]; diff --git a/addons/interact_menu/functions/fnc_createAction.sqf b/addons/interact_menu/functions/fnc_createAction.sqf index b26cb186f3..6845683044 100644 --- a/addons/interact_menu/functions/fnc_createAction.sqf +++ b/addons/interact_menu/functions/fnc_createAction.sqf @@ -68,7 +68,7 @@ _distance = if (count _this > 8) then { _params = if (count _this > 9) then { _this select 9 } else { - [false,false,false,false] + [false,false,false,false,false] }; _modifierFunction = if (count _this > 10) then { diff --git a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf index cff8bb1048..cb21d218db 100644 --- a/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf +++ b/addons/interact_menu/functions/fnc_handlePlayerChanged.sqf @@ -16,7 +16,7 @@ EXPLODE_2_PVT(_this,_newUnit,_oldUnit); // add to new unit private "_ehid"; _ehid = [_newUnit, "DefaultAction", {GVAR(openedMenuType) >= 0}, { - if !(GVAR(actionOnKeyRelease)) then { + if (!GVAR(actionOnKeyRelease) && GVAR(actionSelected)) then { [GVAR(openedMenuType),true] call FUNC(keyUp); }; }] call EFUNC(common,addActionEventHandler); diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index d4e460c10f..5bf156b69e 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -16,6 +16,11 @@ EXPLODE_1_PVT(_this,_menuType); if (GVAR(openedMenuType) == _menuType) exitWith {true}; +// Conditions: canInteract (these don't apply to zeus) +if ((isNull curatorCamera) && { + !([ACE_player, objNull, ["isNotInside","isNotDragging", "isNotCarrying", "isNotSwimming", "notOnMap", "isNotEscorting", "isNotSurrendering", "isNotSitting"]] call EFUNC(common,canInteractWith)) +}) exitWith {false}; + while {dialog} do { closeDialog 0; }; @@ -27,37 +32,46 @@ if (_menuType == 0) then { GVAR(keyDown) = false; GVAR(keyDownSelfAction) = true; }; -GVAR(keyDownTime) = diag_tickTime; +GVAR(keyDownTime) = ACE_diagTime; GVAR(openedMenuType) = _menuType; GVAR(lastTimeSearchedActions) = -1000; GVAR(ParsedTextCached) = []; GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || visibleMap || + (!isNull curatorCamera) || {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || {(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)}; +// Delete existing controls in case there's any left +GVAR(iconCount) = 0; +for "_i" from 0 to (count GVAR(iconCtrls))-1 do { + ctrlDelete (GVAR(iconCtrls) select _i); + GVAR(ParsedTextCached) set [_i, ""]; +}; +GVAR(iconCtrls) resize GVAR(iconCount); + if (GVAR(useCursorMenu)) then { - createDialog QGVAR(cursorMenu); + // Don't close zeus interface if open + if (isNull curatorCamera) then { + (findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + } else { + createDialog QGVAR(cursorMenu); + }; + (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); - ctrlEnable [91921, true]; GVAR(cursorPos) = [0.5,0.5,0]; - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", { - if (GVAR(cursorKeepCentered)) then { - GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; - setMousePosition [0.5, 0.5]; - } else { - GVAR(cursorPos) = [_this select 1, _this select 2, 0]; - }; - }]; - // handles LMB in cursor mode when action on keyrelease is disabled - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", { - if !(GVAR(actionOnKeyRelease)) then { - [GVAR(openedMenuType),true] call FUNC(keyUp); - }; - }]; + + _ctrl = (findDisplay 91919) ctrlCreate ["RscStructuredText", 9922]; + _ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; + _ctrl ctrlCommit 0; + + // handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; }; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 7b24497802..02e2d4db01 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -19,7 +19,7 @@ _calledByClicking = _this select 1; if (GVAR(openedMenuType) < 0) exitWith {true}; if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { - closeDialog 0; + (findDisplay 91919) closeDisplay 2; }; if(GVAR(actionSelected)) then { @@ -46,6 +46,8 @@ if(GVAR(actionSelected)) then { }; }; +["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent); + GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(openedMenuType) = -1; @@ -54,6 +56,4 @@ GVAR(expanded) = false; GVAR(lastPath) = []; GVAR(menuDepthPath) = []; -["interactMenuClosed", [GVAR(openedMenuType)]] call EFUNC(common,localEvent); - true diff --git a/addons/interact_menu/functions/fnc_render.sqf b/addons/interact_menu/functions/fnc_render.sqf index 06c155ac54..55ca280c43 100644 --- a/addons/interact_menu/functions/fnc_render.sqf +++ b/addons/interact_menu/functions/fnc_render.sqf @@ -48,7 +48,7 @@ if (GVAR(openedMenuType) >= 0) then { _closest = GVAR(currentOptions) select _closestSelection; _sPos = _closest select 1; - _cTime = diag_tickTime; + _cTime = ACE_diagTime; _delta = _cTime - GVAR(lastTime); GVAR(lastTime) = _cTime; @@ -73,23 +73,33 @@ if (GVAR(openedMenuType) >= 0) then { } forEach GVAR(lastPath); }; - if(_misMatch && {diag_tickTime-GVAR(expandedTime) > 0.25}) then { - GVAR(startHoverTime) = diag_tickTime; + if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > 0.25}) then { + GVAR(startHoverTime) = ACE_diagTime; GVAR(lastPath) = _hoverPath; GVAR(expanded) = false; } else { - if(!GVAR(expanded) && diag_tickTime-GVAR(startHoverTime) > 0.25) then { + if(!GVAR(expanded) && ACE_diagTime-GVAR(startHoverTime) > 0.25) then { GVAR(expanded) = true; // Start the expanding menu animation only if the user is not going up the menu if !([GVAR(menuDepthPath),GVAR(lastPath)] call FUNC(isSubPath)) then { - GVAR(expandedTime) = diag_tickTime; + GVAR(expandedTime) = ACE_diagTime; }; GVAR(menuDepthPath) = +GVAR(lastPath); // Execute the current action if it's run on hover private "_runOnHover"; - _runOnHover = ((GVAR(selectedAction) select 0) select 9) select 3; + _tmp = ((GVAR(selectedAction) select 0) select 9) select 3; + _runOnHover = true; + if ((typeName _tmp) == "CODE" ) then { + _runOnHover = call _tmp; + } else { + if ((typeName _tmp) == "BOOL" ) then { + _runOnHover = _tmp; + } else { + _runOnHover = _tmp > 0; + }; + }; if (_runOnHover) then { this = GVAR(selectedTarget); _player = ACE_Player; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 8e6cb7d390..8ca7f8aa33 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -14,18 +14,18 @@ GVAR(currentOptions) = []; -private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"]; +private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos", "_virtualPoint", "_wavesAtOrigin", "_wavesAtVirtualPoint"]; _player = ACE_player; +_cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); +_cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; + _fnc_renderNearbyActions = { // Render all nearby interaction menus #define MAXINTERACTOBJECTS 3 - _cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); - _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; - GVAR(foundActions) = []; - GVAR(lastTimeSearchedActions) = diag_tickTime; + GVAR(lastTimeSearchedActions) = ACE_diagTime; _numInteractObjects = 0; _nearestObjects = nearestObjects [ACE_player, ["All"], 13]; @@ -101,34 +101,78 @@ _fnc_renderSelfActions = { // Iterate through base level class actions and render them if appropiate _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target]; _classActions = missionNamespace getVariable [_actionsVarName, []]; + + _pos = if !(GVAR(useCursorMenu)) then { + _virtualPoint = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition); + _wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt); + _wavesAtVirtualPoint = [_virtualPoint] call EFUNC(common,waveHeightAt); + _virtualPoint set [2, ((_virtualPoint select 2) - _wavesAtOrigin + _wavesAtVirtualPoint)]; + _virtualPoint + } else { + [0.5, 0.5] + }; + { _action = _x; - - _pos = if !(GVAR(useCursorMenu)) then { - (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition) - } else { - [0.5, 0.5] - }; [_target, _action, _pos] call FUNC(renderBaseMenu); } forEach _classActions; }; +_fnc_renderZeusActions = { + { + _action = _x; + [_this, _action, [0.5, 0.5]] call FUNC(renderBaseMenu); + } forEach GVAR(ZeusActions); +}; + + +GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { - - if (vehicle ACE_player == ACE_player) then { - if (diag_tickTime > GVAR(lastTimeSearchedActions) + 0.20) then { - // Once every 0.2 secs, collect nearby objects active and visible action points and render them - call _fnc_renderNearbyActions; + if (isNull curatorCamera) then { + if (vehicle ACE_player == ACE_player) then { + if (ACE_diagTime > GVAR(lastTimeSearchedActions) + 0.20) then { + // Once every 0.2 secs, collect nearby objects active and visible action points and render them + call _fnc_renderNearbyActions; + } else { + // The rest of the frames just draw the same action points rendered the last frame + call _fnc_renderLastFrameActions; + }; } else { - // The rest of the frames just draw the same action points rendered the last frame - call _fnc_renderLastFrameActions; + // Render vehicle self actions when in vehicle + (vehicle ACE_player) call _fnc_renderSelfActions; }; } else { - (vehicle ACE_player) call _fnc_renderSelfActions; + // Render zeus actions when zeus open + (getAssignedCuratorLogic player) call _fnc_renderZeusActions; }; - } else { ACE_player call _fnc_renderSelfActions; }; + +if (count GVAR(collectedActionPoints) > 1) then { + // Do the oclusion pass + + // Order action points according to z + GVAR(collectedActionPoints) sort true; + + private ["_i","_j","_delta"]; + for [{_i = count GVAR(collectedActionPoints) - 1}, {_i > 0}, {_i = _i - 1}] do { + for [{_j = _i - 1}, {_j >= 0}, {_j = _j - 1}] do { + // Check if action point _i is ocluded by _j + _delta = vectorNormalized ((GVAR(collectedActionPoints) select _i select 1) vectorDiff (GVAR(collectedActionPoints) select _j select 1)); + + // If _i is inside a cone with 20º half angle with origin on _j + if (_delta select 2 > 0.94) exitWith { + GVAR(collectedActionPoints) deleteAt _i; + }; + }; + }; +}; + +// Render the non-ocluded points +{ + EXPLODE_3_PVT(_x,_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 ca26fb984d..5330bbebd2 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -36,7 +36,7 @@ _pos = if((count _this) > 2) then { }; // For non-self actions, exit if the action is too far away or ocluded -if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && +if (GVAR(openedMenuType) == 0 && (vehicle ACE_player == ACE_player) && (isNull curatorCamera) && { private ["_headPos","_actualDistance"]; _headPos = ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"); @@ -44,7 +44,7 @@ if (GVAR(openedMenuType) == 0 && vehicle ACE_player == ACE_player && if (_actualDistance > _distance) exitWith {true}; - if (_actualDistance > 1.5) exitWith { + if ((_actualDistance > 1.5) && {!((_actionData select 9) select 4)}) exitWith { // If distance to action is greater than 1.5 m, check LOS _line = [_headPos call EFUNC(common,positionToASL), _pos call EFUNC(common,positionToASL), _object, ACE_player]; lineIntersects _line @@ -93,11 +93,17 @@ _fnc_print = { // Check if there's something left for rendering if (count _activeActionTree == 0) exitWith {false}; -//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren); - BEGIN_COUNTER(fnc_renderMenus); -[[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu); +// IGNORE_PRIVATE_WARNING(_cameraPos,_cameraDir); +if (count _pos > 2) then { + _sPos pushBack (((_pos call EFUNC(common,positionToASL)) vectorDiff _cameraPos) vectorDotProduct _cameraDir); +} else { + _sPos pushBack 0; +}; + +// Add action point for oclusion and rendering +GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree]; END_COUNTER(fnc_renderMenus); diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 180b5a3c36..44a280a52e 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -23,6 +23,10 @@ PARAMS_4(_text,_icon,_sPos,_textSettings); if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); diff --git a/addons/interact_menu/functions/fnc_renderMenu.sqf b/addons/interact_menu/functions/fnc_renderMenu.sqf index 84c7799684..a82b82dcb7 100644 --- a/addons/interact_menu/functions/fnc_renderMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderMenu.sqf @@ -102,8 +102,8 @@ if (GVAR(UseListMenu)) then { // Animate menu scale if (_menuInSelectedPath && (_menuDepth == count _path)) then { - _scaleX = _scaleX * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); - _scaleY = _scaleY * (0.3 + 0.7 * (((diag_tickTime - GVAR(expandedTime)) * 8) min 1)); + _scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1)); + _scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1)); }; _target = _actionObject; diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 7ac9559297..96a495c715 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -20,6 +20,10 @@ private ["_displayNum", "_ctrl", "_pos"]; if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); diff --git a/addons/interact_menu/functions/fnc_setupTextColors.sqf b/addons/interact_menu/functions/fnc_setupTextColors.sqf index e26ef9dad8..e54d529668 100644 --- a/addons/interact_menu/functions/fnc_setupTextColors.sqf +++ b/addons/interact_menu/functions/fnc_setupTextColors.sqf @@ -12,7 +12,7 @@ */ #include "script_component.hpp" -private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize"]; +private ["_menuDepth", "_mixColor", "_pathCount", "_row", "_shadowColor", "_textColor", "_textSize", "_colorShadowMax", "_colorShadowMin", "_colorTextMax", "_colorTextMin", "_shadowSetting"]; //Mixes 2 colors (number arrays) and makes a color string "#AARRGGBB" for structured text _mixColor = { @@ -30,9 +30,16 @@ _mixColor = { _return }; -_textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 1] call _mixColor; -_shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 1] call _mixColor; -_textSize = switch (GVAR(textSize)) do { +_colorTextMin = missionNamespace getVariable [QGVAR(colorTextMin), [1,1,1,0.25]]; +_colorTextMax = missionNamespace getVariable [QGVAR(colorTextMax), [1,1,1,1]]; +_colorShadowMin = missionNamespace getVariable [QGVAR(colorShadowMin), [0,0,0,0.25]]; +_colorShadowMax = missionNamespace getVariable [QGVAR(colorShadowMax), [0,0,0,1]]; +_shadowSetting = missionNamespace getVariable [QGVAR(shadowSetting), 2]; +_textSize = missionNamespace getVariable [QGVAR(textSize), 2]; + +_textColor = [_colorTextMin, _colorTextMax, 1] call _mixColor; +_shadowColor = [_colorShadowMin, _colorShadowMax, 1] call _mixColor; +_textSize = switch (_textSize) do { case (0): {0.4}; case (1): {0.6}; case (2): {0.8}; @@ -40,20 +47,20 @@ _textSize = switch (GVAR(textSize)) do { case (4): {1.2}; }; -GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; +GVAR(colorSelectedSettings) = format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, _shadowSetting, _shadowColor]; GVAR(textSettingsMatrix) = []; for "_pathCount" from 0 to 15 do { _row = []; for "_menuDepth" from 0 to 15 do { if (_menuDepth > 0) then { - _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; - _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; + _textColor = [_colorTextMin, _colorTextMax, (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; + _shadowColor = [_colorShadowMin, _colorShadowMax, (((_pathCount - 1) / _menuDepth) max 0.25)] call _mixColor; } else { - _textColor = [GVAR(colorTextMin), GVAR(colorTextMax), 0] call _mixColor; - _shadowColor = [GVAR(colorShadowMin), GVAR(colorShadowMax), 0] call _mixColor; + _textColor = [_colorTextMin, _colorTextMax, 0] call _mixColor; + _shadowColor = [_colorShadowMin, _colorShadowMax, 0] call _mixColor; }; - _row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, GVAR(shadowSetting), _shadowColor]; + _row pushBack format ["color='%1' size='%2' shadow='%3' shadowColor='%4' shadowOffset='0.06'", _textColor, _textSize, _shadowSetting, _shadowColor]; }; GVAR(textSettingsMatrix) pushBack _row; }; diff --git a/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf new file mode 100644 index 0000000000..9143db0d4d --- /dev/null +++ b/addons/interact_menu/functions/fnc_userActions_addHouseActions.sqf @@ -0,0 +1,97 @@ +/* + * Author: PabstMirror + * Scans for nearby "Static" objects (buildings) and adds the UserActions to them. + * Called when interact_menu starts rendering (from "interact_keyDown" event) + * + * Arguments: + * 0: Interact Menu Type (0 - world, 1 - self) + * + * Return Value: + * Nothing + * + * Example: + * [0] call ace_interact_menu_fnc_addHouseActions + * + * Public: Yes + */ +#include "script_component.hpp" + +PARAMS_1(_interactionType); + +//Ignore if not enabled: +if (!GVAR(addBuildingActions)) exitWith {}; +//Ignore self-interaction menu: +if (_interactionType != 0) exitWith {}; +//Ignore when mounted: +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); + + if (!EGVAR(interact_menu,keyDown)) then { + {deleteVehicle _x;} forEach _addedHelpers; + [_pfID] call CBA_fnc_removePerFrameHandler; + } else { + // Prevent Rare Error when ending mission with interact key down: + if (isNull ace_player) exitWith {}; + + //Make the common case fast (cursorTarget is looking at a door): + if ((!isNull cursorTarget) && {cursorTarget isKindOf "Static"} && {!(cursorTarget in _housesScaned)}) then { + if (((count (configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "UserActions")) > 0) || {(count (getArray (configFile >> "CfgVehicles" >> (typeOf cursorTarget) >> "ladders"))) > 0}) then { + _housesToScanForActions = [cursorTarget]; + } else { + _housesScaned pushBack cursorTarget; + }; + }; + + //For performance, we only do 1 thing per frame, + //-either do a wide scan and search for houses with actions + //-or scan one house at a time and add the actions for that house + + if (_housesToScanForActions isEqualTo []) then { + //If player moved >2 meters from last pos, then rescan + if (((getPosASL ace_player) distance _setPosition) < 2) exitWith {}; + + _nearBuidlings = nearestObjects [ace_player, ["Static"], 30]; + { + _typeOfHouse = typeOf _x; + if (((count (configFile >> "CfgVehicles" >> _typeOfHouse >> "UserActions")) == 0) && {(count (getArray (configFile >> "CfgVehicles" >> _typeOfHouse >> "ladders"))) == 0}) then { + _housesScaned pushBack _x; + } else { + _housesToScanForActions pushBack _x; + }; + } forEach (_nearBuidlings - _housesScaned); + + _args set [0, (getPosASL ace_player)]; + } else { + _houseBeingScaned = _housesToScanForActions deleteAt 0; + _typeOfHouse = typeOf _houseBeingScaned; + //Skip this house for now if we are outside of it's radius + //(we have to scan far out for the big houses, but we don't want to waste time adding actions on every little shack) + if ((_houseBeingScaned != cursorTarget) && {((ACE_player distance _houseBeingScaned) - ((sizeOf _typeOfHouse) / 2)) > 4}) exitWith {}; + + _housesScaned pushBack _houseBeingScaned; + + _actionSet = [_typeOfHouse] call FUNC(userActions_getHouseActions); + EXPLODE_2_PVT(_actionSet,_memPoints,_memPointsActions); + + // systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime]; + { + _helperPos = (_houseBeingScaned modelToWorld (_houseBeingScaned selectionPosition _x)) call EFUNC(common,positionToASL); + _helperObject = "Sign_Sphere25cm_F" createVehicleLocal _helperPos; + _addedHelpers pushBack _helperObject; + _helperObject setVariable [QGVAR(building), _houseBeingScaned]; + _helperObject setPosASL _helperPos; + _helperObject hideObject true; + TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned); + + { + [_helperObject, 0, [], _x] call EFUNC(interact_menu,addActionToObject); + } forEach (_memPointsActions select _forEachIndex); + + } forEach _memPoints; + }; + }; +}, 0, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], [], []]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf new file mode 100644 index 0000000000..0b3d4347c7 --- /dev/null +++ b/addons/interact_menu/functions/fnc_userActions_getHouseActions.sqf @@ -0,0 +1,137 @@ +/* + * Author: PabstMirror + * Scans the buidling type for UserActions and Ladder mount points. + * + * Arguments: + * 0: Building Classname + * + * Return Value: + * [[Array of MemPoints], [Array Of Actions]] + * + * Public: Yes + */ +#include "script_component.hpp" + +PARAMS_1(_typeOfBuilding); + +private["_action", "_actionDisplayName", "_actionDisplayNameDefault", "_actionMaxDistance", "_actionOffset", "_actionPath", "_actionPosition", "_building", "_configPath", "_endIndex", "_iconImage", "_index", "_ladders", "_memPointIndex", "_memPoints", "_memPointsActions", "_startIndex"]; + +_searchIndex = GVAR(cachedBuildingTypes) find _typeOfBuilding; +if (_searchIndex != -1) exitWith {GVAR(cachedBuildingActionPairs) select _searchIndex}; + +_memPoints = []; +_memPointsActions = []; + +//Get the offset for a memory point: +_fnc_getMemPointOffset = { + PARAMS_1(_memoryPoint); + _memPointIndex = _memPoints find _memoryPoint; + _actionOffset = [0,0,0]; + if (_memPointIndex == -1) then { + _memPoints pushBack _memoryPoint; + _memPointsActions pushBack []; + } else { + _actionOffset set [2, 0.0254 * (count (_memPointsActions select _memPointIndex))]; + }; + _actionOffset +}; + +// Add UserActions for the building: +_fnc_userAction_Statement = { + PARAMS_3(_target,_player,_variable); + EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + this = _target getVariable [QGVAR(building), objNull]; + call _actionStatement; +}; +_fnc_userAction_Condition = { + PARAMS_3(_target,_player,_variable); + EXPLODE_2_PVT(_variable,_actionStatement,_actionCondition); + this = _target getVariable [QGVAR(building), objNull]; + if (isNull this) exitWith {false}; + call _actionCondition; +}; + +_configPath = configFile >> "CfgVehicles" >> _typeOfBuilding >> "UserActions"; +for "_index" from 0 to ((count _configPath) - 1) do { + _actionPath = _configPath select _index; + + _actionDisplayName = getText (_actionPath >> "displayName"); + _actionDisplayNameDefault = getText (_actionPath >> "displayNameDefault"); + _actionPosition = getText (_actionPath >> "position"); + _actionCondition = getText (_actionPath >> "condition"); + _actionStatement = getText (_actionPath >> "statement"); + _actionMaxDistance = getNumber (_actionPath >> "radius"); + + if (_actionDisplayName == "") then {_actionDisplayName = (configName _x);}; + if (_actionPosition == "") then {ERROR("Bad Position");}; + if (_actionCondition == "") then {_actionCondition = "true";}; + if (_actionStatement == "") then {ERROR("No Statement");}; + + _actionStatement = compile _actionStatement; + _actionCondition = compile _actionCondition; + _actionMaxDistance = _actionMaxDistance + 0.1; //increase range slightly + _iconImage = ""; + + //extension ~4x as fast: + _iconImage = "ace_parse_imagepath" callExtension _actionDisplayNameDefault; + + _actionOffset = [_actionPosition] call _fnc_getMemPointOffset; + _memPointIndex = _memPoints find _actionPosition; + + _action = [(configName _actionPath), _actionDisplayName, _iconImage, _fnc_userAction_Statement, _fnc_userAction_Condition, {}, [_actionStatement, _actionCondition], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction); + (_memPointsActions select _memPointIndex) pushBack _action; +}; + +// Add Ladder Actions for the building: +_fnc_ladder_ladderUp = { + PARAMS_3(_target,_player,_variable); + EXPLODE_1_PVT(_variable,_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); + _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); + //(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); + + _actionMaxDistance = 3; //interact_menu will check head -> target's offset; leave this high and do a precice distance check in condition + + _actionDisplayName = localize "str_action_ladderup"; + _iconImage = "\A3\ui_f\data\igui\cfg\actions\ladderup_ca.paa"; + //Ladder Up Action: + _actionOffset = [_ladderBottomMemPoint] call _fnc_getMemPointOffset; + _actionOffset = _actionOffset vectorAdd [0,0,1]; + _memPointIndex = _memPoints find _ladderBottomMemPoint; + _action = [format ["LadderUp_%1", _forEachIndex], _actionDisplayName, _iconImage, _fnc_ladder_ladderUp, _fnc_ladder_conditional, {}, [_forEachIndex], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction); + (_memPointsActions select _memPointIndex) pushBack _action; + + _actionDisplayName = localize "str_action_ladderdown"; + _iconImage = "\A3\ui_f\data\igui\cfg\actions\ladderdown_ca.paa"; + //Ladder Down Action: + _actionOffset = [_ladderTopMemPoint] call _fnc_getMemPointOffset; + _actionOffset = _actionOffset vectorAdd [0,0,0.25]; + _memPointIndex = _memPoints find _ladderTopMemPoint; + _action = [format ["LadderDown_%1", _forEachIndex], _actionDisplayName, _iconImage, _fnc_ladder_ladderDown, _fnc_ladder_conditional, {}, [_forEachIndex], _actionOffset, _actionMaxDistance, [false,false,false,false,true]] call EFUNC(interact_menu,createAction); + (_memPointsActions select _memPointIndex) pushBack _action; + +} forEach _ladders; + +GVAR(cachedBuildingTypes) pushBack _typeOfBuilding; +GVAR(cachedBuildingActionPairs) pushBack [_memPoints, _memPointsActions]; + + +[_memPoints, _memPointsActions] diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index 9e808eedff..4ab84e1c51 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -10,7 +10,7 @@ Zawsze wyświetlaj kursor dla własnej interakcji Toujours afficher le curseur pour les interactions sur soi-même Mindig legyen a saját cselekvés kurzorja látható - Mostra sempre il cursore per le auto interazioni + Mostra sempre il cursore per le interazioni su se stessi Sempre mostrar cursor para interação pessoal @@ -58,7 +58,7 @@ Klawisz własnej interakcji Touche d'interaction personnelle Saját cselekvő gomb - Tasto per auto interazioni + Tasto interazione su se stessi Tecla de Interação Pessoal @@ -70,7 +70,7 @@ Własne akcje Interaction personnelle Saját cselekvések - Auto interazioni + Interazioni su se stessi Ações Pessoais @@ -85,6 +85,11 @@ Interazioni con veicoli Ações de Veículos + + Zeus Actions + Akcje Zeusa + Akce Zeuse + Interaction - Text Max Interakcja - Tekst max @@ -133,7 +138,7 @@ Cselekvés - Árnyék min. Interação - Min. de Sombra - + Keep cursor centered Garder le curseur au centre Центрировать курсор @@ -143,8 +148,9 @@ Mantener el cursor centrado Udržuj kurzor na středu Manter o cursor centralizado + Mantieni il cursore centrato - + Keeps cursor centered and pans the option menu around. Useful if screen size is limited. Udržuje kurzor na středu. Užitečné, pokud je velikost obrazovky omezena. Garde le curseur au milieu et dispose le menu des options autour. Utile si la taille de l'écran est limitée. @@ -154,6 +160,7 @@ Utrzymuje kursor na środku ekranu, zamiast tego ruch myszą powoduje przesuwanie menu interakcji. Użyteczne w przypadku kiedy rozmiar ekranu jest ograniczony. Mantiene el cursor centrado y despliega los menús alrededor. Útil si el tamaño de la pantalla es limitado. Manter o cursor centralizado e mover o menu de opções. Útil caso o tamanho da tela seja limitado. + Mantieni il cursore centrato e sposta il menù intorno. Utile se lo schermo è piccolo. Do action when releasing menu key @@ -165,8 +172,9 @@ Realizar la acción al soltar la tecla menu Execute a ação quando soltar a tecla de menu Cselekvés végrehajtása a menügomb elengedésekor + Esegui l'azione quando rilasci il tasto menu - + Interaction Text Size Velikost textu interakce Menü-Schriftgröße @@ -176,8 +184,9 @@ Rozmiar tekstu interakcji Tamanho do texto de interação Cselekvő szöveg mérete + Dimensione del testo d'interazione - + Interaction Text Shadow Stín textu interakce Menü-Hintergrundschatten @@ -187,8 +196,9 @@ Cień tekstu interakcji Sombra do texto de interação Cselekvő szöveg árnyéka + Ombra del testo d'interazione - + Allows controlling the text's shadow. Outline ignores custom shadow colors. Umožňuje změnit stíny textu v menu interakce. Barva stínu je u tahu písma ignorována. Stellt den Hintergrundschatten ein. Die Einstellung 'Kontur' ignoriert die Farbe des Schattens. @@ -198,8 +208,9 @@ Pozwala kontrolować cień tekstu. Kontury ignorują niestandardowe kolory cienia. Permite controlar a sombra do texto. Contorno ignora sombras com cores customizadas. Hozzáférést biztosít a szöveg árnyékának kezeléséhez. A körvonal nem veszi figyelembe az egyedi árnyékszíneket. + Permette di controllare l'ombra del testo. L'impostazione "Contorno" ignora il colore dell'ombra. - + Outline Kontura Kontur @@ -209,6 +220,45 @@ Kontur Contorno Körvonal + Contorno + + + Interaction menu background + Tło menu interakcji + Fondo del menú de interacción + Pozadí menu interakce + Fundo do menu de interação + + + Blur the background while the interaction menu is open. + Rozmywa lub przyciemnia tło na czas otwarcia menu interakcji + Desenfocar el fondo mientras el menú de interacción está abierto. + Rozmazat obraz pokud je interakční menu otevřené. + Desfocar o fundo enquanto o menu de interação está aberto. + + + Blur screen + Rozmycie ekranu + Pantalla de desenfoque + Rozmazaný obraz + Desfoque de tela + + + Black + Przyciemnienie ekranu + Negra + Černý obraz + Preto + + + Show actions for buildings + Pokazuj akcje dla budynków + Zobrazit akci pro budovy + + + Adds interaction actions for opening doors and mounting ladders on buildings. (Note: There is a performance cost when opening interaction menu, especially in towns) + Dodaje opcje interakcji dla otwierania drzwi oraz wchodzenia po drabinach do budynków. Uwaga: Użycie tej opcji może spowodować spadek wydajności menu interakcji, szczególnie w dużych miastach. + 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.) - + \ No newline at end of file diff --git a/addons/interaction/ACE_Settings.hpp b/addons/interaction/ACE_Settings.hpp new file mode 100644 index 0000000000..6c97109a37 --- /dev/null +++ b/addons/interaction/ACE_Settings.hpp @@ -0,0 +1,6 @@ +class ACE_Settings { + class GVAR(EnableTeamManagement) { + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/interaction/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp new file mode 100644 index 0000000000..195a979955 --- /dev/null +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -0,0 +1,244 @@ +class ACE_ZeusActions { + // _target = curatorLogic + // curatorSelected = [objects,groups,waypoints,markers] + class ZeusUnits { + displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; + + class stance { + displayName = "$STR_A3_RscAttributeUnitPos_Title"; + + class prone { + displayName = "$STR_Pos_Down"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa"; + statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);"; + }; + class crouch { + displayName = "$STR_Pos_Crouch"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa"; + statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);"; + }; + class stand { + displayName = "$STR_Pos_Up"; + icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa"; + statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);"; + }; + class auto { + displayName = "$STR_Pos_Automatic"; + icon = "\A3\UI_F_Curator\Data\default_ca.paa"; + statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; + }; + }; + class remoteControl { + displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F"; + icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa"; + statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];"; + }; + }; + class ZeusGroups { + displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; + + class behaviour { + displayName = "$STR_Combat_Mode"; + + class careless { + displayName = "$STR_Combat_Careless"; + statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);"; + }; + class safe { + displayName = "$STR_Combat_Safe"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; + statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; + }; + class aware { + displayName = "$STR_Combat_Aware"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; + statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);"; + }; + class combat { + displayName = "$STR_Combat_Combat"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; + statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);"; + }; + class stealth { + displayName = "$STR_Combat_Stealth"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; + statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; + }; + }; + class speed { + displayName = "$STR_HC_Menu_Speed"; + + class limited { + displayName = "$STR_Speed_Limited"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; + statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);"; + }; + class normal { + displayName = "$STR_Speed_Normal"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; + statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);"; + }; + class full { + displayName = "$STR_Speed_Full"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; + statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; + }; + }; + class formation { + displayName = "$STR_Formation"; + + class wedge { + displayName = "$STR_Wedge"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; + statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);"; + }; + class vee { + displayName = "$STR_Vee"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; + statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);"; + }; + class line { + displayName = "$STR_Line"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; + statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);"; + }; + class column { + displayName = "$STR_Column"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; + statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);"; + }; + class file { + displayName = "$STR_File"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; + statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);"; + }; + class stag_column { + displayName = "$STR_Staggered"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; + statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + }; + class ech_left { + displayName = "$STR_EchL"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; + statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + }; + class ech_right { + displayName = "$STR_EchR"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; + statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + }; + class diamond { + displayName = "$STR_Diamond"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; + statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + }; + }; + }; + class ZeusWaypoints { + displayName = "Waypoints"; + icon = "\A3\UI_F_Curator\Data\CfgCurator\waypoint_ca.paa"; + + class behaviour { + displayName = "$STR_Combat_Mode"; + + class careless { + displayName = "$STR_Combat_Careless"; + statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);"; + }; + class safe { + displayName = "$STR_Combat_Safe"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; + statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);"; + }; + class aware { + displayName = "$STR_Combat_Aware"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; + statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);"; + }; + class combat { + displayName = "$STR_Combat_Combat"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; + statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);"; + }; + class stealth { + displayName = "$STR_Combat_Stealth"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; + statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; + }; + }; + class speed { + displayName = "$STR_HC_Menu_Speed"; + + class limited { + displayName = "$STR_Speed_Limited"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; + statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);"; + }; + class normal { + displayName = "$STR_Speed_Normal"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; + statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);"; + }; + class full { + displayName = "$STR_Speed_Full"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; + statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; + }; + }; + class formation { + displayName = "$STR_Formation"; + + class wedge { + displayName = "$STR_Wedge"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; + statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);"; + }; + class vee { + displayName = "$STR_Vee"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; + statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);"; + }; + class line { + displayName = "$STR_Line"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; + statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);"; + }; + class column { + displayName = "$STR_Column"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; + statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);"; + }; + class file { + displayName = "$STR_File"; + icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; + statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);"; + }; + class stag_column { + displayName = "$STR_Staggered"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; + statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + }; + class ech_left { + displayName = "$STR_EchL"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; + statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + }; + class ech_right { + displayName = "$STR_EchR"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; + statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + }; + class diamond { + displayName = "$STR_Diamond"; + icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; + statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + }; + }; + }; + class ZeusMarkers { + displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; + icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; + }; +}; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5548311718..17c271f372 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -1,566 +1,595 @@ class CfgVehicles { - - class Module_F; - class ACE_ModuleInteraction: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleInteraction: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Interaction System"; + displayName = CSTRING(Module_DisplayName); function = "ACE_Interaction_fnc_moduleInteraction"; scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); class Arguments { class EnableTeamManagement { - displayName = "Enable Team Management"; - description = "Should players be allowed to use the Team Management Menu? Default: Yes"; + displayName = CSTRING(EnableTeamManagement_DisplayName); + description = CSTRING(EnableTeamManagement_Description); typeName = "BOOL"; - class values { - class Yes { default = 1; name = "Yes"; value = 1;}; - class No { name = "No"; value = 0; }; - }; + defaultValue = 1; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; - class Man; - class CAManBase: Man { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - distance = 4; - condition = QUOTE(true); - statement = ""; - icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; - selection = "pelvis"; + class Man; + class CAManBase: Man { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + distance = 4; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = "pelvis"; - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); - statement = ""; - showDisabled = 0; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; + class ACE_TeamManagement { + displayName = CSTRING(TeamManagement); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); + statement = ""; + showDisabled = 0; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; - class ACE_AssignTeamRed { - displayName = "$STR_ACE_Interaction_AssignTeamRed"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_red_ca.paa); - priority = 2.4; - hotkey = "R"; + class ACE_AssignTeamRed { + displayName = CSTRING(AssignTeamRed); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_red_ca.paa); + priority = 2.4; + hotkey = "R"; + }; + class ACE_AssignTeamGreen { + displayName = CSTRING(AssignTeamGreen); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_green_ca.paa); + priority = 2.3; + hotkey = "G"; + }; + class ACE_AssignTeamBlue { + displayName = CSTRING(AssignTeamBlue); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_blue_ca.paa); + priority = 2.2; + hotkey = "B"; + }; + class ACE_AssignTeamYellow { + displayName = CSTRING(AssignTeamYellow); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + priority = 2.1; + hotkey = "Y"; + }; + + class ACE_UnassignTeam { + displayName = CSTRING(LeaveTeam); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); + statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_white_ca.paa); + priority = 2.5; + hotkey = "N"; + }; + }; + + class ACE_JoinGroup { + displayName = CSTRING(JoinGroup); + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + statement = QUOTE([_player] joinSilent group _target); + showDisabled = 0; + priority = 2.6; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "J"; + }; + + class ACE_GetDown { + displayName = CSTRING(GetDown); + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(getDown)); + showDisabled = 0; + priority = 2.2; + }; + class ACE_SendAway { + displayName = CSTRING(SendAway); + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(sendAway)); + showDisabled = 0; + priority = 2.0; + }; + class ACE_Pardon { + displayName = CSTRING(Pardon); + condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); + statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); + showDisabled = 0; + priority = 2.5; + }; + }; + class ACE_Torso { + displayName = CSTRING(Torso); + selection = "spine3"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Head { + displayName = CSTRING(Head); + selection = "pilot"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmLeft { + displayName = CSTRING(ArmLeft); + selection = "LeftForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmRight { + displayName = CSTRING(ArmRight); + selection = "RightForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegLeft { + displayName = CSTRING(LegLeft); + selection = "LKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegRight { + displayName = CSTRING(LegRight); + selection = "RKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Weapon { + displayName = CSTRING(Weapon); + position = QUOTE(call FUNC(getWeaponPos)); + distance = 1.50; + condition = ""; + statement = ""; + }; + + class ACE_TapShoulderRight { + displayName = CSTRING(TapShoulder); + selection = "rightshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); + }; + class ACE_TapShoulderLeft { + displayName = CSTRING(TapShoulder); + selection = "leftshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); + }; + }; + + class ACE_SelfActions { + class ACE_TeamManagement { + displayName = CSTRING(TeamManagement); + condition = QUOTE(GVAR(EnableTeamManagement)); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = ""; + showDisabled = 1; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + + class ACE_JoinTeamRed { + displayName = CSTRING(JoinTeamRed); + condition = QUOTE(true); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.4; + icon = PATHTOF(UI\team\team_red_ca.paa); + hotkey = "R"; + }; + class ACE_JoinTeamGreen { + displayName = CSTRING(JoinTeamGreen); + condition = QUOTE(true); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.3; + icon = PATHTOF(UI\team\team_green_ca.paa); + hotkey = "G"; + }; + class ACE_JoinTeamBlue { + displayName = CSTRING(JoinTeamBlue); + condition = QUOTE(true); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.2; + icon = PATHTOF(UI\team\team_blue_ca.paa); + hotkey = "B"; + }; + class ACE_JoinTeamYellow { + displayName = CSTRING(JoinTeamYellow); + condition = QUOTE(true); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + hotkey = "Y"; + }; + + class ACE_LeaveTeam { + displayName = CSTRING(LeaveTeam); + condition = QUOTE(assignedTeam _player != 'MAIN'); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.5; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "N"; + }; + class ACE_BecomeLeader { + displayName = CSTRING(BecomeLeader); + condition = QUOTE(_this call DFUNC(canBecomeLeader)); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE(_this call DFUNC(doBecomeLeader)); + showDisabled = 1; + priority = 1.0; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "L"; + }; + class ACE_LeaveGroup { + displayName = CSTRING(LeaveGroup); + condition = QUOTE(count (units group _player) > 1); + exceptions[] = {"isNotInside", "isNotSitting"}; + statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); + showDisabled = 1; + priority = 1.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + }; + }; + + class ACE_Gestures { + displayName = CSTRING(Gestures); + condition = "canStand _target"; + statement = ""; + showDisabled = 1; + priority = 3.5; + icon = PATHTOF(UI\gestures_ca.paa); + hotkey = "G"; + + /*class ACE_Gesture_Advance { + displayName = CSTRING(Gestures_Attack); + condition = "canStand _target"; + statement = "_target playActionNow 'gestureAttack';"; + showDisabled = 1; + priority = 2.0; + };*/ + class ACE_Gesture_Advance { + displayName = CSTRING(Gestures_Advance); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureAdvance';); + showDisabled = 1; + priority = 1.9; + hotkey = "1"; + }; + class ACE_Gesture_Go { + displayName = CSTRING(Gestures_Go); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); + showDisabled = 1; + priority = 1.8; + hotkey = "2"; + }; + class ACE_Gesture_Follow { + displayName = CSTRING(Gestures_Follow); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFollow';); + showDisabled = 1; + priority = 1.7; + hotkey = "3"; + }; + /*class ACE_Gesture_Point { + displayName = CSTRING(Gestures_Point); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gesturePoint';); + showDisabled = 1; + priority = 1.6; + };*/ + class ACE_Gesture_Up { + displayName = CSTRING(Gestures_Up); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureUp';); + showDisabled = 1; + priority = 1.5; + hotkey = "4"; + }; + class ACE_Gesture_Cover { + displayName = CSTRING(Gestures_Cover); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCover';); + showDisabled = 1; + priority = 1.4; + hotkey = "5"; + }; + class ACE_Gesture_CeaseFire { + displayName = CSTRING(Gestures_Cease_Fire); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCeaseFire';); + showDisabled = 1; + priority = 1.3; + hotkey = "6"; + }; + class ACE_Gesture_Freeze { + displayName = CSTRING(Gestures_Freeze); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFreeze';); + showDisabled = 1; + priority = 1.2; + hotkey = "7"; + }; + class ACE_Gesture_Yes { + displayName = CSTRING(Gestures_Yes); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); + showDisabled = 1; + priority = 1.1; + hotkey = "8"; + }; + class ACE_Gesture_No { + displayName = CSTRING(Gestures_No); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureNo';); + showDisabled = 1; + priority = 1.0; + hotkey = "9"; + }; + class ACE_Gesture_Hi { + displayName = CSTRING(Gestures_Hi); + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); + showDisabled = 1; + priority = 0.9; + hotkey = "0"; + }; + }; + + class ACE_Equipment { + displayName = CSTRING(Equipment); + condition = QUOTE(true); + exceptions[] = {"isNotInside","notOnMap", "isNotSitting"}; + statement = ""; + showDisabled = 1; + priority = 4.5; + icon = ""; // @todo + hotkey = "E"; + }; + }; + }; + + class LandVehicle; + class Car: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class Tank: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class Air; + class Helicopter: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class Plane: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class Ship; + class Ship_F: Ship { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 10; + condition = "true"; + + 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);); + showDisabled = 0; + priority = -1; + }; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = "gunnerview"; + distance = 2; + condition = "true"; + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = CSTRING(Passengers); + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class StaticMGWeapon: StaticWeapon {}; + class HMG_01_base_F: StaticMGWeapon {}; + class HMG_01_high_base_F: HMG_01_base_F { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[-0.172852,0.164063,-0.476091]"; + }; }; - class ACE_AssignTeamGreen { - displayName = "$STR_ACE_Interaction_AssignTeamGreen"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_green_ca.paa); - priority = 2.3; - hotkey = "G"; + }; + class AA_01_base_F: StaticMGWeapon { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0.515869,-0.200671]"; + }; }; - class ACE_AssignTeamBlue { - displayName = "$STR_ACE_Interaction_AssignTeamBlue"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_blue_ca.paa); - priority = 2.2; - hotkey = "B"; + }; + class AT_01_base_F: StaticMGWeapon { + class ACE_Actions: ACE_Actions { + class ACE_MainActions: ACE_MainActions { + position = "[0,0.515869,-0.200671]"; + }; }; - class ACE_AssignTeamYellow { - displayName = "$STR_ACE_Interaction_AssignTeamYellow"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - priority = 2.1; - hotkey = "Y"; - }; - - class ACE_UnassignTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); - statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_white_ca.paa); - priority = 2.5; - hotkey = "N"; - }; - }; - - class ACE_JoinGroup { - displayName = "$STR_ACE_Interaction_JoinGroup"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); - statement = QUOTE([_player] joinSilent group _target); - showDisabled = 0; - priority = 2.6; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "J"; - }; - - class ACE_GetDown { - displayName = "$STR_ACE_Interaction_GetDown"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(getDown)); - showDisabled = 0; - priority = 2.2; - }; - class ACE_SendAway { - displayName = "$STR_ACE_Interaction_SendAway"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(sendAway)); - showDisabled = 0; - priority = 2.0; - }; - class ACE_Pardon { - displayName = "$STR_ACE_Interaction_Pardon"; - condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); - statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); - showDisabled = 0; - priority = 2.5; - }; - }; - class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; - selection = "spine3"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; - selection = "pilot"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; - selection = "LeftForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; - selection = "RightForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; - selection = "LKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; - selection = "RKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Weapon { - displayName = "$STR_ACE_Interaction_Weapon"; - position = QUOTE(call FUNC(getWeaponPos)); - distance = 1.50; - condition = ""; - statement = ""; - }; - - class ACE_TapShoulderRight { - displayName = "$STR_ACE_Interaction_TapShoulder"; - selection = "rightshoulder"; - distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); - }; - class ACE_TapShoulderLeft { - displayName = "$STR_ACE_Interaction_TapShoulder"; - selection = "leftshoulder"; - distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder)); - }; }; - class ACE_SelfActions { - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside"}; - statement = ""; - showDisabled = 1; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - - class ACE_JoinTeamRed { - displayName = "$STR_ACE_Interaction_JoinTeamRed"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.4; - icon = PATHTOF(UI\team\team_red_ca.paa); - hotkey = "R"; + class thingX; + class ReammoBox_F: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = CSTRING(MainAction); + selection = ""; + distance = 2; + condition = "true"; + class ACE_OpenBox { + displayName = CSTRING(OpenBox); + condition = QUOTE(alive _target); + statement = QUOTE(_player action [ARR_2(QUOTE(QUOTE(Gear)), _target)]); + showDisabled = 0; + priority = -1; + }; + }; }; - class ACE_JoinTeamGreen { - displayName = "$STR_ACE_Interaction_JoinTeamGreen"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.3; - icon = PATHTOF(UI\team\team_green_ca.paa); - hotkey = "G"; - }; - class ACE_JoinTeamBlue { - displayName = "$STR_ACE_Interaction_JoinTeamBlue"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.2; - icon = PATHTOF(UI\team\team_blue_ca.paa); - hotkey = "B"; - }; - class ACE_JoinTeamYellow { - displayName = "$STR_ACE_Interaction_JoinTeamYellow"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - hotkey = "Y"; - }; - - class ACE_LeaveTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.5; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "N"; - }; - class ACE_BecomeLeader { - displayName = "$STR_ACE_Interaction_BecomeLeader"; - condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_this call DFUNC(doBecomeLeader)); - showDisabled = 1; - priority = 1.0; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "L"; - }; - class ACE_LeaveGroup { - displayName = "$STR_ACE_Interaction_LeaveGroup"; - condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); - showDisabled = 1; - priority = 1.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - }; - }; - - class ACE_Gestures { - displayName = "$STR_ACE_Interaction_Gestures"; - condition = "canStand _target"; - statement = ""; - showDisabled = 1; - priority = 3.5; - icon = PATHTOF(UI\gestures_ca.paa); - hotkey = "G"; - - /*class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Attack"; - condition = "canStand _target"; - statement = "_target playActionNow 'gestureAttack';"; - showDisabled = 1; - priority = 2.0; - };*/ - class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Advance"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureAdvance';); - showDisabled = 1; - priority = 1.9; - hotkey = "1"; - }; - class ACE_Gesture_Go { - displayName = "$STR_ACE_Interaction_Gestures_Go"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); - showDisabled = 1; - priority = 1.8; - hotkey = "2"; - }; - class ACE_Gesture_Follow { - displayName = "$STR_ACE_Interaction_Gestures_Follow"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFollow';); - showDisabled = 1; - priority = 1.7; - hotkey = "3"; - }; - /*class ACE_Gesture_Point { - displayName = "$STR_ACE_Interaction_Gestures_Point"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gesturePoint';); - showDisabled = 1; - priority = 1.6; - };*/ - class ACE_Gesture_Up { - displayName = "$STR_ACE_Interaction_Gestures_Up"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureUp';); - showDisabled = 1; - priority = 1.5; - hotkey = "4"; - }; - class ACE_Gesture_Cover { - displayName = "$STR_ACE_Interaction_Gestures_Cover"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCover';); - showDisabled = 1; - priority = 1.4; - hotkey = "5"; - }; - class ACE_Gesture_CeaseFire { - displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCeaseFire';); - showDisabled = 1; - priority = 1.3; - hotkey = "6"; - }; - class ACE_Gesture_Freeze { - displayName = "$STR_ACE_Interaction_Gestures_Freeze"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFreeze';); - showDisabled = 1; - priority = 1.2; - hotkey = "7"; - }; - class ACE_Gesture_Yes { - displayName = "$STR_ACE_Interaction_Gestures_Yes"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); - showDisabled = 1; - priority = 1.1; - hotkey = "8"; - }; - class ACE_Gesture_No { - displayName = "$STR_ACE_Interaction_Gestures_No"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureNo';); - showDisabled = 1; - priority = 1.0; - hotkey = "9"; - }; - class ACE_Gesture_Hi { - displayName = "$STR_ACE_Interaction_Gestures_Hi"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); - showDisabled = 1; - priority = 0.9; - hotkey = "0"; - }; - }; - - class ACE_Equipment { - displayName = "$STR_ACE_Interaction_Equipment"; - condition = QUOTE(true); - exceptions[] = {"isNotInside","notOnMap"}; - statement = ""; - showDisabled = 1; - priority = 4.5; - icon = ""; // @todo - hotkey = "E"; - }; + class ACE_SelfActions {}; }; - }; - - class LandVehicle; - class Car: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Tank: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class Air; - class Helicopter: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Plane: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class Ship; - class Ship_F: Ship { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - - class ACE_Push { - displayName = "$STR_ACE_Interaction_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);); - showDisabled = 0; - priority = -1; - }; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class StaticWeapon: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = "gunnerview"; - distance = 2; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class thingX; - class ReammoBox_F: thingX { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 2; - condition = "true"; - }; - }; - class ACE_SelfActions {}; - }; - }; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index 38f12066e0..8359ee560a 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -1,46 +1,44 @@ - #define HSPACE 0.5-2.0/16/2 #define VSPACE 0.5-0.3/9/2 -class RscStructuredText; class ACE_Interaction_Button_Base { - tooltip = ""; - //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; - action = ""; + tooltip = ""; + //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; + action = ""; - idc = -1; - access = 0; - type = 1; - text = ""; - font = "PuristaMedium"; - sizeEx = "0.8 / 40 / (getResolution select 5)"; - shadow = 2; + idc = -1; + access = 0; + type = 1; + text = ""; + font = "PuristaMedium"; + sizeEx = "0.8 / 40 / (getResolution select 5)"; + shadow = 2; - style = 2; - x = 0; - y = 0; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; + style = 2; + x = 0; + y = 0; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; - offsetX = 0.003; - offsetY = 0.003; - offsetPressedX = 0.002; - offsetPressedY = 0.002; - borderSize = 0; + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + borderSize = 0; - colorText[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,1}; - colorBackground[] = {0,0,0,0.8}; - colorBackgroundDisabled[] = {0,0,0,0.8}; - colorBackgroundActive[] = {1,1,1,0}; - colorFocused[] = {1,1,1,1}; - colorShadow[] = {0,0,0,0}; - colorBorder[] = {1,1,1,0.8}; + colorText[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,1}; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundDisabled[] = {0,0,0,0.8}; + colorBackgroundActive[] = {1,1,1,0}; + colorFocused[] = {1,1,1,1}; + colorShadow[] = {0,0,0,0}; + colorBorder[] = {1,1,1,0.8}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; }; class RscListbox; @@ -49,86 +47,86 @@ class RscText; #define X_OFFSET 0.2 class RscACE_SelectAnItem { - idd = 8854; - movingEnable = 0; - class controls { - class back:IGUIBack { - x = X_OFFSET; - y = 0; - w = 0.6; - h = 0.71; - colorBackground[] = {0, 0, 0, 0.2}; - }; - class header: RscText{ - idc = 8870; - x = X_OFFSET + 0.005; - y = 0.005; - w = 0.59; - h = 0.05; - style = 0x02; - text = ""; - }; - class itemList:RscListBox { - onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; - idc = 8866; - x = X_OFFSET + 0.005; - w = 0.59; - h = 0.54; - y = 0.06; - }; + idd = 8854; + movingEnable = 0; + class controls { + class back:IGUIBack { + x = X_OFFSET; + y = 0; + w = 0.6; + h = 0.71; + colorBackground[] = {0, 0, 0, 0.2}; + }; + class header: RscText{ + idc = 8870; + x = X_OFFSET + 0.005; + y = 0.005; + w = 0.59; + h = 0.05; + style = 0x02; + text = ""; + }; + class itemList:RscListBox { + onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; + idc = 8866; + x = X_OFFSET + 0.005; + w = 0.59; + h = 0.54; + y = 0.06; + }; - class cancelBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - }; - class approveBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - }; + class cancelBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + }; + class approveBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + }; - class cancelBtn: ACE_Interaction_Button_Base { - idc = 8855; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - style = 2; - text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; + class cancelBtn: ACE_Interaction_Button_Base { + idc = 8855; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + style = 2; + text = CSTRING(Back); + action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; + class approveBtn: ACE_Interaction_Button_Base { + idc = 8860; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + style = 2; + text = CSTRING(MakeSelection); + action = "call ACE_Interaction_fnc_hideMenu;"; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; }; - class approveBtn: ACE_Interaction_Button_Base { - idc = 8860; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - style = 2; - text = $STR_ACE_Interaction_MakeSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; - }; - }; }; #define GUI_GRID_W (0.025) @@ -136,64 +134,64 @@ class RscACE_SelectAnItem { class RscPicture; class RscInteractionIcon: RscPicture { - x = 19.25 * GUI_GRID_W; - y = 15.75 * GUI_GRID_H; - w = 2*GUI_GRID_H; - h = 2*GUI_GRID_H; + x = 19.25 * GUI_GRID_W; + y = 15.75 * GUI_GRID_H; + w = 2*GUI_GRID_H; + h = 2*GUI_GRID_H; }; class RscInteractionHelperIcon: RscInteractionIcon { - x = 20 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = GUI_GRID_H; - h = GUI_GRID_H; + x = 20 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = GUI_GRID_H; + h = GUI_GRID_H; }; class RscInteractionText: RscText{ - x = 21 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = 8 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; + x = 21 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = 8 * GUI_GRID_W; + h = 1.5 * GUI_GRID_H; }; class RscTitles { - class GVAR(InteractionHelper) { - idd = 9930; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0.5; - fadeOut=0.5; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; + class GVAR(InteractionHelper) { + idd = 9930; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0.5; + fadeOut=0.5; + duration = 10e10; + onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; - class controls { - class SelectIcon: RscInteractionHelperIcon{ - idc = 1200; - text = PATHTOF(UI\mouse_left_ca.paa); - y = 17.5 * GUI_GRID_H; - }; - class SelectText: RscInteractionText{ - idc = 1000; - y = 17 * GUI_GRID_H; - text = $STR_ACE_Interaction_MakeSelection; - }; - class GoBackIcon: RscInteractionHelperIcon{ - idc = 1201; - text = PATHTOF(UI\mouse_right_ca.paa); - y = 19.5 * GUI_GRID_H; - }; - class GoBackText: RscInteractionText{ - idc = 1001; - y = 19 * GUI_GRID_H; - text = $STR_ACE_Interaction_Back; - }; - class ScrollIcon: RscInteractionHelperIcon{ - idc = 1202; - text = PATHTOF(UI\mouse_scroll_ca.paa); - y = 18.5 * GUI_GRID_H; - }; - class ScrollText: RscInteractionText{ - idc = 1002; - y = 18 * GUI_GRID_H; - text = $STR_ACE_Interaction_ScrollHint; - }; + class controls { + class SelectIcon: RscInteractionHelperIcon{ + idc = 1200; + text = PATHTOF(UI\mouse_left_ca.paa); + y = 17.5 * GUI_GRID_H; + }; + class SelectText: RscInteractionText{ + idc = 1000; + y = 17 * GUI_GRID_H; + text = CSTRING(MakeSelection); + }; + class GoBackIcon: RscInteractionHelperIcon{ + idc = 1201; + text = PATHTOF(UI\mouse_right_ca.paa); + y = 19.5 * GUI_GRID_H; + }; + class GoBackText: RscInteractionText{ + idc = 1001; + y = 19 * GUI_GRID_H; + text = CSTRING(Back); + }; + class ScrollIcon: RscInteractionHelperIcon{ + idc = 1202; + text = PATHTOF(UI\mouse_scroll_ca.paa); + y = 18.5 * GUI_GRID_H; + }; + class ScrollText: RscInteractionText{ + idc = 1002; + y = 18 * GUI_GRID_H; + text = CSTRING(ScrollHint); + }; + }; }; - }; }; diff --git a/addons/interaction/README.md b/addons/interaction/README.md index 92401b2547..8e841e9a58 100644 --- a/addons/interaction/README.md +++ b/addons/interaction/README.md @@ -3,7 +3,6 @@ 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 6417043df2..7fe151dac1 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -15,6 +15,7 @@ if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; // restore global fire teams for JIP +private ["_team"]; { _team = _x getVariable [QGVAR(assignedFireTeam), ""]; if (_team != "") then {_x assignTeam _team}; @@ -22,7 +23,7 @@ GVAR(isOpeningDoor) = false; // Add keybinds -["ACE3 Common", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", +["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -42,7 +43,7 @@ GVAR(isOpeningDoor) = false; [57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space -["ACE3 Common", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder", +["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -50,13 +51,13 @@ GVAR(isOpeningDoor) = false; if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; // Statement - [ACE_player, cursorTarget] call FUNC(tapShoulder); + [ACE_player, cursorTarget, 0] call FUNC(tapShoulder); true }, {false}, [20, [true, false, false]], false] call cba_fnc_addKeybind; -["ACE3 Common", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", +["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey), { // Conditions: canInteract //if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index cfca73a90b..0afb2fc0fe 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -1,26 +1,19 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interact_menu"}; - author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; - authorUrl = "https://github.com/commy2/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interact_menu"}; + author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; }; #include "CfgEventHandlers.hpp" - #include "CfgVehicles.hpp" - -#include - -class ACE_Settings { - class GVAR(EnableTeamManagement) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "Menu_Config.hpp" +#include "ACE_Settings.hpp" +#include "ACE_ZeusActions.hpp" diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_AddSelectableItem.sqf deleted file mode 100644 index 498b852635..0000000000 --- a/addons/interaction/functions/fnc_AddSelectableItem.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - Author: Garth de Wet (LH) - - Description: - Adds an item to the select menu - - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data - - Returns: - ARRAY/Number - - Example: -*/ - -#include "script_component.hpp" - -private ["_container", "_displayName", "_picture", "_data", "_index"]; - -_container = _this select 0; -_displayName = _this select 1; -_picture = _this select 2; -_data = _this select 3; - -if (_picture == "" || _picture == "PictureThing") then { - _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); -}; - -_index = lbAdd [_container, _displayName]; -lbSetData [_container, _index, str _data]; -lbSetPicture [_container, _index, _picture]; - -_container diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 82e3b3b4fb..d7e21d4a7b 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Mount unit actions inside passenger submenu * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,14 +10,17 @@ * Return value: * Children actions * + * Example: + * array = [target, player, [params]] call ace_interaction_fnc_addPassengerAction + * * Public: No */ #include "script_component.hpp" EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); +EXPLODE_1_PVT(_parameters,_unit); -private ["_unit","_actions"]; -_unit = _parameters select 0; +private ["_varName", "_actionTrees", "_actions"]; _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; _actionTrees = missionNamespace getVariable [_varName, []]; diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index c446be3737..fe557e7ada 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Create one action per passenger * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,6 +10,9 @@ * Return value: * Children actions * + * Example: + * [target, player, [params]] call ace_interaction_fnc_addPassengersActions + * * Public: No */ #include "script_component.hpp" @@ -20,14 +23,24 @@ private ["_actions"]; _actions = []; { + private ["_unit", "_icon"]; _unit = _x; - if (_x != _player) then { + if ((_unit != _player) && {(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"}) then { + _icon = switch _unit do { + case (driver _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa) }; + case (gunner _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa) }; + case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) }; + default { "" }; + }; + if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then { + _icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa)); + }; _actions pushBack [ [ str(_unit), [_unit, true] call EFUNC(common,getName), - "", + _icon, {}, {true}, {_this call FUNC(addPassengerActions);}, @@ -39,4 +52,4 @@ _actions = []; }; } forEach crew _vehicle; -_actions \ No newline at end of file +_actions diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf new file mode 100644 index 0000000000..74a0e9caea --- /dev/null +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -0,0 +1,32 @@ +/* + * Author: Garth de Wet (LH) + * Adds an item to the select menu + * + * Arguments: + * 0: List container + * 1: Display name + * 2: Picture + * 3: Data + * + * Return value: + * Container + * + * Example: + * [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_4(_container,_displayName,_picture,_data); + +if (_picture == "" || _picture == "PictureThing") then { + _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); +}; + +private ["_index"]; +_index = lbAdd [_container, _displayName]; +lbSetData [_container, _index, str _data]; +lbSetPicture [_container, _index, _picture]; + +_container diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index be35b34877..8aa57d5923 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -1,8 +1,21 @@ -// by commy2 - +/* + * Author: commy2 + * Applies buttons + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_applyButtons + * + * Public: No + */ #include "script_component.hpp" -private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; +private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"]; _object = GVAR(Target); _actions = GVAR(Buttons); diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 11234ad6d7..1821e41506 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -3,11 +3,11 @@ * Test if can Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: - * + * Able to become leader of group * * Example: * [player, player] call ace_interaction_fnc_canBecomeLeader diff --git a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf index 6408d66aa8..c20ac61f94 100644 --- a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -1,5 +1,18 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can interact with civilian + * + * Arguments: + * 0: Target + * + * Return value: + * Able to interact with civilian + * + * Example: + * [target] call ace_interaction_fnc_canInteractWithCivilian + * + * Public: No + */ #include "script_component.hpp" EXPLODE_2_PVT(_this,_unit,_isCivilian); @@ -8,4 +21,4 @@ if (isNil "_isCivilian") then {_isCivilian = true}; alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} \ No newline at end of file +//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index d299524925..315da658db 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -1,10 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a group + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a group + * + * Example: + * [player, target] call ace_interaction_fnc_canJoinGroup + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 45f96393a9..b91a5abd5c 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -1,10 +1,22 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a team + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a team + * + * Example: + * [player, target] call ace_interaction_fnc_canJoinTeam + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 4ea9836117..bbeee51b4a 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -1,11 +1,22 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can tap a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to tap a shoulder + * + * Example: + * [player, target] call ace_interaction_fnc_canTapShoulder + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); _target isKindOf "CAManBase" && {alive _target} && diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 24bfa66c11..0fd81cbc96 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -3,8 +3,8 @@ * Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: * None diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 91c2161d9f..a085c9a3b8 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,9 +1,25 @@ -// by commy2 +/* + * Author: commy2 + * Get door + * + * Arguments: + * 0: Distance + * + * Return value: + * House objects and door + * 0: House + * 1: Door Name + * + * Example: + * [player, target] call ace_interaction_fnc_getDoor + * + * Public: No + */ #include "script_component.hpp" -private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; +PARAMS_1(_distance); -_distance = _this select 0; +private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"]; _position0 = positionCameraToWorld [0, 0, 0]; _position1 = positionCameraToWorld [0, 0, _distance]; @@ -22,4 +38,5 @@ _intersections = [_house, "GEOM"] intersect [_position0, _position1]; _door = _intersections select 0 select 0; if (isNil "_door") exitWith {[_house, ""]}; + [_house, _door] diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ca59ec177c..0de74e61ed 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,10 +1,26 @@ -// by commy2 +/* + * Author: commy2 + * Get door animations + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * Animation and Locked variable + * 0: Animation + * 1: Locked variable + * + * Example: + * array = [target, "door"] call ace_interaction_fnc_getDoorAnimations + * + * Public: No + */ #include "script_component.hpp" -private ["_house", "_door", "_animations", "_lockedVariable"]; +PARAMS_2(_house,_door); -_house = _this select 0; -_door = _this select 1; +private ["_index", "_animations", "_lockedVariable"]; _index = [ "door_1", diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index ead5dcd290..09d651eadf 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -1,21 +1,25 @@ /* * Author: KoffeinFlummi - * - * Forces a civilian to the ground. (chance of failure). + * Forces a civilian to the ground (with a chance of failure) * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none + * None + * + * Example: + * [target] call ace_interaction_fnc_getDown + * + * Public: No */ #include "script_component.hpp" #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; // put something else here. @@ -31,4 +35,4 @@ if (count (weapons ACE_player) > 0) then { _this setUnitPos "DOWN"; }, _x] call CBA_fnc_globalExecute; }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_getSelectedButton.sqf b/addons/interaction/functions/fnc_getSelectedButton.sqf index d1c801e1dc..92768b67f7 100644 --- a/addons/interaction/functions/fnc_getSelectedButton.sqf +++ b/addons/interaction/functions/fnc_getSelectedButton.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Get selected button + * + * Arguments: + * None + * + * Return value: + * Angle + * + * Example: + * call ace_interaction_fnc_getSelectedButton + * + * Public: No + */ #include "script_component.hpp" #define MIN_DISTANCE 0.0065 diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 477e74f9bf..58c8756076 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -2,18 +2,21 @@ * Author: esteldunedain * Return a suitable position for the action point for the current weapon * - * Argument: - * None + * Arguments: + * None (uses local variable _target) * * Return value: * Children actions * + * Example: + * call ace_interaction_fnc_getWeaponPos + * * Public: No */ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_target); -private ["_weaponDir","_refSystem"]; +private ["_weaponDir", "_refSystem"]; _weaponDir = _target weaponDirection currentWeapon _target; _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf index 54263ef032..89dc49be40 100644 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -1,22 +1,22 @@ /* - Author: Garth de Wet (LH) - - Description: - Closes the Interaction menu - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMenu); -*/ + * Author: Garth de Wet (LH) + * Closes the Interaction menu + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMenu + * + * Public: No + */ #include "script_component.hpp" closeDialog 0; (findDisplay 1713999) closeDisplay 1; (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; GVAR(MainButton) = nil; -call FUNC(hideMouseHint); \ No newline at end of file +call FUNC(hideMouseHint); diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index d910352076..69acba25a2 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -1,22 +1,21 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMouseHint); -*/ + * Author: Garth de Wet (LH) + * Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMouseHint + * + * Public: No + */ #include "script_component.hpp" if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -showHUD true; \ No newline at end of file +showHUD true; diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 5048b66001..49ac391871 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -1,21 +1,24 @@ /* * Author: commy2 - * * Check if the vehicle is in range of the player. * - * Argument: - * 0: Vehicke (Object) - * 1: Distance in meters (Number) + * Arguments: + * 0: Vehicle + * 1: Distance in meters * * Return value: - * (Bool) + * Vehicle in range of player + * + * Example: + * [target, 5] call ace_interaction_fnc_isInRange + * + * Public: No */ #include "script_component.hpp" -private ["_vehicle", "_distance", "_player"]; +PARAMS_2(_vehicle,_distance); -_vehicle = _this select 0; -_distance = _this select 1; +private ["_player", "_position0", "_position1"]; _player = ACE_player; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 2e4d1f2898..c2a542d4af 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -1,20 +1,34 @@ -// by commy2 +/* + * Author: commy2 + * Assigns a unit to the team + * + * Arguments: + * 0: Unit + * 1: Team + * + * Return value: + * None + * + * Example: + * [target, "YELLOW"] call ace_interaction_fnc_joinTeam + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_team", "_message"]; +PARAMS_2(_unit,_team); -_unit = _this select 0; -_team = _this select 1; +private ["_message"]; _unit setVariable [QGVAR(assignedFireTeam), _team, true]; [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); if (_unit == ACE_player) then { _message = if (_team == "MAIN") then { - localize "STR_ACE_Interaction_LeftTeam"; + localize LSTRING(LeftTeam); } else { - _team = localize format ["STR_ACE_Interaction_Team%1", _team]; - format [localize "STR_ACE_Interaction_JoinedTeam", _team]; + _team = localize format [LSTRING(Team%1), _team]; + format [localize LSTRING(JoinedTeam), _team]; }; [_message] call EFUNC(common,displayTextStructured); diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 37b7bacba5..bd02093aa0 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -1,16 +1,24 @@ /* * Author: bux578 - * - * Initializes the Interaction module. + * Initializes the Interaction module * * Arguments: - * Whatever the module provides. (I dunno.) + * 0: Logic + * 1: ??? + * 2: Activation State * - * Return Value: + * Return value: * None + * + * Example: + * [logic, ???, activationState] call ace_interaction_fnc_moduleInteraction + * + * Public: No */ #include "script_component.hpp" +private ["_logic", "_activated"]; + _logic = _this select 0; _activated = _this select 2; diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf similarity index 81% rename from addons/interaction/functions/fnc_MoveDown.sqf rename to addons/interaction/functions/fnc_moveDown.sqf index eac30e4008..235f12fb1f 100644 --- a/addons/interaction/functions/fnc_MoveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -1,21 +1,22 @@ /* - Author: Garth de Wet (LH) - - Description: - Depending on the passed value, either scrolls down through the list or up. - - Parameters: - NUMBER - Amount to increase current interaction target - - Returns: - Nothing - - Example: - 1 call FUNC(MoveDown); - -1 call FUNC(MoveDown); -*/ + * Author: Garth de Wet (LH) + * Scrolls through the list down or up + * + * Arguments: + * 0: Amount + * + * Return value: + * None + * + * Example: + * [2] call ace_interaction_fnc_moveDown + * + * Public: No + */ #include "script_component.hpp" +private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText", "_target"]; + #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) if (isNil QGVAR(MainButton)) exitWith{}; if (isNil QGVAR(Buttons)) exitWith{}; diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index cee524c55f..da1b55b613 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -1,7 +1,21 @@ -// by commy2 +/* + * Author: commy2 + * On button up + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onButtonUp + * + * Public: No + */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -20,11 +34,9 @@ _action = if (_index != -1 && {_index < _count}) then { closeDialog 0; - _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; -_exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 29fffb8b94..a240823710 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -1,6 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * On click + * + * Arguments: + * Index + * + * Return value: + * None + * + * Example: + * 5 call ace_interaction_fnc_onClick + * + * Public: No + */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -29,7 +43,6 @@ if (count _subMenu < 2) then { _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; - _exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf index 25d307a2eb..18b69ba40d 100644 --- a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf +++ b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf @@ -1,4 +1,18 @@ -// by CorruptedHeart, commy2 +/* + * Author: CorruptedHeart, commy2 + * On select menu double click + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onSelectMenuDblClick + * + * Public: No + */ #include "script_component.hpp" call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index e175e752cb..db808e2eba 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -1,19 +1,32 @@ -// by commy2 +/* + * Author: commy2 + * Opens door + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * None + * + * Example: + * [house, "door"] call ace_interaction_fnc_openDoor + * + * Public: No + */ #include "script_component.hpp" -private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; +private ["_info", "_phase", "_position", "_time", "_usedMouseWheel", "_getDoorAnimations"]; _info = [2] call FUNC(getDoor); -_house = _info select 0; -_door = _info select 1; +EXPLODE_2_PVT(_info,_house,_door); if (isNull _house) exitWith {}; -_animations = [_house, _door] call FUNC(getDoorAnimations); +_getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations); -_lockedVariable = _animations select 1; -_animations = _animations select 0; +EXPLODE_2_PVT(_getDoorAnimations,_animations,_lockedVariable); if (count _animations == 0) exitWith {}; @@ -26,13 +39,14 @@ GVAR(isOpeningDoor) = true; playSound "ACE_Sound_Click"; [_house, _animations] spawn { + private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; _house = _this select 0; _animations = _this select 1; _phase = _house animationPhase (_animations select 0); _position = getPosASL ACE_player; - _time = time + 0.2; + _time = ACE_time + 0.2; _usedMouseWheel = false; waitUntil { if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then { @@ -47,7 +61,7 @@ playSound "ACE_Sound_Click"; !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} }; - if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { + if (!_usedMouseWheel && {ACE_time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then { _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); {_house animate [_x, _phase]} forEach _animations; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index a13fa6a9f0..6141e839b8 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -1,44 +1,57 @@ -// by commy2 +/* + * Author: commy2 + * Opens menu select UI + * + * Arguments: + * 0: Unit + * 1: Vehicle + * + * Return value: + * None + * + * Example: + * [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI + * + * Public: No + */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_cargo"]; +PARAMS_2(_unit,_vehicle); -_unit = _this select 0; -_vehicle = _this select 1; +private ["_cargo", "_actions"]; -// allow interaction with all cargo slots and all ffv slots +// Allow interaction with all cargo slots and all FFV slots _cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew); -// you can only interact if you are in cargo or ffv yourself. exit otherwise +// You can only interact if you are in cargo or FFV yourself. exit otherwise if !(_unit in _cargo) exitWith {}; GVAR(InteractionMenu_Crew) = _cargo; -// prepare: add header and "OK" button to select menu -private "_actions"; -_actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu); +// Prepare: add header and "OK" button to select menu +_actions = [localize LSTRING(InteractionMenu), localize LSTRING(Interact)] call FUNC(prepareSelectMenu); -// prepare: add all cargo units as options to select menu +// Prepare: add all cargo units as options to select menu { - if (_x != _unit) then { - _actions = [ - _actions, - [_x] call EFUNC(common,getName), - QUOTE(PATHTOF(UI\dot_ca.paa)), - _forEachIndex - ] call FUNC(AddSelectableItem); - }; + if (_x != _unit) then { + _actions = [ + _actions, + [_x] call EFUNC(common,getName), + QUOTE(PATHTOF(UI\dot_ca.paa)), + _forEachIndex + ] call FUNC(addSelectableItem); + }; } forEach _cargo; -// open select menu +// Open select menu [ - _actions, - { - call FUNC(hideMenu); - [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); - GVAR(InteractionMenu_Crew) = nil; - }, - { - call FUNC(hideMenu); - } + _actions, + { + call FUNC(hideMenu); + [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); + GVAR(InteractionMenu_Crew) = nil; + }, + { + call FUNC(hideMenu); + } ] call FUNC(openSelectMenu); diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index de5459f88c..6e42d3af47 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -1,36 +1,42 @@ /* - Author: Garth de Wet (LH) - - Description: - Opens the select menu UI and sets up the UI - - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing - - Example: -*/ + * Author: Garth de Wet (LH) + * Opens the select menu UI and sets up the UI + * + * Arguments: + * 0: Items + * 0: Text + * 1: Statement to execute + * 2: Condition before execute + * 3: showDisabled + * 4: Priority + * 5: Icon + * 6: Extra variables passed to the code + * 1: Select Action + * 2: Cancel Action + * + * Return value: + * None + * + * Example: + * [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu + * + * Public: No + */ #include "script_component.hpp" +private["_action", "_count", "_customActions", "_i"]; + if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { GVAR(SelectAccept) = _this select 1; GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept lbSetCurSel [8866, 0]; }else{ - _customActions = _this select 0; + PARAMS_1(_customActions); + + private ["_count", "_action"]; + _count = count _customActions; if (_count == 0) exitWith {}; _customActions call FUNC(sortOptionsByPriority); diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 593f0d4c47..f42d95b75b 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -1,28 +1,29 @@ /* - Author: Garth de Wet (LH) - - Description: - Prepares the select menu for use. - - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text - - Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. - - Example: - ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); -*/ + * Author: Garth de Wet (LH) + * Prepares the select menu for use + * + * Arguments: + * 0: Header Text + * 1: Approve Button Text + * + * Return value: + * Container object + * + * Example: + * array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu + * + * Public: No + */ #include "script_component.hpp" -private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; +PARAMS_2(_header,_buttonText); + closeDialog 0; -_header = _this select 0; -_buttonText = _this select 1; + if (isNil "_buttonText" or {_buttonText == ""}) then { - _buttonText = localize "STR_ACE_Interaction_MakeSelection"; + _buttonText = localize LSTRING(MakeSelection); }; + createDialog "RscACE_SelectAnItem"; ctrlSetText [8860, _buttonText]; ctrlSetText [8870, _header]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index f52a9d40de..946a5118be 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -1,22 +1,26 @@ /* * Author: KoffeinFlummi - * - * Pushes a boat away from the player. + * Pushes a boat away from the player * * Arguments: - * 0: Boat (object) - * 1: Velocity (vectorlike array) + * 0: Boat + * 1: Velocity * * Return Value: * None + * + * Example: + * [target, [vector]] call ace_interaction_fnc_push + * + * Public: No */ + #include "script_component.hpp" -_boat = _this select 0; -_velocity = _this select 1; +PARAMS_2(_boat,_velocity); if !(local _boat) exitWith { - [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); }; _boat setVelocity _velocity; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 0894520149..b70f04ec99 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -1,7 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Removes tag + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_removeTag + * + * Public: No + */ #include "script_component.hpp" 0 spawn { + private ["_index", "_name"]; + waitUntil {player getVariable ["ACE_Name", ""] != ""}; _name = player getVariable ["ACE_Name", ""]; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 5cd6a9d43a..0dd106de08 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -1,36 +1,40 @@ /* * Author: KoffeinFlummi - * - * Sends a civilian crowd away (chance of failure). + * Sends a civilian crowd away with a chance of failure * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none -*/ + * None + * + * Example: + * [target] call ace_interaction_fnc_sendAway + * + * Public: No + */ #include "script_component.hpp" #define DISTANCE 50 #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; if (count weapons ACE_player > 0) then { - _chance = 0.8; + _chance = 0.8; } else { - _chance = 0.5; + _chance = 0.5; }; { - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - (_this select 0) setUnitPos "AUTO"; - (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; - }, [_x, ACE_player]] call CBA_fnc_globalExecute; - }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + (_this select 0) setUnitPos "AUTO"; + (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; + }, [_x, ACE_player]] call CBA_fnc_globalExecute; + }; +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 5cb96a0eae..e3a9b45f94 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,28 +1,28 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text - - Returns: - Nothing - - Example: - ["Place Explosive", "Cancel"] call FUNC(showMouseHint); -*/ + * Author: Garth de Wet (LH) + * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * 0: Left Click Text + * 1: Right Click Text + * 2: Scroll Text (Optional) + * + * Return value: + * None + * + * Example: + * ["Place Explosive", "Cancel"] call ace_interaction_fnc_showMouseHint + * + * Public: No + */ #include "script_component.hpp" #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -private ["_leftClick", "_rightClick", "_scroll"]; -_leftClick = _this select 0; -_rightClick = _this select 1; + +private ["_scroll", "_display"]; + +PARAMS_2(_leftClick,_rightClick); _scroll = ""; if (count _this > 2) then { _scroll = _this select 2; @@ -44,11 +44,10 @@ if (isNull _display) exitWith{}; if (_scroll == "") exitWith { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; - - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; }; (_display displayCtrl 1002) ctrlSetText _scroll; -showHUD false; \ No newline at end of file +showHUD false; diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf index 28daa4e7e5..05a4f3bad4 100644 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Sort options by priority + * + * Arguments: + * Actions + * + * Return value: + * None + * + * Example: + * customActions call ace_interaction_fnc_sortOptionsByPriority + * + * Public: No + */ #include "script_component.hpp" private ["_actions", "_count", "_index", "_actionN", "_actionM"]; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 11fc6b7881..b8bb591c6d 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -1,7 +1,23 @@ -// by commy2 +/* + * Author: commy2 + * Taps a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * 2: Shoulder which was tapped + * + * Return value: + * None + * + * Example: + * [player, target] call ace_interaction_fnc_tapShoulder + * + * Public: No + */ #include "script_component.hpp" -EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); +PARAMS_3(_tapper,_target,_shoulderNum); if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; @@ -13,12 +29,12 @@ if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; -private "_message"; +private ["_message"]; //localize is converting the escaped <> symbols, so just add them here instead of in the stringtable if (_shoulderNum == 0) then { - _message = format ["%1 >", (localize "STR_ACE_Interaction_YouWereTappedRight")]; + _message = format ["%1 >", (localize LSTRING(YouWereTappedRight))]; } else { - _message = format ["< %1", (localize "STR_ACE_Interaction_YouWereTappedLeft")]; + _message = format ["< %1", (localize LSTRING(YouWereTappedLeft))]; }; [parseText _message] call EFUNC(common,displayTextStructured); diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index 27148c5aa3..93acd6d203 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -1,12 +1,32 @@ -// by commy2 +/* + * Author: commy2 + * Updates tooltip's position + * + * Arguments: + * 0: Tooltip Display + * 1: X Coordinate + * 2: Y Coordinate + * + * Return value: + * None + * + * Example: + * [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition + * + * Public: No + */ #include "script_component.hpp" +PARAMS_3(_tooltip,_coordinateX,_coordinateY); + +private["_ctrl"]; + disableSerialization; -_ctrl = ctrlParent (_this select 0) displayCtrl 40; +_ctrl = ctrlParent _tooltip displayCtrl 40; _ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, + _coordinateX + 0.01 * safezoneW, + _coordinateY + 0.01 * safezoneH, 2.0 / 16 * safezoneW, 0.3 / 9 * safezoneH ]; diff --git a/addons/interaction/script_component.hpp b/addons/interaction/script_component.hpp index caa87ce3ce..68f22e96d7 100644 --- a/addons/interaction/script_component.hpp +++ b/addons/interaction/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT interaction -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_INTERACTION #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INTERACTION #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index cc34994031..7b20dde7c0 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -77,7 +77,7 @@ Right Leg Rechtes Bein Pierna derecha - Pravá hona + Pravá noha Prawa noga Jambe droite Правая нога @@ -111,7 +111,7 @@ Interaction Menu (Self) - Interaktionsmenü (Selbst) + Interaktionsmenü (selbst) Menú de interacción (Propio) Menu interakcji (własne) Menu interakce (vlastní) @@ -119,7 +119,7 @@ Меню взаимодействия (с собой) Cselekvő menü (saját) Menu de Interação (Individual) - Menù interazione (Individuale) + Menù interazione (individuale) Open / Close Door @@ -263,7 +263,7 @@ Жесты Kézjelek Gestos - Segnali gestuali + Gesti Attack @@ -443,7 +443,7 @@ Někdo tě poklepal na PRAVÉ rameno Вас похлопали по ПРАВОМУ плечу Você foi tocado no ombro - Ti è stato dato un colpetto sulla spalla + Ti è stato dato un colpetto sulla spalla destra You were tapped on the LEFT shoulder. @@ -455,7 +455,7 @@ Někdo tě poklepal na LEVÉ rameno Вас похлопали по ЛЕВОМУ плечу Você foi tocado no ombro. - Ti è stato dato un colpetto sulla spalla + Ti è stato dato un colpetto sulla spalla sinistra Cancel @@ -495,7 +495,7 @@ Get Down! - Auf Den Boden! + Auf den Boden! Al suelo! Padnij! K zemi! @@ -503,11 +503,11 @@ A földre! Ложись! Abaixe-se! - A Terra! + A terra! Team Management - Team Management + Gruppenverwaltung Gestión de equipo Gestion d'équipe Zarządzanie oddziałem @@ -522,7 +522,7 @@ Rot Rojo Rouge - Czerwony + Czerwonych Červený Красный Vermelha @@ -534,7 +534,7 @@ Grün Verde Vert - Zielony + Zielonych Zelený Зеленый Verde @@ -546,7 +546,7 @@ Blau Azul Bleu - Niebieski + Niebieskich Modrý Синий Azul @@ -558,7 +558,7 @@ Gelb Amarillo Jaune - Żółty + Żółtych Žlutý Жёлтый Amarela @@ -575,6 +575,7 @@ Přiřadit k červeným Назначить в Красную группу Assigner à rouge + Assegna al team rosso Assign Green @@ -586,6 +587,7 @@ Přiřadit k zeleným Назначить в Зеленую группу Assigner à vert + Assegna al team verde Assign Blue @@ -597,6 +599,7 @@ Přiřadit k modrým Назначить в Синюю группу Assigner à bleu + Assegna al team blu Assign Yellow @@ -608,6 +611,7 @@ Přiřadit ke žlutým Назначить в Желтую группу Assigner à jaune + Assegna al team giallo Join Red @@ -619,6 +623,7 @@ Připojit k červeným Присоединиться к Красной группе Rejoindre rouge + Unirsi al team rosso Join Green @@ -627,9 +632,10 @@ Dołącz do zielonych Entrar em Verde Belépés a Zöldbe - Připojit k zeleným + Připojit k zeleným Присоединиться к Зеленой группе Rejoindre vert + Unirsi al team verde Join Blue @@ -641,6 +647,7 @@ Připojit k modrým Присоединиться к Синей группе Rejoindre bleu + Unirsi al team blu Join Yellow @@ -652,13 +659,14 @@ 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 drużyny %1 + Dołączyłeś do %1 Připojil ses do %1 týmu Вы присоединились к группе %1 Você uniu-se à Equipe %1 @@ -683,7 +691,7 @@ Has dejado el equipo Tu as quitté l'équipe Opuściłeś drużynę - Opustil si tým + Opustil jsi tým Вы покинули группу Você deixou a Equipe Hai lasciato il team @@ -721,7 +729,7 @@ Tecla modificadora Клавиша-модификатор Tecla Modificadora - Modifica tasto + Tasto modifica Módosító billentyű Modifikátor @@ -735,7 +743,7 @@ Hatótávolságon kívül Poza zasięgiem Mimo dosah - Non in raggio + Fuori limite Equipment @@ -758,8 +766,8 @@ Odstrčit Tolás Толкать - Spingi Empurrar + Spingere Interact @@ -770,7 +778,7 @@ Interakcja Interactuar Cselekvés - Interagisci + Interagire Interagir @@ -785,5 +793,41 @@ Passeggeri Passageiros + + Open + Otwórz + Otevřít + + + 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. + - + \ No newline at end of file diff --git a/addons/inventory/ACE_Settings.hpp b/addons/inventory/ACE_Settings.hpp new file mode 100644 index 0000000000..87f2b59550 --- /dev/null +++ b/addons/inventory/ACE_Settings.hpp @@ -0,0 +1,10 @@ +class ACE_Settings { + class GVAR(inventoryDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(SettingName); + description = CSTRING(SettingDescription); + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; +}; \ No newline at end of file diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 622dacc624..1190525901 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -13,15 +13,4 @@ class CfgPatches { }; #include "RscDisplayInventory.hpp" - -class ACE_Settings { - class GVAR(inventoryDisplaySize) { - value = 0; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_Inventory_SettingName"; - description = "$STR_ACE_Inventory_SettingDescription"; - values[] = {"$str_medium", "$str_large", "$str_very_large"}; - }; -}; - +#include "ACE_Settings.hpp" diff --git a/addons/inventory/script_component.hpp b/addons/inventory/script_component.hpp index dd7c439c1a..248f324b36 100644 --- a/addons/inventory/script_component.hpp +++ b/addons/inventory/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT inventory -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_INVENTORY #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml index 6ad5ec0408..8272594df5 100644 --- a/addons/inventory/stringtable.xml +++ b/addons/inventory/stringtable.xml @@ -15,7 +15,7 @@ Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. - Im Regelfall wird die Inventargröße durch die Größe der Nutzeroberfläche bestimmt. Diese Einstellung erlaubt es das Inventar unter Ausschluss der Schriftgröße zu vergrößern. Dadurch können mehr Gegenstände angezeigt werden. + Im Regelfall wird die Inventargröße durch die Größe der Nutzeroberfläche bestimmt. Diese Einstellung erlaubt es, das Inventar unter Ausschluss der Schriftgröße zu vergrößern. Dadurch können mehr Gegenstände angezeigt werden. Normalmente la pantalla de inventario se escala por el tamaño de la interfaz de usuario. Esto permite ampliar el tamaño de la interfaz de usuario de inventario, pero no aumenta el tamaño de fuente, permitiendo mostrar más filas. Обычно, размер окна инвентаря зависит от размеров пользовательского интерфейса. Эта настройка позволяет увеличить размер окна инвентаря, не увеличивая размеры шрифтов, так что отображется большее количество строк. Normálně se velikost invetáře škáluje s velikostí UI. Toto nastavení dovoluje škálování velikost inventáře ale nežvětšuje velikost fontu. To dovoluje zobrazení více řad v inventáři. @@ -26,4 +26,4 @@ Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas. - + \ No newline at end of file diff --git a/addons/javelin/CfgMagazines.hpp b/addons/javelin/CfgMagazines.hpp new file mode 100644 index 0000000000..3053cf1fa1 --- /dev/null +++ b/addons/javelin/CfgMagazines.hpp @@ -0,0 +1,18 @@ +class CfgMagazines { + //Static Titan Magazine + class 5Rnd_GAT_missiles; + class 1Rnd_GAT_missiles: 5Rnd_GAT_missiles { + ammo = "ACE_Javelin_FGM148_static"; //from misssileGuidance, was "M_Titan_AT_static" + }; + + //Handheld Titan "AT" Magazine (Locking - "Anti-Tank") + class Titan_AA; + class Titan_AT: Titan_AA { + ammo = "ACE_Javelin_FGM148"; //from misssileGuidance, was "M_Titan_AT" + }; + + //Handheld Titan "AP" Magazine (SACLOS? "Anti-personal") + // class Titan_AP: Titan_AA { + //??? + // }; +}; diff --git a/addons/javelin/CfgVehicles.hpp b/addons/javelin/CfgVehicles.hpp index 48781036ad..1cd527089d 100644 --- a/addons/javelin/CfgVehicles.hpp +++ b/addons/javelin/CfgVehicles.hpp @@ -16,7 +16,7 @@ class CfgVehicles { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; @@ -29,12 +29,12 @@ class CfgVehicles { }; }; }; - class O_static_AT_F: AT_01_base_F { + class O_static_AT_F: AT_01_base_F { class Turrets : Turrets { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; @@ -47,12 +47,12 @@ class CfgVehicles { }; }; }; - class I_static_AT_F: AT_01_base_F { + class I_static_AT_F: AT_01_base_F { class Turrets : Turrets { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index 1bbf713b3b..75aaf7c332 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -38,7 +38,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_I_Titan_short_F: launch_Titan_short_base { + class launch_I_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); @@ -48,7 +48,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_O_Titan_short_F: launch_Titan_short_base { + class launch_O_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); @@ -59,7 +59,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_Titan_short_F: launch_Titan_short_base { + class launch_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); diff --git a/addons/javelin/config.cpp b/addons/javelin/config.cpp index cb76da0010..8dfc970902 100644 --- a/addons/javelin/config.cpp +++ b/addons/javelin/config.cpp @@ -14,4 +14,5 @@ class CfgPatches { #include "RscInGameUI.hpp" #include "CfgSounds.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" +#include "CfgMagazines.hpp" diff --git a/addons/javelin/functions/fnc_onOpticDraw.sqf b/addons/javelin/functions/fnc_onOpticDraw.sqf index 039484d1af..3e293fcb9c 100644 --- a/addons/javelin/functions/fnc_onOpticDraw.sqf +++ b/addons/javelin/functions/fnc_onOpticDraw.sqf @@ -7,7 +7,7 @@ TRACE_1("enter", _this); private["_apos", "_aposX", "_aposY", "_args", "_boundsInput", "_bpos", "_canFire", "_constraintBottom"]; private["_constraintLeft", "_constraintRight", "_constraintTop", "_currentTarget", "_fireDisabledEH"]; -private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; +private["_firedEH", "_fov", "_lastTick", "_lockTime", "_maxX", "_maxY", "_minX", "_minY", "_newTarget"]; private["_offsetX", "_offsetY", "_pos", "_randomLockInterval", "_randomPosWithinBounds", "_range"]; private["_runTime", "_soundTime", "_targetArray", "_zamerny", "_currentShooter"]; @@ -20,7 +20,7 @@ _currentShooter = (vehicle ACE_player); _args = uiNamespace getVariable[QGVAR(arguments), [] ]; if( (count _args) > 0) then { _lastTick = _args select 0; - if(diag_tickTime - _lastTick > 1) then { + if(ACE_diagTime - _lastTick > 1) then { [] call FUNC(onOpticLoad); }; }; @@ -35,24 +35,33 @@ _soundTime = _args select 4; _randomLockInterval = _args select 5; _fireDisabledEH = _args select 6; -_configs = configProperties [configFile >> "CfgWeapons" >> (currentWeapon (vehicle ACE_player)), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; -if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith { +private["_ammo", "_magazineConfig", "_weaponConfig"]; +_weaponConfig = configProperties [configFile >> "CfgWeapons" >> (currentWeapon _currentShooter), QUOTE(configName _x == QUOTE(QGVAR(enabled))), false]; +_magazineConfig = if ((currentMagazine _currentShooter) != "") then { + _ammo = getText (configFile >> "CfgMagazines" >> (currentMagazine _currentShooter) >> "ammo"); + configProperties [(configFile >> "CfgAmmo" >> _ammo), "(configName _x) == 'ace_missileguidance'", false]; +} else { + [] +}; + +//If weapon does not have "javelin enabled", then exit PFEH +if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1}) exitWith { __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - + if(!isNil "_fireDisabledEH") then { _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); }; - + [(_this select 1)] call cba_fnc_removePerFrameHandler; uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil]; }; // Find a target within the optic range _newTarget = objNull; - + // Bail on fast movement if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && {cameraOn == ACE_player}) exitWith { // keep it steady. ACE_player switchCamera "INTERNAL"; @@ -60,19 +69,20 @@ if ((velocity ACE_player) distance [0,0,0] > 0.5 && {cameraView == "GUNNER"} && // Refresh the firemode [] call FUNC(showFireMode); - - -// bail on not loaded -if( (vehicle ACE_player) != ACE_player) then { - if( (vehicle player) magazineTurretAmmo ["1Rnd_GAT_missiles", [0]] < 1) exitWith { - TRACE_1("No turret ammo, exit", ""); + +_ammo = _currentShooter ammo (currentWeapon _currentShooter); +// not loaded or not "javelin enabled" for magazine, hide targeting and enable firing +if ((_ammo == 0) || {(count _magazineConfig) < 1} || {(getNumber ((_magazineConfig select 0) >> "enabled")) != 1}) exitWith { + __JavelinIGUITargeting ctrlShow false; + __JavelinIGUITargetingGate ctrlShow false; + __JavelinIGUITargetingLines ctrlShow false; + __JavelinIGUITargetingConstraints ctrlShow false; + + if(!isNil "_fireDisabledEH") then { + _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); }; -} else { - if (ACE_player ammo (currentWeapon ACE_player) < 1 ) exitWith { - TRACE_1("No ammo, exit", ""); - }; }; - + _range = parseNumber (ctrlText __JavelinIGUIRangefinder); TRACE_1("Viewing range", _range); if (_range > 50 && {_range < 2500}) then { @@ -104,7 +114,7 @@ _zamerny = if (_currentTarget isKindOf "CAManBase") then {_currentTarget selecti _randomPosWithinBounds = [(_zamerny select 0) + 1 - (random 2.0),(_zamerny select 1) + 1 - (random 2.0),(_zamerny select 2) + 0.5 - (random 1.0)]; _apos = worldToScreen (_currentTarget modelToWorld _randomPosWithinBounds); - + _aposX = 0; _aposY = 0; if (count _apos < 2) then { @@ -115,7 +125,7 @@ if (count _apos < 2) then { _aposY = (_apos select 1) + _offsetY; }; -if((call CBA_fnc_getFoV) select 1 > 9) then { +if((call CBA_fnc_getFoV) select 1 > 9) then { __JavelinIGUINFOV ctrlSetTextColor __ColorGreen; __JavelinIGUIWFOV ctrlSetTextColor __ColorGray; } else { @@ -125,9 +135,9 @@ if((call CBA_fnc_getFoV) select 1 > 9) then { FUNC(disableFire) = { _firedEH = _this select 0; - + if(_firedEH < 0 && difficulty > 0) then { - _firedEH = [ACE_player, "DefaultAction", {true}, { + _firedEH = [ACE_player, "DefaultAction", {true}, { _canFire = (_this select 1) getVariable["ace_missileguidance_target", nil]; if(!isNil "_canFire") exitWith { false }; true @@ -137,7 +147,7 @@ FUNC(disableFire) = { }; FUNC(enableFire) = { _firedEH = _this select 0; - + if(_firedEH > 0 && difficulty > 0) then { [ACE_player, "DefaultAction", _firedEH] call EFUNC(common,removeActionEventHandler); }; @@ -148,38 +158,38 @@ if (isNull _newTarget) then { // No targets found _currentTarget = objNull; _lockTime = 0; - + __JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - - _currentShooter setVariable ["ace_missileguidance_target",nil, false]; - + + _currentShooter setVariable ["ace_missileguidance_target",nil, false]; + // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); } else { _fov = [] call CBA_fnc_getFoV; TRACE_1("FOV", _fov); if (_newTarget distance ACE_player < 2500 - && {(call CBA_fnc_getFoV) select 1 > 9} - && { (currentVisionMode ACE_player == 2)} - && GVAR(isLockKeyDown) - ) then { + && {(call CBA_fnc_getFoV) select 1 > 9} + && { (currentVisionMode ACE_player == 2)} + && GVAR(isLockKeyDown) + ) then { // Lock on after 3 seconds - if(_currentTarget != _newTarget) then { + if(_currentTarget != _newTarget) then { TRACE_1("New Target, reseting locking", _newTarget); - _lockTime = diag_tickTime; + _lockTime = ACE_diagTime; _currentTarget = _newTarget; - + playSound "ACE_Javelin_Locking"; } else { - if(diag_tickTime - _lockTime > __LOCKONTIME + _randomLockInterval) then { + if(ACE_diagTime - _lockTime > __LOCKONTIME + _randomLockInterval) then { TRACE_2("LOCKED!", _currentTarget, _lockTime); - + __JavelinIGUISeek ctrlSetTextColor __ColorGreen; - + __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingConstrains ctrlShow false; __JavelinIGUITargetingGate ctrlShow true; @@ -189,98 +199,98 @@ if (isNull _newTarget) then { //__JavelinIGUITargetingLineV ctrlSetPosition [_aposX,ctrlPosition __JavelinIGUITargetingLineV select 1]; //__JavelinIGUITargetingLineH ctrlSetPosition [ctrlPosition __JavelinIGUITargetingLineH select 0,_aposY]; //{_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingLineH,__JavelinIGUITargetingLineV]; - + _boundsInput = if (_currentTarget isKindOf "CAManBase") then { [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; } else { [_currentTarget,[-1,-1,-2],_currentTarget selectionPosition "zamerny"]; }; - + _bpos = _boundsInput call EFUNC(common,worldToScreenBounds); _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minY = ((_bpos select 1) + _offsetY) max _constraintTop; _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); - + TRACE_4("", _boundsInput, _bpos, _minX, _minY); - + __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; - + {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; - + _currentShooter setVariable["ace_missileguidance_target", _currentTarget, false]; - + // Allow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(enableFire); - - if(diag_tickTime > _soundTime) then { + + if(ACE_diagTime > _soundTime) then { playSound "ACE_Javelin_Locked"; - _soundTime = diag_tickTime + 0.25; + _soundTime = ACE_diagTime + 0.25; }; } else { __JavelinIGUITargeting ctrlShow true; __JavelinIGUITargetingGate ctrlShow true; - __JavelinIGUITargetingConstrains ctrlShow true; + __JavelinIGUITargetingConstrains ctrlShow true; __JavelinIGUITargetingLines ctrlShow false; _currentShooter setVariable["ace_missileguidance_target", nil, false]; - + _boundsInput = if (_currentTarget isKindOf "CAManBase") then { [_newTarget,[-1,-1,-2],_currentTarget selectionPosition "body"]; } else { [_newTarget,[-1,-1,-1],_currentTarget selectionPosition "zamerny"]; }; - + _bpos = _boundsInput call EFUNC(common,worldToScreenBounds); - + _minX = ((_bpos select 0) + _offsetX) max _constraintLeft; _minY = ((_bpos select 1) + _offsetY) max _constraintTop; _maxX = ((_bpos select 2) + _offsetX) min (_constraintRight - 0.025*(3/4)*SafezoneH); _maxY = ((_bpos select 3) + _offsetY) min (_constraintBottom - 0.025*SafezoneH); - + TRACE_4("", _boundsInput, _bpos, _minX, _minY); - + __JavelinIGUITargetingGateTL ctrlSetPosition [_minX,_minY]; __JavelinIGUITargetingGateTR ctrlSetPosition [_maxX,_minY]; __JavelinIGUITargetingGateBL ctrlSetPosition [_minX,_maxY]; __JavelinIGUITargetingGateBR ctrlSetPosition [_maxX,_maxY]; - + {_x ctrlCommit __TRACKINTERVAL} forEach [__JavelinIGUITargetingGateTL,__JavelinIGUITargetingGateTR,__JavelinIGUITargetingGateBL,__JavelinIGUITargetingGateBR]; - if(diag_tickTime > _soundTime) then { + if(ACE_diagTime > _soundTime) then { playSound "ACE_Javelin_Locking"; - _soundTime = diag_tickTime + 0.25; + _soundTime = ACE_diagTime + 0.25; }; // Disallow fire - _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); + _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); }; }; - } else { + } else { // No targets found _currentTarget = objNull; _lockTime = 0; - + __JavelinIGUISeek ctrlSetTextColor __ColorGray; __JavelinIGUITargeting ctrlShow false; __JavelinIGUITargetingGate ctrlShow false; __JavelinIGUITargetingLines ctrlShow false; __JavelinIGUITargetingConstraints ctrlShow false; - + _currentShooter setVariable ["ace_missileguidance_target",nil, false]; - + // Disallow fire _fireDisabledEH = [_fireDisabledEH] call FUNC(disableFire); - }; + }; }; //TRACE_2("", _newTarget, _currentTarget); // Save arguments for next run -_args set[0, diag_tickTime]; +_args set[0, ACE_diagTime]; _args set[1, _currentTarget]; _args set[2, _runTime]; _args set[3, _lockTime]; diff --git a/addons/javelin/functions/fnc_onOpticLoad.sqf b/addons/javelin/functions/fnc_onOpticLoad.sqf index 8e26806162..0332c132e9 100644 --- a/addons/javelin/functions/fnc_onOpticLoad.sqf +++ b/addons/javelin/functions/fnc_onOpticLoad.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" TRACE_1("enter", _this); -#define __LOCKONTIMERANDOM 2 // Deviation in lock on time +#define __LOCKONTIMERANDOM 2 // Deviation in lock on ACE_time if((count _this) > 0) then { uiNameSpace setVariable ['ACE_RscOptics_javelin',_this select 0]; @@ -20,12 +20,12 @@ __JavelinIGUITargetingLines ctrlShow false; uiNameSpace setVariable [QGVAR(arguments), [ - 0, // Last runtime + ACE_diagTime, // Last runtime objNull, // currentTargetObject 0, // Run Time 0, // Lock Time 0, // Sound timer - (random __LOCKONTIMERANDOM), // random lock time addition + (random __LOCKONTIMERANDOM), // random lock ACE_time addition -1 ] ]; diff --git a/addons/javelin/initKeybinds.sqf b/addons/javelin/initKeybinds.sqf index 2c095b93fc..15215466e8 100644 --- a/addons/javelin/initKeybinds.sqf +++ b/addons/javelin/initKeybinds.sqf @@ -1,6 +1,6 @@ // by commy2 -["ACE3 Weapons", QGVAR(lockTarget), localize "STR_ACE_JAVELIN_LockTarget", +["ACE3 Weapons", QGVAR(lockTarget), localize LSTRING(LockTarget), { if (GETGVAR(isLockKeyDown,false)) exitWith {false}; @@ -21,7 +21,7 @@ }, [15, [false, false, false]], false] call cba_fnc_addKeybind; //Tab Key -["ACE3 Weapons", QGVAR(cycleFireMode), localize "STR_ACE_JAVELIN_CycleFireMode", +["ACE3 Weapons", QGVAR(cycleFireMode), localize LSTRING(CycleFireMode), { false }, { [ACE_player] call FUNC(cycleFireMode); diff --git a/addons/javelin/script_component.hpp b/addons/javelin/script_component.hpp index 7234a1e3d4..984edc6988 100644 --- a/addons/javelin/script_component.hpp +++ b/addons/javelin/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT javelin -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_JAVELIN #define DEBUG_MODE_FULL @@ -9,7 +9,7 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_JAVELIN #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define ACE_JAV_FIREMODE_DIR 1 #define ACE_JAV_FIREMODE_TOP 2 diff --git a/addons/javelin/stringtable.xml b/addons/javelin/stringtable.xml index 0557968115..e826263100 100644 --- a/addons/javelin/stringtable.xml +++ b/addons/javelin/stringtable.xml @@ -1,7 +1,7 @@  - - + + Lock Target (Hold) Ziel aufschalten Захватить цель (удерживать) @@ -13,7 +13,7 @@ Fijar objetivo (Mantener) Travar Alvo(Segurar) - + Cycle Fire Mode Wechsle Feuermodus Переключение режимов огня diff --git a/addons/kestrel4500/$PBOPREFIX$ b/addons/kestrel4500/$PBOPREFIX$ new file mode 100644 index 0000000000..15660502ce --- /dev/null +++ b/addons/kestrel4500/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\kestrel4500 \ No newline at end of file diff --git a/addons/kestrel4500/CfgVehicles.hpp b/addons/kestrel4500/CfgVehicles.hpp index 20d8bf5b62..776bd8dcf5 100644 --- a/addons/kestrel4500/CfgVehicles.hpp +++ b/addons/kestrel4500/CfgVehicles.hpp @@ -4,31 +4,31 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class GVAR(open) { - displayName = "$STR_ACE_Kestrel4500_OpenKestrel"; + displayName = CSTRING(OpenKestrel); condition = QUOTE(call FUNC(canShow) && !GVAR(Kestrel4500)); statement = QUOTE(call FUNC(createKestrelDialog)); showDisabled = 0; priority = 0.1; icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); - exceptions[] = {"notOnMap"}; - }; - class GVAR(show) { - displayName = "$STR_ACE_Kestrel4500_ShowKestrel"; - condition = QUOTE(call FUNC(canShow) && !GVAR(Overlay)); - statement = QUOTE(call FUNC(displayKestrel)); - showDisabled = 0; - priority = 0.2; - icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; - }; - class GVAR(hide) { - displayName = "$STR_ACE_Kestrel4500_HideKestrel"; - condition = QUOTE(GVAR(Overlay)); - statement = QUOTE(call FUNC(displayKestrel)); - showDisabled = 0; - priority = 0.3; - icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + class GVAR(show) { + displayName = CSTRING(ShowKestrel); + condition = QUOTE(call FUNC(canShow) && !GVAR(Overlay)); + statement = QUOTE(call FUNC(displayKestrel)); + showDisabled = 0; + priority = 0.2; + icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + }; + class GVAR(hide) { + displayName = CSTRING(HideKestrel); + condition = QUOTE(GVAR(Overlay)); + statement = QUOTE(call FUNC(displayKestrel)); + showDisabled = 0; + priority = 0.3; + icon = QUOTE(PATHTOF(UI\Kestrel4500_Icon.paa)); + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + }; }; }; }; diff --git a/addons/kestrel4500/CfgWeapons.hpp b/addons/kestrel4500/CfgWeapons.hpp index 881edca202..c31b736ac6 100644 --- a/addons/kestrel4500/CfgWeapons.hpp +++ b/addons/kestrel4500/CfgWeapons.hpp @@ -4,11 +4,11 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_Kestrel4500: ACE_ItemCore { - author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"}; + author = ECSTRING(common,ACETeam); scope = 2; - displayName = "$STR_ACE_Kestrel_Name"; - descriptionShort = "$STR_ACE_Kestrel_Description"; - model = PATHTOF(kestrel4500.p3d); + displayName = CSTRING(Name); + descriptionShort = CSTRING(Description); + model = PATHTOF(data\kestrel4500.p3d); picture = PATHTOF(UI\Kestrel4500.paa); icon = "iconObject_circle"; mapSize = 0.034; diff --git a/addons/kestrel4500/RscTitles.hpp b/addons/kestrel4500/RscTitles.hpp index defb954292..fe0adf2c4b 100644 --- a/addons/kestrel4500/RscTitles.hpp +++ b/addons/kestrel4500/RscTitles.hpp @@ -2,8 +2,7 @@ #define ST_RIGHT 1 #define ST_CENTER 2 -class Kestrel4500_RscText -{ +class Kestrel4500_RscText { idc=-1; type=0; style=ST_CENTER; @@ -19,8 +18,7 @@ class Kestrel4500_RscText sizeEx=0.04; shadow=0; }; -class Kestrel4500_RscButton -{ +class Kestrel4500_RscButton { text=""; colorText[]={0,0,0,1}; colorDisabled[]={0,0,0,0}; @@ -49,18 +47,16 @@ class Kestrel4500_RscButton borderSize=0; shadow=0; }; -class Kestrel4500_Display -{ +class Kestrel4500_Display { name="Kestrel4500_Display"; idd=-1; onLoad="uiNamespace setVariable ['Kestrel4500_Display', (_this select 0)]"; + onUnload=QUOTE(_this call FUNC(onCloseDialog)); movingEnable=1; controlsBackground[]={}; objects[]={}; - class controls - { - class BACKGROUND - { + class controls { + class BACKGROUND { moving=1; type=0; font="TahomaB"; @@ -75,18 +71,16 @@ class Kestrel4500_Display colorText[]={1,1,1,1}; text=PATHTOF(UI\Kestrel4500.paa); }; - class POWER: Kestrel4500_RscButton - { + class POWER: Kestrel4500_RscButton { idc=-1; x=safezoneX+0.385; y=safezoneY+1.125; w=0.042; h=0.042*4/3; - action="closeDialog 0"; + action=QUOTE(7 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_exit_button_click'"; }; - class ENTER: POWER - { + class ENTER: POWER { idc=-1; x=safezoneX+0.46; y=safezoneY+1.0; @@ -94,8 +88,7 @@ class Kestrel4500_Display action=QUOTE(0 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_center_button_click'"; }; - class TOP: Kestrel4500_RscButton - { + class TOP: Kestrel4500_RscButton { idc=-1; x=safezoneX+0.46; y=safezoneY+0.93; @@ -104,15 +97,13 @@ class Kestrel4500_Display action=QUOTE(1 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_top_button_click'"; }; - class BOTTOM: TOP - { + class BOTTOM: TOP { idc=-1; y=safezoneY+1.1; action=QUOTE(2 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_bottom_button_click'"; }; - class LEFT: Kestrel4500_RscButton - { + class LEFT: Kestrel4500_RscButton { idc=-1; x=safezoneX+0.4; y=safezoneY+0.97; @@ -121,15 +112,13 @@ class Kestrel4500_Display action=QUOTE(3 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_left_button_click'"; }; - class RIGHT: LEFT - { + class RIGHT: LEFT { idc=-1; x=safezoneX+0.58; action=QUOTE(4 call FUNC(buttonPressed)); onMouseButtonDown = "playSound 'kestrel4500_right_button_click'"; }; - class MEMORY: Kestrel4500_RscButton - { + class MEMORY: Kestrel4500_RscButton { idc=-1; x=safezoneX+0.395; y=safezoneY+0.87; @@ -137,15 +126,13 @@ class Kestrel4500_Display h=0.045*4/3; action=QUOTE(5 call FUNC(buttonPressed)); }; - class BACKLIGHT: MEMORY - { + class BACKLIGHT: MEMORY { idc=-1; x=safezoneX+0.585; action=QUOTE(6 call FUNC(buttonPressed)); }; - class TEXT_TOP: Kestrel4500_RscText - { + class TEXT_TOP: Kestrel4500_RscText { idc=74100; x=safezoneX+0.40; y=safezoneY+0.58; @@ -153,78 +140,95 @@ class Kestrel4500_Display h=0.04; text=""; }; - class TEXT_CENTER_BIG: TEXT_TOP - { + class TEXT_CENTER_BIG: TEXT_TOP { idc=74200; y=safezoneY+0.61; h=0.10; SizeEx=0.06; - text=""; }; - class TEXT_CENTER_LINE_1_LEFT: TEXT_TOP - { + class TEXT_CENTER: TEXT_TOP { + idc=74201; + y=safezoneY+0.64; + }; + class TEXT_CENTER_LINE_1_LEFT: TEXT_TOP { idc=74300; y=safezoneY+0.60; style=ST_LEFT; h=0.10; SizeEx=0.05; - text=""; }; - class TEXT_CENTER_LINE2_LEFT: TEXT_CENTER_LINE_1_LEFT - { + class TEXT_CENTER_LINE2_LEFT: TEXT_CENTER_LINE_1_LEFT { idc=74301; y=safezoneY+0.64; - text=""; }; - class TEXT_CENTER_LINE_3_LEFT: TEXT_CENTER_LINE2_LEFT - { + class TEXT_CENTER_LINE_3_LEFT: TEXT_CENTER_LINE2_LEFT { idc=74302; y=safezoneY+0.68; - text=""; }; - class TEXT_CENTER_LINE_1_RIGHT: TEXT_CENTER_LINE_1_LEFT - { + class TEXT_CENTER_LINE_1_RIGHT: TEXT_CENTER_LINE_1_LEFT { idc=74303; style=ST_RIGHT; }; - class TEXT_CENTER_LINE2_RIGHT: TEXT_CENTER_LINE2_LEFT - { + class TEXT_CENTER_LINE2_RIGHT: TEXT_CENTER_LINE2_LEFT { idc=74304; style=ST_RIGHT; }; - class TEXT_CENTER_LINE_3_RIGHT: TEXT_CENTER_LINE_3_LEFT - { + class TEXT_CENTER_LINE_3_RIGHT: TEXT_CENTER_LINE_3_LEFT { idc=74305; style=ST_RIGHT; }; - class TEXT_INFO_LINE_1: TEXT_TOP - { + class TEXT_INFO_LINE_1: TEXT_TOP { idc=74400; - y=safezoneY+0.69; - text=""; + y=safezoneY+0.68; }; - class TEXT_INFO_LINE_2: TEXT_TOP - { + class TEXT_INFO_LINE_2: TEXT_TOP { idc=74401; y=safezoneY+0.72; - text=""; + }; + class TEXT_BOTTOM_BIG: TEXT_TOP { + idc=74500; + y=safezoneY+0.67; + h=0.10; + SizeEx=0.06; + }; + class TEXT_CENTER_LINE_1: TEXT_TOP { + idc=74600; + y=safezoneY+0.58; + SizeEx=0.03; + }; + class TEXT_CENTER_LINE_2: TEXT_CENTER_LINE_1 { + idc=74601; + y=safezoneY+0.61; + }; + class TEXT_CENTER_LINE_3: TEXT_CENTER_LINE_1 { + idc=74602; + y=safezoneY+0.64; + }; + class TEXT_CENTER_LINE_4: TEXT_CENTER_LINE_1 { + idc=74603; + y=safezoneY+0.67; + }; + class TEXT_CENTER_LINE_5: TEXT_CENTER_LINE_1 { + idc=74604; + y=safezoneY+0.70; + }; + class TEXT_CENTER_LINE_6: TEXT_CENTER_LINE_1 { + idc=74605; + y=safezoneY+0.73; }; }; }; -class RscTitles -{ - class RscKestrel4500 - { +class RscTitles { + class RscKestrel4500 { idd=-1; onLoad="with uiNameSpace do { RscKestrel4500 = _this select 0 };"; + onUnload=(_this call FUNC(onCloseDisplay)); movingEnable=0; duration=60; fadeIn="false"; fadeOut="false"; - class controls - { - class RscKestrel4500 - { + class controls { + class RscKestrel4500 { idc=75000; moving=0; type=0; @@ -239,8 +243,7 @@ class RscTitles colorText[]={1,1,1,1}; text=PATHTOF(UI\Kestrel4500_0.paa); }; - class RscTextTop: Kestrel4500_RscText - { + class RscTextTop: Kestrel4500_RscText { idc=75100; x=safezoneX-0.05+0.40*0.75; y=safezoneY+0.7+0.58*0.75; @@ -249,16 +252,18 @@ class RscTitles SizeEx=0.04*0.75; text=""; }; - class RscTextCenterBig: RscTextTop - { + class RscTextCenterBig: RscTextTop { idc=75200; y=safezoneY+0.7+0.61*0.75; h=0.10*0.75; SizeEx=0.06*0.75; text=""; }; - class RscTextCenterLine1Left: RscTextTop - { + class RscTextCenter: RscTextTop { + idc=75201; + y=safezoneY+0.7+0.64*0.75; + }; + class RscTextCenterLine1Left: RscTextTop { idc=75300; y=safezoneY+0.7+0.60*0.75; style=ST_LEFT; @@ -266,45 +271,70 @@ class RscTitles SizeEx=0.05*0.75; text=""; }; - class RscTextCenterLine2Left: RscTextCenterLine1Left - { + class RscTextCenterLine2Left: RscTextCenterLine1Left { idc=75301; y=safezoneY+0.7+0.64*0.75; text=""; }; - class RscTextCenterLine3Left: RscTextCenterLine2Left - { + class RscTextCenterLine3Left: RscTextCenterLine2Left { idc=75302; y=safezoneY+0.7+0.68*0.75; text=""; }; - class RscTextCenterLine1Right: RscTextCenterLine1Left - { + class RscTextCenterLine1Right: RscTextCenterLine1Left { idc=75303; style=ST_RIGHT; }; - class RscTextCenterLine2Right: RscTextCenterLine2Left - { + class RscTextCenterLine2Right: RscTextCenterLine2Left { idc=75304; style=ST_RIGHT; }; - class RscTextCenterLine3Right: RscTextCenterLine3Left - { + class RscTextCenterLine3Right: RscTextCenterLine3Left { idc=75305; style=ST_RIGHT; }; - class RscTextInfoLine1: RscTextTop - { + class RscTextInfoLine1: RscTextTop { idc=75400; - y=safezoneY+0.7+0.69*0.75; + y=safezoneY+0.7+0.68*0.75; text=""; }; - class RscTextInfoLine2: RscTextTop - { + class RscTextInfoLine2: RscTextTop { idc=75401; y=safezoneY+0.7+0.72*0.75; text=""; }; + class RscTextBottomBig: RscTextTop { + idc=75500; + y=safezoneY+0.7+0.67*0.75; + h=0.10*0.75; + SizeEx=0.06*0.75; + text=""; + }; + class RscTextCenterLine1: RscTextTop { + idc=75600; + y=safezoneY+0.7+0.58*0.75; + SizeEx=0.03*0.75; + }; + class RscTextCenterLine2: RscTextCenterLine1 { + idc=75601; + y=safezoneY+0.7+0.61*0.75; + }; + class RscTextCenterLine3: RscTextCenterLine1 { + idc=75602; + y=safezoneY+0.7+0.64*0.75; + }; + class RscTextCenterLine4: RscTextCenterLine1 { + idc=75603; + y=safezoneY+0.7+0.67*0.75; + }; + class RscTextCenterLine5: RscTextCenterLine1 { + idc=75604; + y=safezoneY+0.7+0.70*0.75; + }; + class RscTextCenterLine6: RscTextCenterLine1 { + idc=75605; + y=safezoneY+0.7+0.73*0.75; + }; }; }; diff --git a/addons/kestrel4500/XEH_postInit.sqf b/addons/kestrel4500/XEH_postInit.sqf index 461ed533db..f22fc2228f 100644 --- a/addons/kestrel4500/XEH_postInit.sqf +++ b/addons/kestrel4500/XEH_postInit.sqf @@ -2,24 +2,31 @@ #include "initKeybinds.sqf" -GVAR(Menus) = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"]; +GVAR(Menus) = ["Date", "Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "CHILL °C", "HUMIDITY %", "HEAT INDEX °C", "DEW POINT °C", "WET BULB °C", "BARO hPA", "ALTITUDE m", "DENS ALT m", "User Screen 1", "User Screen 2"]; -GVAR(TOTAL) = [0, 0, 0, 0, 0, 0, 0, 0]; -GVAR(ENTRIES) = [0, 0, 0, 0, 0, 0, 0, 0]; +GVAR(TOTAL) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; +GVAR(ENTRIES) = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; GVAR(MinAvgMax) = false; GVAR(MinAvgMaxMode) = 0; +GVAR(referenceHeadingMenu) = 0; +GVAR(referenceHeadingAutoSet) = true; +GVAR(manualSetCooldown) = ACE_diagTime; +GVAR(headingSetDisplayTimer) = 0; GVAR(Menu) = 1; GVAR(Directions) = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]; GVAR(Direction) = 0; GVAR(RefHeading) = 0; +GVAR(TmpHeading) = 0; GVAR(updateTimer) = 0; -GVAR(outputData) = ["", "", "", "", "", "", "", "", "", ""]; +GVAR(outputData) = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]; GVAR(MeasuredWindSpeed) = 0; GVAR(ImpellerState) = 0; GVAR(Kestrel4500) = false; GVAR(Overlay) = false; + +[] call FUNC(restoreUserData); \ No newline at end of file diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index d081f485ec..7b36167a16 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -3,13 +3,16 @@ ADDON = false; PREP(buttonPressed); -PREP(calculateWindSpeed); PREP(canShow); PREP(collectData); PREP(createKestrelDialog); PREP(displayKestrel); PREP(generateOutputData); PREP(measureWindSpeed); +PREP(onCloseDialog); +PREP(onCloseDisplay); +PREP(restoreUserData); +PREP(storeUserData); PREP(updateDisplay); PREP(updateImpellerState); diff --git a/addons/kestrel4500/config.cpp b/addons/kestrel4500/config.cpp index 8e558af44f..95a533fd9f 100644 --- a/addons/kestrel4500/config.cpp +++ b/addons/kestrel4500/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {"ACE_Kestrel4500"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ACE_common", "ACE_weather"}; - author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"}; + author[] = {ECSTRING(common,ACETeam), "Ruthberg"}; VERSION_CONFIG; }; }; diff --git a/addons/kestrel4500/data/Kestrel4500.p3d b/addons/kestrel4500/data/Kestrel4500.p3d new file mode 100644 index 0000000000..8166e552f2 Binary files /dev/null and b/addons/kestrel4500/data/Kestrel4500.p3d differ diff --git a/addons/kestrel4500/data/Kestrel4500.rvmat b/addons/kestrel4500/data/Kestrel4500.rvmat new file mode 100644 index 0000000000..256b6b86bb --- /dev/null +++ b/addons/kestrel4500/data/Kestrel4500.rvmat @@ -0,0 +1,82 @@ +class StageTI { + texture = "a3\data_f\default_glass_ti_ca.paa"; +}; +ambient[] = {1,1,1,1}; +diffuse[] = {1,1,1,1}; +forcedDiffuse[] = {0,0,0,0}; +emmisive[] = {0,0,0,1}; +specular[] = {0.3,0.3,0.3,1}; +specularPower = 50; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\kestrel4500\data\Kestrel4500_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,32,128,1)fresnel(0.85,0.36)"; + 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_interier_car_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/kestrel4500/data/Kestrel4500_co.paa b/addons/kestrel4500/data/Kestrel4500_co.paa new file mode 100644 index 0000000000..c34d195a7e Binary files /dev/null and b/addons/kestrel4500/data/Kestrel4500_co.paa differ diff --git a/addons/kestrel4500/data/Kestrel4500_nohq.paa b/addons/kestrel4500/data/Kestrel4500_nohq.paa new file mode 100644 index 0000000000..7c8886d688 Binary files /dev/null and b/addons/kestrel4500/data/Kestrel4500_nohq.paa differ diff --git a/addons/kestrel4500/data/arrow1.paa b/addons/kestrel4500/data/arrow1.paa deleted file mode 100644 index 8edb257ead..0000000000 Binary files a/addons/kestrel4500/data/arrow1.paa and /dev/null differ diff --git a/addons/kestrel4500/data/body.paa b/addons/kestrel4500/data/body.paa deleted file mode 100644 index dfaa44723e..0000000000 Binary files a/addons/kestrel4500/data/body.paa and /dev/null differ diff --git a/addons/kestrel4500/data/gpstemp.paa b/addons/kestrel4500/data/gpstemp.paa deleted file mode 100644 index ef45fe406c..0000000000 Binary files a/addons/kestrel4500/data/gpstemp.paa and /dev/null differ diff --git a/addons/kestrel4500/data/rad.paa b/addons/kestrel4500/data/rad.paa deleted file mode 100644 index 13a3ffe6f7..0000000000 Binary files a/addons/kestrel4500/data/rad.paa and /dev/null differ diff --git a/addons/kestrel4500/data/tasten.paa b/addons/kestrel4500/data/tasten.paa deleted file mode 100644 index 8a140ec5f0..0000000000 Binary files a/addons/kestrel4500/data/tasten.paa and /dev/null differ diff --git a/addons/kestrel4500/data/tasten1.paa b/addons/kestrel4500/data/tasten1.paa deleted file mode 100644 index af441a51de..0000000000 Binary files a/addons/kestrel4500/data/tasten1.paa and /dev/null differ diff --git a/addons/kestrel4500/functions/fnc_buttonPressed.sqf b/addons/kestrel4500/functions/fnc_buttonPressed.sqf index f0f9a10db1..8f38568462 100644 --- a/addons/kestrel4500/functions/fnc_buttonPressed.sqf +++ b/addons/kestrel4500/functions/fnc_buttonPressed.sqf @@ -17,37 +17,107 @@ switch (_this) do { case 0: { // Enter - if (!GVAR(MinAvgMax) && (GVAR(Menu) == 2 || GVAR(Menu) == 3)) then { - GVAR(RefHeading) = getDir ACE_player; + if (!GVAR(MinAvgMax) && (GVAR(Menu) == 3 || GVAR(Menu) == 4)) then { + switch (GVAR(referenceHeadingMenu)) do { + case 0: { // Head- and Crosswind main page + GVAR(TmpHeading) = GVAR(RefHeading); + GVAR(referenceHeadingMenu) = 1; + }; + case 1: { // Mode selection + if (GVAR(referenceHeadingAutoSet)) then { + GVAR(referenceHeadingMenu) = 2; + } else { + GVAR(referenceHeadingMenu) = 3; + }; + }; + case 2: { // Auto set + GVAR(RefHeading) = (getDir ACE_player) % 360; + GVAR(referenceHeadingMenu) = 0; + GVAR(headingSetDisplayTimer) = ACE_diagTime; + }; + case 3: { // Manual set + GVAR(RefHeading) = GVAR(TmpHeading); + GVAR(referenceHeadingMenu) = 0; + GVAR(headingSetDisplayTimer) = ACE_diagTime; + }; + }; }; - if (GVAR(MinAvgMax) && GVAR(Menu) > 0 && GVAR(Menu) < 4) then { + if (GVAR(MinAvgMax) && GVAR(Menu) > 1 && GVAR(Menu) < 5) then { if (GVAR(MinAvgMaxMode) != 1) then { { GVAR(MIN) set [_x, 0]; GVAR(MAX) set [_x, 0]; GVAR(TOTAL) set [_x, 0]; GVAR(ENTRIES) set [_x, 0]; - } forEach [1, 2, 3]; + } forEach [2, 3, 4]; }; GVAR(MinAvgMaxMode) = (GVAR(MinAvgMaxMode) + 1) % 3; }; }; case 1: { // Top - GVAR(Menu) = (GVAR(Menu) - 1 + (count GVAR(Menus))) % (count GVAR(Menus)); + if (GVAR(referenceHeadingMenu) == 1) then { + GVAR(referenceHeadingAutoSet) = !GVAR(referenceHeadingAutoSet); + } else { + GVAR(Menu) = (GVAR(Menu) - 1 + (count GVAR(Menus))) % (count GVAR(Menus)); + }; }; case 2: { // Bottom - GVAR(Menu) = (GVAR(Menu) + 1 + (count GVAR(Menus))) % (count GVAR(Menus)); + if (GVAR(referenceHeadingMenu) == 1) then { + GVAR(referenceHeadingAutoSet) = !GVAR(referenceHeadingAutoSet); + } else { + GVAR(Menu) = (GVAR(Menu) + 1 + (count GVAR(Menus))) % (count GVAR(Menus)); + }; }; case 3: { // Left - GVAR(MinAvgMax) = !GVAR(MinAvgMax); + if (GVAR(referenceHeadingMenu) == 0) then { + GVAR(MinAvgMax) = !GVAR(MinAvgMax); + } else { + if (GVAR(referenceHeadingMenu) == 3) then { + if (ACE_diagTime - GVAR(manualSetCooldown) < 0.2) then { + GVAR(TmpHeading) = GVAR(TmpHeading) - 10; + } else { + GVAR(TmpHeading) = GVAR(TmpHeading) - 1; + }; + GVAR(TmpHeading) = (GVAR(TmpHeading) + 360) % 360; + GVAR(manualSetCooldown) = ACE_diagTime; + }; + }; }; case 4: { // Right - GVAR(MinAvgMax) = !GVAR(MinAvgMax); + if (GVAR(referenceHeadingMenu) == 0) then { + GVAR(MinAvgMax) = !GVAR(MinAvgMax); + } else { + if (GVAR(referenceHeadingMenu) == 3) then { + if (ACE_diagTime - GVAR(manualSetCooldown) < 0.2) then { + GVAR(TmpHeading) = GVAR(TmpHeading) + 10; + } else { + GVAR(TmpHeading) = GVAR(TmpHeading) + 1; + }; + GVAR(TmpHeading) = (GVAR(TmpHeading) + 360) % 360; + GVAR(manualSetCooldown) = ACE_diagTime; + }; + }; }; case 5: { // Memory }; case 6: { // Backlight }; + case 7: { // Exit + private ["_exit"]; + _exit = true; + if (GVAR(referenceHeadingMenu) == 1) then { + GVAR(referenceHeadingMenu) = 0; + _exit = false; + }; + if (GVAR(referenceHeadingMenu) > 1) then { + GVAR(referenceHeadingMenu) = 1; + _exit = false; + }; + if (_exit) then { + closeDialog 0; + }; + }; }; [] call FUNC(updateDisplay); +[] call FUNC(storeUserData); diff --git a/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf b/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf deleted file mode 100644 index 8267f7f729..0000000000 --- a/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Author: Ruthberg - * - * Calculates the wind speed at a given world position - * - * Arguments: - * 0: _this - world position - * - * Return Value: - * 0: wind speed - m/s - * - * Public: No - */ -#include "script_component.hpp" - -private ["_windSpeed", "_windDir", "_newWindSpeed", "_windSource"]; - -fnc_polar2vect = { - private ["_mag2D"]; - _mag2D = (_this select 0) * cos((_this select 2)); - [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; -}; - -_windSpeed = vectorMagnitude ACE_wind; -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - -// Terrain effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - _windSpeed = _newWindSpeed; -}; - -// Obstacle effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; - _windSpeed = _newWindSpeed; -}; -_windSpeed = 0 max _windSpeed; - -_windSpeed diff --git a/addons/kestrel4500/functions/fnc_collectData.sqf b/addons/kestrel4500/functions/fnc_collectData.sqf index a812ad0f7c..4858ad80b2 100644 --- a/addons/kestrel4500/functions/fnc_collectData.sqf +++ b/addons/kestrel4500/functions/fnc_collectData.sqf @@ -14,37 +14,46 @@ */ #include "script_component.hpp" -private ["_playerDir", "_windSpeed", "_crosswind", "_headwind", "_humidity", "_temperature", "_humidity", "_barometricPressure", "_altitude"]; +private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_altitude", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_updateMemory", "_windSpeed", "_crosswind", "_headwind"]; +_playerDir = getDir ACE_player; +_playerAltitude = (getPosASL ACE_player) select 2; +_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); +_humidity = EGVAR(weather,currentHumidity); +_barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); +_altitude = EGVAR(weather,Altitude) + _playerAltitude; +_airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); +_densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); +_chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); +_heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); +_dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); +_wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); if (isNil QGVAR(MIN) || isNil QGVAR(MAX)) then { - _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL ACE_player) select 2); - _humidity = EGVAR(weather,currentHumidity); - _barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); - _altitude = EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2); - GVAR(MIN) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; - GVAR(MAX) = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; + GVAR(MIN) = [0, _playerDir, 0, 0, 0, _temperature, _chill, _humidity, _heatIndex, _dewPoint, _wetBulb, _barometricPressure, _altitude, _densityAltitude]; + GVAR(MAX) = [0, _playerDir, 0, 0, 0, _temperature, _chill, _humidity, _heatIndex, _dewPoint, _wetBulb, _barometricPressure, _altitude, _densityAltitude]; }; { GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1]; -} forEach [0, 4, 5, 6 ,7]; +} forEach [1, 5, 6, 7, 8, 9, 10, 11, 12, 13]; -// Direction -_playerDir = getDir ACE_player; -GVAR(MIN) set [0, (GVAR(MIN) select 0) min _playerDir]; -GVAR(MAX) set [0, _playerDir max (GVAR(MAX) select 0)]; -GVAR(TOTAL) set [0, (GVAR(TOTAL) select 0) + _playerDir]; +_fnc_updateMemory = { + PARAMS_2(_slot,_value); + GVAR(MIN) set [_slot, (GVAR(MIN) select _slot) min _value]; + GVAR(MAX) set [_slot, _value max (GVAR(MAX) select _slot)]; + GVAR(TOTAL) set [_slot, (GVAR(TOTAL) select _slot) + _value]; +}; + +[0, _playerDir] call _fnc_updateMemory; if (GVAR(MinAvgMaxMode) == 1) then { { GVAR(ENTRIES) set [_x, (GVAR(ENTRIES) select _x) + 1]; - } forEach [1, 2, 3]; + } forEach [2, 3, 4]; // Wind SPD _windSpeed = call FUNC(measureWindSpeed); - GVAR(MIN) set [1, (GVAR(MIN) select 1) min abs(_windSpeed)]; - GVAR(MAX) set [1, abs(_windSpeed) max (GVAR(MAX) select 1)]; - GVAR(TOTAL) set [1, (GVAR(TOTAL) select 1) + abs(_windSpeed)]; + [2, _windSpeed] call _fnc_updateMemory; // CROSSWIND _crosswind = 0; @@ -53,42 +62,30 @@ if (GVAR(MinAvgMaxMode) == 1) then { } else { _crosswind = abs(sin(GVAR(RefHeading)) * _windSpeed); }; - GVAR(MIN) set [2, (GVAR(MIN) select 2) min _crosswind]; - GVAR(MAX) set [2, _crosswind max (GVAR(MAX) select 2)]; - GVAR(TOTAL) set [2, (GVAR(TOTAL) select 2) + _crosswind]; + [3, _crosswind] call _fnc_updateMemory; // HEADWIND _headwind = 0; if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _headwind = abs(cos(GVAR(RefHeading) - _playerDir) * _windSpeed); + _headwind = cos(GVAR(RefHeading) - _playerDir) * _windSpeed; } else { - _headwind = abs(cos(GVAR(RefHeading)) * _windSpeed); + _headwind = cos(GVAR(RefHeading)) * _windSpeed; }; - GVAR(MIN) set [3, (GVAR(MIN) select 3) min _headwind]; - GVAR(MAX) set [3, _headwind max (GVAR(MAX) select 3)]; - GVAR(TOTAL) set [3, (GVAR(TOTAL) select 3) + _headwind]; + if (abs(_headwind) > abs(GVAR(MAX) select 4)) then { + GVAR(MAX) set [4, _headwind]; + }; + if (abs(_headwind) < abs(GVAR(MIN) select 4)) then { + GVAR(MIN) set [4, _headwind]; + }; + GVAR(TOTAL) set [4, (GVAR(TOTAL) select 4) + _headwind]; }; -// TEMP -_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL ACE_player) select 2); -GVAR(MIN) set [4, (GVAR(MIN) select 4) min _temperature]; -GVAR(MAX) set [4, _temperature max (GVAR(MAX) select 4)]; -GVAR(TOTAL) set [4, (GVAR(TOTAL) select 4) + _temperature]; - -// HUMIDITY -_humidity = EGVAR(weather,currentHumidity); -GVAR(MIN) set [5, (GVAR(MIN) select 5) min _humidity]; -GVAR(MAX) set [5, _humidity max (GVAR(MAX) select 5)]; -GVAR(TOTAL) set [5, (GVAR(TOTAL) select 5) + _humidity]; - -// BARO -_barometricPressure = ((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure); -GVAR(MIN) set [6, (GVAR(MIN) select 6) min _barometricPressure]; -GVAR(MAX) set [6, _barometricPressure max (GVAR(MAX) select 6)]; -GVAR(TOTAL) set [6, (GVAR(TOTAL) select 6) + _barometricPressure]; - -// ALTITUDE -_altitude = EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2); -GVAR(MIN) set [7, (GVAR(MIN) select 7) min _altitude]; -GVAR(MAX) set [7, _altitude max (GVAR(MAX) select 7)]; -GVAR(TOTAL) set [7, (GVAR(TOTAL) select 7) + _altitude]; \ No newline at end of file +[5, _temperature] call _fnc_updateMemory; +[6, _chill] call _fnc_updateMemory; +[7, _humidity] call _fnc_updateMemory; +[8, _heatIndex] call _fnc_updateMemory; +[9, _dewPoint] call _fnc_updateMemory; +[10, _wetBulb] call _fnc_updateMemory; +[11, _barometricPressure] call _fnc_updateMemory; +[12, _altitude] call _fnc_updateMemory; +[13, _densityAltitude] call _fnc_updateMemory; diff --git a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf index f9cd6cf04a..289d0825fc 100644 --- a/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf +++ b/addons/kestrel4500/functions/fnc_createKestrelDialog.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -//if (dialog) exitWith { false }; +if (GVAR(Kestrel4500)) exitWith { false }; if (underwater ACE_player) exitWith { false }; if (!("ACE_Kestrel4500" in (uniformItems ACE_player)) && !("ACE_Kestrel4500" in (vestItems ACE_player))) exitWith { false }; diff --git a/addons/kestrel4500/functions/fnc_displayKestrel.sqf b/addons/kestrel4500/functions/fnc_displayKestrel.sqf index 8eb2cea0ad..679ecce6af 100644 --- a/addons/kestrel4500/functions/fnc_displayKestrel.sqf +++ b/addons/kestrel4500/functions/fnc_displayKestrel.sqf @@ -18,6 +18,7 @@ #define __ctrlKestrel4500 (__dsp displayCtrl 75000) #define __ctrlTop (__dsp displayCtrl 75100) #define __ctrlCenterBig (__dsp displayCtrl 75200) +#define __ctrlCenter (__dsp displayCtrl 75201) #define __ctrlCenterLine1Left (__dsp displayCtrl 75300) #define __ctrlCenterLine2Left (__dsp displayCtrl 75301) #define __ctrlCenterLine3Left (__dsp displayCtrl 75302) @@ -26,6 +27,13 @@ #define __ctrlCenterLine3Right (__dsp displayCtrl 75305) #define __ctrlInfoLine1 (__dsp displayCtrl 75400) #define __ctrlInfoLine2 (__dsp displayCtrl 75401) +#define __ctrlBottomBig (__dsp displayCtrl 75500) +#define __ctrlCenterLine1 (__dsp displayCtrl 75600) +#define __ctrlCenterLine2 (__dsp displayCtrl 75601) +#define __ctrlCenterLine3 (__dsp displayCtrl 75602) +#define __ctrlCenterLine4 (__dsp displayCtrl 75603) +#define __ctrlCenterLine5 (__dsp displayCtrl 75604) +#define __ctrlCenterLine6 (__dsp displayCtrl 75605) if (GVAR(Overlay)) exitWith { GVAR(Overlay) = false; @@ -50,8 +58,8 @@ GVAR(Overlay) = true; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - if (diag_tickTime > GVAR(updateTimer)) then { - GVAR(updateTimer) = diag_tickTime + 1; + if (ACE_diagTime > GVAR(updateTimer)) then { + GVAR(updateTimer) = ACE_diagTime + 1; private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); @@ -63,17 +71,40 @@ GVAR(Overlay) = true; __ctrlTop ctrlSetText (_outputData select 0); __ctrlCenterBig ctrlSetText (_outputData select 1); + __ctrlCenter ctrlSetText (_outputData select 2); - __ctrlCenterLine1Left ctrlSetText (_outputData select 2); - __ctrlCenterLine2Left ctrlSetText (_outputData select 3); - __ctrlCenterLine3Left ctrlSetText (_outputData select 4); + __ctrlCenterLine1Left ctrlSetText (_outputData select 3); + __ctrlCenterLine2Left ctrlSetText (_outputData select 4); + __ctrlCenterLine3Left ctrlSetText (_outputData select 5); - __ctrlCenterLine1Right ctrlSetText (_outputData select 5); - __ctrlCenterLine2Right ctrlSetText (_outputData select 6); - __ctrlCenterLine3Right ctrlSetText (_outputData select 7); + __ctrlCenterLine1Right ctrlSetText (_outputData select 6); + __ctrlCenterLine2Right ctrlSetText (_outputData select 7); + __ctrlCenterLine3Right ctrlSetText (_outputData select 8); - __ctrlInfoLine1 ctrlSetText (_outputData select 8); - __ctrlInfoLine2 ctrlSetText (_outputData select 9); + __ctrlInfoLine1 ctrlSetText (_outputData select 9); + __ctrlInfoLine2 ctrlSetText (_outputData select 10); + + __ctrlBottomBig ctrlSetText (_outputData select 11); + + __ctrlCenterLine1 ctrlSetText (_outputData select 12); + __ctrlCenterLine2 ctrlSetText (_outputData select 13); + __ctrlCenterLine3 ctrlSetText (_outputData select 14); + __ctrlCenterLine4 ctrlSetText (_outputData select 15); + __ctrlCenterLine5 ctrlSetText (_outputData select 16); + __ctrlCenterLine6 ctrlSetText (_outputData select 17); + + if (GVAR(referenceHeadingMenu) == 1) then { + if (GVAR(referenceHeadingAutoSet)) then { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 0.6]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0]; + } else { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 1.0]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 0.6]; + }; + } else { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 1.0]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0]; + }; }; call FUNC(updateImpellerState); diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index 6b139fe72e..fce359de6f 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -14,12 +14,15 @@ */ #include "script_component.hpp" -private ["_playerDir", "_textTop", "_textCenterBig", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_temperature", "_humidity", "_windSpeed", "_windDir"]; +if (ACE_diagTime - GVAR(headingSetDisplayTimer) < 0.8) exitWith {["", "", " Heading Set", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]}; + +private ["_playerDir", "_playerAltitude", "_temperature", "_humidity", "_barometricPressure", "_airDensity", "_densityAltitude", "_chill", "_heatIndex", "_dewPoint", "_wetBulb", "_fnc_dayOfWeek", "_dayString", "_monthString", "_windSpeed", "_windDir", "_textTop", "_textCenterBig", "_textCenter", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_textBottomBig", "_textCenterLine1", "_textCenterLine2", "_textCenterLine3", "_textCenterLine4", "_textCenterLine5", "_textCenterLine6"]; [] call FUNC(collectData); _textTop = GVAR(Menus) select GVAR(Menu); _textCenterBig = ""; +_textCenter = ""; _textCenterLine1Left = ""; _textCenterLine2Left = ""; @@ -31,13 +34,43 @@ _textCenterLine3Right = ""; _textInfoLine1 = ""; _textInfoLine2 = ""; +_textBottomBig = ""; + +_textCenterLine1 = ""; +_textCenterLine2 = ""; +_textCenterLine3 = ""; +_textCenterLine4 = ""; +_textCenterLine5 = ""; +_textCenterLine6 = ""; + _windSpeed = call FUNC(measureWindSpeed); _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); -_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL ACE_player) select 2); -_humidity = EGVAR(weather,currentHumidity); - _playerDir = getDir ACE_player; +_playerAltitude = (getPosASL ACE_player) select 2; + +_temperature = _playerAltitude call EFUNC(weather,calculateTemperatureAtHeight); +_humidity = EGVAR(weather,currentHumidity); +_barometricPressure = _playerAltitude call EFUNC(weather,calculateBarometricPressure); +_airDensity = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateAirDensity); +_densityAltitude = _airDensity call EFUNC(weather,calculateDensityAltitude); +_chill = [_temperature, _humidity] call EFUNC(weather,calculateWindChill); +_heatIndex = [_temperature, _humidity] call EFUNC(weather,calculateHeatIndex); +_dewPoint = [_temperature, _humidity] call EFUNC(weather,calculateDewPoint); +_wetBulb = [_temperature, _barometricPressure, _humidity] call EFUNC(weather,calculateWetBulb); + +_fnc_dayOfWeek = { + private ["_year", "_month", "_day", "_table"]; + _year = _this select 0; + _month = _this select 1; + _day = _this select 2; + + _table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]; + if (_month < 3) then { + _year = _year - 1; + }; + (_year + floor(_year/4) - floor(_year/100) + floor(_year/400) + (_table select (_month - 1)) + _day) % 7 +}; GVAR(Direction) = 4 * floor(_playerDir / 90); if (_playerDir % 90 > 10) then { GVAR(Direction) = GVAR(Direction) + 1}; @@ -46,172 +79,270 @@ if (_playerDir % 90 > 55) then { GVAR(Direction) = GVAR(Direction) + 1}; if (_playerDir % 90 > 80) then { GVAR(Direction) = GVAR(Direction) + 1}; GVAR(Direction) = GVAR(Direction) % 16; -switch (GVAR(Menu)) do { - case 0: { // Direction - if (!GVAR(MinAvgMax)) then { - _textCenterBig = format["%1", format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]]; - } else { - _textCenterLine1Left = "Min"; - _textCenterLine2Left = "Avg"; - _textCenterLine3Left = "Max"; - _textCenterLine1Right = "N/A"; - _textCenterLine2Right = "N/A"; - _textCenterLine3Right = "N/A"; +if (GVAR(referenceHeadingMenu) == 0) then { + switch (GVAR(Menu)) do { + case 0: { // Date + EXPLODE_3_PVT(date,_year,_month,_day); + _dayString = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] select (date call _fnc_dayOfWeek); + _monthString = localize (["str_january","str_february","str_march","str_april","str_may","str_june","str_july","str_august","str_september","str_october","str_november","str_december"] select (_month - 1)); + _textTop = _dayString; + _textCenter = format["%1 %2 %3", _day, _monthString, _year]; + _textBottomBig = [daytime, "HH:MM:SS"] call bis_fnc_timeToString; }; - }; - case 1: { // Wind SPD - if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(abs(_windSpeed) * 10) / 10); - } else { - _textCenterLine1Left = "Max"; - _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMaxMode)) do { - case 0: { - _textCenterLine1Right = "--. -"; - _textCenterLine2Right = "--. -"; - _textInfoLine2 = "- average"; - }; - case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 1) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 1) / (GVAR(Entries) select 1) * 10) / 10); - _textInfoLine2 = "- stop"; - }; - case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 1) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 1) / (GVAR(Entries) select 1) * 10) / 10); - _textInfoLine2 = "- clear"; - }; - }; - }; - }; - case 2: { // CROSSWIND - if (!GVAR(MinAvgMax)) then { - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + case 1: { // Direction + if (!GVAR(MinAvgMax)) then { + _textCenterBig = format["%1", format["%1 %2", GVAR(Directions) select GVAR(Direction), round(_playerDir)]]; } else { - _textCenterBig = Str(round(abs(sin(GVAR(RefHeading)) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; - }; - _textInfoLine2 = "- set heading"; - } else { - _textCenterLine1Left = "Max"; - _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { - case 0: { - _textCenterLine1Right = "--. -"; - _textCenterLine2Right = "--. -"; - _textInfoLine2 = "- average"; - }; - case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); - _textInfoLine2 = "- stop"; - }; - case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); - _textInfoLine2 = "- clear"; - }; + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = "N/A"; + _textCenterLine2Right = "N/A"; + _textCenterLine3Right = "N/A"; }; }; - }; - case 3: { // HEADWIND - if (!GVAR(MinAvgMax)) then { - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _textCenterBig = Str(round(abs(cos(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + case 2: { // Wind SPD + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(abs(_windSpeed) * 10) / 10); } else { - _textCenterBig = Str(round(abs(cos(GVAR(RefHeading)) * _windSpeed) * 10) / 10); - _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; - }; - _textInfoLine2 = "- set heading"; - } else { - _textCenterLine1Left = "Max"; - _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { - case 0: { - _textCenterLine1Right = "--. -"; - _textCenterLine2Right = "--. -"; - _textInfoLine2 = "- average"; - }; - case 1: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); - _textInfoLine2 = "- stop"; - }; - case 2: { - _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); - _textInfoLine2 = "- clear"; + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (GVAR(MinAvgMaxMode)) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((GVAR(Max) select 2) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 2) / (GVAR(Entries) select 2) * 10) / 10); + _textInfoLine2 = "- clear"; + }; }; }; }; - }; - case 4: { // TEMP - if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_temperature * 10) / 10); - } else { - _textCenterLine1Left = "Min"; - _textCenterLine2Left = "Avg"; - _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 4) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 4) * 10) / 10); + case 3: { // CROSSWIND + if (!GVAR(MinAvgMax)) then { + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _textCenterBig = Str(round(abs(sin(GVAR(RefHeading) - _playerDir) * _windSpeed) * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + } else { + _textCenterBig = Str(round(abs(sin(GVAR(RefHeading)) * _windSpeed) * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; + }; + _textInfoLine2 = "- set heading"; + } else { + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (GVAR(MinAvgMax)Mode) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((GVAR(Max) select 3) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 3) / (GVAR(Entries) select 3) * 10) / 10); + _textInfoLine2 = "- clear"; + }; + }; + }; + }; + case 4: { // HEADWIND + if (!GVAR(MinAvgMax)) then { + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _textCenterBig = Str(round(cos(GVAR(RefHeading) - _playerDir) * _windSpeed * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round((abs(cos(_playerDir - _windDir)) * _windSpeed) * 10) / 10, round(_playerDir)]; + } else { + _textCenterBig = Str(round(cos(GVAR(RefHeading)) * _windSpeed * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round(_windSpeed * 10) / 10, round(_windDir)]; + }; + _textInfoLine2 = "- set heading"; + } else { + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (GVAR(MinAvgMax)Mode) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((GVAR(Max) select 4) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 4) / (GVAR(Entries) select 4) * 10) / 10); + _textInfoLine2 = "- clear"; + }; + }; + }; + }; + case 5: { // TEMP + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_temperature * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 5) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 5) * 10) / 10); + }; + }; + case 6: { // CHILL + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_chill * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 6) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 6) * 10) / 10); + }; + }; + case 7: { // HUMIDITY + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_humidity * 100 * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 7) * 100 * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7) * 100 * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 7) * 100 * 10) / 10); + }; + }; + case 8: { // HEAT INDEX + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_heatIndex * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 8) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 8) / (GVAR(Entries) select 8) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 8) * 10) / 10); + }; + }; + case 9: { // DEW POINT + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_dewPoint * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 9) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 9) / (GVAR(Entries) select 9) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 9) * 10) / 10); + }; + }; + case 10: { // WET BULB + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_wetBulb * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 10) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 10) / (GVAR(Entries) select 10) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 10) * 10) / 10); + }; + }; + case 11: { // BARO + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_barometricPressure * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((GVAR(Min) select 11) * 10) / 10); + _textCenterLine2Right = Str(round((GVAR(Total) select 11) / (GVAR(Entries) select 11) * 10) / 10); + _textCenterLine3Right = Str(round((GVAR(Max) select 11) * 10) / 10); + }; + }; + case 12: { // ALTITUDE + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(EGVAR(weather,Altitude) + _playerAltitude)); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round(GVAR(Min) select 12)); + _textCenterLine2Right = Str(round((GVAR(Total) select 12) / (GVAR(Entries) select 12))); + _textCenterLine3Right = Str(round(GVAR(Max) select 12)); + }; + }; + case 13: { // DENSITY ALTITUDE + if (!GVAR(MinAvgMax)) then { + _textCenterBig = Str(round(_densityAltitude)); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round(GVAR(Min) select 13)); + _textCenterLine2Right = Str(round((GVAR(Total) select 13) / (GVAR(Entries) select 13))); + _textCenterLine3Right = Str(round(GVAR(Max) select 13)); + }; + }; + case 14: { // User Screen 1 + _textCenterLine1Left = Str(round(_playerDir)); + _textCenterLine2Left = Str(round(EGVAR(weather,Altitude) + _playerAltitude)); + _textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10); + _textCenterLine1Right = GVAR(Directions) select GVAR(Direction); + _textCenterLine2Right = "m"; + _textCenterLine3Right = "m/s"; + }; + case 15: { // User Screen 2 + _textCenterLine1Left = Str(round(_temperature * 10) / 10); + _textCenterLine2Left = Str(round(_humidity * 100 * 10) / 10); + _textCenterLine3Left = Str(round((_playerAltitude call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); + _textCenterLine1Right = "C"; + _textCenterLine2Right = "%"; + _textCenterLine3Right = "hPA"; }; }; - case 5: { // HUMIDITY - if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(_humidity * 100 * 10) / 10); - } else { - _textCenterLine1Left = "Min"; - _textCenterLine2Left = "Avg"; - _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 5) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 5) / (GVAR(Entries) select 5) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 5) * 10) / 10); +} else { + _textTop = ""; + switch (GVAR(referenceHeadingMenu)) do { + case 1: { + _textCenterLine1 = "MAGNETIC HEADING"; + _textCenterLine2 = Str(round(GVAR(RefHeading))); + _textCenterLine3 = "Auto Set "; + _textCenterLine4 = "Manual Set "; + _textCenterLine5 = "================"; + _textCenterLine6 = "- select (|) exit"; }; - }; - case 6: { // BARO - if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round((((getPosASL ACE_player) select 2) call EFUNC(weather,calculateBarometricPressure)) * 10) / 10); - } else { - _textCenterLine1Left = "Min"; - _textCenterLine2Left = "Avg"; - _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round((GVAR(Min) select 6) * 10) / 10); - _textCenterLine2Right = Str(round((GVAR(Total) select 6) / (GVAR(Entries) select 6) * 10) / 10); - _textCenterLine3Right = Str(round((GVAR(Max) select 6) * 10) / 10); + case 2: { + _textCenterLine1 = "MAGNETIC HEADING"; + _textCenterLine2 = Str(round(_playerDir)); + _textCenterLine3 = "Point Down the"; + _textCenterLine4 = "Runway or Range"; + _textCenterLine5 = "================"; + _textCenterLine6 = "- set heading"; }; - }; - case 7: { // ALTITUDE - if (!GVAR(MinAvgMax)) then { - _textCenterBig = Str(round(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2))); - } else { - _textCenterLine1Left = "Min"; - _textCenterLine2Left = "Avg"; - _textCenterLine3Left = "Max"; - _textCenterLine1Right = Str(round(GVAR(Min) select 7)); - _textCenterLine2Right = Str(round((GVAR(Total) select 7) / (GVAR(Entries) select 7))); - _textCenterLine3Right = Str(round(GVAR(Max) select 7)); + case 3: { + _textCenterLine1 = "MAGNETIC HEADING"; + _textCenterLine2 = Str(round(GVAR(TmpHeading))); + _textCenterLine3 = "Press < and >"; + _textCenterLine4 = "to Adjust"; + _textCenterLine5 = "================"; + _textCenterLine6 = "- set heading"; }; }; - case 8: { // User Screen 1 - _textCenterLine1Left = Str(round(_playerDir)); - _textCenterLine2Left = Str(round(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2))); - _textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10); - _textCenterLine1Right = GVAR(Directions) select GVAR(Direction); - _textCenterLine2Right = "m"; - _textCenterLine3Right = "m/s"; - }; - case 9: { // User Screen 2 - _textCenterLine1Left = Str(round(_temperature * 10) / 10); - _textCenterLine2Left = Str(round(_humidity * 100 * 10) / 10); - _textCenterLine3Left = Str(round((1013.25 * exp(-(EGVAR(weather,Altitude) + ((getPosASL ACE_player) select 2)) / 7990) - 10 * overcast) * 10) / 10); - _textCenterLine1Right = "C"; - _textCenterLine2Right = "%"; - _textCenterLine3Right = "hPA"; - }; }; -[_textTop, _textCenterBig, _textCenterLine1Left, _textCenterLine2Left, _textCenterLine3Left, _textCenterLine1Right, _textCenterLine2Right, _textCenterLine3Right, _textInfoLine1, _textInfoLine2] +[_textTop, _textCenterBig, _textCenter, _textCenterLine1Left, _textCenterLine2Left, _textCenterLine3Left, _textCenterLine1Right, _textCenterLine2Right, _textCenterLine3Right, _textInfoLine1, _textInfoLine2, _textBottomBig, _textCenterLine1, _textCenterLine2, _textCenterLine3, _textCenterLine4, _textCenterLine5, _textCenterLine6] diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index eb718906aa..73b4e228d6 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -19,12 +19,13 @@ private ["_playerDir", "_windSpeed", "_windDir"]; _playerDir = getDir ACE_player; _windSpeed = vectorMagnitude ACE_wind; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _windSpeed = (eyePos ACE_player) call EFUNC(advanced_ballistics,calculateWindSpeed); + // With wind gradient + _windSpeed = [eyePos ACE_player, true, true, true] call EFUNC(weather,calculateWindSpeed); _windSpeed = abs(cos(_playerDir - _windDir)) * _windSpeed; } else { - _windSpeed = (eyePos ACE_player) call FUNC(calculateWindSpeed); + // Without wind gradient + _windSpeed = [eyePos ACE_player, false, true, true] call EFUNC(weather,calculateWindSpeed); }; if (_windSpeed > 0.3 || {GVAR(MeasuredWindSpeed) > 0.1 && _windSpeed > 0.125}) then { diff --git a/addons/kestrel4500/functions/fnc_onCloseDialog.sqf b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf new file mode 100644 index 0000000000..a45a9decc3 --- /dev/null +++ b/addons/kestrel4500/functions/fnc_onCloseDialog.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +uiNamespace setVariable ['Kestrel4500_Display', nil]; +GVAR(Kestrel4500) = false; diff --git a/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf new file mode 100644 index 0000000000..efb60b322a --- /dev/null +++ b/addons/kestrel4500/functions/fnc_onCloseDisplay.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +uiNamespace setVariable ['RscKestrel4500', nil]; +GVAR(Overlay) = false; diff --git a/addons/kestrel4500/functions/fnc_restoreUserData.sqf b/addons/kestrel4500/functions/fnc_restoreUserData.sqf new file mode 100644 index 0000000000..0ce463ad67 --- /dev/null +++ b/addons/kestrel4500/functions/fnc_restoreUserData.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Reads user data from profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_kestrel4500_fnc_restore_user_data + * + * Public: No + */ +#include "script_component.hpp" + +GVAR(Menu) = 0 max (profileNamespace getVariable ["ACE_Kestrel4500_menu", 0]) min ((count GVAR(Menus)) - 1); +GVAR(RefHeading) = 0 max (profileNamespace getVariable ["ACE_Kestrel4500_RefHeading", 0]) min 359; diff --git a/addons/kestrel4500/functions/fnc_storeUserData.sqf b/addons/kestrel4500/functions/fnc_storeUserData.sqf new file mode 100644 index 0000000000..a5d069b31d --- /dev/null +++ b/addons/kestrel4500/functions/fnc_storeUserData.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * Saves user data into profileNamespace + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_kestrel4500_fnc_store_user_data + * + * Public: No + */ +#include "script_component.hpp" + +profileNamespace setVariable ["ACE_Kestrel4500_menu", GVAR(menu)]; +profileNamespace setVariable ["ACE_Kestrel4500_RefHeading", GVAR(RefHeading)]; diff --git a/addons/kestrel4500/functions/fnc_updateDisplay.sqf b/addons/kestrel4500/functions/fnc_updateDisplay.sqf index 0f8be4f873..90f77f5f6a 100644 --- a/addons/kestrel4500/functions/fnc_updateDisplay.sqf +++ b/addons/kestrel4500/functions/fnc_updateDisplay.sqf @@ -14,20 +14,47 @@ */ #include "script_component.hpp" +#define __dsp (uiNamespace getVariable "Kestrel4500_Display") +#define __ctrlCenterLine3 (__dsp displayCtrl 74602) +#define __ctrlCenterLine4 (__dsp displayCtrl 74603) + private ["_outputData"]; _outputData = [] call FUNC(generateOutputData); ctrlSetText [74100, _outputData select 0]; ctrlSetText [74200, _outputData select 1]; +ctrlSetText [74201, _outputData select 2]; -ctrlSetText [74300, _outputData select 2]; -ctrlSetText [74301, _outputData select 3]; -ctrlSetText [74302, _outputData select 4]; +ctrlSetText [74300, _outputData select 3]; +ctrlSetText [74301, _outputData select 4]; +ctrlSetText [74302, _outputData select 5]; -ctrlSetText [74303, _outputData select 5]; -ctrlSetText [74304, _outputData select 6]; -ctrlSetText [74305, _outputData select 7]; +ctrlSetText [74303, _outputData select 6]; +ctrlSetText [74304, _outputData select 7]; +ctrlSetText [74305, _outputData select 8]; -ctrlSetText [74400, _outputData select 8]; -ctrlSetText [74401, _outputData select 9]; \ No newline at end of file +ctrlSetText [74400, _outputData select 9]; +ctrlSetText [74401, _outputData select 10]; + +ctrlSetText [74500, _outputData select 11]; + +ctrlSetText [74600, _outputData select 12]; +ctrlSetText [74601, _outputData select 13]; +ctrlSetText [74602, _outputData select 14]; +ctrlSetText [74603, _outputData select 15]; +ctrlSetText [74604, _outputData select 16]; +ctrlSetText [74605, _outputData select 17]; + +if (GVAR(referenceHeadingMenu) == 1) then { + if (GVAR(referenceHeadingAutoSet)) then { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 0.6]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0]; + } else { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 1.0]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 0.6]; + }; +} else { + __ctrlCenterLine3 ctrlSetTextColor [0, 0, 0, 1.0]; + __ctrlCenterLine4 ctrlSetTextColor [0, 0, 0, 1.0]; +}; diff --git a/addons/kestrel4500/initKeybinds.sqf b/addons/kestrel4500/initKeybinds.sqf index f6b4fec3ce..5793d36976 100644 --- a/addons/kestrel4500/initKeybinds.sqf +++ b/addons/kestrel4500/initKeybinds.sqf @@ -1,8 +1,11 @@ -["ACE3 Equipment", QGVAR(KestrelDialogKey), localize "STR_ACE_Kestrel4500_KestrelDialogKey", +["ACE3 Equipment", QGVAR(KestrelDialogKey), localize LSTRING(KestrelDialogKey), { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (GVAR(Kestrel4500)) exitWith { + closeDialog 0; + false + }; // Statement [] call FUNC(createKestrelDialog); false @@ -10,14 +13,47 @@ {false}, [0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) -["ACE3 Equipment", QGVAR(DisplayKestrelKey), localize "STR_ACE_Kestrel4500_DisplayKestrelKey", +["ACE3 Equipment", QGVAR(DisplayKestrelKey), localize LSTRING(DisplayKestrelKey), { // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Statement [] call FUNC(displayKestrel); false }, {false}, [0, [true, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) + + +//Add deviceKey entry: +private ["_conditonCode", "_toggleCode", "_closeCode"]; +_conditonCode = { + [] call FUNC(canShow); +}; +_toggleCode = { + // Conditions: canInteract + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {}; + + // Statement + if (!GVAR(Overlay)) then { + //If no overlay, show it: + [] call FUNC(displayKestrel); + } else { + //If overlay is up, switch to dialog: + [] call FUNC(createKestrelDialog); + }; +}; +_closeCode = { + // Statement + if (GVAR(Overlay)) then { + //If dispaly is open, close it: + GVAR(Overlay) = false; + }; + if (dialog && {!isNull (uiNamespace getVariable ["Kestrel4500_Display", displayNull])}) then { + //If dialog is open, close it: + GVAR(Kestrel4500) = false; + closeDialog 0; + }; +}; +[(localize LSTRING(Name)), QUOTE(PATHTOF(UI\Kestrel4500.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); diff --git a/addons/kestrel4500/kestrel4500.p3d b/addons/kestrel4500/kestrel4500.p3d deleted file mode 100644 index bb4edd2706..0000000000 Binary files a/addons/kestrel4500/kestrel4500.p3d and /dev/null differ diff --git a/addons/kestrel4500/script_component.hpp b/addons/kestrel4500/script_component.hpp index b8db2edb78..90c338ebeb 100644 --- a/addons/kestrel4500/script_component.hpp +++ b/addons/kestrel4500/script_component.hpp @@ -10,5 +10,3 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" - -#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h)) diff --git a/addons/kestrel4500/stringtable.xml b/addons/kestrel4500/stringtable.xml index e584b9120c..3ad9e8824f 100644 --- a/addons/kestrel4500/stringtable.xml +++ b/addons/kestrel4500/stringtable.xml @@ -1,7 +1,7 @@  - + Kestrel 4500NV Kestrel 4500NV Kestrel 4500NV @@ -13,7 +13,7 @@ Kestrel 4500NV Kestrel 4500NV - + Kestrel 4500 Pocket Weather Tracker Anemomentr skrzydełkowy Kestrel 4500 Карманная метеостанция Kestrel 4500NV diff --git a/addons/laser/README.md b/addons/laser/README.md index acd112e233..96a2bd7b19 100644 --- a/addons/laser/README.md +++ b/addons/laser/README.md @@ -1,7 +1,7 @@ ace_laser ========= -Contains various functions necessary for the realitic protrayal of laser mechanics in other components. +Contains various functions necessary for the realistic portrayal of laser mechanics in other components. ## Maintainers diff --git a/addons/laser/functions/fnc_keyLaserCodeDown.sqf b/addons/laser/functions/fnc_keyLaserCodeDown.sqf index a27b376d59..f833c477c6 100644 --- a/addons/laser/functions/fnc_keyLaserCodeDown.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeDown.sqf @@ -8,5 +8,5 @@ if(_oldLaserCode > ACE_DEFAULT_LASER_CODE) then { ACE_player setVariable [QGVAR(code), _laserCode, false]; }; if(_laserCode != _oldLaserCode) then { - [format ["%1: %2", localize "STR_ACE_laser_laserCode", _laserCode]] call EFUNC(common,displayTextStructured); + [format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured); }; \ No newline at end of file diff --git a/addons/laser/functions/fnc_keyLaserCodeUp.sqf b/addons/laser/functions/fnc_keyLaserCodeUp.sqf index 4e8750164c..5357cec14c 100644 --- a/addons/laser/functions/fnc_keyLaserCodeUp.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeUp.sqf @@ -6,5 +6,5 @@ _oldLaserCode = ACE_player getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; _laserCode = _oldLaserCode + 1; ACE_player setVariable [QGVAR(code), _laserCode, false]; if(_laserCode != _oldLaserCode) then { -[format ["%1: %2", localize "STR_ACE_laser_laserCode", _laserCode]] call EFUNC(common,displayTextStructured); +[format ["%1: %2", localize LSTRING(laserCode), _laserCode]] call EFUNC(common,displayTextStructured); }; \ No newline at end of file diff --git a/addons/laser/functions/fnc_laserOn.sqf b/addons/laser/functions/fnc_laserOn.sqf index 9b5faa3859..901fa04b9a 100644 --- a/addons/laser/functions/fnc_laserOn.sqf +++ b/addons/laser/functions/fnc_laserOn.sqf @@ -17,7 +17,7 @@ #include "script_component.hpp" private ["_uuid", "_args"]; -_uuid = format["%1%2%3", floor diag_tickTime, floor random 1000, floor random 10000]; +_uuid = format["%1%2%3", floor ACE_diagTime, floor random 1000, floor random 10000]; _args = [_uuid, _this]; ["laser_laserOn", _args] call EFUNC(common,globalEvent); _uuid; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 77713eb591..346aec837e 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -1,32 +1,32 @@ -/* - * Author: Nou - * Turn a laser designator on. - * - * Arguments: - * 0: Position of seeker (ASL) - * 1: Direction vector (will be normalized) - * 2: Seeker FOV in degrees - * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. - * 4: Seeker laser code. - * - * 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 ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; -private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; - -_pos = _this select 0; -_dir = vectorNormalized (_this select 1); +/* + * Author: Nou + * Turn a laser designator on. + * + * Arguments: + * 0: Position of seeker (ASL) + * 1: Direction vector (will be normalized) + * 2: Seeker FOV in degrees + * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. + * 4: Seeker laser code. + * + * 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 ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; +private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; + +_pos = _this select 0; +_dir = vectorNormalized (_this select 1); _seekerFov = _this select 2; _seekerWavelengths = _this select 3; -_seekerCode = _this select 4; - - +_seekerCode = _this select 4; + + _seekerCos = cos _seekerFov; _spots = []; @@ -47,9 +47,9 @@ _finalOwner = nil; _laser = []; if(IS_CODE(_method)) then { _laser = _x call _method; - } else { - if(IS_STRING(_method)) then { - _laser = _x call (missionNamespace getVariable [_method, {}]); + } else { + if(IS_STRING(_method)) then { + _laser = _x call (missionNamespace getVariable [_method, {}]); } else { if(IS_ARRAY(_method)) then { if(count _method == 2) then { @@ -59,18 +59,18 @@ _finalOwner = nil; _laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), (ATLtoASL (_obj modelToWorldVisual (_method select 1))) vectorFromTo (ATLtoASL (_obj modelToWorldVisual (_method select 2)))]; }; }; - }; + }; }; }; _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; + { + _testPoint = _x select 0; + _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); + _testDotProduct = _dir vectorDotProduct _testPointVector; if(_testDotProduct > _seekerCos) then { - _spots pushBack [_testPoint, _owner]; + _spots pushBack [_testPoint, _owner]; }; } forEach (_res select 2); }; @@ -128,7 +128,7 @@ if((count _spots) > 0) then { _avgY = 0; _avgZ = 0; { - player sideChat format["x: %1", _x]; + //player sideChat format["x: %1", _x]; _avgX = _avgX + ((_x select 0) select 0); _avgY = _avgY + ((_x select 0) select 1); _avgZ = _avgZ + ((_x select 0) select 2); diff --git a/addons/laser/initKeybinds.sqf b/addons/laser/initKeybinds.sqf index d367b3553c..5e3d017103 100644 --- a/addons/laser/initKeybinds.sqf +++ b/addons/laser/initKeybinds.sqf @@ -1,4 +1,4 @@ -["ACE3 Equipment", QGVAR(LaserCodeUp), localize "STR_ACE_laser_laserCodeUp", +["ACE3 Equipment", QGVAR(LaserCodeUp), localize LSTRING(laserCodeUp), { if( EGVAR(laser_selfdesignate,active) || @@ -12,7 +12,7 @@ {false}, [16, [false, true, true]], false, 0] call CBA_fnc_addKeybind; // (ALT+CTRL+Q) -["ACE3 Equipment", QGVAR(LaserCodeDown), localize "STR_ACE_laser_laserCodeDown", +["ACE3 Equipment", QGVAR(LaserCodeDown), localize LSTRING(laserCodeDown), { if( EGVAR(laser_selfdesignate,active) || diff --git a/addons/laser/script_component.hpp b/addons/laser/script_component.hpp index 77369ead96..6620f63c4d 100644 --- a/addons/laser/script_component.hpp +++ b/addons/laser/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT laser -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_LASER #define DEBUG_MODE_FULL @@ -9,7 +9,7 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define FIREMODE_DIRECT_LOAL 1 diff --git a/addons/laser/stringtable.xml b/addons/laser/stringtable.xml index 77a16db525..4a478096d0 100644 --- a/addons/laser/stringtable.xml +++ b/addons/laser/stringtable.xml @@ -1,38 +1,41 @@ - - - - - Laser Code - Lasercode - Kod lasera - Code laser - Лазерный код - Código do Laser - Lézerkód - Código del láser - Laser kód - - - Laser - Cycle Code Up - Lasercode + - Laser - Następny kod - Laser - Code + - Лазер - увеличить частоту - Laser - Alternar Código para Cima - Lézer - kódciklus növelése - Láser - Aumentar código - Laser - Kód + - - - Laser - Cycle Code Down - Lasercode - - Laser - Poprzedni kod - Laser - Code - - Лазер - уменьшить частоту - Laser - Alternar Código para Baixo - Lézer - kódciklus csökkentése - Láser - Reducir código - Laser - Kód - - - - \ No newline at end of file + + + + + Laser Code + Lasercode + Kod lasera + Code laser + Лазерный код + Código do Laser + Lézerkód + Código del láser + Laser kód + Codice laser + + + Laser - Cycle Code Up + Lasercode + + Laser - Następny kod + Laser - Code + + Лазер - увеличить частоту + Laser - Alternar Código para Cima + Lézer - kódciklus növelése + Láser - Aumentar código + Laser - Kód + + Codice laser + + + + Laser - Cycle Code Down + Lasercode - + Laser - Poprzedni kod + Laser - Code - + Лазер - уменьшить частоту + Laser - Alternar Código para Baixo + Lézer - kódciklus csökkentése + Láser - Reducir código + Laser - Kód - + Codice laser - + + + diff --git a/addons/laser_selfdesignate/$PBOPREFIX$ b/addons/laser_selfdesignate/$PBOPREFIX$ index 3871f5df99..821ffd07ea 100644 --- a/addons/laser_selfdesignate/$PBOPREFIX$ +++ b/addons/laser_selfdesignate/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\laser_selfdesignate \ No newline at end of file +z\ace\addons\laser_selfdesignate \ No newline at end of file diff --git a/addons/laser_selfdesignate/config.cpp b/addons/laser_selfdesignate/config.cpp index 19ec28063b..597500caf6 100644 --- a/addons/laser_selfdesignate/config.cpp +++ b/addons/laser_selfdesignate/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_laser"}; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf index 6514c889a1..a75e58f533 100644 --- a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf +++ b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf @@ -31,7 +31,7 @@ GVAR(initializedClasses) = _initializedClasses; // e.g.: _vehicle setVariable [format ["%1_%2", QGVAR(active), _x], false]; // Add actions - _onAction = [QGVAR(LaserOn), localize "STR_ACE_Laser_SelfDesignate_DesignatorOn", "", + _onAction = [QGVAR(LaserOn), localize LSTRING(DesignatorOn), "", { // Statement _this call FUNC(laserHudDesignateOn) @@ -41,7 +41,7 @@ GVAR(initializedClasses) = _initializedClasses; !GVAR(active) && {[ACE_player] call FUNC(unitTurretHasDesignator)} }] call EFUNC(interact_menu,createAction); - _offAction = [QGVAR(LaserOff), localize "STR_ACE_Laser_SelfDesignate_DesignatorOff", "", + _offAction = [QGVAR(LaserOff), localize LSTRING(DesignatorOff), "", { // Statement _this call FUNC(laserHudDesignateOff) diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index e0c835814e..0da2866738 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -32,7 +32,7 @@ FUNC(laserHudDesignatePFH) = { }; if( (count _args) < 4) then { - _args set[3, diag_tickTime + FCS_UPDATE_DELAY]; + _args set[3, ACE_diagTime + FCS_UPDATE_DELAY]; }; _forceUpdateTime = _args select 3; @@ -57,9 +57,9 @@ FUNC(laserHudDesignatePFH) = { }; */ - if(diag_tickTime > _forceUpdateTime) then { + if(ACE_diagTime > _forceUpdateTime) then { ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent; - _args set[3, diag_tickTime + FCS_UPDATE_DELAY]; + _args set[3, ACE_diagTime + FCS_UPDATE_DELAY]; }; _this set[0, _args]; diff --git a/addons/laser_selfdesignate/functions/script_component.hpp b/addons/laser_selfdesignate/functions/script_component.hpp index 38c6d2c44b..320dc825c7 100644 --- a/addons/laser_selfdesignate/functions/script_component.hpp +++ b/addons/laser_selfdesignate/functions/script_component.hpp @@ -1 +1 @@ -#include "\z\ace\Addons\laser_selfdesignate\script_component.hpp" +#include "\z\ace\addons\laser_selfdesignate\script_component.hpp" diff --git a/addons/laser_selfdesignate/script_component.hpp b/addons/laser_selfdesignate/script_component.hpp index 46e9c48d2f..d0e095924d 100644 --- a/addons/laser_selfdesignate/script_component.hpp +++ b/addons/laser_selfdesignate/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT laser_selfdesignate -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_LASER_SELFDESIGNATE #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/laser_selfdesignate/stringtable.xml b/addons/laser_selfdesignate/stringtable.xml index f25689c5b9..cdd7439200 100644 --- a/addons/laser_selfdesignate/stringtable.xml +++ b/addons/laser_selfdesignate/stringtable.xml @@ -26,4 +26,4 @@ Designador Laser Desligado - \ No newline at end of file + diff --git a/addons/laserpointer/ACE_Settings.hpp b/addons/laserpointer/ACE_Settings.hpp new file mode 100644 index 0000000000..0536db730d --- /dev/null +++ b/addons/laserpointer/ACE_Settings.hpp @@ -0,0 +1,6 @@ +class ACE_Settings { + class GVAR(enabled) { + typeName = "BOOL"; + value = 1; + }; +}; diff --git a/addons/laserpointer/CfgWeapons.hpp b/addons/laserpointer/CfgWeapons.hpp index 6223c3a988..608d025a01 100644 --- a/addons/laserpointer/CfgWeapons.hpp +++ b/addons/laserpointer/CfgWeapons.hpp @@ -10,26 +10,26 @@ class CfgWeapons { class acc_pointer_IR: ItemCore { ACE_nextModeClass = "ACE_acc_pointer_red"; - ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + ACE_modeDescription = CSTRING(IRLaser); - displayName = "$STR_ACE_Laserpointer_red"; - descriptionUse = "$STR_ACE_Laserpointer_useLaser"; + displayName = CSTRING(red); + descriptionUse = CSTRING(useLaser); }; class ACE_acc_pointer_red: ItemCore { ACE_nextModeClass = "acc_pointer_IR"; - ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + ACE_modeDescription = CSTRING(Laser); ACE_laserpointer = 1; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_acc_pointer_red"; scope = 1; - displayName = "$STR_ACE_Laserpointer_red"; - descriptionUse = "$STR_ACE_Laserpointer_useLaser"; + displayName = CSTRING(red); + descriptionUse = CSTRING(useLaser); picture = "\A3\weapons_F\Data\UI\gear_accv_pointer_CA.paa"; model = "\A3\weapons_f\acc\accv_pointer_F"; - descriptionShort = "$STR_ACE_Laserpointer_Description"; + descriptionShort = CSTRING(Description); class ItemInfo: InventoryFlashLightItem_Base_F { mass = 6; @@ -69,23 +69,23 @@ class CfgWeapons { class ACE_acc_pointer_green_IR: acc_pointer_IR { ACE_nextModeClass = "ACE_acc_pointer_green"; - ACE_modeDescription = "$STR_ACE_Laserpointer_IRLaser"; + ACE_modeDescription = CSTRING(IRLaser); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_acc_pointer_green"; scope = 1; - displayName = "$STR_ACE_Laserpointer_green"; + displayName = CSTRING(green); }; class ACE_acc_pointer_green: ACE_acc_pointer_red { ACE_nextModeClass = "ACE_acc_pointer_green_IR"; - ACE_modeDescription = "$STR_ACE_Laserpointer_Laser"; + ACE_modeDescription = CSTRING(Laser); ACE_laserpointer = 2; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_acc_pointer_green"; scope = 2; - displayName = "$STR_ACE_Laserpointer_green"; + displayName = CSTRING(green); }; }; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index 38fc35f262..133931578a 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -1,33 +1,41 @@ // by commy2 #include "script_component.hpp" -// fixes laser when being captured. Needed, because the selectionpsoition of the right hand is used +// 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) = []; -// @todo. Maybe move to common? -[{ - private "_nearUnits"; - _nearUnits = []; - - { - _nearUnits append crew _x; - - if (count _nearUnits > 10) exitWith { - _nearUnits resize 10; - }; - - } 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", { - call FUNC(onDraw); -}]; - #include "initKeybinds.sqf" + +["SettingsInitialized", { + //If not enabled, dont't add draw eventhandler or PFEH (for performance) + if (!GVAR(enabled)) exitWith {}; + + // @todo. Maybe move to common? + [{ + private "_nearUnits"; + _nearUnits = []; + { + _nearUnits append crew _x; + if (count _nearUnits > 10) exitWith { + _nearUnits resize 10; + }; + } 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", { + call FUNC(onDraw); + }]; +}] call EFUNC(common,addEventHandler); diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index 5ca5ce3470..d368512257 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -12,6 +12,7 @@ class CfgPatches { }; }; +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf index 93a421a094..e69fc5e271 100644 --- a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -1,6 +1,8 @@ // by commy2 and esteldunedain #include "script_component.hpp" +private ["_p0", "_p1", "_p0Pos", "_offV1", "_offV2", "_offV3", "_camPos", "_intermediatePos", "_iteration", "_light", "_line", "_pL", "_pL2", "_pX", "_size", "_units", "_fnc_getDistanceToTerrain", "_fnc_doesIntersectWithMan"]; + // init object /*if (isNil QGVAR(laserdot)) then { _light = "#lightpoint" createVehicleLocal [0,0,0]; @@ -14,7 +16,7 @@ GVAR(laserdot) = _light; };*/ -EXPLODE_3_PVT(_this,_unit,_range,_isGreen); +EXPLODE_4_PVT(_this,_unit,_range,_isGreen,_brightness); _p0Pos = _unit modelToWorldVisual (_unit selectionPosition "righthand"); @@ -47,7 +49,7 @@ _p1 = _p0 vectorAdd (_v1 vectorMultiply _range); //Debugaaa = lineIntersectsObjs [_p0, _p1, objNull, _unit, false, 2]; _fnc_getDistanceToTerrain = { - private "_distance"; + private ["_distance"]; _pX = + _p0; _line = [_p0, _pX]; @@ -55,9 +57,7 @@ _fnc_getDistanceToTerrain = { _distance = _this; _iteration = _distance; - while { - _iteration > 0.05 / 2 - } do { + while {_iteration > 0.05 / 2} do { _iteration = _iteration / 2; _pX = _p0 vectorAdd (_v1 vectorMultiply _distance); diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf index c1e955d028..09663f9ecf 100644 --- a/addons/laserpointer/functions/fnc_onDraw.sqf +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -1,18 +1,19 @@ // by commy2 #include "script_component.hpp" -_brightness = 2 - call EFUNC(common,ambientBrightness); -_isIR = currentVisionMode ACE_player; +private ["_brightness", "_cacheName", "_isIR", "_laser", "_laserID", "_weapon"]; +_isIR = currentVisionMode ACE_player; if (_isIR == 2) exitWith {}; _isIR = _isIR == 1; +_brightness = 2 - call EFUNC(common,ambientBrightness); + { _weapon = currentWeapon _x; _laser = switch (_weapon) do { - case (""): {""}; case (primaryWeapon _x): { primaryWeaponItems _x select 1; }; @@ -34,7 +35,7 @@ _isIR = _isIR == 1; }; if (_laserID > 0 && {_x isFlashlightOn _weapon}) then { - [_x, 50, _laserID == 2 || _isIR] call FUNC(drawLaserpoint); + [_x, 50, (_laserID == 2 || _isIR), _brightness] call FUNC(drawLaserpoint); }; }; diff --git a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf index f996d6b270..99549ec18f 100644 --- a/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf +++ b/addons/laserpointer/functions/fnc_switchLaserLightMode.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_weapon"]; +private ["_unit", "_weapon", "_error"]; _unit = _this select 0; _weapon = _this select 1; @@ -29,30 +29,61 @@ _pointer = switch (_weapon) do { if (_pointer == "") exitWith {}; +private "_config"; +_config = configFile >> "CfgWeapons" >> _pointer; + private "_nextPointer"; -_nextPointer = getText (configFile >> "CfgWeapons" >> _pointer >> "ACE_nextModeClass"); +_nextPointer = getText (_config >> "ACE_nextModeClass"); if (_nextPointer == "") exitWith {}; +//If system disabled, don't switch to a laser: +private "_nextPointerIsLaser"; +_nextPointerIsLaser = getNumber (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_laserpointer"); +if ((!GVAR(enabled)) && {_nextPointerIsLaser == 1}) exitWith {}; + +// disable inheritance for this entry, because addons claim this as a base class for convenience +if !((_config >> "ACE_nextModeClass") in configProperties [_config, "true", false]) exitWith {}; + private ["_description", "_picture"]; _description = getText (configFile >> "CfgWeapons" >> _nextPointer >> "ACE_modeDescription"); _picture = getText (configFile >> "CfgWeapons" >> _nextPointer >> "picture"); +_error = false; switch (_currentWeaponType) do { - case 1: { - _unit removePrimaryWeaponItem _pointer; - _unit addPrimaryWeaponItem _nextPointer; - }; - case 2: { - _unit removeSecondaryWeaponItem _pointer; - _unit addSecondaryWeaponItem _nextPointer; - }; - case 3: { - _unit removeHandgunItem _pointer; - _unit addHandgunItem _nextPointer; - }; + case 1: { + _unit removePrimaryWeaponItem _pointer; + _unit addPrimaryWeaponItem _nextPointer; + if (((primaryWeaponItems _unit) select 1) != _nextPointer) then { + ERROR("NextPointer not compatible"); + _unit addPrimaryWeaponItem _pointer; + _error = true; + }; + }; + case 2: { + _unit removeSecondaryWeaponItem _pointer; + _unit addSecondaryWeaponItem _nextPointer; + if (((secondaryWeaponItems _unit) select 1) != _nextPointer) then { + ERROR("NextPointer not compatible"); + _unit addSecondaryWeaponItem _pointer; + _error = true; + }; + }; + case 3: { + _unit removeHandgunItem _pointer; + _unit addHandgunItem _nextPointer; + if (((handgunItems _unit) select 1) != _nextPointer) then { + ERROR("NextPointer not compatible"); + _unit addHandgunItem _pointer; + _error = true; + }; + }; }; -[_description, _picture] call EFUNC(common,displayTextPicture); +if (!_error) then { + [_description, _picture] call EFUNC(common,displayTextPicture); +} else { + diag_log text format ["Failed to add %1 to %2 - reverting to %3", _nextPointer, _weapon, _pointer]; +}; playSound "ACE_Sound_Click"; diff --git a/addons/laserpointer/initKeybinds.sqf b/addons/laserpointer/initKeybinds.sqf index e01f3be5fa..a4164d420e 100644 --- a/addons/laserpointer/initKeybinds.sqf +++ b/addons/laserpointer/initKeybinds.sqf @@ -1,9 +1,9 @@ // by commy2 -["ACE3 Weapons", QGVAR(switchLaserLightMode), localize "STR_ACE_Laserpointer_switchLaserLight", +["ACE3 Weapons", QGVAR(switchLaserLightMode), localize LSTRING(switchLaserLight), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml index bf785781d0..1a4182bd8e 100644 --- a/addons/laserpointer/stringtable.xml +++ b/addons/laserpointer/stringtable.xml @@ -34,7 +34,7 @@ Wydziela widzialne światło. Látható fényt bocsát ki. Emite luz visible. - Emette luce visibile + Emette luce visibile. Emite luz visível. @@ -86,4 +86,4 @@ Alternar entre Laser / Laser IV - \ No newline at end of file + diff --git a/addons/logistics_uavbattery/CfgVehicles.hpp b/addons/logistics_uavbattery/CfgVehicles.hpp index 5feba4c9a8..ca924a1cb8 100644 --- a/addons/logistics_uavbattery/CfgVehicles.hpp +++ b/addons/logistics_uavbattery/CfgVehicles.hpp @@ -1,15 +1,25 @@ class CfgVehicles { - class Helicopter_Base_F; - class UAV_01_base_F: Helicopter_Base_F { + class Air; + class Helicopter: Air { class ACE_Actions { - class ACE_MainActions { + class ACE_MainActions {}; + }; + }; + class Helicopter_Base_F: Helicopter { + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions {}; + }; + }; + class UAV_01_base_F: Helicopter_Base_F { + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions { class GVAR(RefuelUAV) { - displayName = "$STR_ACE_logistics_uavbattery_Recharge"; + displayName = CSTRING(Recharge); distance = 4; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canRefuelUAV)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(refuelUAV)); - showDisabled = 0; \ - priority = 1.245; \ + showDisabled = 0; + priority = 1.245; icon = QUOTE(PATHTOF(ui\UAV_battery_ca.paa)); }; }; diff --git a/addons/logistics_uavbattery/CfgWeapons.hpp b/addons/logistics_uavbattery/CfgWeapons.hpp index 1986b4f80f..923d2dd934 100644 --- a/addons/logistics_uavbattery/CfgWeapons.hpp +++ b/addons/logistics_uavbattery/CfgWeapons.hpp @@ -4,8 +4,8 @@ class CfgWeapons { class ACE_UAVBattery: ACE_ItemCore { scope = 2; - displayName = "$STR_ACE_logistics_uavbattery_Battery_Name"; - descriptionShort = "$STR_ACE_logistics_uavbattery_Battery_Description"; + displayName = CSTRING(Battery_Name); + descriptionShort = CSTRING(Battery_Description); model = QUOTE(PATHTOF(models\ace_battery.p3d)); picture = QUOTE(PATHTOF(ui\UAV_battery_ca.paa)); class ItemInfo: InventoryItem_Base_F { diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 6fda0fed10..e51f17777e 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -36,4 +36,4 @@ _onFailure = { [_caller, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); -[10, [_caller, _target], _onFinish, _onFailure, (localize "STR_ACE_logistics_uavbattery_Battery_Recharge"), {(_this select 0) call FUNC(canRefuelUAV)}] call EFUNC(common,progressBar); +[10, [_caller, _target], _onFinish, _onFailure, (localize LSTRING(Battery_Recharge)), {(_this select 0) call FUNC(canRefuelUAV)}] call EFUNC(common,progressBar); diff --git a/addons/logistics_uavbattery/stringtable.xml b/addons/logistics_uavbattery/stringtable.xml index 8c0bd56675..5b3a219a30 100644 --- a/addons/logistics_uavbattery/stringtable.xml +++ b/addons/logistics_uavbattery/stringtable.xml @@ -1,7 +1,7 @@  - - + + Drone is full Drohne ist voll El VANT está lleno @@ -13,7 +13,7 @@ Il drone è pieno БПЛА полностью заряжен - + You need a UAV Battery Du brauchst eine UAV-Batterie Necesitas una batería para VANT @@ -25,7 +25,7 @@ Hai bisogno di una Batteria UAV Требуется аккумулятор для БПЛА - + Recharge Aufladen Recargar @@ -37,7 +37,7 @@ Ricarica Зарядить - + UAV Battery UAV-Batterie Batería para VANT @@ -49,7 +49,7 @@ Batteria UAV Аккумулятор БПЛА - + Used to refuel Carried UAV's Verwendet zum Aufladen von tragbaren UAVs Usada para reabastecer el VANT @@ -61,7 +61,7 @@ Usata per ricaricare la Batteria dell'UAV Используется для зарядки переносных БПЛА - + Recharging ... Aufladen ... Recargando ... diff --git a/addons/logistics_wirecutter/CfgWeapons.hpp b/addons/logistics_wirecutter/CfgWeapons.hpp index 648bc3a3f8..31de39cf2c 100644 --- a/addons/logistics_wirecutter/CfgWeapons.hpp +++ b/addons/logistics_wirecutter/CfgWeapons.hpp @@ -3,9 +3,9 @@ class CfgWeapons { class ACE_ItemCore; class ACE_wirecutter: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_logistics_wirecutter_wirecutterName"; - descriptionShort = "$STR_ACE_logistics_wirecutter_wirecutterDescription"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(wirecutterName); + descriptionShort = CSTRING(wirecutterDescription); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa)); scope = 2; diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 0cab7ab461..f45f0c1511 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -38,4 +38,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 "STR_ACE_logistics_wirecutter_CuttingFence", _progressCheck] call EFUNC(common,progressBar); +[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf index 77bc4f2ba6..57495a2a03 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf @@ -18,5 +18,5 @@ PARAMS_1(_fenceObject); _fenceObject setdamage 1; -// [localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured); +// [localize LSTRING(FenceCut)] call EFUNC(common,displayTextStructured); [ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index efb8f292c9..05c47c4454 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -53,7 +53,7 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; if ([_x] call FUNC(isFence)) then { _fencesHelped pushBack _x; _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); - _action = [QGVAR(helperCutFence), (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction); + _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; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 1ab97a67af..4c247b268a 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -17,7 +17,7 @@ #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"] +#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"] diff --git a/addons/logistics_wirecutter/stringtable.xml b/addons/logistics_wirecutter/stringtable.xml index c49243d91e..085971264c 100644 --- a/addons/logistics_wirecutter/stringtable.xml +++ b/addons/logistics_wirecutter/stringtable.xml @@ -1,7 +1,7 @@  - - + + Wirecutter Pince coupante Drahtschneider @@ -10,10 +10,10 @@ Štípací kleště Nożyce do cięcia drutu Drótvágó - Pinze da Taglio + Trancia Cortador de Arame - + Wirecutter Schneidet Draht. Cortador de cables @@ -22,10 +22,10 @@ Służą do cięcia drutu i płotów Pince coupante Drótok, huzalok, és kábelek vágására alkalmas olló. - Pinze da Taglio + Trancia da ferro Cortador de Arame - + Cut Fence Zaun schneiden Cortar alambrado @@ -37,7 +37,7 @@ Drótkerítés átvágása Разрезать забор - + Cutting Fences / Wires ... Zaun / Draht schneiden ... Cortando alambrado / cables ... @@ -49,7 +49,7 @@ Drótok elvágása ... Разрезаем забор / провода ... - + Fence cut Zaun geschnitten Alambrado cortado @@ -62,4 +62,4 @@ Забор разрезан - \ No newline at end of file + diff --git a/addons/magazinerepack/ACE_Settings.hpp b/addons/magazinerepack/ACE_Settings.hpp new file mode 100644 index 0000000000..0b7b2d4628 --- /dev/null +++ b/addons/magazinerepack/ACE_Settings.hpp @@ -0,0 +1,17 @@ +class ACE_Settings { + //Time to move a round from one magazine to another + class GVAR(TimePerAmmo) { + value = 1.5; + typeName = "SCALAR"; + }; + //Time to swap between magazines when repacking + class GVAR(TimePerMagazine) { + value = 2.0; + typeName = "SCALAR"; + }; + //Time to relink 2 belts together + class GVAR(TimePerBeltLink) { + value = 8.0; + typeName = "SCALAR"; + }; +}; diff --git a/addons/magazinerepack/CfgVehicles.hpp b/addons/magazinerepack/CfgVehicles.hpp index a5312369d5..78af19bcfe 100644 --- a/addons/magazinerepack/CfgVehicles.hpp +++ b/addons/magazinerepack/CfgVehicles.hpp @@ -3,9 +3,9 @@ class CfgVehicles { class CAManBase: Man { class ACE_SelfActions { class ACE_RepackMagazines { - displayName = "$STR_ACE_MagazineRepack_RepackMagazines"; + displayName = CSTRING(RepackMagazines); condition = QUOTE(true); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; insertChildren = QUOTE(_this call FUNC(getMagazineChildren)); priority = -2; icon = QUOTE(PATHTOF(UI\repack_ca.paa)); diff --git a/addons/magazinerepack/config.cpp b/addons/magazinerepack/config.cpp index 7c921889a1..47c0ac889c 100644 --- a/addons/magazinerepack/config.cpp +++ b/addons/magazinerepack/config.cpp @@ -15,21 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgSounds.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - //Time to move a round from one magazine to another - class GVAR(TimePerAmmo) { - value = 1.5; - typeName = "SCALAR"; - }; - //Time to swap between magazines when repacking - class GVAR(TimePerMagazine) { - value = 2.0; - typeName = "SCALAR"; - }; - //Time to relink 2 belts together - class GVAR(TimePerBeltLink) { - value = 8.0; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index c4ddb2d93d..1f5be8f72a 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -26,12 +26,12 @@ EXPLODE_2_PVT(_args,_magazineClassname,_lastAmmoCount); _fullMagazineCount = getNumber (configfile >> "CfgMagazines" >> _magazineClassname >> "count"); //Don't show anything if player can't interact: -if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; +if (!([ACE_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; _structuredOutputText = if (_errorCode == 0) then { - format ["%1
", (localize "STR_ACE_MagazineRepack_RepackComplete")]; + format ["%1
", (localize LSTRING(RepackComplete))]; } else { - format ["%1
", (localize "STR_ACE_MagazineRepack_RepackInterrupted")]; + format ["%1
", (localize LSTRING(RepackInterrupted))]; }; _picture = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "picture"); @@ -51,6 +51,6 @@ _structuredOutputText = _structuredOutputText + format ["" + (localize "STR_ACE_MagazineRepack_RepackedMagazinesCount") + ""), _fullMags, _partialMags]; +// _structuredOutputText = _structuredOutputText + format [("" + (localize LSTRING(RepackedMagazinesCount)) + ""), _fullMags, _partialMags]; [parseText _structuredOutputText, 2] call EFUNC(common,displayTextStructured); diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 4ef69044da..e57e569dc1 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -9,7 +9,7 @@ * 2: Magazine is a belt * * Return Value: - * Array in format [time, isBullet, array of ammo counts] + * Array in format [ACE_time, isBullet, array of ammo counts] * * Example: * [10, [1,2,3,8], false] call ace_magazinerepack_fnc_simulateRepackEvents = @@ -24,7 +24,8 @@ private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowI PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); // Sort Ascending - Don't modify original -_arrayOfAmmoCounts = (+_arrayOfAmmoCounts) call BIS_fnc_sortNum; +_arrayOfAmmoCounts = +_arrayOfAmmoCounts; +_arrayOfAmmoCounts sort true; _newMagFnc = { _time = _time + GVAR(TimePerMagazine); diff --git a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf index bb98461316..e0621a41be 100644 --- a/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf +++ b/addons/magazinerepack/functions/fnc_startRepackingMagazine.sqf @@ -31,7 +31,7 @@ _fullMagazineCount = getNumber (_magazineCfg >> "count"); _isBelt = (isNumber (_magazineCfg >> "ACE_isBelt")) && {(getNumber (_magazineCfg >> "ACE_isBelt")) == 1}; //Check canInteractWith: -if (!([_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; +if (!([_player, objNull, ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {}; [_player] call EFUNC(common,goKneeling); @@ -67,7 +67,7 @@ _totalTime, [_magazineClassname, _startingAmmoCounts, _simEvents], {_this call FUNC(magazineRepackFinish)}, {_this call FUNC(magazineRepackFinish)}, -(localize "STR_ACE_MagazineRepack_RepackingMagazine"), +(localize LSTRING(RepackingMagazine)), {_this call FUNC(magazineRepackProgress)}, -["isNotInside"] +["isNotInside", "isNotSitting"] ] call EFUNC(common,progressBar); diff --git a/addons/magazinerepack/stringtable.xml b/addons/magazinerepack/stringtable.xml index 7030dc374e..c6879280da 100644 --- a/addons/magazinerepack/stringtable.xml +++ b/addons/magazinerepack/stringtable.xml @@ -8,7 +8,7 @@ Réorganiser les chargeurs Przepakuj magazynki Přepáskovat Zásobníky - Ricarica Caricatori + Ricarica caricatori Reorganizar Carregadores Újratárazás Перепаковать магазины @@ -20,7 +20,7 @@ Sélectionner menu des chargeurs Menu wyboru magazynków Zvolit Menu zásobníků - Seleziona Menù di Ricarica + Seleziona menù di ricarica Menu de Seleção de Carregador Fegyvertár menü kiválasztás Меню выбора магазинов @@ -32,7 +32,7 @@ Sélectionner chargeur Wybierz magazynek Zvolit zásobník - Seleziona Caricatore + Seleziona caricatore Selecionar Carregador Tár kiválasztása Выбрать магазин @@ -68,7 +68,7 @@ %1 chargeur(s) plein(s) et %2 cartouche(s) en rab Pełnych magazynków: %1.<br/>Dodatkowych naboi: %2. %1 plný zásobník(y) a %2 munice navíc - %1 caricatore/i pieno e %2 munizioni extra + %1 caricatore(i) pieno e %2 munizioni extra %1 carregador(es) cheio(s) e %2 disparo(s) a mais %1 teljes tár és %2 extra lőszer %1 полных магазина(ов) и %2 патрона(ов) @@ -76,7 +76,7 @@ Repacking Finished Réorganisation terminée - Wiederverpacken Fertig + Wiederverpacken fertig Reorganización finalizada Перепаковка завершена Páskování dokončeno @@ -88,7 +88,7 @@ Repacking Interrupted Réorganisation interrompue - Umpacken Unterbrochen + Umpacken unterbrochen Reorganización interrumpida Перепаковка прервана Páskování přerušeno @@ -106,8 +106,8 @@ %1 plný a %2 částečně Pełnych: %1.<br/>Częściowo pełnych: %2. %1 teljes és %2 részleges - %1 pieno e %2 parziale + %1 pieno(i) e %2 parziale(i) %1 Total e %2 Parcial - + \ No newline at end of file diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index d4b6739918..1fb4a0b622 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -22,6 +22,13 @@ #define PATHTOEF(var1,var2) PATHTOF_SYS(PREFIX,var1,var2) +#ifndef STRING_MACROS_GUARD +#define STRING_MACROS_GUARD + #define LSTRING(var1) QUOTE(TRIPLES(STR,ADDON,var1)) + #define LESTRING(var1,var2) QUOTE(TRIPLES(STR,DOUBLES(PREFIX,var1),var2)) + #define CSTRING(var1) QUOTE(TRIPLES($STR,ADDON,var1)) + #define ECSTRING(var1,var2) QUOTE(TRIPLES($STR,DOUBLES(PREFIX,var1),var2)) +#endif #define GETVAR_SYS(var1,var2) getVariable [ARR_2(QUOTE(var1),var2)] #define SETVAR_SYS(var1,var2) setVariable [ARR_2(QUOTE(var1),var2)] @@ -82,4 +89,8 @@ #define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) #define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) +// Time functions for accuracy per frame +#define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime)) + + #include "script_debug.hpp" \ No newline at end of file diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 5777d7223e..b94cde4b31 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -4,9 +4,9 @@ #define PREFIX ace #define MAJOR 3 -#define MINOR 0 -#define PATCHLVL 0 -#define BUILD 2 +#define MINOR 1 +#define PATCHLVL 2 +#define BUILD 0 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD diff --git a/addons/map/$PBOPREFIX$ b/addons/map/$PBOPREFIX$ index 11a24a58d8..6fde8eb5b8 100644 --- a/addons/map/$PBOPREFIX$ +++ b/addons/map/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\map \ No newline at end of file +z\ace\addons\map \ No newline at end of file diff --git a/addons/map/ACE_Settings.hpp b/addons/map/ACE_Settings.hpp new file mode 100644 index 0000000000..15e2a174e4 --- /dev/null +++ b/addons/map/ACE_Settings.hpp @@ -0,0 +1,30 @@ +class ACE_Settings { + class GVAR(BFT_Interval) { + value = 1.0; + typeName = "SCALAR"; + }; + class GVAR(BFT_Enabled) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(BFT_HideAiGroups) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(mapIllumination) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapShake) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapLimitZoom) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(mapShowCursorCoordinates) { + value = 0; + typeName = "BOOL"; + }; +}; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 612cadb006..d1b7e38dba 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,76 +1,75 @@ class CfgVehicles { - class Module_F; - class ACE_ModuleMap: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleMap: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Map"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMap); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Map_ca.paa); class Arguments { class MapIllumination { - displayName = "Map illumination?"; - description = "Calculate dynamic map illumination based on light conditions?"; + displayName = CSTRING(MapIllumination_DisplayName); + description = CSTRING(MapIllumination_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; default = 1; }; - class No { name = "No"; value = 0; }; - }; + defaultValue = 1; }; class MapShake { - displayName = "Map shake?"; - description = "Make map shake when walking?"; + displayName = CSTRING(MapShake_DisplayName); + description = CSTRING(MapShake_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; default = 1;}; - class No { name = "No"; value = 0; }; - }; + defaultValue = 1; }; class MapLimitZoom { - displayName = "Limit map zoom?"; - description = "Limit the amount of zoom available for the map?"; + displayName = CSTRING(MapLimitZoom_DisplayName); + description = CSTRING(MapLimitZoom_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1;}; - }; + defaultValue = 0; }; class MapShowCursorCoordinates { - displayName = "Show cursor coordinates?"; - description = "Show the grid coordinates on the mouse pointer?"; + displayName = CSTRING(MapShowCursorCoordinates_DisplayName); + description = CSTRING(MapShowCursorCoordinates_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1;}; - }; + defaultValue = 0; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; + class Module_F; class ACE_ModuleBlueForceTracking: Module_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Blue Force Tracking"; + displayName = CSTRING(BFT_Module_DisplayName); function = QFUNC(blueForceTrackingModule); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { + class Enabled { + displayName = CSTRING(BFT_Enabled_DisplayName); + description = CSTRING(BFT_Enabled_Description); + typeName = "BOOL"; + defaultValue = 0; + }; class Interval { - displayName = "Interval"; - description = "How often the markers should be refreshed (in seconds)"; + displayName = CSTRING(BFT_Interval_DisplayName); + description = CSTRING(BFT_Interval_Description); + typeName = "NUMBER"; defaultValue = 1; }; class HideAiGroups { - displayName = "Hide AI groups?"; - description = "Hide markers for 'AI only' groups?"; + displayName = CSTRING(BFT_HideAiGroups_DisplayName); + description = CSTRING(BFT_HideAiGroups_Description); typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1; }; - }; + defaultValue = 0; }; }; + class ModuleDescription { + description = CSTRING(BFT_Module_Description); + }; }; }; diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index ccaf9041ab..52c904b1ce 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,6 +1,8 @@ #include "script_component.hpp" -ADDON = false; +// Exit on Headless as well +if !(hasInterface) exitWith {}; + LOG(MSG_INIT); // Calculate the maximum zoom allowed for this map @@ -13,10 +15,39 @@ call FUNC(determineZoom); waitUntil {(!isNull findDisplay 12)}; GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; - GVAR(lastStillTime) = time; + GVAR(lastStillTime) = ACE_time; GVAR(isShaking) = false; + //Allow panning the lastStillPosition while mapShake is active + GVAR(rightMouseButtonLastPos) = []; ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseMoving", { + if (GVAR(isShaking) && {(count GVAR(rightMouseButtonLastPos)) == 2}) then { + private["_lastPos", "_newPos"]; + _lastPos = (_this select 0) ctrlMapScreenToWorld GVAR(rightMouseButtonLastPos); + _newPos = (_this select 0) ctrlMapScreenToWorld (_this select [1,2]); + GVAR(lastStillPosition) set [0, (GVAR(lastStillPosition) select 0) + (_lastPos select 0) - (_newPos select 0)]; + GVAR(lastStillPosition) set [1, (GVAR(lastStillPosition) select 1) + (_lastPos select 1) - (_newPos select 1)]; + GVAR(rightMouseButtonLastPos) = _this select [1,2]; + TRACE_3("Mouse Move",_lastPos,_newPos,GVAR(rightMouseButtonLastPos)); + }; + }]; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonDown", { + if ((_this select 1) == 1) then { + GVAR(rightMouseButtonLastPos) = _this select [2,2]; + }; + }]; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["MouseButtonUp", { + if ((_this select 1) == 1) then { + GVAR(rightMouseButtonLastPos) = []; + }; + }]; }; -ADDON = true; +["SettingsInitialized", { + // Start Blue Force Tracking if Enabled + if (GVAR(BFT_Enabled)) then { + GVAR(BFT_markers) = []; + [FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 927d9aeb0f..078c06b41d 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -23,37 +23,7 @@ class RscButtonMenuCancel; class RscButtonMenu; class RscEdit; -class ACE_Settings { - class GVAR(BFT_Interval) { - value = 1.0; - typeName = "SCALAR"; - }; - class GVAR(BFT_Enabled) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(BFT_HideAiGroups) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(mapIllumination) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapShake) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(mapLimitZoom) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(mapShowCursorCoordinates) { - value = 0; - typeName = "BOOL"; - }; -}; - +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" @@ -87,6 +57,22 @@ class RscMapControl { sizeExGrid = 0.032; }; +class RscMap; +class RscDisplayArcadeMap_Layout_2: RscMap { //"Traditional" Editor: + class controlsBackground { + class CA_Map: RscMapControl { + #include "MapTweaks.hpp" + }; + }; +}; +class RscDisplayArcadeMap_Layout_6: RscMap { //"Streamlined" Editor: + class controlsBackground { + class CA_Map: RscMapControl { + #include "MapTweaks.hpp" + }; + }; +}; + // REGULAR MAP class RscDisplayMainMap { // Tweak map styling diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf index c156c9527d..bab776c9ab 100644 --- a/addons/map/functions/fnc_blueForceTrackingModule.sqf +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -18,13 +18,9 @@ PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; -GVAR(BFT_Enabled) = true; +[_logic, QGVAR(BFT_Enabled), "Enabled"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readSettingFromModule); diag_log text "[ACE]: Blue Force Tracking Module initialized."; -TRACE_2("[ACE]: Blue Force Tracking Module initialized.",GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); - -//start BFT: -GVAR(BFT_markers) = []; -[FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; +TRACE_2("[ACE]: Blue Force Tracking Module initialized.", GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index edbe484f04..71e4e8c818 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -1,4 +1,6 @@ +// #define ENABLE_PERFORMANCE_COUNTERS #include "script_component.hpp" +// BEGIN_COUNTER(blueForceTrackingUpdate); private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_colour", "_marker"]; @@ -7,6 +9,7 @@ private ["_groupsToDrawMarkers", "_playerSide", "_anyPlayers", "_markerType", "_ deleteMarkerLocal _x; } forEach GVAR(BFT_markers); +GVAR(BFT_markers) = []; if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { @@ -38,3 +41,5 @@ if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { GVAR(BFT_markers) pushBack _marker; } forEach _groupsToDrawMarkers; }; + +// END_COUNTER(blueForceTrackingUpdate); diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf index 441dc8103a..9c205299e6 100644 --- a/addons/map/functions/fnc_determineMapLight.sqf +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -26,7 +26,7 @@ _fnc_blendColor = { (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] }; -// Ambient light tint depending on time of day +// Ambient light tint depending on ACE_time of day _lightTint = switch (true) do { case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] }; case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf index 4bcdb69269..514d2af034 100644 --- a/addons/map/functions/fnc_moduleMap.sqf +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -10,6 +10,8 @@ */ #include "script_component.hpp" +if !(isServer) exitWith {}; + PARAMS_3(_logic,_units,_activated); if !(_activated) exitWith {}; @@ -19,4 +21,4 @@ if !(_activated) exitWith {}; [_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule); -diag_log text "[ACE]: Interaction Module Initialized."; +diag_log text "[ACE]: Map Module Initialized."; diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf index 027197a150..3550df517c 100644 --- a/addons/map/functions/fnc_updateMapEffects.sqf +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -46,8 +46,8 @@ if (GVAR(mapShake)) then { _amplitude = (_speed - 0.1) / 5 * (1000 * _mapScale); _time = 0.1; - _shakePos = [(GVAR(lastStillPosition) select 0) + sin((time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, - (GVAR(lastStillPosition) select 1) + sin((time + _time - GVAR(lastStillTime))*260) * _amplitude]; + _shakePos = [(GVAR(lastStillPosition) select 0) + sin((ACE_time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, + (GVAR(lastStillPosition) select 1) + sin((ACE_time + _time - GVAR(lastStillTime))*260) * _amplitude]; _mapCtrl ctrlMapAnimAdd [_time, _mapScale, _shakePos]; ctrlMapAnimCommit _mapCtrl; @@ -57,14 +57,14 @@ if (GVAR(mapShake)) then { } else { if (GVAR(isShaking)) then { // Stop shaking, return to original position + ctrlMapAnimClear _mapCtrl; _mapCtrl ctrlMapAnimAdd [0, _mapScale, GVAR(lastStillPosition)]; ctrlMapAnimCommit _mapCtrl; GVAR(isShaking) = false; } else { // The map is still, store state - ctrlMapAnimClear _mapCtrl; GVAR(lastStillPosition) = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; - GVAR(lastStillTime) = time; + GVAR(lastStillTime) = ACE_time; }; }; }; diff --git a/addons/map/script_component.hpp b/addons/map/script_component.hpp index 3f126eb653..c62086b03a 100644 --- a/addons/map/script_component.hpp +++ b/addons/map/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT map -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAP #define DEBUG_MODE_FULL @@ -9,7 +9,7 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define MARKERNAME_MAPTOOL_FIXED "ACE_MapToolFixed" diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 4423bbcfb4..0f252d5b97 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -1,6 +1,143 @@  - - - + + + Map + Mapa + Mapa + Karte + Mapa + Mapa + + + Map illumination? + Oświetlenie mapy + ¿Iluminación de mapa? + Kartenausleuchtung + Osvětlení mapy + 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? + + + Map shake? + Drżenie mapy + ¿Temblor de mapa? + Kamerawackeln + Třesení mapy? + Tremor de mapa? + + + Make map shake when walking? + Ekran mapy drży podczas ruchu + Hace que el mapa tiemble cuando caminas + Kamerawackeln beim Gehen? + Umožnit třesení mapy za pochodu? + Tremer o mapa enquanto caminha? + + + Limit map zoom? + Ograniczony zoom + ¿Limitar el zoom de mapa? + Kartenzoom einschränken + Omezit přiblížení mapy? + Limitar zoom do mapa? + + + Limit the amount of zoom available for the map? + Ogranicza maksymalny stopień przybliżenia mapy + Limita la cantidad de zoom disponible para el mapa + Zoomstufe der Karte einschränken? + Omezit stupeň přiblížení pro mapu? + Limitar a quantidade de zoom disponível para o mapa? + + + Show cursor coordinates? + Koordynaty pod kursorem + ¿Mostrar coordenadas de cursor? + Zeige Cursor-Koordinaten? + Zobrazit souřadnice u kurzoru? + Mostrar coordenadas no cursor? + + + Show the grid coordinates on the mouse pointer? + Pokazuje pod kursorem koordynaty wskazanego kwadratu mapy + Muestra las coordenadas de la cuadricula en el puntero del ratón + Gitter-Koordinaten auf dem Mauszeiger anzeigen? + Zobrazit souřadnice u kurzoru v mapě? + Mostrar as coordenadas de grade no ponteiro do mouse? + + + + Moduł ten pozwala dostosować opcje widoku ekranu mapy. + Dieses Modul erweitert die Kartenfunktionen. + Tento modul umožňuje přizpůsobit mapu s obrazem. + Este módulo permite que você personalize a tela de mapa. + + + Blue Force Tracking + Blue Force Tracking + Seguimiento de fuerzas amigas + Blue Force Tracking + Blue Force Tracking + Rastreio de forças azuis + + + BFT Enable + RFA ativo + Aktywuj BFT + Povolit BFT + + + Enable Blue Force Tracking. Default: No + Ativa Rastreio de Forças Azuis. Padrão: Não + Aktywuj Blue Force Tracking. Domyślnie: Nie + Povolit Blue Force Tracking. Výchozí: Ne + + + Interval + Interwał + Intervalo + Intervall + Interval + Intervalo + + + How often the markers should be refreshed (in seconds) + Jak często markery powinny być odświeżane (w sekundach) + Frecuencia de actualización de los marcadores (en segundos) + Wie oft sollen die Markierungen aktualisiert werden (in Sekunden) + Jak často budou značky aktualizovány (v sekundách) + Frequência em que os marcadores devem ser atualizados (em segundos) + + + Hide AI groups? + Ukryj grupy AI + ¿Ocultar grupos de IA? + KI-Gruppen verstecken? + Skrýt AI skupiny? + Esconder grupos de IA? + + + Hide markers for 'AI only' groups? + Ukrywa markery dla grup złożonych tylko z AI + Oculta las marcas de grupos 'solo IA' + Verstecke Marker für "nur KI"-Gruppen? + Skrýt značky pouze pro AI skupiny? + Esconder marcadores que pertencem ao grupo de IA? + + + + Pozwala śledzić na mapie pozycje sojuszniczych jednostek za pomocą markerów BFT. + Dieses Modul ermöglicht es verbündete Einheiten mit dem BFT auf der Karte zu verfolgen. + 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. + + \ No newline at end of file diff --git a/addons/maptools/$PBOPREFIX$ b/addons/maptools/$PBOPREFIX$ index 15fe8ae13f..89df7fa624 100644 --- a/addons/maptools/$PBOPREFIX$ +++ b/addons/maptools/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\maptools \ No newline at end of file +z\ace\addons\maptools \ No newline at end of file diff --git a/addons/maptools/ACE_Settings.hpp b/addons/maptools/ACE_Settings.hpp new file mode 100644 index 0000000000..9c53a84a7c --- /dev/null +++ b/addons/maptools/ACE_Settings.hpp @@ -0,0 +1,6 @@ +class ACE_Settings { + class GVAR(EveryoneCanDrawOnBriefing) { + value = 1; + typeName = "BOOL"; + }; +}; diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp index d9eb295871..5c3266d2d6 100644 --- a/addons/maptools/CfgVehicles.hpp +++ b/addons/maptools/CfgVehicles.hpp @@ -4,66 +4,66 @@ class CfgVehicles { class ACE_SelfActions { class ACE_MapTools { - displayName = "$STR_ACE_MapTools_MapTools_Menu"; + displayName = CSTRING(MapTools_Menu); condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); statement = ""; - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 0; priority = 100; class ACE_MapToolsHide { - displayName = "$STR_ACE_MapTools_MapToolsHide"; + displayName = CSTRING(MapToolsHide); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 5; }; class ACE_MapToolsShowNormal { - displayName = "$STR_ACE_MapTools_MapToolsShowNormal"; + displayName = CSTRING(MapToolsShowNormal); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 4; }; class ACE_MapToolsShowSmall { - displayName = "$STR_ACE_MapTools_MapToolsShowSmall"; + displayName = CSTRING(MapToolsShowSmall); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 3; }; class ACE_MapToolsAlignNorth { - displayName = "$STR_ACE_MapTools_MapToolsAlignNorth"; + displayName = CSTRING(MapToolsAlignNorth); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 2; }; class ACE_MapToolsAlignCompass { - displayName = "$STR_ACE_MapTools_MapToolsAlignCompass"; + displayName = CSTRING(MapToolsAlignCompass); condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 1; priority = 1; }; class ACE_MapGpsShow { - displayName = "$STR_ACE_MapTools_MapGpsShow"; + displayName = CSTRING(MapGpsShow); condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 0; priority = 0; }; class ACE_MapGpsHide { - displayName = "$STR_ACE_MapTools_MapGpsHide"; + displayName = CSTRING(MapGpsHide); condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"isNotDragging", "notOnMap", "isNotInside"}; + exceptions[] = {"isNotDragging", "notOnMap", "isNotInside", "isNotSitting"}; showDisabled = 0; priority = 0; }; @@ -73,7 +73,7 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { class ACE_CopyMap { - displayName = "$STR_ACE_MapTools_CopyMap"; + displayName = CSTRING(CopyMap); condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); showDisabled = 0; diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp index 9d4d313c43..2e2271509b 100644 --- a/addons/maptools/CfgWeapons.hpp +++ b/addons/maptools/CfgWeapons.hpp @@ -3,8 +3,8 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_MapTools: ACE_ItemCore { - displayName = "$STR_ACE_MapTools_Name"; - descriptionShort = "$STR_ACE_MapTools_Description"; + displayName = CSTRING(Name); + descriptionShort = CSTRING(Description); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = PATHTOF(UI\maptool_item.paa); scope = 2; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp index ab11fdceec..1e82cd2269 100644 --- a/addons/maptools/config.cpp +++ b/addons/maptools/config.cpp @@ -12,12 +12,7 @@ class CfgPatches { }; }; -class ACE_Settings { - class GVAR(EveryoneCanDrawOnBriefing) { - value = 1; - typeName = "BOOL"; - }; -}; +#include "ACE_Settings.hpp" class RscControlsGroup; class RscActiveText; diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp index 30a9f83d0d..5d5c524419 100644 --- a/addons/maptools/script_component.hpp +++ b/addons/maptools/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT maptools -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MAPTOOLS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml index f2a14e8b33..07b2e5dc88 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -1,6 +1,6 @@  - + Map Tools Herramientas de mapa @@ -8,7 +8,7 @@ Narzędzia nawigacyjne Kartenwerkzeug Pomůcky k mapě - Strumenti Cartografici + Strumenti cartografici Ferramentas de Mapa Térképészeti eszközök Инструменты карты @@ -20,7 +20,7 @@ Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. Das Kartenwerkzeug ermöglicht es dir, Distanzen und Winkel zu messen. Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. - Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. + Gli strumenti cartografici ti consentono di misurare distanze ed angoli sulla mappa. As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. A térképészeti eszközökkel távolságokat és szögeket tudsz mérni a térképen. Картографические инструменты позволяют измерять расстояния и углы на карте. @@ -32,7 +32,7 @@ Narzędzia nawigacyjne Kartenwerkzeug Pomůcky k mapě - Strumenti Cartografici + Strumenti cartografici Ferramentas de Mapa Térképészeti eszközök Инструменты карты @@ -142,7 +142,7 @@ Dirección: %1° Irány: %1 Направление: %1° - Direzione : %1° + Direzione: %1° Direção: %1 diff --git a/addons/markers/functions/fnc_initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf index 6c5160c031..c55e07c360 100644 --- a/addons/markers/functions/fnc_initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -25,7 +25,7 @@ PARAMS_1(_display); //Can't place markers when can't interact - if (!([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith))) exitWith { + if (!([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith { _display closeDisplay 2; //emulate "Cancel" button }; diff --git a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf index 747c0d4bbb..1210b8ce71 100644 --- a/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf +++ b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf @@ -25,6 +25,6 @@ if (_direction < 0) then { _direction = _direction + 360; }; -((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _direction]; +((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize LSTRING(MarkerDirection), _direction]; GVAR(currentMarkerAngle) = _data; diff --git a/addons/medical/ACE_Medical_Actions.hpp b/addons/medical/ACE_Medical_Actions.hpp index 9052df81da..ecb9afdfe4 100644 --- a/addons/medical/ACE_Medical_Actions.hpp +++ b/addons/medical/ACE_Medical_Actions.hpp @@ -1,6 +1,6 @@ class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; + displayName = CSTRING(Head); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -9,7 +9,7 @@ class ACE_Head { icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(treatment)); @@ -21,7 +21,7 @@ class ACE_Head { }; // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(treatment)); @@ -32,54 +32,54 @@ class ACE_Head { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class CheckResponse: CheckPulse { - displayName = "$STR_ACE_Medical_Check_Response"; + displayName = CSTRING(Check_Response); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckResponse')] call DFUNC(treatment)); EXCEPTIONS }; class Diagnose: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_Diagnose"; + displayName = CSTRING(Actions_Diagnose); condition = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'head', 'Diagnose')] call DFUNC(treatment)); EXCEPTIONS }; }; class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; + displayName = CSTRING(Torso); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -88,7 +88,7 @@ class ACE_Torso { icon = PATHTOF(UI\icons\medical_cross.paa); distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(treatment)); @@ -100,7 +100,7 @@ class ACE_Torso { icon = PATHTOF(UI\icons\bandage.paa); }; class PlaceInBodyBag { - displayName = "$STR_ACE_Medical_PlaceInBodyBag"; + displayName = CSTRING(PlaceInBodyBag); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'BodyBag')] call DFUNC(treatment)); @@ -111,7 +111,7 @@ class ACE_Torso { enableInside = 1; }; class TriageCard { - displayName = "$STR_ACE_Medical_Actions_TriageCard"; + displayName = CSTRING(Actions_TriageCard); distance = 2.0; condition = "true"; statement = QUOTE([ARR_2(_target, true)] call DFUNC(displayTriageCard)); @@ -125,7 +125,7 @@ class ACE_Torso { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(treatment)); @@ -137,42 +137,42 @@ class ACE_Torso { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class SurgicalKit: fieldDressing { - displayName = "$STR_ACE_Medical_Use_SurgicalKit"; + displayName = CSTRING(Use_SurgicalKit); condition = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'SurgicalKit')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\surgicalKit.paa); }; class PersonalAidKit: fieldDressing { - displayName = "$STR_ACE_Medical_Use_Aid_Kit"; + displayName = CSTRING(Use_Aid_Kit); condition = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'PersonalAidKit')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CPR: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CPR"; + displayName = CSTRING(Actions_CPR); condition = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'body', 'CPR')] call DFUNC(treatment)); EXCEPTIONS @@ -180,7 +180,7 @@ class ACE_Torso { }; }; class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; + displayName = ECSTRING(interaction,ArmLeft); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -190,7 +190,7 @@ class ACE_ArmLeft { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(treatment)); @@ -203,7 +203,7 @@ class ACE_ArmLeft { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(treatment)); @@ -214,131 +214,131 @@ class ACE_ArmLeft { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\bandage.paa); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; + displayName = CSTRING(Actions_Blood4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_500"; + displayName = CSTRING(Actions_Blood4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_250"; + displayName = CSTRING(Actions_Blood4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + displayName = CSTRING(Actions_Plasma4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; + displayName = CSTRING(Actions_Plasma4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; + displayName = CSTRING(Actions_Plasma4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; + displayName = CSTRING(Actions_Saline4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_500"; + displayName = CSTRING(Actions_Saline4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_250"; + displayName = CSTRING(Actions_Saline4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS }; }; class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; + displayName = ECSTRING(interaction,ArmRight); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -348,7 +348,7 @@ class ACE_ArmRight { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(treatment)); @@ -361,7 +361,7 @@ class ACE_ArmRight { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(treatment)); @@ -372,120 +372,120 @@ class ACE_ArmRight { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); EXCEPTIONS }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; + displayName = CSTRING(Actions_Blood4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_500"; + displayName = CSTRING(Actions_Blood4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_250"; + displayName = CSTRING(Actions_Blood4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + displayName = CSTRING(Actions_Plasma4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; + displayName = CSTRING(Actions_Plasma4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; + displayName = CSTRING(Actions_Plasma4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; + displayName = CSTRING(Actions_Saline4_1000); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_500"; + displayName = CSTRING(Actions_Saline4_500); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_250"; + displayName = CSTRING(Actions_Saline4_250); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); EXCEPTIONS icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS @@ -493,7 +493,7 @@ class ACE_ArmRight { }; class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; + displayName = ECSTRING(interaction,LegLeft); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -503,7 +503,7 @@ class ACE_LegLeft { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(treatment)); @@ -517,7 +517,7 @@ class ACE_LegLeft { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(treatment)); @@ -528,115 +528,115 @@ class ACE_LegLeft { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; + displayName = CSTRING(Actions_Blood4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_500"; + displayName = CSTRING(Actions_Blood4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_250"; + displayName = CSTRING(Actions_Blood4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + displayName = CSTRING(Actions_Plasma4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; + displayName = CSTRING(Actions_Plasma4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; + displayName = CSTRING(Actions_Plasma4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; + displayName = CSTRING(Actions_Saline4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_500"; + displayName = CSTRING(Actions_Saline4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_250"; + displayName = CSTRING(Actions_Saline4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS }; }; class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; + displayName = ECSTRING(interaction,LegRight); runOnHover = 1; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); ACTION_CONDITION @@ -646,7 +646,7 @@ class ACE_LegRight { distance = MEDICAL_ACTION_DISTANCE; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(treatment)); @@ -660,7 +660,7 @@ class ACE_LegRight { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(treatment)); @@ -671,107 +671,107 @@ class ACE_LegRight { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); EXCEPTIONS }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); EXCEPTIONS }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); EXCEPTIONS }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Blood4_1000"; + displayName = CSTRING(Actions_Blood4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV')] call DFUNC(treatment)); EXCEPTIONS icon = PATHTOF(UI\icons\iv.paa); }; class BloodIV_500: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_500"; + displayName = CSTRING(Actions_Blood4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class BloodIV_250: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Blood4_250"; + displayName = CSTRING(Actions_Blood4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'BloodIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_1000"; + displayName = CSTRING(Actions_Plasma4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_500: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_500"; + displayName = CSTRING(Actions_Plasma4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class PlasmaIV_250: PlasmaIV { - displayName = "$STR_ACE_Medical_Actions_Plasma4_250"; + displayName = CSTRING(Actions_Plasma4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PlasmaIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV: BloodIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_1000"; + displayName = CSTRING(Actions_Saline4_1000); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_500: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_500"; + displayName = CSTRING(Actions_Saline4_500); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_500')] call DFUNC(treatment)); EXCEPTIONS }; class SalineIV_250: SalineIV { - displayName = "$STR_ACE_Medical_Actions_Saline4_250"; + displayName = CSTRING(Actions_Saline4_250); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'SalineIV_250')] call DFUNC(treatment)); EXCEPTIONS }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); EXCEPTIONS diff --git a/addons/medical/ACE_Medical_SelfActions.hpp b/addons/medical/ACE_Medical_SelfActions.hpp index 5b98448664..0f85930f51 100644 --- a/addons/medical/ACE_Medical_SelfActions.hpp +++ b/addons/medical/ACE_Medical_SelfActions.hpp @@ -1,23 +1,23 @@ class Medical { - displayName = "$STR_ACE_Medical_Actions_Medical"; + displayName = CSTRING(Actions_Medical); runOnHover = 1; hotkey = "M"; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; + displayName = CSTRING(Head); icon = PATHTOF(UI\icons\medical_cross.paa); - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,0,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; runOnHover = 1; class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -29,7 +29,7 @@ class Medical { }; // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'head', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -40,46 +40,46 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'QuikClot')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'head', 'CheckBloodPressure')] call DFUNC(treatment)); }; }; class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; + displayName = CSTRING(Torso); distance = 5.0; condition = "true"; runOnHover = 1; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 1)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,1,_this select 3)] call FUNC(modifyMedicalAction)); showDisabled = 1; @@ -88,7 +88,7 @@ class Medical { icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -100,7 +100,7 @@ class Medical { }; class TriageCard { - displayName = "$STR_ACE_Medical_Actions_TriageCard"; + displayName = CSTRING(Actions_TriageCard); distance = 2.0; condition = "true"; exceptions[] = {"isNotInside"}; @@ -113,7 +113,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'body', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -124,21 +124,21 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'body', 'QuikClot')] call DFUNC(treatment)); @@ -146,16 +146,16 @@ class Medical { }; }; class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; + displayName = ECSTRING(interaction,ArmLeft); runOnHover = 1; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 2)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,2,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -168,7 +168,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -179,85 +179,85 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'ElasticBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'QuikClot')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\bandage.paa); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Tourniquet')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Morphine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Atropine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'Epinephrine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; + displayName = ECSTRING(interaction,ArmRight); runOnHover = 1; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 3)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,3,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -270,7 +270,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -281,81 +281,81 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Tourniquet')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Morphine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'Epinephrine')] call DFUNC(treatment)); }; class CheckPulse: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CheckPulse"; + displayName = CSTRING(Actions_CheckPulse); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckPulse')] call DFUNC(treatment)); icon = ""; }; class CheckBloodPressure: CheckPulse { - displayName = "$STR_ACE_Medical_Actions_CheckBloodPressure"; + displayName = CSTRING(Actions_CheckBloodPressure); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'CheckBloodPressure')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'hand_r', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; + displayName = ECSTRING(interaction,LegLeft); runOnHover = 1; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 4)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,4,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -369,7 +369,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -380,69 +380,69 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Tourniquet')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Morphine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Atropine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_l', 'RemoveTourniquet')] call DFUNC(treatment)); }; }; class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; + displayName = ECSTRING(interaction,LegRight); runOnHover = 1; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE([ARR_3(_target, true, 5)] call DFUNC(displayPatientInformation)); modifierFunction = QUOTE([ARR_4(_target,_player,5,_this select 3)] call FUNC(modifyMedicalAction)); condition = "true"; icon = PATHTOF(UI\icons\medical_cross.paa); class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; + displayName = CSTRING(Bandage); distance = 2.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Bandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -456,7 +456,7 @@ class Medical { // Advanced medical class FieldDressing { - displayName = "$STR_ACE_Medical_Actions_FieldDressing"; + displayName = CSTRING(Actions_FieldDressing); distance = 5.0; condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'FieldDressing')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; @@ -467,52 +467,52 @@ class Medical { icon = PATHTOF(UI\icons\bandage.paa); }; class PackingBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_PackingBandage"; + displayName = CSTRING(Actions_PackingBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'PackingBandage')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\packingBandage.paa); }; class ElasticBandage: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_ElasticBandage"; + displayName = CSTRING(Actions_ElasticBandage); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'ElasticBandage')] call DFUNC(treatment)); }; class QuikClot: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_QuikClot"; + displayName = CSTRING(Actions_QuikClot); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'QuikClot')] call DFUNC(treatment)); }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_Tourniquet"; + displayName = CSTRING(Actions_Tourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Tourniquet')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\tourniquet.paa); }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; + displayName = CSTRING(Inject_Morphine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Morphine')] call DFUNC(treatment)); icon = PATHTOF(UI\icons\autoInjector.paa); }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; + displayName = CSTRING(Inject_Atropine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Atropine')] call DFUNC(treatment)); }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'Epinephrine')] call DFUNC(treatment)); }; class RemoveTourniquet: Tourniquet { - displayName = "$STR_ACE_Medical_Actions_RemoveTourniquet"; + displayName = CSTRING(Actions_RemoveTourniquet); condition = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(canTreatCached)); exceptions[] = {"isNotInside"}; statement = QUOTE([ARR_4(_player, _target, 'leg_r', 'RemoveTourniquet')] call DFUNC(treatment)); diff --git a/addons/medical/ACE_Medical_Treatments.hpp b/addons/medical/ACE_Medical_Treatments.hpp index 9848410c8c..079ae40506 100644 --- a/addons/medical/ACE_Medical_Treatments.hpp +++ b/addons/medical/ACE_Medical_Treatments.hpp @@ -2,8 +2,8 @@ class ACE_Medical_Actions { class Basic { class Bandage { - displayName = "$STR_ACE_Medical_Bandage"; - displayNameProgress = "$STR_ACE_Medical_Bandaging"; + displayName = CSTRING(Bandage); + displayNameProgress = CSTRING(Bandaging); treatmentLocations[] = {"All"}; requiredMedic = 0; @@ -11,6 +11,7 @@ class ACE_Medical_Actions { treatmentTimeSelfCoef = 1; items[] = {{"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot"}}; condition = ""; + patientStateCondition = 0; itemConsumed = 1; callbackSuccess = QUOTE(DFUNC(treatmentBasic_bandage)); @@ -27,8 +28,8 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}} }; }; class Morphine: Bandage { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - displayNameProgress = "$STR_ACE_Medical_Injecting_Morphine"; + displayName = CSTRING(Inject_Morphine); + displayNameProgress = CSTRING(Injecting_Morphine); treatmentTime = 2; items[] = {"ACE_morphine"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_morphine)); @@ -36,8 +37,8 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} }; }; class Epinephrine: Bandage { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); + displayNameProgress = CSTRING(Injecting_Epinephrine); requiredMedic = 1; treatmentTime = 3; items[] = {"ACE_epinephrine"}; @@ -46,21 +47,27 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: Bandage { - displayName = "$STR_ACE_Medical_Transfuse_Blood"; - displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood"; + displayName = CSTRING(Transfuse_Blood); + displayNameProgress = CSTRING(Transfusing_Blood); requiredMedic = 1; treatmentTime = 20; - items[] = {{"ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250"}}; + items[] = {"ACE_bloodIV"}; callbackSuccess = QUOTE(DFUNC(treatmentBasic_bloodbag)); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; litter[] = {}; }; + class BloodIV_500: BloodIV { + items[] = {"ACE_bloodIV_500"}; + }; + class BloodIV_250: BloodIV { + items[] = {"ACE_bloodIV_250"}; + }; class BodyBag: Bandage { - displayName = "$STR_ACE_Medical_PlaceInBodyBag"; - displayNameProgress = "$STR_ACE_Medical_PlacingInBodyBag"; + displayName = CSTRING(PlaceInBodyBag); + displayNameProgress = CSTRING(PlacingInBodyBag); treatmentLocations[] = {"All"}; requiredMedic = 0; - treatmentTime = 2; + treatmentTime = 4; items[] = {"ACE_bodyBag"}; condition = "!alive (_this select 1);"; callbackSuccess = QUOTE(DFUNC(actionPlaceInBodyBag)); @@ -72,8 +79,8 @@ class ACE_Medical_Actions { litter[] = {}; }; class Diagnose: Bandage { - displayName = "$STR_ACE_Medical_Actions_Diagnose"; - displayNameProgress = "$STR_ACE_Medical_Actions_Diagnosing"; + displayName = CSTRING(Actions_Diagnose); + displayNameProgress = CSTRING(Actions_Diagnosing); treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 1; @@ -90,8 +97,8 @@ class ACE_Medical_Actions { class Advanced { class FieldDressing { - displayName = "$STR_ACE_Medical_Bandage"; - displayNameProgress = "$STR_ACE_Medical_Bandaging"; + displayName = CSTRING(Bandage); + displayNameProgress = CSTRING(Bandaging); // Which locations can this treatment action be used? Available: Field, MedicalFacility, MedicalVehicle, All. treatmentLocations[] = {"All"}; // What is the level of medical skill required for this treatment action? 0 = all soldiers, 1 = medic, 2 = doctor @@ -101,6 +108,7 @@ class ACE_Medical_Actions { // Item required for the action. Leave empty for no item required. items[] = {"ACE_fieldDressing"}; condition = ""; + patientStateCondition = 0; // Callbacks callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_bandage)); callbackFailure = ""; @@ -125,8 +133,8 @@ class ACE_Medical_Actions { items[] = {"ACE_quikclot"}; }; class Tourniquet: fieldDressing { - displayName = "$STR_ACE_Medical_Apply_Tourniquet"; - displayNameProgress = "$STR_ACE_Medical_Applying_Tourniquet"; + displayName = CSTRING(Apply_Tourniquet); + displayNameProgress = CSTRING(Applying_Tourniquet); items[] = {"ACE_tourniquet"}; treatmentTime = 6; callbackSuccess = QUOTE(DFUNC(treatmentTourniquet)); @@ -134,8 +142,8 @@ class ACE_Medical_Actions { litter[] = {}; }; class Morphine: fieldDressing { - displayName = "$STR_ACE_Medical_Inject_Morphine"; - displayNameProgress = "$STR_ACE_Medical_Injecting_Morphine"; + displayName = CSTRING(Inject_Morphine); + displayNameProgress = CSTRING(Injecting_Morphine); items[] = {"ACE_morphine"}; treatmentTime = 3; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_medication)); @@ -143,20 +151,20 @@ class ACE_Medical_Actions { litter[] = { {"All", "", {"ACE_MedicalLitter_morphine"}} }; }; class Atropine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Atropine"; - displayNameProgress = "$STR_ACE_Medical_Injecting_Atropine"; + displayName = CSTRING(Inject_Atropine); + displayNameProgress = CSTRING(Injecting_Atropine); items[] = {"ACE_atropine"}; litter[] = { {"All", "", {"ACE_MedicalLitter_atropine"}} }; }; class Epinephrine: Morphine { - displayName = "$STR_ACE_Medical_Inject_Epinephrine"; - displayNameProgress = "$STR_ACE_Medical_Injecting_Epinephrine"; + displayName = CSTRING(Inject_Epinephrine); + displayNameProgress = CSTRING(Injecting_Epinephrine); items[] = {"ACE_epinephrine"}; litter[] = { {"All", "", {"ACE_MedicalLitter_epinephrine"}} }; }; class BloodIV: fieldDressing { - displayName = "$STR_ACE_Medical_Transfuse_Blood"; - displayNameProgress = "$STR_ACE_Medical_Transfusing_Blood"; + displayName = CSTRING(Transfuse_Blood); + displayNameProgress = CSTRING(Transfusing_Blood); items[] = {"ACE_bloodIV"}; requiredMedic = 1; treatmentTime = 7; @@ -171,8 +179,8 @@ class ACE_Medical_Actions { items[] = {"ACE_bloodIV_250"}; }; class PlasmaIV: BloodIV { - displayName = "$STR_ACE_Medical_Transfuse_Plasma"; - displayNameProgress = "$STR_ACE_Medical_Transfusing_Plasma"; + displayName = CSTRING(Transfuse_Plasma); + displayNameProgress = CSTRING(Transfusing_Plasma); items[] = {"ACE_plasmaIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; @@ -183,8 +191,8 @@ class ACE_Medical_Actions { items[] = {"ACE_plasmaIV_250"}; }; class SalineIV: BloodIV { - displayName = "$STR_ACE_Medical_Transfuse_Saline"; - displayNameProgress = "$STR_ACE_Medical_Transfusing_Saline"; + displayName = CSTRING(Transfuse_Saline); + displayNameProgress = CSTRING(Transfusing_Saline); items[] = {"ACE_salineIV"}; animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; }; @@ -196,23 +204,26 @@ class ACE_Medical_Actions { }; class SurgicalKit: fieldDressing { displayName = ""; - displayNameProgress = "$STR_ACE_Medical_TreatmentAction"; + displayNameProgress = CSTRING(TreatmentAction); items[] = {"ACE_surgicalKit"}; treatmentLocations[] = {QGVAR(useLocation_SurgicalKit)}; requiredMedic = QGVAR(medicSetting_SurgicalKit); - treatmentTime = 10; - callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_surgicalKit)); + patientStateCondition = QGVAR(useCondition_SurgicalKit); + treatmentTime = "(count ((_this select 1) getVariable ['ACE_Medical_bandagedWounds', []]) * 5)"; + callbackSuccess = ""; + callbackProgress = QUOTE(DFUNC(treatmentAdvanced_surgicalKit_onProgress)); itemConsumed = QGVAR(consumeItem_SurgicalKit); animationCaller = "AinvPknlMstpSnonWnonDnon_medic1"; litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"} }}; }; class PersonalAidKit: fieldDressing { displayName = ""; - displayNameProgress = "$STR_ACE_Medical_TreatmentAction"; + displayNameProgress = CSTRING(TreatmentAction); items[] = {"ACE_personalAidKit"}; treatmentLocations[] = {QGVAR(useLocation_PAK)}; requiredMedic = QGVAR(medicSetting_PAK); - treatmentTime = 10; + patientStateCondition = QGVAR(useCondition_PAK); + treatmentTime = QUOTE((_this select 1) call FUNC(treatmentAdvanced_fullHealTreatmentTime)); callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_fullHeal)); itemConsumed = QGVAR(consumeItem_PAK); animationPatient = ""; @@ -225,7 +236,7 @@ class ACE_Medical_Actions { }; class CheckPulse: fieldDressing { displayName = ""; - displayNameProgress = "$STR_ACE_Medical_Check_Pulse_Content"; + displayNameProgress = CSTRING(Check_Pulse_Content); treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -240,29 +251,29 @@ class ACE_Medical_Actions { }; class CheckBloodPressure: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckBloodPressure)); - displayNameProgress = "$STR_ACE_Medical_Check_Bloodpressure_Content"; + displayNameProgress = CSTRING(Check_Bloodpressure_Content); }; class CheckResponse: CheckPulse { callbackSuccess = QUOTE(DFUNC(actionCheckResponse)); - displayNameProgress = "$STR_ACE_Medical_Check_Response_Content"; + displayNameProgress = CSTRING(Check_Response_Content); }; class RemoveTourniquet: CheckPulse { treatmentTime = 2.5; callbackSuccess = QUOTE(DFUNC(actionRemoveTourniquet)); condition = QUOTE([ARR_2(_this select 1, _this select 2)] call FUNC(hasTourniquetAppliedTo)); - displayNameProgress = "$STR_ACE_Medical_RemovingTourniquet"; + displayNameProgress = CSTRING(RemovingTourniquet); }; class CPR: fieldDressing { - displayName = "$STR_ACE_Medical_Actions_CPR"; - displayNameProgress = "$STR_ACE_Medical_Actions_PerformingCPR"; + displayName = CSTRING(Actions_CPR); + displayNameProgress = CSTRING(Actions_PerformingCPR); treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 15; items[] = {}; - condition = "((_this select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; + condition = "!([(_this select 1)] call ace_common_fnc_isAwake)"; callbackSuccess = QUOTE(DFUNC(treatmentAdvanced_CPR)); callbackFailure = ""; - callbackProgress = "(((_this select 0) select 1) getvariable ['ACE_medical_inCardiacArrest', false])"; + callbackProgress = "!([((_this select 0) select 1)] call ace_common_fnc_isAwake)"; animationPatient = ""; animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback"; animationCaller = "AinvPknlMstpSlayWnonDnon_medic"; @@ -273,8 +284,8 @@ class ACE_Medical_Actions { litter[] = {}; }; class BodyBag: fieldDressing { - displayName = "$STR_ACE_Medical_PlaceInBodyBag"; - displayNameProgress = "$STR_ACE_Medical_PlacingInBodyBag"; + displayName = CSTRING(PlaceInBodyBag); + displayNameProgress = CSTRING(PlacingInBodyBag); treatmentLocations[] = {"All"}; requiredMedic = 0; treatmentTime = 2; @@ -300,53 +311,54 @@ class ACE_Medical_Advanced { // Source: Scarle // Also called scrapes, they occur when the skin is rubbed away by friction against another rough surface (e.g. rope burns and skinned knees). class Abrasion { - name = "$STR_ACE_Medical_Wounds_Abrasion"; + name = CSTRING(Wounds_Abrasion); selections[] = {"All"}; bleedingRate = 0.0001; pain = 0.01; causes[] = {"falling", "ropeburn", "vehiclecrash", "unknown"}; minDamage = 0.01; class Minor { - name = "$STR_ACE_Medical_Wounds_Abrasion_Minor"; + name = CSTRING(Wounds_Abrasion_Minor); minDamage = 0.01; maxDamage = 0.2; bleedingRate = 0.0001; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Abrasion_Medium"; + name = CSTRING(Wounds_Abrasion_Medium); minDamage = 0.2; maxDamage = 0.3; bleedingRate = 0.00015; }; class Large { - name = "$STR_ACE_Medical_Wounds_Abrasion_Large"; + name = CSTRING(Wounds_Abrasion_Large); minDamage = 0.3; + maxDamage = 0.5; bleedingRate = 0.0002; }; }; // 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. class Avulsions { - name = "$STR_ACE_Medical_Wounds_Avulsion"; + name = CSTRING(Wounds_Avulsion); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.3; causes[] = {"explosive", "vehiclecrash", "grenade", "shell", "bullet", "backblast", "bite"}; minDamage = 0.2; class Minor { - name = "$STR_ACE_Medical_Wounds_Avulsion_Minor"; + name = CSTRING(Wounds_Avulsion_Minor); minDamage = 0.2; maxDamage = 0.3; bleedingRate = 0.01; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Avulsion_Medium"; + name = CSTRING(Wounds_Avulsion_Medium); minDamage = 0.3; maxDamage = 0.6; bleedingRate = 0.02; }; class Large { - name = "$STR_ACE_Medical_Wounds_Avulsion_Large"; + name = CSTRING(Wounds_Avulsion_Large); minDamage = 0.5; bleedingRate = 0.05; }; @@ -354,7 +366,7 @@ class ACE_Medical_Advanced { // 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. class Contusion { - name = "$STR_ACE_Medical_Wounds_Contusion"; + name = CSTRING(Wounds_Contusion); selections[] = {"All"}; bleedingRate = 0.0; pain = 0.05; @@ -362,17 +374,17 @@ class ACE_Medical_Advanced { minDamage = 0.01; maxDamage = 0.1; class Minor { - name = "$STR_ACE_Medical_Wounds_Contusion_Minor"; + name = CSTRING(Wounds_Contusion_Minor); minDamage = 0.01; maxDamage = 0.1; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Contusion_Medium"; + name = CSTRING(Wounds_Contusion_Medium); minDamage = 0.1; maxDamage = 0.15; }; class Large { - name = "$STR_ACE_Medical_Wounds_Contusion_Large"; + name = CSTRING(Wounds_Contusion_Large); minDamage = 0.15; maxDamage = 0.2; }; @@ -380,26 +392,26 @@ class ACE_Medical_Advanced { // Occur when a heavy object falls onto a person, splitting the skin and shattering or tearing underlying structures. class CrushWound { - name = "$STR_ACE_Medical_Wounds_Crush"; + name = CSTRING(Wounds_Crush); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.1; causes[] = {"falling", "vehiclecrash", "punch", "unknown"}; minDamage = 0.1; class Minor { - name = "$STR_ACE_Medical_Wounds_Crush_Minor"; + name = CSTRING(Wounds_Crush_Minor); minDamage = 0.1; maxDamage = 0.45; bleedingRate = 0.005; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Crush_Medium"; + name = CSTRING(Wounds_Crush_Medium); minDamage = 0.4; maxDamage = 0.7; bleedingRate = 0.007; }; class Large { - name = "$STR_ACE_Medical_Wounds_Crush_Large"; + name = CSTRING(Wounds_Crush_Large); minDamage = 0.6; bleedingRate = 0.0095; }; @@ -407,26 +419,26 @@ class ACE_Medical_Advanced { // 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. class Cut { - name = "$STR_ACE_Medical_Wounds_Cut"; + name = CSTRING(Wounds_Cut); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"vehiclecrash", "grenade", "explosive", "shell", "backblast", "stab", "unknown"}; minDamage = 0.1; class Minor { - name = "$STR_ACE_Medical_Wounds_Cut_Minor"; + name = CSTRING(Wounds_Cut_Minor); minDamage = 0.1; maxDamage = 0.3; bleedingRate = 0.005; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Cut_Medium"; + name = CSTRING(Wounds_Cut_Medium); minDamage = 0.3; maxDamage = 0.65; bleedingRate = 0.02; }; class Large { - name = "$STR_ACE_Medical_Wounds_Cut_Large"; + name = CSTRING(Wounds_Cut_Large); minDamage = 0.65; bleedingRate = 0.05; }; @@ -434,26 +446,26 @@ class ACE_Medical_Advanced { // 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. class Laceration { - name = "$STR_ACE_Medical_Wounds_Laceration"; + name = CSTRING(Wounds_Laceration); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"vehiclecrash", "punch"}; minDamage = 0.01; class Minor { - name = "$STR_ACE_Medical_Wounds_Laceration_Minor"; + name = CSTRING(Wounds_Laceration_Minor); minDamage = 0.1; maxDamage = 0.5; bleedingRate = 0.005; }; class Medium { - name = "$STR_ACE_Medical_Wounds_Laceration_Medium"; + name = CSTRING(Wounds_Laceration_Medium); minDamage = 0.5; maxDamage = 0.7; bleedingRate = 0.01; }; class Large { - name = "$STR_ACE_Medical_Wounds_Laceration_Large"; + name = CSTRING(Wounds_Laceration_Large); minDamage = 0.7; bleedingRate = 0.03; }; @@ -461,25 +473,25 @@ class ACE_Medical_Advanced { // Also called velocity wounds, they are caused by an object entering the body at a high speed, typically a bullet or small peices of shrapnel. class velocityWound { - name = "$STR_ACE_Medical_Wounds_VelocityWound"; + name = CSTRING(Wounds_VelocityWound); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.2; causes[] = {"bullet", "grenade","explosive", "shell", "unknown"}; minDamage = 0.15; class Minor { - name = "$STR_ACE_Medical_Wounds_VelocityWound_Minor"; + name = CSTRING(Wounds_VelocityWound_Minor); minDamage = 0.15; maxDamage = 0.3; bleedingRate = 0.025; }; class Medium { - name = "$STR_ACE_Medical_Wounds_VelocityWound_Medium"; + name = CSTRING(Wounds_VelocityWound_Medium); minDamage = 0.3; bleedingRate = 0.05; }; class Large { - name = "$STR_ACE_Medical_Wounds_VelocityWound_Large"; + name = CSTRING(Wounds_VelocityWound_Large); minDamage = 0.75; bleedingRate = 0.1; }; @@ -487,26 +499,26 @@ class ACE_Medical_Advanced { // Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. class punctureWound { - name = "$STR_ACE_Medical_Wounds_PunctureWound"; + name = CSTRING(Wounds_PunctureWound); selections[] = {"All"}; bleedingRate = 0.01; pain = 0.075; causes[] = {"stab", "grenade"}; minDamage = 0.01; class Minor { - name = "$STR_ACE_Medical_Wounds_PunctureWound_Minor"; + name = CSTRING(Wounds_PunctureWound_Minor); minDamage = 0.01; maxDamage = 0.5; bleedingRate = 0.01; }; class Medium { - name = "$STR_ACE_Medical_Wounds_PunctureWound_Medium"; + name = CSTRING(Wounds_PunctureWound_Medium); minDamage = 0.5; maxDamage = 0.75; bleedingRate = 0.03; }; class Large { - name = "$STR_ACE_Medical_Wounds_PunctureWound_Large"; + name = CSTRING(Wounds_PunctureWound_Large); minDamage = 0.65; bleedingRate = 0.08; }; @@ -514,7 +526,7 @@ class ACE_Medical_Advanced { }; class fractures { class Femur { - name = "$STR_ACE_Medical_Wounds_Femur"; + name = CSTRING(Wounds_Femur); selections[] = {"Head", "Torso"}; pain = 0.2; causes[] = {"Bullet", "VehicleCrash", "Backblast", "Explosive", "Shell", "Grenade"}; @@ -804,11 +816,11 @@ class ACE_Medical_Advanced { // specific details for the ACE_Morphine treatment action class Morphine { - painReduce = 1; + painReduce = 15; hrIncreaseLow[] = {-10, -30, 35}; hrIncreaseNormal[] = {-10, -50, 40}; hrIncreaseHigh[] = {-10, -40, 50}; - timeInSystem = 500; + timeInSystem = 900; maxDose = 4; inCompatableMedication[] = {}; viscosityChange = 10; @@ -824,9 +836,9 @@ class ACE_Medical_Advanced { }; class Atropine { painReduce = 0; - hrIncreaseLow[] = {20, 30, 15}; - hrIncreaseNormal[] = {-10, -50, 20}; - hrIncreaseHigh[] = {-10, -40, 10}; + hrIncreaseLow[] = {-5, -7, 15}; + hrIncreaseNormal[] = {-10, -30, 20}; + hrIncreaseHigh[] = {-10, -20, 10}; timeInSystem = 120; maxDose = 6; inCompatableMedication[] = {}; diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index b3c2152df1..fcaba03aa0 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -59,6 +59,10 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {"Disabled", "50/50", "Enabled"}; }; + class GVAR(remoteControlledAI) { + typeName = "BOOL"; + value = 1; + }; class GVAR(preventInstaDeath) { typeName = "BOOL"; value = 0; @@ -85,8 +89,8 @@ class ACE_Settings { value = 1; }; class GVAR(litterSimulationDetail) { - displayName = "$STR_ACE_Medical_litterSimulationDetail"; - description = "$STR_ACE_Medical_litterSimulationDetail_Desc"; + displayName = CSTRING(litterSimulationDetail); + description = CSTRING(litterSimulationDetail_Desc); typeName = "SCALAR"; value = 3; @@ -129,19 +133,39 @@ class ACE_Settings { value = 2; values[] = {"Anywhere", "Medical vehicles", "Medical facility", "vehicle & facility", "Disabled"}; }; + class GVAR(useCondition_PAK) { + displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description); + typeName = "SCALAR"; + value = 0; + values[] = {"Anytime", "Stable"}; + }; + class GVAR(useCondition_SurgicalKit) { + displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description); + typeName = "SCALAR"; + value = 0; + values[] = {"Anytime", "Stable"}; + }; class GVAR(keepLocalSettingsSynced) { typeName = "BOOL"; value = 1; }; class GVAR(healHitPointAfterAdvBandage) { + displayName = CSTRING(healHitPointAfterAdvBandage); + typeName = "BOOL"; + value = 0; + }; + class GVAR(painIsOnlySuppressed) { + displayName = CSTRING(painIsOnlySuppressed); typeName = "BOOL"; value = 1; }; class GVAR(painEffectType) { - displayName = "$STR_ACE_Medical_painEffectType"; + displayName = CSTRING(painEffectType); typeName = "SCALAR"; value = 0; - values[] = {"$STR_ACE_Medical_painEffect_Flash", "$STR_ACE_Medical_painEffect_Chroma"}; + values[] = {CSTRING(painEffect_Flash), CSTRING(painEffect_Chroma)}; isClientSettable = 1; }; class GVAR(allowUnconsciousAnimationOnTreatment) { @@ -154,11 +178,11 @@ class ACE_Settings { }; class GVAR(menuTypeStyle) { - displayName = "$STR_ACE_Medical_menuTypeDisplay"; - description = "$STR_ACE_Medical_menuTypeDescription"; + displayName = CSTRING(menuTypeDisplay); + description = CSTRING(menuTypeDescription); typeName = "SCALAR"; value = 0; - values[] = {"$STR_ACE_Medical_useSelection"/*, "$STR_ACE_Medical_useRadial"*/}; + values[] = {CSTRING(useSelection)/*, CSTRING(useRadial)*/}; // isClientSettable = 1; }; }; diff --git a/addons/medical/CfgFactionClasses.hpp b/addons/medical/CfgFactionClasses.hpp index e98b1f84ec..0ca922c8a6 100644 --- a/addons/medical/CfgFactionClasses.hpp +++ b/addons/medical/CfgFactionClasses.hpp @@ -1,6 +1,6 @@ class CfgFactionClasses { class NO_CATEGORY; class ADDON: NO_CATEGORY { - displayName = "ACE Medical"; + displayName = CSTRING(Category_DisplayName); }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 4054a2ee1e..66df5550fc 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -9,91 +9,90 @@ class CfgVehicles { }; }; class ACE_Module; - // TODO localization for all the modules class ACE_moduleMedicalSettings: ACE_Module { scope = 2; - displayName = "Medical Settings [ACE]"; + displayName = CSTRING(MedicalSettings_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(DFUNC(moduleMedicalSettings)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class level { - displayName = "Medical Level"; - description = "What is the medical simulation level?"; + displayName = CSTRING(MedicalSettings_level_DisplayName); + description = CSTRING(MedicalSettings_level_Description); typeName = "NUMBER"; class values { class normal { - name = "Basic"; + name = CSTRING(MedicalSettings_basic); value = 1; default = 1; }; class full { - name = "Advanced"; + name = CSTRING(MedicalSettings_advanced); value = 2; }; }; }; class medicSetting { - displayName = "Medics setting"; - description = "What is the level of detail prefered for medics?"; + displayName = CSTRING(MedicalSettings_medicSetting_DisplayName); + description = CSTRING(MedicalSettings_medicSetting_Description); typeName = "NUMBER"; class values { class disable { - name = "Disable medics"; + name = CSTRING(MedicalSettings_medicSetting_disable); value = 0; }; class normal { - name = "Normal"; + name = CSTRING(MedicalSettings_basic); value = 1; default = 1; }; class full { - name = "Advanced"; + name = CSTRING(MedicalSettings_advanced); value = 2; }; }; }; class allowLitterCreation { - displayName = "Enable Litter"; - description = "Enable litter being created upon treatment"; + displayName = CSTRING(MedicalSettings_allowLitterCreation_DisplayName); + description = CSTRING(MedicalSettings_allowLitterCreation_Description); typeName = "BOOL"; defaultValue = 1; }; class litterCleanUpDelay { - displayName = "Life time of litter objects"; - description = "How long should litter objects stay? In seconds. -1 is forever."; + displayName = CSTRING(MedicalSettings_litterCleanUpDelay_DisplayName); + description = CSTRING(MedicalSettings_litterCleanUpDelay_Description); typeName = "NUMBER"; defaultValue = 1800; }; class enableScreams { - displayName = "Enable Screams"; - description = "Enable screaming by injuried units"; + displayName = CSTRING(MedicalSettings_enableScreams_DisplayName); + description = CSTRING(MedicalSettings_enableScreams_Description); typeName = "BOOL"; defaultValue = 1; }; class playerDamageThreshold { - displayName = "Player Damage"; - description = "What is the damage a player can take before being killed?"; + displayName = CSTRING(MedicalSettings_playerDamageThreshold_DisplayName); + description = CSTRING(MedicalSettings_playerDamageThreshold_Description); typeName = "NUMBER"; defaultValue = 1; }; class AIDamageThreshold { - displayName = "AI Damage"; - description = "What is the damage an AI can take before being killed?"; + displayName = CSTRING(MedicalSettings_AIDamageThreshold_DisplayName); + description = CSTRING(MedicalSettings_AIDamageThreshold_Description); typeName = "NUMBER"; defaultValue = 1; }; class enableUnconsciousnessAI { - displayName = "AI Unconsciousness"; - description = "Allow AI to go unconscious"; + displayName = CSTRING(MedicalSettings_enableUnconsciousnessAI_DisplayName); + description = CSTRING(MedicalSettings_enableUnconsciousnessAI_Description); typeName = "NUMBER"; class values { class disable { - name = "Disabled"; + name = CSTRING(disabled); value = 0; }; class normal { @@ -102,45 +101,51 @@ class CfgVehicles { default = 1; }; class full { - name = "Enabled"; + name = CSTRING(enabled); value = 2; }; }; }; + class remoteControlledAI { + displayName = CSTRING(MedicalSettings_remoteControlledAI_DisplayName); + description = CSTRING(MedicalSettings_remoteControlledAI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class preventInstaDeath { - displayName = "Prevent instant death"; - description = "Have a unit move to unconscious instead of death"; + displayName = CSTRING(MedicalSettings_preventInstaDeath_DisplayName); + description = CSTRING(MedicalSettings_preventInstaDeath_Description); typeName = "BOOL"; defaultValue = 0; }; class bleedingCoefficient { - displayName = "Bleeding coefficient"; - description = "Coefficient to modify the bleeding speed"; + displayName = CSTRING(MedicalSettings_bleedingCoefficient_DisplayName); + description = CSTRING(MedicalSettings_bleedingCoefficient_Description); typeName = "NUMBER"; defaultValue = 1; }; class painCoefficient { - displayName = "Pain coefficient"; - description = "Coefficient to modify the pain intensity"; + displayName = CSTRING(MedicalSettings_painCoefficient_DisplayName); + description = CSTRING(MedicalSettings_painCoefficient_Description); typeName = "NUMBER"; defaultValue = 1; }; class keepLocalSettingsSynced { - displayName = "Sync status"; - description = "Keep unit status synced. Recommended on."; + displayName = CSTRING(MedicalSettings_keepLocalSettingsSynced_DisplayName); + description = CSTRING(MedicalSettings_keepLocalSettingsSynced_Description); typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = "Provides a medical system for both players and AI."; + description = CSTRING(MedicalSettings_Module_Description); sync[] = {}; }; }; class ACE_moduleAdvancedMedicalSettings: ACE_Module { scope = 2; - displayName = "Advanced Medical Settings [ACE]"; + displayName = CSTRING(AdvancedMedicalSettings_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAdvancedMedicalSettings)); @@ -148,83 +153,111 @@ class CfgVehicles { isGlobal = 2; isTriggerActivated = 0; isDisposable = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class enableFor { - displayName = "Enabled for"; - description = "Select what units the advanced medical system will be enabled for"; + displayName = CSTRING(AdvancedMedicalSettings_enableFor_DisplayName); + description = CSTRING(AdvancedMedicalSettings_enableFor_Description); typeName = "NUMBER"; class values { class playableUnits { - name = "Players only."; + name = CSTRING(playeronly); value = 0; default = 1; }; class playableUnitsAndAI { - name = "Players and AI"; + name = CSTRING(playersandai); value = 1; }; }; }; class enableAdvancedWounds { - displayName = "Enable Advanced wounds"; - description = "Allow reopening of bandaged wounds?"; + displayName = CSTRING(AdvancedMedicalSettings_enableAdvancedWounds_DisplayName); + description = CSTRING(AdvancedMedicalSettings_enableAdvancedWounds_Description); typeName = "BOOL"; defaultValue = 0; }; class enableVehicleCrashes { - displayName = "Vehicle Crashes"; - description = "Do units take damage from a vehicle crash?"; + displayName = CSTRING(AdvancedMedicalSettings_enableVehicleCrashes_DisplayName); + description = CSTRING(AdvancedMedicalSettings_enableVehicleCrashes_Description); typeName = "BOOL"; defaultValue = 1; }; class medicSetting_PAK { - displayName = "Allow PAK"; - description = "Who can use the PAK for full heal?"; + displayName = CSTRING(AdvancedMedicalSettings_medicSetting_PAK_DisplayName); + description = CSTRING(AdvancedMedicalSettings_medicSetting_PAK_Description); typeName = "NUMBER"; class values { - class anyone { name = "Anyone"; value = 0; }; - class Medic { name = "Medics only"; value = 1; default = 1; }; - class Special { name = "Doctors only"; value = 2; }; + class anyone { name = CSTRING(AdvancedMedicalSettings_anyone); value = 0; }; + class Medic { name = CSTRING(AdvancedMedicalSettings_Medic); value = 1; default = 1; }; + class Special { name = CSTRING(AdvancedMedicalSettings_Special); value = 2; }; }; }; class consumeItem_PAK { - displayName = "Remove PAK on use"; - description = "Should PAK be removed on usage?"; + displayName = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_DisplayName); + description = CSTRING(AdvancedMedicalSettings_consumeItem_PAK_Description); typeName = "NUMBER"; class values { - class keep { name = "No"; value = 0; }; - class remove { name = "Yes"; value = 1; default = 1; }; + class keep { name = CSTRING(No); value = 0; }; + class remove { name = CSTRING(Yes); value = 1; default = 1; }; + }; + }; + class useCondition_PAK { + displayName = CSTRING(AdvancedMedicalSettings_useCondition_PAK_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useCondition_PAK_Description); + typeName = "NUMBER"; + class values { + class AnyTime { name = CSTRING(AnyTime); value = 0; }; + class Stable { name = CSTRING(Stable); value = 1; default = 1; }; }; }; class useLocation_PAK { - displayName = "Locations PAK"; - description = "Where can the personal aid kit be used?"; + displayName = CSTRING(AdvancedMedicalSettings_useLocation_PAK_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useLocation_PAK_Description); typeName = "NUMBER"; class values { - class anywhere { name = "Anywhere"; value = 0; }; - class vehicle { name = "Medical Vehicles"; value = 1; }; - class facility { name = "Medical facility"; value = 2; }; - class vehicleAndFacility { name = "Vehicles & facility"; value = 3; default = 1; }; - class disabled { name = "Disabled"; value = 4;}; + class anywhere { name = CSTRING(AdvancedMedicalSettings_anywhere); value = 0; }; + 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 medicSetting_SurgicalKit: medicSetting_PAK { - displayName = "Allow Surgical kit (Adv)"; - description = "Who can use the surgical kit?"; + displayName = CSTRING(AdvancedMedicalSettings_medicSetting_SurgicalKit_DisplayName); + description = CSTRING(AdvancedMedicalSettings_medicSetting_SurgicalKit_Description); }; class consumeItem_SurgicalKit: consumeItem_PAK { - displayName = "Remove Surgical kit (Adv)"; - description = "Should Surgical kit be removed on usage?"; + displayName = CSTRING(AdvancedMedicalSettings_consumeItem_SurgicalKit_DisplayName); + description = CSTRING(AdvancedMedicalSettings_consumeItem_SurgicalKit_Description); }; class useLocation_SurgicalKit: useLocation_PAK { - displayName = "Locations Surgical kit (Adv)"; - description = "Where can the Surgical kit be used?"; + displayName = CSTRING(AdvancedMedicalSettings_useLocation_SurgicalKit_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useLocation_SurgicalKit_Description); + }; + class useCondition_SurgicalKit: useCondition_PAK { + displayName = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_DisplayName); + description = CSTRING(AdvancedMedicalSettings_useCondition_SurgicalKit_Description); + class values { + class AnyTime { name = CSTRING(AnyTime); value = 0; default = 1; }; + class Stable { name = CSTRING(Stable); value = 1; }; + }; + }; + class healHitPointAfterAdvBandage { + displayName = CSTRING(AdvancedMedicalSettings_healHitPointAfterAdvBandage_DisplayName); + description = CSTRING(AdvancedMedicalSettings_healHitPointAfterAdvBandage_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class painIsOnlySuppressed { + displayName = CSTRING(AdvancedMedicalSettings_painIsOnlySuppressed_DisplayName); + description = CSTRING(AdvancedMedicalSettings_painIsOnlySuppressed_Description); + typeName = "BOOL"; + defaultValue = 1; }; - }; class ModuleDescription { - description = "Configure the treatment settings from ACE Medical"; + description = CSTRING(AdvancedMedicalSettings_Module_Description); sync[] = {}; }; }; @@ -232,47 +265,47 @@ class CfgVehicles { class ACE_moduleReviveSettings: ACE_Module { scope = 2; - displayName = "Revive Settings [ACE]"; + displayName = CSTRING(ReviveSettings_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(DFUNC(moduleReviveSettings)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class enableRevive { - displayName = "Enable Revive"; - description = "Enable a basic revive system"; + displayName = CSTRING(ReviveSettings_enableRevive_DisplayName); + description = CSTRING(ReviveSettings_enableRevive_Description); typeName = "NUMBER"; defaultValue = 0; class values { - class disable { name = "Disabled"; value = 0; default = 1;}; - class playerOnly { name = "Player only"; value = 1; }; - class playerAndAI { name = "Player & AI"; value = 2; }; + class disable { name = CSTRING(disabled); value = 0; default = 1;}; + class playerOnly { name = CSTRING(playeronly); value = 1; }; + class playerAndAI { name = CSTRING(playersandai); value = 2; }; }; }; class maxReviveTime { - displayName = "Max Revive time"; - description = "Max amount of seconds a unit can spend in revive state"; + displayName = CSTRING(ReviveSettings_maxReviveTime_DisplayName); + description = CSTRING(ReviveSettings_maxReviveTime_Description); typeName = "NUMBER"; defaultValue = 120; }; class amountOfReviveLives { - displayName = "Max Revive lives"; - description = "Max amount of lives a unit. 0 or -1 is disabled."; + displayName = CSTRING(ReviveSettings_amountOfReviveLives_DisplayName); + description = CSTRING(ReviveSettings_amountOfReviveLives_Description); typeName = "NUMBER"; defaultValue = -1; }; }; class ModuleDescription { - description = "Provides a medical system for both players and AI."; + description = CSTRING(ReviveSettings_Module_Description); sync[] = {}; }; }; class ACE_moduleAssignMedicRoles: Module_F { scope = 2; - displayName = "Set Medic Class [ACE]"; + displayName = CSTRING(AssignMedicRoles_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicRoles)); @@ -280,44 +313,44 @@ class CfgVehicles { isGlobal = 2; isTriggerActivated = 0; isDisposable = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = "List"; - description = "List of unit names that will be classified as medic, separated by commas."; + displayName = CSTRING(AssignMedicRoles_EnableList_DisplayName); + description = CSTRING(AssignMedicRoles_EnableList_Description); defaultValue = ""; typeName = "STRING"; }; class role { - displayName = "Is Medic"; - description = "Medics allow for more advanced treatment in case of Advanced Medic roles enabled"; + displayName = CSTRING(AssignMedicRoles_role_DisplayName); + description = CSTRING(AssignMedicRoles_role_Description); typeName = "NUMBER"; class values { class none { - name = "None"; + name = CSTRING(AssignMedicRoles_role_none); value = 0; }; class medic { - name = "Regular medic"; + name = CSTRING(AssignMedicRoles_role_medic); value = 1; default = 1; }; class doctor { - name = "Doctor (Only Advanced Medics)"; + name = CSTRING(AssignMedicRoles_role_doctor); value = 2; }; }; }; }; class ModuleDescription { - description = "Assigns the ACE medic class to a unit"; + description = CSTRING(AssignMedicRoles_Module_Description); sync[] = {}; }; }; class ACE_moduleAssignMedicVehicle: Module_F { scope = 2; - displayName = "Set Medical Vehicle [ACE]"; + displayName = CSTRING(AssignMedicVehicle_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicalVehicle)); @@ -325,25 +358,26 @@ class CfgVehicles { isGlobal = 2; isTriggerActivated = 0; isDisposable = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class EnableList { - displayName = "List"; - description = "List of vehicles that will be classified as medical vehicle, separated by commas."; + displayName = CSTRING(AssignMedicVehicle_EnableList_DisplayName); + description = CSTRING(AssignMedicVehicle_EnableList_Description); defaultValue = ""; typeName = "STRING"; }; class enabled { - displayName = "Is Medical Vehicle"; - description = "Whatever or not the objects in the list will be a medical vehicle."; + displayName = CSTRING(AssignMedicVehicle_enabled_DisplayName); + description = CSTRING(AssignMedicVehicle_enabled_Description); + typeName = "NUMBER"; class values { class none { - name = "No"; + name = CSTRING(No); value = 0; }; class medic { - name = "Yes"; + name = CSTRING(Yes); value = 1; default = 1; }; @@ -351,13 +385,13 @@ class CfgVehicles { }; }; class ModuleDescription { - description = "Assigns the ACE medic class to a unit"; + description = CSTRING(AssignMedicVehicle_Module_Description); sync[] = {}; }; }; class ACE_moduleAssignMedicalFacility: Module_F { scope = 2; - displayName = "Set Medical Facility [ACE]"; + displayName = CSTRING(AssignMedicalFacility_Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicalFacility)); @@ -365,16 +399,16 @@ class CfgVehicles { isGlobal = 2; isTriggerActivated = 0; isDisposable = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class enabled { - displayName = "Is Medical Facility"; - description = "Registers an object as a medical facility for CMS"; + displayName = CSTRING(AssignMedicalFacility_enabled_DisplayName); + description = CSTRING(AssignMedicalFacility_enabled_Description); typeName = "BOOL"; }; }; class ModuleDescription { - description = "Defines an object as a medical facility for CMS. This allows for more advanced treatments. Can be used on buildings and vehicles. "; + description = CSTRING(AssignMedicalFacility_Module_Description); sync[] = {}; }; }; @@ -450,7 +484,7 @@ class CfgVehicles { // Create a consolidates medical menu for treatment while boarded class ACE_MainActions { class Medical { - displayName = "$STR_ACE_Medical_Actions_Medical"; + displayName = CSTRING(Actions_Medical); runOnHover = 1; exceptions[] = {"isNotInside"}; condition = QUOTE((vehicle _target != _target && vehicle _target == vehicle _player) || GVAR(menuTypeStyle) == 1); @@ -464,7 +498,7 @@ class CfgVehicles { #include "ACE_Medical_Actions.hpp" }; class GVAR(loadPatient) { - displayName = "$STR_ACE_Medical_LoadPatient"; + displayName = CSTRING(LoadPatient); distance = 5; condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target == _target); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionLoadUnit)); @@ -474,7 +508,7 @@ class CfgVehicles { exceptions[] = {"isNotDragging", "isNotCarrying"}; }; class GVAR(UnLoadPatient) { - displayName = "$STR_ACE_Medical_UnloadPatient"; + displayName = CSTRING(UnloadPatient); distance = 5; condition = QUOTE(_target getvariable[ARR_2(QUOTE(QUOTE(ACE_isUnconscious)),false)] && vehicle _target != _target); statement = QUOTE([ARR_2(_player, _target)] call DFUNC(actionUnloadUnit)); @@ -659,13 +693,13 @@ class CfgVehicles { side = -1; model = QUOTE(PATHTOEF(apl,bodybag.p3d)); icon = ""; - displayName = $STR_ACE_Medical_Bodybag_Display; + displayName = CSTRING(Bodybag_Display); EGVAR(dragging,canDrag) = 1; EGVAR(dragging,dragPosition[]) = {0,1.2,0}; EGVAR(dragging,dragDirection) = 0; class ACE_Actions { class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; + displayName = ECSTRING(interaction,MainAction); distance = 5; condition = QUOTE(true); statement = ""; @@ -712,8 +746,8 @@ class CfgVehicles { class ACE_fieldDressingItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Bandage_Basic_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Bandage_Basic_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_fieldDressing { @@ -725,8 +759,8 @@ class CfgVehicles { class ACE_packingBandageItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Packing_Bandage_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Packing_Bandage_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_packingBandage { @@ -738,8 +772,8 @@ class CfgVehicles { class ACE_elasticBandageItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Bandage_Elastic_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Bandage_Elastic_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_elasticBandage { @@ -751,8 +785,8 @@ class CfgVehicles { class ACE_tourniquetItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Tourniquet_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Tourniquet_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_tourniquet { @@ -764,8 +798,8 @@ class CfgVehicles { class ACE_morphineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Morphine_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Morphine_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_morphine { @@ -777,8 +811,8 @@ class CfgVehicles { class ACE_atropineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Atropine_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Atropine_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_atropine { @@ -790,8 +824,8 @@ class CfgVehicles { class ACE_epinephrineItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Epinephrine_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Epinephrine_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_epinephrine { @@ -803,8 +837,8 @@ class CfgVehicles { class ACE_plasmaIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Plasma_IV; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Plasma_IV); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_plasmaIV { @@ -817,8 +851,8 @@ class CfgVehicles { class ACE_bloodIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Blood_IV; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Blood_IV); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_bloodIV { @@ -830,8 +864,8 @@ class CfgVehicles { class ACE_salineIVItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Saline_IV; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Saline_IV); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_salineIV { @@ -843,8 +877,8 @@ class CfgVehicles { class ACE_quikClotItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_QuikClot_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(QuikClot_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_quikClot { @@ -856,8 +890,8 @@ class CfgVehicles { class ACE_personalAidKitItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Aid_Kit_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Aid_Kit_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_personalAidKit { @@ -869,8 +903,8 @@ class CfgVehicles { class ACE_surgicalKitItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_SurgicalKit_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(SurgicalKit_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_surgicalKit { @@ -882,8 +916,8 @@ class CfgVehicles { class ACE_bodyBagItem: Item_Base_F { scope = 2; scopeCurator = 2; - displayName = $STR_ACE_Medical_Bodybag_Display; - author = "$STR_ACE_Common_ACETeam"; + displayName = CSTRING(Bodybag_Display); + author = ECSTRING(common,ACETeam); vehicleClass = "Items"; class TransportItems { class ACE_bodyBag { @@ -897,9 +931,9 @@ class CfgVehicles { class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Medical Supply Crate (Basic)"; + displayName = CSTRING(medicalSupplyCrate); model = PATHTOF(data\ace_medcrate.p3d); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; @@ -932,7 +966,7 @@ class CfgVehicles { }; }; class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { - displayName = "[ACE] Medical Supply Crate (Advanced)"; + displayName = CSTRING(medicalSupplyCrate_advanced); class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp index d70b64a1d2..ef6c702604 100644 --- a/addons/medical/CfgWeapons.hpp +++ b/addons/medical/CfgWeapons.hpp @@ -24,64 +24,64 @@ class CfgWeapons { scope = 2; model = QUOTE(PATHTOF(data\bandage.p3d)); picture = QUOTE(PATHTOF(ui\items\fieldDressing_x_ca.paa)); - displayName = $STR_ACE_Medical_Bandage_Basic_Display; - descriptionShort = $STR_ACE_Medical_Bandage_Basic_Desc_Short; - descriptionUse = $STR_ACE_Medical_Bandage_Basic_Desc_Use; + displayName = CSTRING(Bandage_Basic_Display); + descriptionShort = CSTRING(Bandage_Basic_Desc_Short); + descriptionUse = CSTRING(Bandage_Basic_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_packingBandage: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Packing_Bandage_Display; + displayName = CSTRING(Packing_Bandage_Display); picture = QUOTE(PATHTOF(ui\items\packingBandage_x_ca.paa)); model = QUOTE(PATHTOF(data\packingbandage.p3d)); - descriptionShort = $STR_ACE_Medical_Packing_Bandage_Desc_Short; - descriptionUse = $STR_ACE_Medical_Packing_Bandage_Desc_Use; + descriptionShort = CSTRING(Packing_Bandage_Desc_Short); + descriptionUse = CSTRING(Packing_Bandage_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_elasticBandage: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Bandage_Elastic_Display; + displayName = CSTRING(Bandage_Elastic_Display); picture = QUOTE(PATHTOF(ui\items\elasticBandage_x_ca.paa)); model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; - descriptionShort = $STR_ACE_Medical_Bandage_Elastic_Desc_Short; - descriptionUse = $STR_ACE_Medical_Bandage_Elastic_Desc_Use; + descriptionShort = CSTRING(Bandage_Elastic_Desc_Short); + descriptionUse = CSTRING(Bandage_Elastic_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_tourniquet: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Tourniquet_Display; + displayName = CSTRING(Tourniquet_Display); picture = QUOTE(PATHTOF(ui\items\tourniquet_x_ca.paa)); model = QUOTE(PATHTOF(data\tourniquet.p3d)); - descriptionShort = $STR_ACE_Medical_Tourniquet_Desc_Short; - descriptionUse = $STR_ACE_Medical_Tourniquet_Desc_Use; + descriptionShort = CSTRING(Tourniquet_Desc_Short); + descriptionUse = CSTRING(Tourniquet_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_morphine: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Morphine_Display; + displayName = CSTRING(Morphine_Display); picture = QUOTE(PATHTOF(ui\items\morphine_x_ca.paa)); model = QUOTE(PATHTOF(data\morphine.p3d)); - descriptionShort = $STR_ACE_Medical_Morphine_Desc_Short; - descriptionUse = $STR_ACE_Medical_Morphine_Desc_Use; + descriptionShort = CSTRING(Morphine_Desc_Short); + descriptionUse = CSTRING(Morphine_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_atropine: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Atropine_Display; + displayName = CSTRING(Atropine_Display); picture = QUOTE(PATHTOF(ui\items\atropine_x_ca.paa)); model = QUOTE(PATHTOF(data\atropine.p3d)); - descriptionShort = $STR_ACE_Medical_Atropine_Desc_Short; - descriptionUse = $STR_ACE_Medical_Atropine_Desc_Use; + descriptionShort = CSTRING(Atropine_Desc_Short); + descriptionUse = CSTRING(Atropine_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; @@ -89,33 +89,33 @@ class CfgWeapons { }; class ACE_epinephrine: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Epinephrine_Display; + displayName = CSTRING(Epinephrine_Display); picture = QUOTE(PATHTOF(ui\items\epinephrine_x_ca.paa)); model = QUOTE(PATHTOF(data\epinephrine.p3d)); - descriptionShort = $STR_ACE_Medical_Epinephrine_Desc_Short; - descriptionUse = $STR_ACE_Medical_Epinephrine_Desc_Use; + descriptionShort = CSTRING(Epinephrine_Desc_Short); + descriptionUse = CSTRING(Epinephrine_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_plasmaIV: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Plasma_IV; + displayName = CSTRING(Plasma_IV); picture = QUOTE(PATHTOF(ui\items\plasmaIV_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_Plasma_IV_Desc_Short; - descriptionUse = $STR_ACE_Medical_Plasma_IV_Desc_Use; + descriptionShort = CSTRING(Plasma_IV_Desc_Short); + descriptionUse = CSTRING(Plasma_IV_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_plasmaIV_500: ACE_plasmaIV { - displayName = $STR_ACE_Medical_Plasma_IV_500; + displayName = CSTRING(Plasma_IV_500); class ItemInfo: InventoryItem_Base_F { mass = 5; }; }; class ACE_plasmaIV_250: ACE_plasmaIV { - displayName = $STR_ACE_Medical_Plasma_IV_250; + displayName = CSTRING(Plasma_IV_250); class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; @@ -123,88 +123,88 @@ class CfgWeapons { class ACE_bloodIV: ACE_ItemCore { scope = 2; model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; - displayName = $STR_ACE_Medical_Blood_IV; + displayName = CSTRING(Blood_IV); picture = QUOTE(PATHTOF(ui\items\bloodIV_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_Blood_IV_Desc_Short; - descriptionUse = $STR_ACE_Medical_Blood_IV_Desc_Use; + descriptionShort = CSTRING(Blood_IV_Desc_Short); + descriptionUse = CSTRING(Blood_IV_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_bloodIV_500: ACE_bloodIV { - displayName = $STR_ACE_Medical_Blood_IV_500; + displayName = CSTRING(Blood_IV_500); class ItemInfo: InventoryItem_Base_F { mass = 5; }; }; class ACE_bloodIV_250: ACE_bloodIV { - displayName = $STR_ACE_Medical_Blood_IV_250; + displayName = CSTRING(Blood_IV_250); class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_salineIV: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Saline_IV; + displayName = CSTRING(Saline_IV); picture = QUOTE(PATHTOF(ui\items\salineIV_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_Saline_IV_Desc_Short; - descriptionUse = $STR_ACE_Medical_Saline_IV_Desc_Use; + descriptionShort = CSTRING(Saline_IV_Desc_Short); + descriptionUse = CSTRING(Saline_IV_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 10; }; }; class ACE_salineIV_500: ACE_salineIV { - displayName = $STR_ACE_Medical_Saline_IV_500; + displayName = CSTRING(Saline_IV_500); class ItemInfo: InventoryItem_Base_F { - mass = 2.5; + mass = 5; }; }; class ACE_salineIV_250: ACE_salineIV { - displayName = $STR_ACE_Medical_Saline_IV_250; + displayName = CSTRING(Saline_IV_250); class ItemInfo: InventoryItem_Base_F { mass = 2.5; }; }; class ACE_quikclot: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_QuikClot_Display; + displayName = CSTRING(QuikClot_Display); picture = QUOTE(PATHTOF(ui\items\quickclot_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_QuikClot_Desc_Short; - descriptionUse = $STR_ACE_Medical_QuikClot_Desc_Use; + descriptionShort = CSTRING(QuikClot_Desc_Short); + descriptionUse = CSTRING(QuikClot_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 1; }; }; class ACE_personalAidKit: ACE_ItemCore { scope = 2; - displayName = $STR_ACE_Medical_Aid_Kit_Display; + displayName = CSTRING(Aid_Kit_Display); picture = QUOTE(PATHTOF(ui\items\personal_aid_kit_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_Aid_Kit_Desc_Short; - descriptionUse = $STR_ACE_Medical_Aid_Kit_Desc_Use; + descriptionShort = CSTRING(Aid_Kit_Desc_Short); + descriptionUse = CSTRING(Aid_Kit_Desc_Use); class ItemInfo: InventoryItem_Base_F { - mass = 2; + mass = 10; }; }; class ACE_surgicalKit: ACE_ItemCore { scope=2; - displayName= $STR_ACE_Medical_SurgicalKit_Display; + displayName= CSTRING(SurgicalKit_Display); model = QUOTE(PATHTOF(data\surgical_kit.p3d)); picture = QUOTE(PATHTOF(ui\items\surgicalKit_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_SurgicalKit_Desc_Short; - descriptionUse = $STR_ACE_Medical_SurgicalKit_Desc_Use; - class ItemInfo: InventoryItem_Base_F { - mass = 5; - }; - }; - class ACE_bodyBag: ACE_ItemCore { - scope=2; - displayName= $STR_ACE_Medical_Bodybag_Display; - model = QUOTE(PATHTOF(data\bodybagItem.p3d)); - picture = QUOTE(PATHTOF(ui\items\bodybag_x_ca.paa)); - descriptionShort = $STR_ACE_Medical_Bodybag_Desc_Short; - descriptionUse = $STR_ACE_Medical_Bodybag_Desc_Use; + descriptionShort = CSTRING(SurgicalKit_Desc_Short); + descriptionUse = CSTRING(SurgicalKit_Desc_Use); class ItemInfo: InventoryItem_Base_F { mass = 15; }; }; + class ACE_bodyBag: ACE_ItemCore { + scope=2; + displayName= CSTRING(Bodybag_Display); + model = QUOTE(PATHTOF(data\bodybagItem.p3d)); + picture = QUOTE(PATHTOF(ui\items\bodybag_x_ca.paa)); + descriptionShort = CSTRING(Bodybag_Desc_Short); + descriptionUse = CSTRING(Bodybag_Desc_Use); + class ItemInfo: InventoryItem_Base_F { + mass = 20; + }; + }; }; diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf index 1bb0e744bc..f9f821eeb3 100644 --- a/addons/medical/XEH_postInit.sqf +++ b/addons/medical/XEH_postInit.sqf @@ -2,15 +2,13 @@ #include "script_component.hpp" -GVAR(enabledFor) = 1; // TODO remove this once we implement settings. Just here to get the vitals working. - GVAR(heartBeatSounds_Fast) = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "ACE_heartbeat_fast_3"]; GVAR(heartBeatSounds_Normal) = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; -["medical_propagateWound", FUNC(onPropagateWound)] call ace_common_fnc_addEventHandler; -["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call ace_common_fnc_addEventHandler; -["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call ace_common_fnc_addEventHandler; +["medical_propagateWound", FUNC(onPropagateWound)] call EFUNC(common,addEventHandler); +["medical_woundUpdateRequest", FUNC(onWoundUpdateRequest)] call EFUNC(common,addEventHandler); +["interactMenuClosed", {[objNull, false] call FUNC(displayPatientInformation); }] call EFUNC(common,addEventHandler); ["medical_onUnconscious", { if (local (_this select 0)) then { @@ -32,7 +30,7 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"]; if (!isNil "acre_api_fnc_setGlobalVolume") then { [1] call acre_api_fnc_setGlobalVolume; }; }; }; -}] call ace_common_fnc_addEventHandler; +}] call EFUNC(common,addEventHandler); // Initialize all effects @@ -88,13 +86,13 @@ GVAR(effectPainCC) = [ // Initialize Other Variables GVAR(effectBlind) = false; -GVAR(effectTimeBlood) = time; +GVAR(effectTimeBlood) = ACE_time; // MAIN EFFECTS LOOP [{ private["_bleeding", "_blood"]; // Zeus interface is open or player is dead; disable everything - if (!(isNull (findDisplay 312)) or !(alive ACE_player)) exitWith { + if (!(isNull curatorCamera) or !(alive ACE_player)) exitWith { GVAR(effectUnconsciousCC) ppEffectEnable false; GVAR(effectUnconsciousRB) ppEffectEnable false; GVAR(effectBlindingCC) ppEffectEnable false; @@ -135,8 +133,8 @@ GVAR(effectTimeBlood) = time; _bleeding = [ACE_player] call FUNC(getBloodLoss); // Bleeding Indicator - if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < time) then { - GVAR(effectTimeBlood) = time; + if (_bleeding > 0 and GVAR(effectTimeBlood) + 3.5 < ACE_time) then { + GVAR(effectTimeBlood) = ACE_time; [600 * _bleeding] call BIS_fnc_bloodEffect; }; @@ -152,75 +150,87 @@ GVAR(effectTimeBlood) = time; }, 0.5, []] call CBA_fnc_addPerFrameHandler; -GVAR(lastHeartBeat) = time; -GVAR(lastHeartBeatSound) = time; +GVAR(lastHeartBeat) = ACE_time; +GVAR(lastHeartBeatSound) = ACE_time; // HEARTRATE BASED EFFECTS [{ - private["_heartRate", "_interval", "_minTime", "_sound", "_strength"]; + private["_heartRate", "_interval", "_minTime", "_sound", "_strength", "_pain"]; _heartRate = ACE_player getVariable [QGVAR(heartRate), 70]; + _pain = ACE_player getVariable [QGVAR(pain), 0]; if (GVAR(level) == 1) then { - _heartRate = 60 + 40 * (ACE_player getVariable [QGVAR(pain), 0]); + _heartRate = 60 + 40 * _pain; }; if (_heartRate <= 0) exitwith {}; _interval = 60 / (_heartRate min 50); - if (time > GVAR(lastHeartBeat) + _interval) then { - GVAR(lastHeartBeat) = time; - // Pain effect - _strength = ACE_player getVariable [QGVAR(pain), 0]; - _strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]); + if ((ACE_player getVariable ["ACE_isUnconscious", false])) then { if (GVAR(painEffectType) == 1) then { - GVAR(effectPainCC) ppEffectEnable false; - if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { - _strength = _strength * 0.15; - GVAR(effectPainCA) ppEffectEnable true; - GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false]; - GVAR(effectPainCA) ppEffectCommit 0.01; - [{ - GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; - GVAR(effectPainCA) ppEffectCommit (_this select 1); - }, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute); - [{ - GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; - GVAR(effectPainCA) ppEffectCommit 0.01; - }, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute); - [{ - GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; - GVAR(effectPainCA) ppEffectCommit (_this select 1); - }, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute); - } else { - GVAR(effectPainCA) ppEffectEnable false; - }; - } else { GVAR(effectPainCA) ppEffectEnable false; - if ((ACE_player getVariable [QGVAR(pain), 0]) > 0 && {alive ACE_player}) then { - _strength = _strength * 0.9; - GVAR(effectPainCC) ppEffectEnable true; - GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]]; - GVAR(effectPainCC) ppEffectCommit 0.01; - [{ - GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; - GVAR(effectPainCC) ppEffectCommit (_this select 1); - }, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute); - [{ - GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; - GVAR(effectPainCC) ppEffectCommit 0.01; - }, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute); - [{ - GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; - GVAR(effectPainCC) ppEffectCommit (_this select 1); - }, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute); - } else { - GVAR(effectPainCC) ppEffectEnable false; + } else { + GVAR(effectPainCC) ppEffectEnable false; + }; + } else { + if ((ACE_time > GVAR(lastHeartBeat) + _interval)) then { + GVAR(lastHeartBeat) = ACE_time; + + // Pain effect, no pain effect in zeus camera + if (isNull curatorCamera) then { + _strength = (_pain - (ACE_player getvariable [QGVAR(painSuppress), 0])) max 0; + _strength = _strength * (ACE_player getVariable [QGVAR(painCoefficient), GVAR(painCoefficient)]); + if (GVAR(painEffectType) == 1) then { + GVAR(effectPainCC) ppEffectEnable false; + if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { + _strength = _strength * 0.15; + GVAR(effectPainCA) ppEffectEnable true; + GVAR(effectPainCA) ppEffectAdjust [_strength, _strength, false]; + GVAR(effectPainCA) ppEffectCommit 0.01; + [{ + GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; + GVAR(effectPainCA) ppEffectCommit (_this select 1); + }, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute); + [{ + GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; + GVAR(effectPainCA) ppEffectCommit 0.01; + }, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute); + [{ + GVAR(effectPainCA) ppEffectAdjust [(_this select 0), (_this select 0), false]; + GVAR(effectPainCA) ppEffectCommit (_this select 1); + }, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute); + } else { + GVAR(effectPainCA) ppEffectEnable false; + }; + } else { + GVAR(effectPainCA) ppEffectEnable false; + if (_pain > (ACE_player getvariable [QGVAR(painSuppress), 0]) && {alive ACE_player}) then { + _strength = _strength * 0.9; + GVAR(effectPainCC) ppEffectEnable true; + GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - _strength,1 - _strength,0,0,0,0.2,2]]; + GVAR(effectPainCC) ppEffectCommit 0.01; + [{ + GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; + GVAR(effectPainCC) ppEffectCommit (_this select 1); + }, [_strength * 0.1, _interval * 0.2], _interval * 0.05, 0] call EFUNC(common,waitAndExecute); + [{ + GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; + GVAR(effectPainCC) ppEffectCommit 0.01; + }, [_strength * 0.7], _interval * 0.3, 0] call EFUNC(common,waitAndExecute); + [{ + GVAR(effectPainCC) ppEffectAdjust [1,1,0, [1,1,1,1], [0,0,0,0], [1,1,1,1], [1 - (_this select 0),1 - (_this select 0),0,0,0,0.2,2]]; + GVAR(effectPainCC) ppEffectCommit (_this select 1); + }, [_strength * 0.1, _interval * 0.55], _interval * 0.4, 0] call EFUNC(common,waitAndExecute); + } else { + GVAR(effectPainCC) ppEffectEnable false; + }; + }; }; }; }; if (GVAR(level) >= 2 && {_heartRate > 0}) then { _minTime = 60 / _heartRate; - if (time - GVAR(lastHeartBeatSound) > _minTime) then { - GVAR(lastHeartBeatSound) = time; + if (ACE_time - GVAR(lastHeartBeatSound) > _minTime) then { + GVAR(lastHeartBeatSound) = ACE_time; // Heart rate sound effect if (_heartRate < 60) then { _sound = GVAR(heartBeatSounds_Normal) select (random((count GVAR(heartBeatSounds_Normal)) -1)); @@ -252,7 +262,7 @@ if (USE_WOUND_EVENT_SYNC) then { [ {(((_this select 0) getvariable [QGVAR(bloodVolume), 100]) < 65)}, - {(((_this select 0) getvariable [QGVAR(pain), 0]) > 0.9)}, + {(((_this select 0) getvariable [QGVAR(pain), 0]) - ((_this select 0) getvariable [QGVAR(painSuppress), 0])) > 0.9}, {(([_this select 0] call FUNC(getBloodLoss)) > 0.25)}, {((_this select 0) getvariable [QGVAR(inReviveState), false])}, {((_this select 0) getvariable [QGVAR(inCardiacArrest), false])}, @@ -276,5 +286,5 @@ if (hasInterface) then { ["PlayerJip", { diag_log format["[ACE] JIP Medical init for player"]; [player] call FUNC(init); - }] call FUNC(addEventHandler); + }] call EFUNC(common,addEventHandler); }; diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 4f4ff5bc30..b479383468 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -40,6 +40,7 @@ PREP(handleDamage_caching); PREP(handleDamage_fractures); PREP(handleDamage_internalInjuries); PREP(handleDamage_wounds); +PREP(handleDamage_woundsOld); PREP(handleUnitVitals); PREP(handleKilled); PREP(handleLocal); @@ -55,6 +56,7 @@ PREP(isInMedicalFacility); PREP(isInMedicalVehicle); PREP(isMedic); PREP(isMedicalVehicle); +PREP(isInStableCondition); PREP(itemCheck); PREP(modifyMedicalAction); PREP(onMedicationUsage); @@ -76,8 +78,10 @@ PREP(treatmentAdvanced_CPR); PREP(treatmentAdvanced_CPRLocal); PREP(treatmentAdvanced_fullHeal); PREP(treatmentAdvanced_fullHealLocal); +PREP(treatmentAdvanced_fullHealTreatmentTime); PREP(treatmentAdvanced_medication); PREP(treatmentAdvanced_medicationLocal); +PREP(treatmentAdvanced_surgicalKit_onProgress); PREP(treatmentBasic_bandage); PREP(treatmentBasic_bloodbag); PREP(treatmentBasic_bloodbagLocal); @@ -110,6 +114,8 @@ PREP(handleCreateLitter); GVAR(injuredUnitCollection) = []; GVAR(IVBags) = []; +DFUNC(handleDamage_assignWounds) = if ("ace_medical" callExtension "version" == "") then { DFUNC(handleDamage_woundsOld) } else { DFUNC(handleDamage_wounds)}; + call FUNC(parseConfigForInjuries); GVAR(HITPOINTS) = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; diff --git a/addons/medical/XEH_respawn.sqf b/addons/medical/XEH_respawn.sqf index 0a95e064fd..44060fa15c 100644 --- a/addons/medical/XEH_respawn.sqf +++ b/addons/medical/XEH_respawn.sqf @@ -13,7 +13,7 @@ if (!(_unit getVariable ["ACE_isUnconscious", false])) then { [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); }; -// Remove maximum unconsciousness time handler +// Remove maximum unconsciousness ACE_time handler _maxUnconHandle = _unit getVariable [QGVAR(maxUnconTimeHandle), -1]; if (_maxUnconHandle > 0) then { [_maxUnconHandle] call CBA_fnc_removePerFrameHandler; diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 566de29f91..463ed95406 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { units[] = {"ACE_medicalSupplyCrate", "ACE_medicalSupplyCrate_advanced", "ACE_fieldDressingItem", "ACE_packingBandageItem", "ACE_elasticBandageItem", "ACE_tourniquetItem", "ACE_morphineItem", "ACE_atropineItem", "ACE_epinephrineItem", "ACE_plasmaIVItem", "ACE_bloodIVItem", "ACE_salineIVItem", "ACE_quikclotItem", "ACE_personalAidKitItem", "ACE_surgicalKitItem", "ACE_bodyBagItem", "ACE_bodyBagObject"}; weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interaction","ace_modules", "ace_apl"}; - author[] = {"Glowbal", "KoffienFlummi"}; + requiredAddons[] = {"ace_interaction", "ace_apl"}; + author[] = {"Glowbal", "KoffeinFlummi"}; authorUrl = ""; VERSION_CONFIG; }; @@ -21,3 +21,7 @@ class CfgPatches { #include "ACE_Settings.hpp" #include "UI\RscTitles.hpp" #include "UI\triagecard.hpp" + +class ACE_Extensions { + extensions[] += {"ace_medical"}; +}; diff --git a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf index 560b171400..19bd75caad 100644 --- a/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckBloodPressureLocal.sqf @@ -28,27 +28,28 @@ _bloodPressureLow = _bloodPressure select 0; _output = ""; _logOutPut = ""; if ([_caller] call FUNC(isMedic)) then { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_1"; + _output = LSTRING(Check_Bloodpressure_Output_1); _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; } else { if (_bloodPressureHigh > 20) then { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_2"; - _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_Low"; + _output = LSTRING(Check_Bloodpressure_Output_2); + _logOutPut = LSTRING(Check_Bloodpressure_Low); if (_bloodPressureHigh > 100) then { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_3"; - _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_Normal"; + _output = LSTRING(Check_Bloodpressure_Output_3); + _logOutPut = LSTRING(Check_Bloodpressure_Normal); if (_bloodPressureHigh > 160) then { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_4"; - _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_High"; + _output = LSTRING(Check_Bloodpressure_Output_4); + _logOutPut = LSTRING(Check_Bloodpressure_High); }; }; } else { if (random(10) > 3) then { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_5"; - _logOutPut = localize "STR_ACE_Medical_Check_Bloodpressure_NoBloodpressure"; + _output = LSTRING(Check_Bloodpressure_Output_5); + _logOutPut = LSTRING(Check_Bloodpressure_NoBloodpressure); } else { - _output = "STR_ACE_Medical_Check_Bloodpressure_Output_6"; + _output = LSTRING(Check_Bloodpressure_Output_6); + //Fail to find pressure, no logoutput }; }; }; @@ -56,5 +57,5 @@ if ([_caller] call FUNC(isMedic)) then { ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_target,"activity", localize "STR_ACE_Medical_Check_Bloodpressure_Log", [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); + [_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog); }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 85e9bee828..9af18d0a6d 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -23,24 +23,24 @@ _heartRate = _unit getvariable [QGVAR(heartRate), 80]; if (!alive _unit) then { _heartRate = 0; }; -_heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_5"; -_logOutPut = "No heart rate"; +_heartRateOutput = LSTRING(Check_Pulse_Output_5); +_logOutPut = LSTRING(Check_Pulse_None); if (_heartRate > 1.0) then { if ([_caller] call FUNC(isMedic)) then { - _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_1"; + _heartRateOutput = LSTRING(Check_Pulse_Output_1); _logOutPut = format["%1",round(_heartRate)]; } else { // non medical personel will only find a pulse/HR - _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_2"; - _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Weak"; + _heartRateOutput = LSTRING(Check_Pulse_Output_2); + _logOutPut = LSTRING(Check_Pulse_Weak); if (_heartRate > 60) then { if (_heartRate > 100) then { - _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_3"; - _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Strong"; + _heartRateOutput = LSTRING(Check_Pulse_Output_3); + _logOutPut = LSTRING(Check_Pulse_Strong); } else { - _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_4"; - _logOutPut = localize "STR_ACE_Medical_Check_Pulse_Normal"; + _heartRateOutput = LSTRING(Check_Pulse_Output_4); + _logOutPut = LSTRING(Check_Pulse_Normal); }; }; }; @@ -49,5 +49,5 @@ if (_heartRate > 1.0) then { ["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent); if (_logOutPut != "") then { - [_unit,"activity", localize "STR_ACE_Medical_Check_Pulse_Log",[[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToLog); + [_unit,"activity", 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 92e724a3e0..2d62df12f6 100644 --- a/addons/medical/functions/fnc_actionCheckResponse.sqf +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -20,9 +20,9 @@ _target = _this select 1; _output = ""; if ([_target] call EFUNC(common,isAwake)) then { - _output = "STR_ACE_Medical_Check_Response_Responsive"; + _output = LSTRING(Check_Response_Responsive); } else { - _output = "STR_ACE_Medical_Check_Response_Unresponsive"; + _output = LSTRING(Check_Response_Unresponsive); }; ["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionDiagnose.sqf b/addons/medical/functions/fnc_actionDiagnose.sqf index d0a5aebc9f..243edbdef8 100644 --- a/addons/medical/functions/fnc_actionDiagnose.sqf +++ b/addons/medical/functions/fnc_actionDiagnose.sqf @@ -18,28 +18,28 @@ private ["_caller", "_target", "_genericMessages"]; _caller = _this select 0; _target = _this select 1; -_genericMessages = ["STR_ACE_Medical_diagnoseMessage"]; +_genericMessages = [LSTRING(diagnoseMessage)]; _genericMessages pushBack ([_target] call EFUNC(common,getName)); if (alive _target) then { - _genericMessages pushback "STR_ACE_Medical_diagnoseAlive"; + _genericMessages pushback LSTRING(diagnoseAlive); } else { - _genericMessages pushback "STR_ACE_Medical_diagnoseDead"; + _genericMessages pushback LSTRING(diagnoseDead); }; if (_target getvariable[QGVAR(hasLostBlood), 0] > 0) then { if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { - _genericMessages pushback "STR_ACE_Medical_lostBloodALot"; + _genericMessages pushback LSTRING(lostBloodALot); } else { - _genericMessages pushback "STR_ACE_Medical_lostBlood"; + _genericMessages pushback LSTRING(lostBlood); }; } else { - _genericMessages pushback "STR_ACE_Medical_noBloodloss"; + _genericMessages pushback LSTRING(noBloodloss); }; if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback "STR_ACE_Medical_inPain"; + _genericMessages pushback LSTRING(inPain); } else { - _genericMessages pushback "STR_ACE_Medical_noPain"; + _genericMessages pushback LSTRING(noPain); }; ["displayTextStructured", [_caller], [_genericMessages, 3.0, _caller]] call EFUNC(common,targetEvent); diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf index 872b9a628a..73f9eeca4d 100644 --- a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -1,31 +1,40 @@ /* * Author: Glowbal - * Replace a dead body by a bodybag + * Replace a (dead) body by a body bag * * Arguments: - * 0: The patient - * 1: The new item classname + * 0: The actor + * 1: The patient * * Return Value: - * nil + * body bag * * Public: Yes */ #include "script_component.hpp" -private ["_target","_caller", "_nameOfUnit", "_onPosition", "_bodyBagCreated"]; -_caller = _this select 0; -_target = _this select 1; +PARAMS_2(_caller,_target); + +private ["_position", "_headPos", "_spinePos", "_dirVect", "_direction", "_bodyBag"]; -_nameOfUnit = [_target] call EFUNC(common,getName); if (alive _target) then { [_target, true] call FUNC(setDead); }; -_onPosition = getPos _target; -deleteVehicle _target; -_bodyBagCreated = createVehicle ["ACE_bodyBagObject", _onPosition, [], 0, "NONE"]; -// reset the position to ensure it is on the correct one. -_bodyBagCreated setPos [_onPosition select 0, _onPosition select 1, (_onPosition select 2) + 0.2]; -_bodyBagCreated; +_position = (getPosASL _target) vectorAdd [0, 0, 0.2]; + +_headPos = _target modelToWorldVisual (_target selectionPosition "head"); +_spinePos = _target modelToWorldVisual (_target selectionPosition "Spine3"); +_dirVect = _headPos vectorFromTo _spinePos; +_direction = _dirVect call CBA_fnc_vectDir; + +deleteVehicle _target; + +_bodyBag = createVehicle ["ACE_bodyBagObject", _position, [], 0, "CAN_COLLIDE"]; + +// prevent body bag from flipping +_bodyBag setPosASL _position; +_bodyBag setDir _direction; + +_bodyBag diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf index bb66147f2a..a73f32265a 100644 --- a/addons/medical/functions/fnc_actionUnloadUnit.sqf +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -22,12 +22,6 @@ _drag = if (count _this > 2) then {_this select 2} else {false}; // cannot unload a unit not in a vehicle. if (vehicle _target == _target) exitwith {}; -if (([_target] call cse_fnc_isAwake)) exitwith {}; +if (([_target] call EFUNC(common,isAwake))) exitwith {}; -if ([_target] call EFUNC(common,unloadPerson)) then { - if (_drag) then { - if ((vehicle _caller) == _caller) then { - [[_caller, _target, true], QUOTE(DFUNC(actionDragUnit)), _caller, false] call EFUNC(common,execRemoteFnc); // TODO replace by event - }; - }; -}; +["unloadPersonEvent", _target, [_target, vehicle _target]] call EFUNC(common,targetEvent) \ No newline at end of file diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf index dbe0271e99..f4516a100c 100644 --- a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The unit * 1: value - * 2: time in seconds + * 2: ACE_time in seconds * 3: callback * * Return Value: @@ -25,4 +25,4 @@ _callBack = [_this, 3, {}, [{}]] call BIS_fnc_Param; _adjustment = _unit getvariable [QGVAR(heartRateAdjustments), []]; _adjustment pushback [_value, _time, _callBack]; _unit setvariable [QGVAR(heartRateAdjustments), _adjustment ]; -["Medical_onHeartRateAdjustmentAdded", [_unit, _value, _time]] call ace_common_fnc_localEvent; +["Medical_onHeartRateAdjustmentAdded", [_unit, _value, _time]] call EFUNC(common,localEvent); diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf index c95db059df..083f949d9d 100644 --- a/addons/medical/functions/fnc_addToInjuredCollection.sqf +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -27,8 +27,11 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { _unit setvariable [QGVAR(addedToUnitLoop), true, true]; [{ - private "_unit"; + private ["_unit", "_interval"]; _unit = (_this select 0) select 0; + _interval = ACE_time - ((_this select 0) select 1); + (_this select 0) set [1, ACE_time]; + if (!alive _unit || !local _unit) then { [_this select 1] call CBA_fnc_removePerFrameHandler; if (!local _unit) then { @@ -39,11 +42,11 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { _unit setvariable [QGVAR(bloodVolume), _unit getvariable [QGVAR(bloodVolume), 100], true]; }; } else { - [_unit] call FUNC(handleUnitVitals); + [_unit, _interval] call FUNC(handleUnitVitals); private "_pain"; _pain = _unit getvariable [QGVAR(pain), 0]; - if (_pain > 0) then { + if (_pain > (_unit getvariable [QGVAR(painSuppress), 0])) then { if (_pain > 0.7 && {random(1) > 0.6}) then { [_unit] call FUNC(setUnconscious); }; @@ -51,5 +54,5 @@ if ([_unit] call FUNC(hasMedicalEnabled) || _force) then { [_unit, _pain] call FUNC(playInjuredSound); }; }; - }, 1, [_unit]] call CBA_fnc_addPerFrameHandler; + }, 1, [_unit, ACE_time]] call CBA_fnc_addPerFrameHandler; }; diff --git a/addons/medical/functions/fnc_addToLog.sqf b/addons/medical/functions/fnc_addToLog.sqf index 46bacf2349..af7d9f3170 100644 --- a/addons/medical/functions/fnc_addToLog.sqf +++ b/addons/medical/functions/fnc_addToLog.sqf @@ -47,7 +47,7 @@ if (count _log >= 8) then { _log pushback [_message,_moment,_type, _arguments]; _unit setvariable [_logVarName, _log, true]; -["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call ace_common_fnc_localEvent; +["medical_onLogEntryAdded", [_unit, _type, _message, _arguments]] call EFUNC(common,localEvent); _logs = _unit getvariable [QGVAR(allLogs), []]; if !(_logVarName in _logs) then { diff --git a/addons/medical/functions/fnc_addToTriageCard.sqf b/addons/medical/functions/fnc_addToTriageCard.sqf index 61add24cfc..7495c04a8a 100644 --- a/addons/medical/functions/fnc_addToTriageCard.sqf +++ b/addons/medical/functions/fnc_addToTriageCard.sqf @@ -30,7 +30,7 @@ _amount = 1; private "_info"; _info = _log select _foreachIndex; _info set [1,(_info select 1) + 1]; - _info set [2, time]; + _info set [2, ACE_time]; _log set [_foreachIndex, _info]; _amount = (_info select 1); @@ -39,7 +39,7 @@ _amount = 1; }foreach _log; if (!_inList) then { - _log pushback [_newItem, 1, time]; + _log pushback [_newItem, 1, ACE_time]; }; _unit setvariable [QGVAR(triageCard), _log, true]; -["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call ace_common_fnc_localEvent; +["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call EFUNC(common,localEvent); diff --git a/addons/medical/functions/fnc_canTreat.sqf b/addons/medical/functions/fnc_canTreat.sqf index 062a696fcd..4795ccc561 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"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_condition", "_patientStateCondition"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -44,7 +44,6 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; -_locations = getArray (_config >> "treatmentLocations"); _return = true; if (getText (_config >> "condition") != "") then { @@ -62,6 +61,14 @@ if (getText (_config >> "condition") != "") then { }; if (!_return) exitwith {false}; +_patientStateCondition = if (isText(_config >> "patientStateCondition")) then { + missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] +} else { + getNumber(_config >> "patientStateCondition") +}; +if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; + +_locations = getArray (_config >> "treatmentLocations"); if ("All" in _locations) exitwith {true}; private [ "_medFacility", "_medVeh"]; diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 8682cc24d5..6797785763 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -38,12 +38,18 @@ _litter = getArray (_config >> "litter"); _createLitter = { private["_position", "_litterClass", "_direction"]; - _position = getPos (_this select 0); + + // @TODO: handle carriers over water + // For now, don't spawn litter if we are over water to avoid floating litter + if(surfaceIsWater (getPos (_this select 0))) exitWith { false }; + + _position = getPosATL (_this select 0); + _position = [_position select 0, _position select 1, 0]; _litterClass = _this select 1; if (random(1) >= 0.5) then { - _position = [(_position select 0) + random 2, (_position select 1) + random 2, _position select 2]; + _position = [(_position select 0) + random 1, (_position select 1) + random 1, _position select 2]; } else { - _position = [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; + _position = [(_position select 0) - random 1, (_position select 1) - random 1, _position select 2]; }; _direction = (random 360); diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index c5c5d23a01..cd61550152 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -50,22 +50,22 @@ if (_show) then { _genericMessages = []; if (GVAR(level) >= 2) then { - _partText = ["STR_ACE_Interaction_Head", "STR_ACE_Interaction_Torso", "STR_ACE_Interaction_ArmLeft" ,"STR_ACE_Interaction_ArmRight" ,"STR_ACE_Interaction_LegLeft", "STR_ACE_Interaction_LegRight"] select _selectionN; + _partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN; _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; }; if (_target getvariable[QGVAR(isBleeding), false]) then { - _genericMessages pushback [localize "STR_ACE_Medical_Status_Bleeding", [1, 0.1, 0.1, 1]]; + _genericMessages pushback [localize LSTRING(Status_Bleeding), [1, 0.1, 0.1, 1]]; }; if (_target getvariable[QGVAR(hasLostBlood), 0] > 1) then { - _genericMessages pushback [localize "STR_ACE_Medical_Status_Lost_Blood", [1, 0.1, 0.1, 1]]; + _genericMessages pushback [localize LSTRING(Status_Lost_Blood), [1, 0.1, 0.1, 1]]; }; if (((_target getvariable [QGVAR(tourniquets), [0,0,0,0,0,0]]) select _selectionN) > 0) then { - _genericMessages pushback [localize "STR_ACE_Medical_Status_Tourniquet_Applied", [0.77, 0.51, 0.08, 1]]; + _genericMessages pushback [localize LSTRING(Status_Tourniquet_Applied), [0.77, 0.51, 0.08, 1]]; }; if (_target getvariable[QGVAR(hasPain), false]) then { - _genericMessages pushback [localize "STR_ACE_Medical_Status_Pain", [1, 1, 1, 1]]; + _genericMessages pushback [localize LSTRING(Status_Pain), [1, 1, 1, 1]]; }; _totalIvVolume = 0; @@ -77,7 +77,7 @@ if (_show) then { }; }foreach GVAR(IVBags); if (_totalIvVolume >= 1) then { - _genericMessages pushback [format[localize "STR_ACE_Medical_receivingIvVolume", floor _totalIvVolume], [1, 1, 1, 1]]; + _genericMessages pushback [format[localize LSTRING(receivingIvVolume), floor _totalIvVolume], [1, 1, 1, 1]]; }; _damaged = [false, false, false, false, false, false]; @@ -133,17 +133,17 @@ if (_show) then { if (_target getHitPointDamage _x > 0 && {_forEachIndex == _selectionN}) then { _pointDamage = _target getHitPointDamage _x; _severity = switch (true) do { - case (_pointDamage > 0.5): {localize "STR_ACE_Medical_HeavilyWounded"}; - case (_pointDamage > 0.1): {localize "STR_ACE_Medical_LightlyWounded"}; - default {localize "STR_ACE_Medical_VeryLightlyWounded"}; + case (_pointDamage > 0.5): {localize LSTRING(HeavilyWounded)}; + case (_pointDamage > 0.1): {localize LSTRING(LightlyWounded)}; + default {localize LSTRING(VeryLightlyWounded)}; }; _part = localize ([ - "STR_ACE_Medical_Head", - "STR_ACE_Medical_Torso", - "STR_ACE_Medical_LeftArm", - "STR_ACE_Medical_RightArm", - "STR_ACE_Medical_LeftLeg", - "STR_ACE_Medical_RightLeg" + LSTRING(Head), + LSTRING(Torso), + LSTRING(LeftArm), + LSTRING(RightArm), + LSTRING(LeftLeg), + LSTRING(RightLeg) ] select _forEachIndex); _allInjuryTexts pushBack [format ["%1 %2", _severity, toLower _part], [1,1,1,1]]; }; @@ -186,7 +186,7 @@ if (_show) then { _lbCtrl lbSetColor [_foreachIndex + _amountOfGeneric, _x select 1]; }foreach _allInjuryTexts; if (count _allInjuryTexts == 0) then { - _lbCtrl lbAdd (localize "STR_ACE_Medical_NoInjuriesBodypart"); + _lbCtrl lbAdd (localize LSTRING(NoInjuriesBodypart)); }; _logCtrl = (_display displayCtrl 302); diff --git a/addons/medical/functions/fnc_displayTriageCard.sqf b/addons/medical/functions/fnc_displayTriageCard.sqf index a9054dac46..c4ed4ad829 100644 --- a/addons/medical/functions/fnc_displayTriageCard.sqf +++ b/addons/medical/functions/fnc_displayTriageCard.sqf @@ -58,7 +58,7 @@ if (_show) then { }foreach _log; if (count _triageCardTexts == 0) then { - _lbCtrl lbAdd (localize "STR_ACE_Medical_TriageCard_NoEntry"); + _lbCtrl lbAdd (localize LSTRING(TriageCard_NoEntry)); }; { _lbCtrl lbAdd _x; diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf index a44e8a8e29..34d7be33af 100644 --- a/addons/medical/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -14,7 +14,7 @@ #include "script_component.hpp" /* - Cardiac output (Q or or CO ) is the volume of blood being pumped by the heart, in particular by a left or right ventricle in the time interval of one minute. CO may be measured in many ways, for example dm3/min (1 dm3 equals 1 litre). + Cardiac output (Q or or CO ) is the volume of blood being pumped by the heart, in particular by a left or right ventricle in the ACE_time interval of one minute. CO may be measured in many ways, for example dm3/min (1 dm3 equals 1 litre). Source: http://en.wikipedia.org/wiki/Cardiac_output */ diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf index aaeec2d516..812c20ed2a 100644 --- a/addons/medical/functions/fnc_getTriageStatus.sqf +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -17,10 +17,10 @@ private ["_unit","_return","_status"]; _unit = _this select 0; _status = _unit getvariable [QGVAR(triageLevel), -1]; _return = switch (_status) do { - case 1: {[localize "STR_ACE_Medical_Triage_Status_Minor", 1, [0, 0.5, 0, 0.9]]}; - case 2: {[localize "STR_ACE_Medical_Triage_Status_Delayed", 2, [0.7, 0.5, 0, 0.9]]}; - case 3: {[localize "STR_ACE_Medical_Triage_Status_Immediate", 3, [0.4, 0.07, 0.07, 0.9]]}; - case 4: {[localize "STR_ACE_Medical_Triage_Status_Deceased", 4, [0, 0, 0, 0.9]]}; - default {[localize "STR_ACE_Medical_Triage_Status_None", 0, [0, 0, 0, 0.9]]}; + case 1: {[localize LSTRING(Triage_Status_Minor), 1, [0, 0.5, 0, 0.9]]}; + case 2: {[localize LSTRING(Triage_Status_Delayed), 2, [0.7, 0.5, 0, 0.9]]}; + case 3: {[localize LSTRING(Triage_Status_Immediate), 3, [0.4, 0.07, 0.07, 0.9]]}; + case 4: {[localize LSTRING(Triage_Status_Deceased), 4, [0, 0, 0, 0.9]]}; + default {[localize LSTRING(Triage_Status_None), 0, [0, 0, 0, 0.9]]}; }; _return; diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 4dd517679a..d51131ce0c 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -13,22 +13,23 @@ #include "script_component.hpp" -private ["_typeOfProjectile","_typeOfInjury"]; -_typeOfProjectile = _this select 0; -_typeOfInjury = switch (true) do { - case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"}; - case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"}; - case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "MineCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "FuelExplosion"): {"Explosive"}; - case (_typeOfProjectile iskindof "ShellBase"): {"Shell"}; - case (_typeOfProjectile iskindof "RocketBase"): {"Explosive"}; - case (_typeOfProjectile iskindof "MissileBase"): {"Explosive"}; - case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "BombCore"): {"Explosive"}; - case (_typeOfProjectile iskindof "Grenade"): {"Grenade"}; - case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"}; - default {_typeOfProjectile}; +PARAMS_1(_typeOfProjectile); + +private ["_typeOfDamage"]; + +_typeOfDamage = switch (true) do { + case (_typeOfProjectile isKindOf "BulletBase"): {"bullet"}; + case (_typeOfProjectile isKindOf "GrenadeCore"): {"grenade"}; + case (_typeOfProjectile isKindOf "TimeBombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "MineCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "FuelExplosion"): {"explosive"}; + case (_typeOfProjectile isKindOf "ShellBase"): {"shell"}; + case (_typeOfProjectile isKindOf "RocketBase"): {"explosive"}; + case (_typeOfProjectile isKindOf "MissileBase"): {"explosive"}; + case (_typeOfProjectile isKindOf "LaserBombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "BombCore"): {"explosive"}; + case (_typeOfProjectile isKindOf "Grenade"): {"grenade"}; + default {toLower _typeOfProjectile}; }; -// TODO replace the capitalization on the switch results instead.. -toLower _typeOfInjury; + +_typeOfDamage diff --git a/addons/medical/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf index 83955f7bd1..19d3bdec1d 100644 --- a/addons/medical/functions/fnc_getUnconsciousCondition.sqf +++ b/addons/medical/functions/fnc_getUnconsciousCondition.sqf @@ -16,7 +16,6 @@ private ["_unit","_return"]; _unit = _this select 0; -if (GVAR(level) == 1) exitwith {true}; if (isnil QGVAR(unconsciousConditions)) then { GVAR(unconsciousConditions) = []; }; diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf index a92bf9029c..a86077cb3b 100644 --- a/addons/medical/functions/fnc_handleBandageOpening.sqf +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -58,10 +58,10 @@ if (isClass (_config >> _className)) then { _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; -_injuryId = _injury select 0; +_injuryType = _injury select 1; _bandagedInjury = []; { - if ((_x select 0) == _injuryId) exitwith { + if ((_x select 1) == _injuryType && (_x select 2) == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, (_existingInjury select 3) + _impact]; @@ -73,16 +73,11 @@ _bandagedInjury = []; if !(_exist) then { // [ID, classID, bodypart, percentage treated, bloodloss rate] - _bandagedInjury = [_injuryId, _injury select 1, _injury select 2, _impact, _injury select 4]; + _bandagedInjury = [_injury select 0, _injury select 1, _injury select 2, _impact, _injury select 4]; _bandagedWounds pushback _bandagedInjury; }; -_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC]; - -if (USE_WOUND_EVENT_SYNC) then { - // sync _bandagedInjury - -}; +_target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; // Check if we are ever going to reopen this if (random(1) <= _reopeningChance) then { @@ -95,22 +90,19 @@ if (random(1) <= _reopeningChance) then { _injuryIndex = _this select 3; _injury = _this select 4; - if (alive _target) then { + //if (alive _target) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; if ((count _openWounds)-1 < _injuryIndex) exitwith {}; _selectedInjury = _openWounds select _injuryIndex; - if (_selectedInjury select 0 == _injury select 0) then { // matching the IDs + if (_selectedInjury select 1 == _injury select 1 && (_selectedInjury select 2) == (_injury select 2)) then { // matching the IDs _selectedInjury set [3, (_selectedInjury select 3) + _impact]; _openWounds set [_injuryIndex, _selectedInjury]; - _target setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; - if (USE_WOUND_EVENT_SYNC) then { - ["medical_propagateWound", [_target, _selectedInjury]] call EFUNC(common,globalEvent); - }; + _bandagedWounds = _target getvariable [QGVAR(bandagedWounds), []]; _exist = false; - _injuryId = _injury select 0; + _injuryId = _injury select 1; { - if ((_x select 0) == _injuryId) exitwith { + if ((_x select 1) == _injuryId && (_x select 2) == (_injury select 2)) exitwith { _exist = true; _existingInjury = _x; _existingInjury set [3, ((_existingInjury select 3) - _impact) max 0]; @@ -119,10 +111,11 @@ if (random(1) <= _reopeningChance) then { }foreach _bandagedWounds; if (_exist) then { - _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, !USE_WOUND_EVENT_SYNC]; + _target setvariable [QGVAR(bandagedWounds), _bandagedWounds, true]; + _target setvariable [QGVAR(openWounds), _openWounds, true]; }; }; // Otherwise something went wrong, we we don't reopen them.. - }; - }, [_target, _impact, _part, _injuryIndex, _injury], _delay, 0] call EFUNC(common,waitAndExecute); + //}; + }, [_target, _impact, _part, _injuryIndex, +_injury], _delay, 0] call EFUNC(common,waitAndExecute); }; diff --git a/addons/medical/functions/fnc_handleCreateLitter.sqf b/addons/medical/functions/fnc_handleCreateLitter.sqf index 617d05e519..f13fbc8c05 100644 --- a/addons/medical/functions/fnc_handleCreateLitter.sqf +++ b/addons/medical/functions/fnc_handleCreateLitter.sqf @@ -14,7 +14,10 @@ if (isNil QGVAR(allCreatedLitter)) then { _litterObject = _litterClass createVehicleLocal _position; _litterObject setDir _direction; - +_litterObject setPosATL _position; +// Move the litter next frame to get rid of HORRIBLE spacing, fixes #1112 +[{ (_this select 0) setPosATL (_this select 1); }, [_litterObject, _position]] call EFUNC(common,execNextFrame); + _maxLitterCount = getArray (configFile >> "ACE_Settings" >> QGVAR(litterSimulationDetail) >> "_values") select GVAR(litterSimulationDetail); if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { // gank the first litter object, and spawn ours. @@ -25,12 +28,12 @@ if((count GVAR(allCreatedLitter)) > _maxLitterCount ) then { } forEach (_oldLitter select 1); }; -GVAR(allCreatedLitter) pushBack [time, [_litterObject]]; +GVAR(allCreatedLitter) pushBack [ACE_time, [_litterObject]]; if(!GVAR(litterPFHRunning) && {GVAR(litterCleanUpDelay) > 0}) then { [{ { - if (time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { + if (ACE_time - (_x select 0) >= GVAR(litterCleanUpDelay)) then { { deleteVehicle _x; } forEach (_x select 1); diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf index 1d8c821d1f..aad69ee2fa 100644 --- a/addons/medical/functions/fnc_handleDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -41,22 +41,6 @@ if (_selection in GVAR(SELECTIONS)) then { }; if !(_unit getVariable [QGVAR(allowDamage), true]) exitWith {_damageOld}; -// Figure out whether to prevent death before handling damage -if (diag_frameno > (_unit getVariable [QGVAR(frameNo), -3]) + 2) then { - _unit setVariable [QGVAR(frameNo), diag_frameno]; - _unit setVariable [QGVAR(wasUnconscious), _unit getVariable ["ACE_isUnconscious", false]]; - - _preventDeath = _unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]; - if (_unit getVariable ["ACE_isUnconscious", false]) then { - _preventDeath = _unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]; - if !([_unit] call EFUNC(common,isPlayer)) then { - _preventDeath = _preventDeath - 1; - }; - _preventDeath = _preventDeath > 0; - }; - _unit setVariable [QGVAR(preventDeath), _preventDeath]; -}; - // Get return damage _damageReturn = _damage; if (GVAR(level) < 2) then { @@ -64,10 +48,12 @@ if (GVAR(level) < 2) then { } else { if !([_unit] call FUNC(hasMedicalEnabled)) exitwith { // Because of the config changes, we cannot properly disable the medical system for a unit. - // lets use basic for the time being.. + // lets use basic for the ACE_time being.. _damageReturn = _this call FUNC(handleDamage_basic); }; _newDamage = _this call FUNC(handleDamage_caching); + // handleDamage_caching may have modified the projectile string + _projectile = _this select 4; _typeOfDamage = [_projectile] call FUNC(getTypeOfDamage); _typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage); @@ -82,7 +68,7 @@ if (GVAR(level) < 2) then { }; }; - if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} || !alive vehicle _unit) then { + if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then { if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith { _damageReturn = 0.9; }; @@ -94,33 +80,47 @@ if (GVAR(level) < 2) then { } else { _damageReturn = _damageReturn min 0.89; }; + }; [_unit] call FUNC(addToInjuredCollection); -// Prevent death if necessary -if (_unit getVariable QGVAR(preventDeath)) then { - if (_selection in ["", "head", "body"]) then { - _damageReturn = _damageReturn min 0.89; - }; - - // Move the unit out of the vehicle if necessary - if (vehicle _unit != _unit and damage (vehicle _unit) == 1) then { +if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith { + if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then { [_unit] call EFUNC(common,unloadPerson); - if (_unit getVariable QGVAR(wasUnconscious)) then { - [_unit] call FUNC(setDead); - } else { - [_unit, true] call FUNC(setUnconscious); - }; }; - // Temporarily disable all damage to prevent stuff like - // being killed during the animation etc. - if (!_wasUnconscious and (_unit getVariable ["ACE_isUnconscious", false])) then { - _unit setVariable [QGVAR(allowDamage), false]; - [{ - _this setVariable [QGVAR(allowDamage), true]; - }, _unit, 0.7, 0] call EFUNC(common,waitAndExecute); + private "_delayedUnconsicous"; + _delayedUnconsicous = false; + if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then { + [_unit] call EFUNC(common,unloadPerson); + _delayedUnconsicous = true; }; + + if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith { + if (_unit getvariable ["ACE_isUnconscious", false]) exitwith { + [_unit] call FUNC(setDead); + 0.89; + }; + if (_delayedUnconsicous) then { + [{ + [_this select 0, true] call FUNC(setUnconscious); + }, [_unit], 0.7, 0] call EFUNC(common,waitAndExec); + } else { + [{ + [_this select 0, true] call FUNC(setUnconscious); + }, [_unit]] call EFUNC(common,execNextFrame); + }; + 0.89; + }; + 0.89; }; -_damageReturn +if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith { + if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then { + [_unit] call EFUNC(common,unloadPerson); + }; + [_unit] call FUNC(setDead); + 0.89; +}; + +_damageReturn; diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index 8bd0267d3f..e617738a90 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -12,7 +12,7 @@ * 6: Type of Damage * * Return Value: - * Damage To Be Inflicted + * Nothing * * Public: No */ @@ -28,10 +28,7 @@ _typeOfProjectile = _this select 4; _newDamage = _this select 5; // Most likely taking exessive fire damage. Lets exit. -if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith { - 0 -}; -_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); +if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {}; _part = [_selectionName] call FUNC(selectionNameToNumber); if (_part < 0) exitwith {}; @@ -42,9 +39,8 @@ _damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; _damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage]; _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true]; -[_unit] call FUNC(handleDamage_advancedSetDamage); - -[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds); +_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); +[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_assignWounds); // TODO Disabled until implemented fully //if (GVAR(enableAirway)) then { @@ -63,5 +59,3 @@ if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then { [_unit] call FUNC(setUnconscious); }; }; - -_amountOfDamage; diff --git a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf index f464ef5a94..3df8a5ce0c 100644 --- a/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf +++ b/addons/medical/functions/fnc_handleDamage_advancedSetDamage.sqf @@ -13,42 +13,22 @@ #include "script_component.hpp" -private ["_unit", "_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; -_unit = _this select 0; +PARAMS_1(_unit); if (!local _unit) exitwith {}; -_bodyStatus = _unit getvariable [QGVAR(bodyPartStatus),[0,0,0,0,0,0]]; +private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; + // ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] -_headDamage = _bodyStatus select 0; -if (_headDamage > 0.95) then { - _unit setHitPointDamage ["hitHead", 0.95]; -} else { - _unit setHitPointDamage ["hitHead", _headDamage]; -}; +_bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]; -_torsoDamage = _bodyStatus select 1; -if (_torsoDamage > 0.95) then { - _unit setHitPointDamage ["hitBody", 0.95]; -} else { - _unit setHitPointDamage ["hitBody", _torsoDamage]; -}; +EXPLODE_6_PVT(_bodyStatus,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL); +_unit setHitPointDamage ["hitHead", _headDamage min 0.95]; +_unit setHitPointDamage ["hitBody", _torsoDamage min 0.95]; +_unit setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95]; +_unit setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95]; -_handsDamage = (_bodyStatus select 2) + (_bodyStatus select 3); -if (_handsDamage > 0.95) then { - _unit setHitPointDamage ["hitHands", 0.95]; -} else { - _unit setHitPointDamage ["hitHands", _handsDamage]; -}; - -_legsDamage = (_bodyStatus select 4) + (_bodyStatus select 5); -if (_legsDamage > 0.95) then { - _unit setHitPointDamage ["hitLegs", 0.95]; -} else { - _unit setHitPointDamage ["hitLegs", _legsDamage]; -}; - -if ({_x > 0} count _bodyStatus == 0) then { +if (_bodyStatus isEqualTo [0,0,0,0,0,0]) then { _unit setDamage 0; }; diff --git a/addons/medical/functions/fnc_handleDamage_basic.sqf b/addons/medical/functions/fnc_handleDamage_basic.sqf index 7b308ad188..04049cfa7c 100644 --- a/addons/medical/functions/fnc_handleDamage_basic.sqf +++ b/addons/medical/functions/fnc_handleDamage_basic.sqf @@ -48,20 +48,28 @@ if (diag_frameno > (_unit getVariable [QGVAR(basic_frameNo), -3]) + 2) then { _unit setVariable [QGVAR(hitPoints), []]; _unit setVariable [QGVAR(damages), []]; _unit setVariable [QGVAR(structDamage), 0]; + + if (isnil {_unit getvariable QGVAR(structDamagePFH)}) then { // Assign orphan structural damage to torso - [{ - private ["_unit", "_damagesum"]; - _unit = _this select 0; - _damagesum = (_unit getHitPointDamage "HitHead") + - (_unit getHitPointDamage "HitBody") + - (_unit getHitPointDamage "HitLeftArm") + - (_unit getHitPointDamage "HitRightArm") + - (_unit getHitPointDamage "HitLeftLeg") + - (_unit getHitPointDamage "HitRightLeg"); - if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { - _unit setHitPointDamage ["HitBody", damage _unit]; - }; - }, [_unit], 2, 0.1] call EFUNC(common,waitAndExecute); + [{ + private ["_unit", "_damagesum"]; + _unit = (_this select 0) select 0; + if (ACE_diagTime - (_unit getvariable [QGVAR(structDamagePFH),-2]) >= 2) then { + _unit setVariable [QGVAR(structDamagePFH), nil]; + _damagesum = (_unit getHitPointDamage "HitHead") + + (_unit getHitPointDamage "HitBody") + + (_unit getHitPointDamage "HitLeftArm") + + (_unit getHitPointDamage "HitRightArm") + + (_unit getHitPointDamage "HitLeftLeg") + + (_unit getHitPointDamage "HitRightLeg"); + if (_damagesum < 0.06 and damage _unit > 0.06 and alive _unit) then { + _unit setHitPointDamage ["HitBody", damage _unit]; + }; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + }, 0, [_unit]] call CBA_fnc_addPerFrameHandler; + }; + _unit setVariable [QGVAR(structDamagePFH), ACE_diagTime]; // Assign starting ACE_time or reset it }; _newDamage = _damage - (damage _unit); diff --git a/addons/medical/functions/fnc_handleDamage_caching.sqf b/addons/medical/functions/fnc_handleDamage_caching.sqf index 95d750843d..99816ee274 100644 --- a/addons/medical/functions/fnc_handleDamage_caching.sqf +++ b/addons/medical/functions/fnc_handleDamage_caching.sqf @@ -18,7 +18,7 @@ #include "script_component.hpp" -private ["_unit", "_selectionName","_damage", "_source","_projectile","_hitSelections","_hitPoints","_newDamage","_cache_hitpoints","_cache_projectiles","_cache_params","_cache_damages"]; +private ["_unit", "_selectionName", "_damage", "_source", "_projectile", "_hitSelections", "_hitPoints", "_impactVelocity", "_newDamage", "_cache_hitpoints", "_cache_projectiles", "_cache_params", "_cache_damages"]; _unit = _this select 0; _selectionName = _this select 1; _damage = _this select 2; @@ -41,18 +41,33 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN if (GVAR(enableVehicleCrashes)) then { _selectionName = _hitSelections select (floor(random(count _hitSelections))); _projectile = "vehiclecrash"; + _this set [1, _selectionName]; + _this set [4, _projectile]; }; }; -// From AGM medical: -// Exclude falling damage to everything other than legs; reduce structural damage. -if (((velocity _unit) select 2 < -5) && {(vehicle _unit == _unit)}) then { - _unit setVariable [QGVAR(isFalling), True]; +// Handle falling damage +_impactVelocity = (velocity _unit) select 2; +if (_impactVelocity < -5 && {vehicle _unit == _unit}) then { + _unit setVariable [QGVAR(isFalling), true]; + _unit setVariable [QGVAR(impactVelocity), _impactVelocity]; }; - -if (_unit getVariable [QGVAR(isFalling), false] && {!(_selectionName in ["", "leg_l", "leg_r"])}) exitWith {}; if (_unit getVariable [QGVAR(isFalling), false]) then { - _newDamage = _newDamage * 0.7; + if !(_selectionName in ["", "leg_l", "leg_r"]) then { + if (_selectionName == "body") then { + _newDamage = _newDamage * abs(_unit getVariable [QGVAR(impactVelocity), _impactVelocity]) / 50; + } else { + _newDamage = _newDamage * 0.5; + }; + } else { + if (_selectionName == "") then { + _selectionName = ["leg_l", "leg_r"] select (floor(random 2)); + _this set [1, _selectionName]; + }; + _newDamage = _newDamage * 0.7; + }; + _projectile = "falling"; + _this set [4, "falling"]; }; // Finished with the current frame, reset variables @@ -66,12 +81,17 @@ if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) t _args = _this select 0; if (diag_frameno > (_args select 1) + 2) then { + (_args select 0) setDamage 0; + _cache_params = (_args select 0) getVariable [QGVAR(cachedHandleDamageParams), []]; _cache_damages = (_args select 0) getVariable QGVAR(cachedDamages); { _params = _x + [_cache_damages select _foreachIndex]; _params call FUNC(handleDamage_advanced); }foreach _cache_params; + + [(_args select 0)] call FUNC(handleDamage_advancedSetDamage); + [(_this select 1)] call cba_fnc_removePerFrameHandler; }; }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; @@ -88,7 +108,7 @@ if (_selectionName != "") then { private ["_index","_otherDamage"]; _index = _cache_projectiles find _projectile; // Check if the current projectile has already been handled once - if (_index >= 0) exitwith { + if (_index >= 0 && {_projectile != "falling"}) exitwith { _cache_damages = _unit getVariable QGVAR(cachedDamages); // Find the previous damage this projectile has done _otherDamage = (_cache_damages select _index); diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 9172304dd2..70eeb74f9d 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -24,120 +24,43 @@ _damage = _this select 2; _typeOfProjectile = _this select 3; _typeOfDamage = _this select 4; -// Convert the selectionName to a number and ensure it is a valid selection. -_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); -if (_bodyPartn < 0) exitwith {}; - -// Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes] -_injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; - -// This are the available injuries for this damage type. Format [[classtype, selections, bloodloss, minimalDamage, pain], ..] -_allInjuriesForDamageType = _injuryTypeInfo select 2; -// It appears we are dealing with an unknown type of damage. - -if (count _allInjuriesForDamageType == 0) then { - // grabbing the configuration for unknown damage type - _injuryTypeInfo = missionNamespace getvariable [QGVAR(woundInjuryType_unknown),[[], false, []]]; - _allInjuriesForDamageType = _injuryTypeInfo select 2; -}; - -// find the available injuries for this damage type and damage amount -_highestPossibleSpot = -1; -_highestPossibleDamage = -1; -_allPossibleInjuries = []; -{ - _damageLevels = _x select 4; - _minDamage = _damageLevels select 0; - _maxDamage = _damageLevels select 1; - - // Check if the damage is higher as the min damage for the specific injury - if (_damage >= _minDamage && {_damage <= _maxDamage || _maxDamage < 0}) then { - //_classType = _x select 0; - _selections = _x select 1; - //_bloodLoss = _x select 2; - //_pain = _x select 3; - - // Check if the injury can be applied to the given selection name - if ("All" in _selections || _selectionName in _selections) then { - - // Find the wound which has the highest minimal damage, so we can use this later on for adding the correct injuries - if (_minDamage > _highestPossibleDamage) then { - _highestPossibleSpot = _foreachIndex; - _highestPossibleDamage = _minDamage; - }; - - // Store the valid possible injury for the damage type, damage amount and selection - _allPossibleInjuries pushback _x; - }; - }; -}foreach _allInjuriesForDamageType; - -// No possible wounds available for this damage type or damage amount. -if (_highestPossibleSpot < 0) exitwith {}; - // Administration for open wounds and ids _openWounds = _unit getvariable[QGVAR(openWounds), []]; _woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; +_extensionOutput = "ace_medical" callExtension format ["HandleDamageWounds,%1,%2,%3,%4", _selectionName, _damage, _typeOfDamage, _woundID]; + _painToAdd = 0; _woundsCreated = []; + +call compile _extensionOutput; +_foundIndex = -1; { - if (_x select 0 <= _damage) exitwith { - for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do { - - // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage] - _toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));}; - _toAddClassID = _toAddInjury select 0; - _foundIndex = -1; - - _bodyPartNToAdd = if (_injuryTypeInfo select 1) then {_bodyPartn} else {floor(random(6))}; - // If the injury type is selection part specific, we will check if one of those injury types already exists and find the spot for it.. - if ((_injuryTypeInfo select 1)) then { - { - // Check if we have an id of the given class on the given bodypart already - if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { - _foundIndex = _foreachIndex; - }; - }foreach _openWounds; - }; - - _injury = []; - if (_foundIndex < 0) then { - // Create a new injury. Format [ID, classID, bodypart, percentage treated, bloodloss rate] - _injury = [_woundID, _toAddInjury select 0, _bodyPartNToAdd, 1, _toAddInjury select 2]; - - // Since it is a new injury, we will have to add it to the open wounds array to store it - _openWounds pushback _injury; - - // New injuries will also increase the wound ID - _woundID = _woundID + 1; - } else { - // We already have one of these, so we are just going to increase the number that we have of it with a new one. - _injury = _openWounds select _foundIndex; - _injury set [3, (_injury select 3) + 1]; - }; - // Store the injury so we can process it later correctly. - _woundsCreated pushback _injury; - - // Collect the pain that is caused by this injury - _painToAdd = _painToAdd + (_toAddInjury select 3); + _toAddClassID = _x select 1; + _bodyPartNToAdd = _x select 2; + { + // Check if we have an id of the given class on the given bodypart already + if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { + _foundIndex = _foreachIndex; }; - }; -}foreach (_injuryTypeInfo select 0); // foreach damage thresholds + }foreach _openWounds; -_unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; + if (_foundIndex < 0) then { + // Since it is a new injury, we will have to add it to the open wounds array to store it + _openWounds pushback _x; + } else { + // We already have one of these, so we are just going to increase the number that we have of it with a new one. + _injury = _openWounds select _foundIndex; + _injury set [3, (_injury select 3) + 1]; + }; +}foreach _woundsCreated; + +_unit setvariable [QGVAR(openWounds), _openWounds, true]; // Only update if new wounds have been created if (count _woundsCreated > 0) then { _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; }; -if (USE_WOUND_EVENT_SYNC) then { - // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. - { - ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); - }foreach _woundsCreated; -}; - _painLevel = _unit getvariable [QGVAR(pain), 0]; _unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; diff --git a/addons/medical/functions/fnc_handleDamage_woundsOld.sqf b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf new file mode 100644 index 0000000000..1034ba9cae --- /dev/null +++ b/addons/medical/functions/fnc_handleDamage_woundsOld.sqf @@ -0,0 +1,143 @@ +/* + * Author: Glowbal + * Handling of the open wounds & injuries upon the handleDamage eventhandler. + * + * Arguments: + * 0: Unit That Was Hit + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter or source of the damage + * 4: Type of the damage done + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_unit", "_selectionName", "_damage", "_typeOfProjectile", "_typeOfDamage", "_bodyPartn", "_injuryTypeInfo", "_allInjuriesForDamageType", "_allPossibleInjuries", "_highestPossibleDamage", "_highestPossibleSpot", "_minDamage", "_openWounds", "_woundID", "_toAddInjury", "_painToAdd", "_bloodLoss", "_bodyPartNToAdd", "_classType", "_damageLevels", "_foundIndex", "_i", "_injury", "_maxDamage", "_pain", "_painLevel", "_selections", "_toAddClassID", "_woundsCreated"]; +_unit = _this select 0; +_selectionName = _this select 1; +_damage = _this select 2; +_typeOfProjectile = _this select 3; +_typeOfDamage = _this select 4; + +// Convert the selectionName to a number and ensure it is a valid selection. +_bodyPartn = [_selectionName] call FUNC(selectionNameToNumber); +if (_bodyPartn < 0) exitwith {}; + +// Get the injury type information. Format: [typeDamage thresholds, selectionSpecific, woundTypes] +_injuryTypeInfo = missionNamespace getvariable [format[QGVAR(woundInjuryType_%1), _typeOfDamage],[[], false, []]]; + +// This are the available injuries for this damage type. Format [[classtype, selections, bloodloss, minimalDamage, pain], ..] +_allInjuriesForDamageType = _injuryTypeInfo select 2; +// It appears we are dealing with an unknown type of damage. + +if (count _allInjuriesForDamageType == 0) then { + // grabbing the configuration for unknown damage type + _injuryTypeInfo = missionNamespace getvariable [QGVAR(woundInjuryType_unknown),[[], false, []]]; + _allInjuriesForDamageType = _injuryTypeInfo select 2; +}; + +// find the available injuries for this damage type and damage amount +_highestPossibleSpot = -1; +_highestPossibleDamage = -1; +_allPossibleInjuries = []; +{ + _damageLevels = _x select 4; + _minDamage = _damageLevels select 0; + _maxDamage = _damageLevels select 1; + + // Check if the damage is higher as the min damage for the specific injury + if (_damage >= _minDamage && {_damage <= _maxDamage || _maxDamage < 0}) then { + //_classType = _x select 0; + _selections = _x select 1; + //_bloodLoss = _x select 2; + //_pain = _x select 3; + + // Check if the injury can be applied to the given selection name + if ("All" in _selections || _selectionName in _selections) then { + + // Find the wound which has the highest minimal damage, so we can use this later on for adding the correct injuries + if (_minDamage > _highestPossibleDamage) then { + _highestPossibleSpot = _foreachIndex; + _highestPossibleDamage = _minDamage; + }; + + // Store the valid possible injury for the damage type, damage amount and selection + _allPossibleInjuries pushback _x; + }; + }; +}foreach _allInjuriesForDamageType; + +// No possible wounds available for this damage type or damage amount. +if (_highestPossibleSpot < 0) exitwith {}; + +// Administration for open wounds and ids +_openWounds = _unit getvariable[QGVAR(openWounds), []]; +_woundID = _unit getvariable[QGVAR(lastUniqueWoundID), 1]; + +_painToAdd = 0; +_woundsCreated = []; +{ + if (_x select 0 <= _damage) exitwith { + for "_i" from 0 to (1+ floor(random(_x select 1)-1)) /* step +1 */ do { + + // Find the injury we are going to add. Format [ classID, allowdSelections, bloodloss, painOfInjury, minimalDamage] + _toAddInjury = if (random(1) >= 0.85) then {_allInjuriesForDamageType select _highestPossibleSpot} else {_allPossibleInjuries select (floor(random (count _allPossibleInjuries)));}; + _toAddClassID = _toAddInjury select 0; + _foundIndex = -1; + + _bodyPartNToAdd = if (_injuryTypeInfo select 1) then {_bodyPartn} else {floor(random(6))}; + // If the injury type is selection part specific, we will check if one of those injury types already exists and find the spot for it.. + if ((_injuryTypeInfo select 1)) then { + { + // Check if we have an id of the given class on the given bodypart already + if (_x select 1 == _toAddClassID && {_x select 2 == _bodyPartNToAdd}) exitwith { + _foundIndex = _foreachIndex; + }; + }foreach _openWounds; + }; + + _injury = []; + if (_foundIndex < 0) then { + // Create a new injury. Format [ID, classID, bodypart, percentage treated, bloodloss rate] + _injury = [_woundID, _toAddInjury select 0, _bodyPartNToAdd, 1, _toAddInjury select 2]; + + // Since it is a new injury, we will have to add it to the open wounds array to store it + _openWounds pushback _injury; + + // New injuries will also increase the wound ID + _woundID = _woundID + 1; + } else { + // We already have one of these, so we are just going to increase the number that we have of it with a new one. + _injury = _openWounds select _foundIndex; + _injury set [3, (_injury select 3) + 1]; + }; + // Store the injury so we can process it later correctly. + _woundsCreated pushback _injury; + + // Collect the pain that is caused by this injury + _painToAdd = _painToAdd + (_toAddInjury select 3); + }; + }; +}foreach (_injuryTypeInfo select 0); // foreach damage thresholds + +_unit setvariable [QGVAR(openWounds), _openWounds, !USE_WOUND_EVENT_SYNC]; + +// Only update if new wounds have been created +if (count _woundsCreated > 0) then { +// _unit setvariable [QGVAR(lastUniqueWoundID), _woundID, true]; +}; + +if (USE_WOUND_EVENT_SYNC) then { + // Broadcast the new injuries across the net in parts. One broadcast per injury. Prevents having to broadcast one massive array of injuries. + { + // ["medical_propagateWound", [_unit, _x]] call EFUNC(common,globalEvent); + }foreach _woundsCreated; +}; + +_painLevel = _unit getvariable [QGVAR(pain), 0]; +_unit setvariable [QGVAR(pain), _painLevel + _painToAdd]; diff --git a/addons/medical/functions/fnc_handleLocal.sqf b/addons/medical/functions/fnc_handleLocal.sqf index 216fb8ed49..c0f9c15292 100644 --- a/addons/medical/functions/fnc_handleLocal.sqf +++ b/addons/medical/functions/fnc_handleLocal.sqf @@ -26,7 +26,7 @@ if (_local) then { if ((_unit getvariable ["ACE_isUnconscious",false]) && {count (_unit getvariable [QGVAR(unconsciousArguments), []]) >= 6}) then { private "_arguments"; _arguments = (_unit getvariable [QGVAR(unconsciousArguments), []]); - _arguments set [2, time]; + _arguments set [2, ACE_time]; [DFUNC(unconsciousPFH), 0.1, _arguments ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index ebfb8be746..c96c1b05f8 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -15,16 +15,14 @@ private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus", "_lastTimeValuesSynced", "_syncValues", "_airwayStatus", "_blood", "_bloodPressureH", "_bloodPressureL", "_interval"]; _unit = _this select 0; - -_interval = time - (_unit getVariable [QGVAR(lastMomentVitalsHandled), 0]); -_unit setVariable [QGVAR(lastMomentVitalsHandled), time]; +_interval = _this select 1; if (_interval == 0) exitWith {}; _lastTimeValuesSynced = _unit getvariable [QGVAR(lastMomentValuesSynced), 0]; -_syncValues = (time - _lastTimeValuesSynced >= (10 + floor(random(10))) && GVAR(keepLocalSettingsSynced)); +_syncValues = (ACE_time - _lastTimeValuesSynced >= (10 + floor(random(10))) && GVAR(keepLocalSettingsSynced)); if (_syncValues) then { - _unit setvariable [QGVAR(lastMomentValuesSynced), time]; + _unit setvariable [QGVAR(lastMomentValuesSynced), ACE_time]; }; _bloodVolume = (_unit getvariable [QGVAR(bloodVolume), 100]) + ([_unit] call FUNC(getBloodVolumeChange)); @@ -60,7 +58,7 @@ if (([_unit] call FUNC(getBloodLoss)) > 0) then { }; _painStatus = _unit getvariable [QGVAR(pain), 0]; -if (_painStatus > 0) then { +if (_painStatus > (_unit getvariable [QGVAR(painSuppress), 0])) then { if !(_unit getvariable [QGVAR(hasPain), false]) then { _unit setvariable [QGVAR(hasPain), true, true]; }; diff --git a/addons/medical/functions/fnc_hasMedicalEnabled.sqf b/addons/medical/functions/fnc_hasMedicalEnabled.sqf index ee433c1715..63fddd16b4 100644 --- a/addons/medical/functions/fnc_hasMedicalEnabled.sqf +++ b/addons/medical/functions/fnc_hasMedicalEnabled.sqf @@ -15,7 +15,7 @@ _unit = _this select 0; _medicalEnabled = _unit getvariable QGVAR(enableMedical); if (isnil "_medicalEnabled") exitwith { - (((GVAR(enabledFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enabledFor) == 1)); + (((GVAR(enableFor) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(enableFor) == 1) || GVAR(level) == 1); }; _medicalEnabled; diff --git a/addons/medical/functions/fnc_init.sqf b/addons/medical/functions/fnc_init.sqf index 0ec6ce3ce2..27d80163a5 100644 --- a/addons/medical/functions/fnc_init.sqf +++ b/addons/medical/functions/fnc_init.sqf @@ -64,6 +64,7 @@ _unit setvariable [QGVAR(hasLostBlood), 0, true]; _unit setvariable [QGVAR(isBleeding), false, true]; _unit setvariable [QGVAR(hasPain), false, true]; _unit setvariable [QGVAR(amountOfReviveLives), GVAR(amountOfReviveLives), true]; +_unit setvariable [QGVAR(painSuppress), 0, true]; // medication _allUsedMedication = _unit getVariable [QGVAR(allUsedMedication), []]; diff --git a/addons/medical/functions/fnc_isInMedicalVehicle.sqf b/addons/medical/functions/fnc_isInMedicalVehicle.sqf index cffc24410d..d376ce3824 100644 --- a/addons/medical/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isInMedicalVehicle.sqf @@ -21,4 +21,4 @@ _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {false}; if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false}; -_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] +(_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0 diff --git a/addons/medical/functions/fnc_isInStableCondition.sqf b/addons/medical/functions/fnc_isInStableCondition.sqf new file mode 100644 index 0000000000..f7c22ed085 --- /dev/null +++ b/addons/medical/functions/fnc_isInStableCondition.sqf @@ -0,0 +1,30 @@ +/* +* Author: Glowbal +* Check if a unit is in a stable condition +* +* Arguments: +* 0: The patient +* +* Return Value: +* Is in stable condition +* +* Public: No +*/ + +#include "script_component.hpp" + +private ["_unit"]; +_unit = _this select 0; + +if (GVAR(level) <= 1) exitwith { + ([_unit] call FUNC(getBloodloss)) == 0; +}; + +_totalBloodLoss = 0; +_openWounds = _unit getvariable [QGVAR(openWounds), []]; +{ + // total bleeding ratio * percentage of injury left + _totalBloodLoss = _totalBloodLoss + ((_x select 4) * (_x select 3)); +}foreach _openWounds; + +(_totalBloodLoss == 0); diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index 7be406e556..5e9283852f 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -15,4 +15,4 @@ private ["_vehicle"]; _vehicle = _this select 0; -_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] +(_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0 diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 179ae9eb83..268ba8e253 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -34,7 +34,7 @@ private ["_openWounds", "_amountOf"]; _openWounds = _target getvariable [QGVAR(openWounds), []]; { _amountOf = _x select 3; - if (_amountOf > 0 && {(_selectionN == (_x select 2))}) exitwith { + if (_amountOf > 0 && {(_selectionN == (_x select 2))} && {(_x select 4) > 0}) exitwith { _actionData set [2, QUOTE(PATHTOF(UI\icons\medical_crossRed.paa))]; }; } foreach _openWounds; diff --git a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf index cf884e0ab0..2960c65b9d 100644 --- a/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleAdvancedMedicalSettings.sqf @@ -33,3 +33,7 @@ if !(_activated) exitWith {}; [_logic, QGVAR(consumeItem_SurgicalKit), "consumeItem_SurgicalKit"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(useLocation_PAK), "useLocation_PAK"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(useLocation_SurgicalKit), "useLocation_SurgicalKit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(useCondition_PAK), "useCondition_PAK"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(useCondition_SurgicalKit), "useCondition_SurgicalKit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(healHitPointAfterAdvBandage), "healHitPointAfterAdvBandage"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(painIsOnlySuppressed), "painIsOnlySuppressed"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 539d428da0..af6de73ce1 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -37,7 +37,7 @@ if (!isNull _logic) then { _list = "[" + _nilCheckPassedList + "]"; _parsedList = [] call compile _list; - _setting = _logic getvariable ["enabled", false]; + _setting = _logic getvariable ["enabled", 0]; _objects = synchronizedObjects _logic; if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { { diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 296b4f1d56..00b7a15fcf 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -30,6 +30,7 @@ if !(_activated) exitWith {}; [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(enableUnconsciousnessAI), "enableUnconsciousnessAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(remoteControlledAI), "remoteControlledAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(painCoefficient), "painCoefficient"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/functions/fnc_onMedicationUsage.sqf b/addons/medical/functions/fnc_onMedicationUsage.sqf index c56f676744..904ad3ef88 100644 --- a/addons/medical/functions/fnc_onMedicationUsage.sqf +++ b/addons/medical/functions/fnc_onMedicationUsage.sqf @@ -7,7 +7,7 @@ * 1: Medication Treatment classname * 2: The medication treatment variablename * 3: Max dosage - * 4: The time in the system + * 4: The ACE_time in the system * 5: Incompatable medication > * * Return Value: @@ -18,7 +18,7 @@ #include "script_component.hpp" -private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount", "_viscosityChange", "_viscosityAdjustment", "_medicationConfig", "_onOverDose"]; +private ["_target", "_className", "_variable", "_maxDosage", "_timeInSystem", "_incompatabileMeds", "_foundEntry", "_allUsedMedication","_allMedsFromClassname", "_usedMeds", "_hasOverDosed", "_med", "_limit", "_classNamesUsed", "_decreaseAmount", "_viscosityChange", "_viscosityAdjustment", "_medicationConfig", "_onOverDose", "_painReduce"]; _target = _this select 0; _className = _this select 1; _variable = _this select 2; @@ -26,6 +26,7 @@ _maxDosage = _this select 3; _timeInSystem = _this select 4; _incompatabileMeds = _this select 5; _viscosityChange = _this select 6; +_painReduce = _this select 7; _foundEntry = false; _allUsedMedication = _target getvariable [QGVAR(allUsedMedication), []]; @@ -84,7 +85,7 @@ _decreaseAmount = 1 / _timeInSystem; _viscosityAdjustment = _viscosityChange / _timeInSystem; [{ - private ["_args", "_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment"]; + private ["_args", "_target", "_timeInSystem", "_variable", "_amountDecreased","_decreaseAmount", "_usedMeds", "_viscosityAdjustment", "_painReduce"]; _args = _this select 0; _target = _args select 0; _timeInSystem = _args select 1; @@ -92,6 +93,7 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem; _amountDecreased = _args select 3; _decreaseAmount = _args select 4; _viscosityAdjustment = _args select 5; + _painReduce = _args select 6; _usedMeds = _target getvariable [_variable, 0]; _usedMeds = _usedMeds - _decreaseAmount; @@ -101,9 +103,10 @@ _viscosityAdjustment = _viscosityChange / _timeInSystem; // Restoring the viscosity while the medication is leaving the system _target setvariable [QGVAR(peripheralResistance), ((_target getvariable [QGVAR(peripheralResistance), 100]) - _viscosityAdjustment) max 0]; + _target setvariable [QGVAR(painSuppress), ((_target getvariable [QGVAR(painSuppress), 0]) - _painReduce) max 0]; if (_amountDecreased >= 1 || (_usedMeds <= 0) || !alive _target) then { [(_this select 1)] call cba_fnc_removePerFrameHandler; }; _args set [3, _amountDecreased]; -}, 1, [_target, _timeInSystem, _variable, 0, _decreaseAmount, _viscosityAdjustment] ] call CBA_fnc_addPerFrameHandler; +}, 1, [_target, _timeInSystem, _variable, 0, _decreaseAmount, _viscosityAdjustment, _painReduce / _timeInSystem] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_parseConfigForInjuries.sqf b/addons/medical/functions/fnc_parseConfigForInjuries.sqf index 503ff9833e..1b2db7c278 100644 --- a/addons/medical/functions/fnc_parseConfigForInjuries.sqf +++ b/addons/medical/functions/fnc_parseConfigForInjuries.sqf @@ -118,4 +118,58 @@ _selectionSpecific = getNumber(_damageTypesConfig >> "selectionSpecific"); if (isNumber(_damageTypesConfig >> _x >> "selectionSpecific")) then { _selectionSpecificType = getNumber(_damageTypesConfig >> _x >> "selectionSpecific");}; }; missionNamespace setvariable [_varName, [_typeThresholds, _selectionSpecificType > 0, _woundTypes]]; + + private ["_minDamageThresholds", "_amountThresholds"]; + // extension loading + _minDamageThresholds = ""; + _amountThresholds = ""; + { + _minDamageThresholds = _minDamageThresholds + str(_x select 0); + _amountThresholds = _amountThresholds + str(_x select 1); + if (_forEachIndex < (count _typeThresholds) - 1) then { + _minDamageThresholds = _minDamageThresholds + ":"; + _amountThresholds = _amountThresholds + ":"; + }; + }foreach _typeThresholds; + + "ace_medical" callExtension format ["addDamageType,%1,%2,%3,%4,%5", _type, GVAR(minLethalDamages) select _foreachIndex, _minDamageThresholds, _amountThresholds, _selectionSpecificType]; + }foreach _allFoundDamageTypes; + + +// Extension loading + +{ + private ["_classID", "_className", "_allowedSelections", "_bloodLoss", "_pain", "_minDamage", "_maxDamage", "_causes", "_classDisplayName", "_extensionInput", "_selections", "_causesArray"]; + // add shit to addInjuryType + _classID = _x select 0; + _className = GVAR(woundClassNames) select _forEachIndex; + _allowedSelections = ""; + + _selections = _x select 1; + { + _allowedSelections = _allowedSelections + _x; + if (_forEachIndex < (count _selections) - 1) then { + _allowedSelections = _allowedSelections + ":"; + }; + }foreach _selections; + + _bloodLoss = _x select 2; + _pain = _x select 3; + _minDamage = (_x select 4) select 0; + _maxDamage = (_x select 4) select 1; + _causes = ""; + _causesArray = (_x select 5); + { + _causes = _causes + _x; + if (_forEachIndex < (count _causesArray) - 1) then { + _causes = _causes + ":"; + }; + }foreach _causesArray; + _classDisplayName = _x select 6; + + "ace_medical" callExtension format["addInjuryType,%1,%2,%3,%4,%5,%6,%7,%8,%9", _classID, _className, _allowedSelections, _bloodLoss, _pain, _minDamage, _maxDamage, _causes, _classDisplayName]; + +}foreach _allWoundClasses; + +"ace_medical" callExtension "ConfigComplete"; diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf index c48e3d0a4c..3d41ec70db 100644 --- a/addons/medical/functions/fnc_playInjuredSound.sqf +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -1,7 +1,7 @@ /* * Author: Glowbal * Play the injured sound for a unit if the unit is damaged. The sound broadcasted across MP. - * Will not play if the unit has already played a sound within to close a time frame. + * Will not play if the unit has already played a sound within to close a ACE_time frame. * Delay: With minimal damage (below 1), the delay is (10 + random(50)) seconds. Otherwise it is 60 seconds / damage. * * Arguments: diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index b4483defc2..c33d83bb40 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -21,7 +21,7 @@ if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; _unit setvariable [QGVAR(inCardiacArrest), true,true]; _unit setvariable [QGVAR(heartRate), 0]; -["Medical_onEnteredCardiacArrest", [_unit]] call ace_common_fnc_localEvent; +["Medical_onEnteredCardiacArrest", [_unit]] call EFUNC(common,localEvent); [_unit, true] call FUNC(setUnconscious); _timeInCardiacArrest = 120 + round(random(600)); @@ -38,10 +38,10 @@ _timeInCardiacArrest = 120 + round(random(600)); [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; }; - if (time - _startTime >= _timeInCardiacArrest) exitwith { + if (ACE_time - _startTime >= _timeInCardiacArrest) exitwith { [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inCardiacArrest), nil,true]; [_unit] call FUNC(setDead); }; -}, 1, [_unit, time, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; +}, 1, [_unit, ACE_time, _timeInCardiacArrest] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf index 411fd6dc06..831a1fa6a0 100644 --- a/addons/medical/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -40,7 +40,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == }; _unit setvariable [QGVAR(inReviveState), true, true]; - _unit setvariable [QGVAR(reviveStartTime), time]; + _unit setvariable [QGVAR(reviveStartTime), ACE_time]; [_unit, true] call FUNC(setUnconscious); [{ @@ -49,7 +49,7 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == _unit = _args select 0; _startTime = _unit getvariable [QGVAR(reviveStartTime), 0]; - if (time - _startTime > GVAR(maxReviveTime)) exitwith { + if (ACE_time - _startTime > GVAR(maxReviveTime)) exitwith { [(_this select 1)] call cba_fnc_removePerFrameHandler; _unit setvariable [QGVAR(inReviveState), nil, true]; _unit setvariable [QGVAR(reviveStartTime), nil]; @@ -66,6 +66,11 @@ if (((_reviveVal == 1 && {[_unit] call EFUNC(common,isPlayer)} || _reviveVal == _unit setvariable [QGVAR(reviveStartTime), nil]; [(_this select 1)] call cba_fnc_removePerFrameHandler; }; + if (GVAR(level) >= 2) then { + if (_unit getvariable [QGVAR(heartRate), 60] > 0) then { + _unit setvariable [QGVAR(heartRate), 0]; + }; + }; }, 1, [_unit] ] call CBA_fnc_addPerFrameHandler; false; }; @@ -74,5 +79,8 @@ _unit setvariable ["ACE_isDead", true, true]; if (isPLayer _unit) then { _unit setvariable ["isDeadPlayer", true, true]; }; + +["medical_onSetDead", [_unit]] call EFUNC(common,localEvent); + _unit setdamage 1; true; diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index 72d297b2c8..3298c0a869 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -5,7 +5,7 @@ * Arguments: * 0: The unit that will be put in an unconscious state * 1: Set unconsciouns - * 2: Minimum unconscious time + * 2: Minimum unconscious ACE_time * * ReturnValue: * nil @@ -17,10 +17,11 @@ #define DEFAULT_DELAY (round(random(10)+5)) -private ["_unit", "_set", "_animState", "_originalPos", "_startingTime","_minWaitingTime"]; +private ["_unit", "_set", "_animState", "_originalPos", "_startingTime","_minWaitingTime", "_force", "_isDead"]; _unit = _this select 0; _set = if (count _this > 1) then {_this select 1} else {true}; _minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY}; +_force = if (count _this > 3) then {_this select 3} else {false}; // No change, fuck off. (why is there no xor?) if (_set isEqualTo (_unit getVariable ["ACE_isUnconscious", false])) exitWith {}; @@ -32,7 +33,7 @@ if !(_set) exitwith { if !(!(isNull _unit) && {(_unit isKindOf "CAManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{}; if (!local _unit) exitwith { - [[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [[_unit, _set, _minWaitingTime, _force], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; _unit setvariable ["ACE_isUnconscious", true, true]; @@ -46,12 +47,15 @@ if (_unit == ACE_player) then { }; // if we have unconsciousness for AI disabled, we will kill the unit instead -if !([_unit] call EFUNC(common,isPlayer)) then { +_isDead = false; +if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then { _enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)]; - if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) exitWith { + if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then { [_unit, true] call FUNC(setDead); + _isDead = true; }; }; +if (_isDead) exitWith {}; // If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious, // therefor we force it to select the primairy weapon before going unconscious @@ -96,7 +100,7 @@ _anim = [_unit] call EFUNC(common,getDeathAnim); }; }, [_unit, _anim], 0.5, 0] call EFUNC(common,waitAndExecute); -_startingTime = time; +_startingTime = ACE_time; [DFUNC(unconsciousPFH), 0.1, [_unit, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf index f50ff505e0..18f3406df2 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"]; +private ["_caller", "_target", "_selectionName", "_className", "_config", "_medicRequired", "_items", "_locations", "_return", "_callbackProgress", "_treatmentTime", "_callerAnim", "_patientAnim", "_iconDisplayed", "_return", "_usersOfItems", "_consumeItems", "_condition", "_displayText", "_wpn", "_treatmentTimeConfig", "_patientStateCondition"]; _caller = _this select 0; _target = _this select 1; _selectionName = _this select 2; @@ -26,7 +26,7 @@ _className = _this select 3; if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { [{ _this call FUNC(treatment); - }, _this, 0, 0] call EFUNC(common,waitAndExecute); + }, _this] call EFUNC(common,execNextFrame); }; if !(_target isKindOf "CAManBase") exitWith {false}; @@ -53,9 +53,6 @@ if !([_caller, _medicRequired] call FUNC(isMedic)) exitwith {false}; _items = getArray (_config >> "items"); if (count _items > 0 && {!([_caller, _target, _items] call FUNC(hasItems))}) exitwith {false}; -// Check allowed locations -_locations = getArray (_config >> "treatmentLocations"); - _return = true; if (isText (_config >> "Condition")) then { _condition = getText(_config >> "condition"); @@ -74,6 +71,16 @@ if (isText (_config >> "Condition")) then { }; if (!_return) exitwith {false}; +_patientStateCondition = if (isText(_config >> "patientStateCondition")) then { + missionNamespace getvariable [getText(_config >> "patientStateCondition"), 0] +} else { + getNumber(_config >> "patientStateCondition") +}; +if (_patientStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitwith {false}; + +// Check allowed locations +_locations = getArray (_config >> "treatmentLocations"); + if ("All" in _locations) then { _return = true; } else { @@ -156,7 +163,7 @@ if (currentWeapon _caller == secondaryWeapon _caller) then { _caller selectWeapon (primaryWeapon _caller); }; -_wpn = ["non", "rfl", "pst"] select (["", primaryWeapon _caller, handgunWeapon _caller] find (currentWeapon _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 { @@ -174,8 +181,26 @@ if (vehicle _caller == _caller && {_callerAnim != ""}) then { [_caller, _callerAnim] call EFUNC(common,doAnimation); }; +//Get treatment time +_treatmentTime = if (isNumber (_config >> "treatmentTime")) then { + getNumber (_config >> "treatmentTime"); +} else { + if (isText (_config >> "treatmentTime")) exitwith { + _treatmentTimeConfig = getText(_config >> "treatmentTime"); + if (isnil _treatmentTimeConfig) then { + _treatmentTimeConfig = compile _treatmentTimeConfig; + } else { + _treatmentTimeConfig = missionNamespace getvariable _treatmentTimeConfig; + }; + if (typeName _treatmentTimeConfig == "SCALAR") exitwith { + _treatmentTimeConfig; + }; + [_caller, _target, _selectionName, _className] call _treatmentTimeConfig; + }; + 0; +}; + // Start treatment -_treatmentTime = getNumber (_config >> "treatmentTime"); [ _treatmentTime, [_caller, _target, _selectionName, _className, _items, _usersOfItems], diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf index 0a49420783..ade74a6ccb 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPR.sqf @@ -23,7 +23,7 @@ _selectionName = _this select 2; _className = _this select 3; _items = _this select 4; -// TODO replace by event system instead -[[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ - +if (alive _target && {(_target getvariable [QGVAR(inCardiacArrest), false] || _target getvariable [QGVAR(inReviveState), false])}) then { + [[_caller, _target], QUOTE(DFUNC(treatmentAdvanced_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +}; true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf index 4bb14e1139..61723319a5 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_CPRLocal.sqf @@ -14,17 +14,15 @@ #include "script_component.hpp" -private ["_caller","_target", "_n"]; +private ["_caller","_target", "_reviveStartTime"]; _caller = _this select 0; _target = _this select 1; -_n = _target getvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER),0]; -if (_n > 0) then { - _n = _n - random(20); - if (_n < 0) then { - _n = 0; +if (_target getvariable [QGVAR(inReviveState), false]) exitwith { + _reviveStartTime = _target getvariable [QGVAR(reviveStartTime),0]; + if (_reviveStartTime > 0) then { + _target setvariable [QGVAR(reviveStartTime), (_reviveStartTime + random(20)) min ACE_time]; }; - _target setvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER), _n]; }; if (random(1)>= 0.6) exitwith { diff --git a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf index 394595ade3..6b6b7adb81 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_bandage.sqf @@ -37,6 +37,6 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith { }; }foreach _items;*/ -[_target, "activity", "STR_ACE_Medical_Activity_bandagedPatient", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf index e385c5f7c0..544ef6ae55 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealLocal.sqf @@ -58,6 +58,7 @@ if (alive _target) exitwith { _target setvariable [QGVAR(hasLostBlood), 0, true]; _target setvariable [QGVAR(isBleeding), false, true]; _target setvariable [QGVAR(hasPain), false, true]; + _target setvariable [QGVAR(painSuppress), 0, true]; // medication _allUsedMedication = _target getVariable [QGVAR(allUsedMedication), []]; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf b/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf new file mode 100644 index 0000000000..108bdd4a5d --- /dev/null +++ b/addons/medical/functions/fnc_treatmentAdvanced_fullHealTreatmentTime.sqf @@ -0,0 +1,26 @@ +/* + * Author: Ruthberg + * Calculates the personal aid kit treatment time based on amount of damage to heal + * + * Arguments: + * unit + * + * Return Value: + * treatment time + * + * Example: + * [_target] call ace_medical_fnc_treatmentAdvanced_fullHealTreatmentTime + * + * Public: No + */ +#include "script_component.hpp" + +private ["_target", "_totalDamage"]; +_target = _this; +_totalDamage = 0; + +{ + _totalDamage = _totalDamage + _x; +} forEach (_target getVariable [QGVAR(bodyPartStatus), []]); + +(10 max (_totalDamage * 10) min 120) diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf index c6ac2dc8e5..e3d07616f3 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medication.sqf @@ -32,6 +32,6 @@ _items = _this select 4; }; }foreach _items; -[_target, "activity", "STR_ACE_Medical_Activity_usedItem", [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); +[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), _className]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf index 934bc9239a..c4ba840398 100644 --- a/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf +++ b/addons/medical/functions/fnc_treatmentAdvanced_medicationLocal.sqf @@ -60,28 +60,32 @@ _heartRate = _target getvariable [QGVAR(heartRate), 70]; if (alive _target) then { if (_heartRate > 0) then { if (_heartRate <= 45) then { - [_target, ((_hrIncreaseLow select 0) + random((_hrIncreaseLow select 1))), (_hrIncreaseLow select 2), _hrCallback] call FUNC(addHeartRateAdjustment); + [_target, ((_hrIncreaseLow select 0) + random ((_hrIncreaseLow select 1) - (_hrIncreaseLow select 0))), (_hrIncreaseLow select 2), _hrCallback] call FUNC(addHeartRateAdjustment); } else { if (_heartRate > 120) then { - [_target, ((_hrIncreaseHigh select 0) + random((_hrIncreaseHigh select 1))), (_hrIncreaseHigh select 2), _hrCallback] call FUNC(addHeartRateAdjustment); + [_target, ((_hrIncreaseHigh select 0) + random ((_hrIncreaseHigh select 1) - (_hrIncreaseHigh select 0))), (_hrIncreaseHigh select 2), _hrCallback] call FUNC(addHeartRateAdjustment); } else { - [_target, ((_hrIncreaseNorm select 0) + random((_hrIncreaseNorm select 1))), (_hrIncreaseNorm select 2), _hrCallback] call FUNC(addHeartRateAdjustment); + [_target, ((_hrIncreaseNorm select 0) + random ((_hrIncreaseNorm select 1) - (_hrIncreaseNorm select 0))), (_hrIncreaseNorm select 2), _hrCallback] call FUNC(addHeartRateAdjustment); }; }; }; }; if (_painReduce > 0) then { - // Reduce the pain level - _pain = _target getvariable [QGVAR(pain), 0]; - _target setvariable [QGVAR(pain), (_pain - (_pain * _painReduce)) max 0]; + // Reduce pain + _painSuppress = _target getvariable [QGVAR(painSuppress), 0]; + _target setvariable [QGVAR(painSuppress), (_painSuppress + _painReduce) max 0]; + if (!GVAR(painIsOnlySuppressed)) then { + _pain = _target getvariable [QGVAR(pain), 0]; + _target setvariable [QGVAR(pain), (_pain - _painReduce) max 0, true]; + }; }; _resistance = _target getvariable [QGVAR(peripheralResistance), 100]; _resistance = _resistance + _viscosityChange; _target setvariable [QGVAR(peripheralResistance), _resistance max 0]; -// Call back to ensure that the medication is decreased over time -[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange] call FUNC(onMedicationUsage); +// Call back to ensure that the medication is decreased over ACE_time +[_target, _classname, _varName, _maxDose, _timeInSystem, _inCompatableMedication, _viscosityChange, _painReduce] call FUNC(onMedicationUsage); true diff --git a/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf new file mode 100644 index 0000000000..c0e1037027 --- /dev/null +++ b/addons/medical/functions/fnc_treatmentAdvanced_surgicalKit_onProgress.sqf @@ -0,0 +1,28 @@ +/* + * Author: BaerMitUmlaut + * Handles treatment via surgical kit per frame. + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_args", "_target", "_caller", "_elapsedTime", "_totalTime", "_bandagedWounds"]; +_args = _this select 0; +_caller = _args select 0; +_target = _args select 1; +_elapsedTime = _this select 1; +_totalTime = _this select 2; + +_bandagedWounds = _target getVariable [QGVAR(bandagedWounds), []]; + +//In case two people stitch up one patient and the last wound has already been closed we can stop already +if (count _bandagedWounds == 0) exitWith {false}; + +//Has enough time elapsed that we can close another wound? +if ((_totalTime - _elapsedTime) <= (((count _bandagedWounds) - 1) * 5)) then { + _bandagedWounds deleteAt 0; + _target setVariable [QGVAR(bandagedWounds), _bandagedWounds, true]; +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf index 9d2c12280d..7cfb65a909 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbag.sqf @@ -16,8 +16,9 @@ #include "script_component.hpp" -private ["_caller", "_target"]; +private ["_caller", "_target", "_treatmentClassname"]; _caller = _this select 0; _target = _this select 1; +_treatmentClassname = _this select 3; -[[_target], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +[[_target, _treatmentClassname], QUOTE(DFUNC(treatmentBasic_bloodbagLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ diff --git a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf index 9bbe04b35f..08057c9492 100644 --- a/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf +++ b/addons/medical/functions/fnc_treatmentBasic_bloodbagLocal.sqf @@ -4,6 +4,7 @@ * * Arguments: * 0: The patient + * 1: Treatment Classname * * Return Value: * nil @@ -14,8 +15,15 @@ #include "script_component.hpp" #define BLOODBAGHEAL 70 -private ["_target","_blood"]; -_target = _this select 0; +PARAMS_2(_target,_treatmentClassname); -_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + BLOODBAGHEAL) min 100; +private ["_blood", "_bloodAdded"]; + +_bloodAdded = switch (true) do { + case (_treatmentClassname == "BloodIV_250"): {0.25 * BLOODBAGHEAL}; + case (_treatmentClassname == "BloodIV_500"): {0.5 * BLOODBAGHEAL}; + default {BLOODBAGHEAL}; +}; + +_blood = ((_target getVariable [QGVAR(bloodVolume), 100]) + _bloodAdded) min 100; _target setVariable [QGVAR(bloodVolume), _blood, true]; diff --git a/addons/medical/functions/fnc_treatmentIV.sqf b/addons/medical/functions/fnc_treatmentIV.sqf index c0f4e4681f..fc6b91b057 100644 --- a/addons/medical/functions/fnc_treatmentIV.sqf +++ b/addons/medical/functions/fnc_treatmentIV.sqf @@ -27,6 +27,6 @@ _items = _this select 4; if (count _items == 0) exitwith {}; _removeItem = _items select 0; -[[_target, _removeItem], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ +[[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", "STR_ACE_Medical_Activity_gaveIV", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); diff --git a/addons/medical/functions/fnc_treatmentIVLocal.sqf b/addons/medical/functions/fnc_treatmentIVLocal.sqf index 04708b965f..9abb5fda2f 100644 --- a/addons/medical/functions/fnc_treatmentIVLocal.sqf +++ b/addons/medical/functions/fnc_treatmentIVLocal.sqf @@ -4,7 +4,7 @@ * * Arguments: * 0: The medic - * 1: Item used classname + * 1: Treatment classname * * * Return Value: @@ -15,9 +15,9 @@ #include "script_component.hpp" -private ["_target", "_ivItem", "_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; +private ["_target", "_treatmentClassname", "_config", "_volumeAdded", "_typeOf", "_varName", "_bloodVolume"]; _target = _this select 0; -_ivItem = _this select 1; +_treatmentClassname = _this select 1; _bloodVolume = _target getvariable [QGVAR(bloodVolume), 100]; if (_bloodVolume >= 100) exitwith {}; @@ -27,10 +27,12 @@ _config = (configFile >> "ACE_Medical_Advanced" >> "Treatment" >> "IV"); _volumeAdded = getNumber (_config >> "volume"); _typeOf = getText (_config >> "type"); -if (isClass (_config >> _ivItem)) then { - _config = (_config >> _ivItem); +if (isClass (_config >> _treatmentClassname)) then { + _config = (_config >> _treatmentClassname); if (isNumber (_config >> "volume")) then { _volumeAdded = getNumber (_config >> "volume");}; if (isText (_config >> "type")) then { _typeOf = getText (_config >> "type"); }; +} else { + ERROR("IV Treatment Classname not found"); }; _varName = format["ACE_Medical_IVVolume_%1",_typeOf]; diff --git a/addons/medical/functions/fnc_treatmentTourniquet.sqf b/addons/medical/functions/fnc_treatmentTourniquet.sqf index c4ee10011e..cab44d3295 100644 --- a/addons/medical/functions/fnc_treatmentTourniquet.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquet.sqf @@ -43,7 +43,7 @@ _removeItem = _items select 0; [[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ [_target, _removeItem] call FUNC(addToTriageCard); -[_target, "activity", "STR_ACE_Medical_Activity_appliedTourniquet", [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); +[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); true; diff --git a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf index 02484bbca6..5108bf8433 100644 --- a/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf +++ b/addons/medical/functions/fnc_treatmentTourniquetLocal.sqf @@ -44,9 +44,9 @@ _target setvariable [QGVAR(tourniquets), _tourniquets, true]; // Tourniquet has been removed [(_this select 1)] call cba_fnc_removePerFrameHandler; }; - if (time - _time > 120) then { + if (ACE_time - _time > 120) then { _target setvariable [QGVAR(pain), (_target getvariable [QGVAR(pain), 0]) + 0.005]; }; -}, 5, [_target, _applyingTo, _part, time] ] call CBA_fnc_addPerFrameHandler; +}, 5, [_target, _applyingTo, _part, ACE_time] ] call CBA_fnc_addPerFrameHandler; true; diff --git a/addons/medical/functions/fnc_treatment_failure.sqf b/addons/medical/functions/fnc_treatment_failure.sqf index 19352e5441..53fd03d2f3 100644 --- a/addons/medical/functions/fnc_treatment_failure.sqf +++ b/addons/medical/functions/fnc_treatment_failure.sqf @@ -60,4 +60,4 @@ if (isNil _callback) then { _args call _callback; -_args call FUNC(createLitter); +// _args call FUNC(createLitter); diff --git a/addons/medical/functions/fnc_treatment_success.sqf b/addons/medical/functions/fnc_treatment_success.sqf index ffe67d21bc..b3b6e9d52a 100644 --- a/addons/medical/functions/fnc_treatment_success.sqf +++ b/addons/medical/functions/fnc_treatment_success.sqf @@ -55,3 +55,8 @@ if (isNil _callback) then { _args call _callback; _args call FUNC(createLitter); + +//If we're not already tracking vitals, start: +if (!(_target getvariable [QGVAR(addedToUnitLoop),false])) then { + [_target] call FUNC(addToInjuredCollection); +}; diff --git a/addons/medical/functions/fnc_unconsciousPFH.sqf b/addons/medical/functions/fnc_unconsciousPFH.sqf index f0759a66ba..5b1ca04d2d 100644 --- a/addons/medical/functions/fnc_unconsciousPFH.sqf +++ b/addons/medical/functions/fnc_unconsciousPFH.sqf @@ -30,6 +30,10 @@ _hasMovedOut = _args select 4; _parachuteCheck = _args select 5; if (!alive _unit) exitwith { + if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { + TRACE_1("Removing fake weapon [on death]",_unit); + _unit removeWeapon "ACE_FakePrimaryWeapon"; + }; if (GVAR(moveUnitsFromGroupOnUnconscious)) then { [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); }; @@ -49,6 +53,11 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith { // TODO, handle this with carry instead, so we can remove the PFH here. // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations if !(([_unit] call FUNC(isBeingCarried)) || ([_unit] call FUNC(isBeingDragged))) then { + if ("ACE_FakePrimaryWeapon" in (weapons _unit)) then { + TRACE_1("Removing fake weapon [on wakeup]",_unit); + _unit removeWeapon "ACE_FakePrimaryWeapon"; + }; + if (vehicle _unit == _unit) then { if (animationState _unit == "AinjPpneMstpSnonWrflDnon") then { [_unit,"AinjPpneMstpSnonWrflDnon_rolltofront", 2] call EFUNC(common,doAnimation); @@ -121,13 +130,13 @@ if (_parachuteCheck) then { }; if (!local _unit) exitwith { - _args set [3, _minWaitingTime - (time - _startingTime)]; + _args set [3, _minWaitingTime - (ACE_time - _startingTime)]; _unit setvariable [QGVAR(unconsciousArguments), _args, true]; [(_this select 1)] call cba_fnc_removePerFrameHandler; }; // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs -if ((time - _startingTime) >= _minWaitingTime) exitwith { +if ((ACE_time - _startingTime) >= _minWaitingTime) exitwith { if (!([_unit] call FUNC(getUnconsciousCondition))) then { _unit setvariable ["ACE_isUnconscious", false, true]; }; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index f573f53b0d..35f989e8a1 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -44,7 +44,7 @@ Устанавливает количество мусора, который появляется после использования мед. препаратов. Большое количество мусора может уменьшить производительность, поэтому данная настройка локальна для клиента. Il livello di dettagli della simulazione dei rifiuti indica il numero di rifiuti che verranno creati localmente nel client. La creazione di troppi rifiuti in aree locali potrebbe causare lag e calo di FPS. Questo è un settaggio client. Le niveau de simulation des détritus règle la quantité de déchets qui vont être créés localement chez le client. Des quantitées excessive chez certains clients peuvent causer des chutes de FPS, c'est donc une option client uniquement. - Die Einstellung für das Abfall-Detaillevel stellt die Menge der lokal erzeugten medizinischen Abfälle ein. Zuviel erzeugte Abfälle können FPS-Lags erzeugen, deswegen ist diese Einstellung nur clientseitig. + Die Einstellung für das Abfall-Detaillevel stellt die Menge der lokal erzeugten medizinischen Abfälle ein. Zuviel erzeugte Abfälle können FPS-Einbrüche erzeugen, deswegen ist diese Einstellung nur clientseitig. A hulladékszimuláció részletessége megszabja a kliens által megjelenített hulladékobjektumok mennyiségét. Súlyos mennyiségek izolált területeken alacsony FPS-t okozhatnak, így ez egy kliensoldali beállítás. O nível de detalhe de sujeira determina o número de itens que irão aparecer no cliente. Quantidades excessivas em áreas locais podem aumentar o lag do FPS, então esta é uma opção somente para o cliente. Počet zobrazených předmětů po použití zdravotnického materiálu ovlivňuje počet objektů, které budou zobrazeny klientovi v místě použití zdravotnického materiálu. Vyšší množství objektů může způsobovat poklesy FPS a proto je toto nastavení čistě na klientovi. @@ -83,7 +83,7 @@ Injecter de la morphine Morfium beadása Injetar Morfina - Inietta Morfina + Inietta morfina Transfuse Blood @@ -95,7 +95,7 @@ Transfusion Infúzió (vér) Transfundir Sangue - Effettua trasfusione di sangue + Trasfusione di sangue Transfuse Plasma @@ -106,19 +106,19 @@ Transfuser du Plasma Перелить плазму Infúzió (vérplazma) - Effettua trasfusione di plasma + Trasfusione di Plasma Transfundir Plasma Transfuse Saline - Salzlösungtransfusion + Salzlösungstransfusion Transfundir salino Transfúze fyziologický roztoku Przetocz sól fizjologiczną Transfuser de la solution saline Перелить физраствор Infúzió (sós víz) - Effettua trasfusione di soluzione salina + Trasfusione di soluzione salina Transfundir Soro @@ -171,7 +171,7 @@ Bandage Left Arm - Arm links verbinden + Linken Arm verbinden Vendar el brazo izquierdo Bandażuj lewe ramię Obvázat levou ruku @@ -183,7 +183,7 @@ Bandage Right Arm - Arm rechts verbinden + Rechten Arm verbinden Vendar el brazo derecho Bandażuj prawe ramię Obvázat pravou ruku @@ -195,7 +195,7 @@ Bandage Left Leg - Bein links verbinden + Linkes Bein verbinden Vendar la pierna izquierda Bandażuj lewą nogę Obvázat levou nohu @@ -207,7 +207,7 @@ Bandage Right Leg - Bein rechts verbinden + Rechtes Bein verbinden Vendar la pierna derecha Bandażuj prawą nogę Obvázat pravou nohu @@ -267,14 +267,14 @@ Transfusing Saline ... - Sallösungtransfusion ... + Salzlösungtransfusion ... Transfusión de salino ... Probíha transfúze fyziologický roztoku ... Przetaczanie soli fizjologicznej ... Transfusion de saline ... Переливание физраствора ... Infúzió sós vizzel ... - Effettuo la rasfusione di salina + Effettuo la rasfusione di soluzione salina Transfundindo Soro... @@ -370,7 +370,7 @@ QuikClot Hémostatique QuikClot - QuikClot(polvere emostatica) + QuikClot (polvere emostatica) QuikClot @@ -787,7 +787,7 @@ Utilizado para cubrir una herida Utilisé pour couvrir une blessure Używany w celu przykrycia i ochrony miejsca zranienia - Verwendet, um Wunden abzudecken + Verwendet um Wunden abzudecken Sebesülések befedésére alkalmas Usato per coprire una ferita Usado para cobrir um ferimento @@ -801,7 +801,7 @@ Bandage fait d'un matériel spécial utilisé pour couvrir une blessure, qui peut etre appliqué dès que le saignement a été stoppé. Opatrunek materiałowy, używany do przykrywania ran, zakładany na ranę po zatamowaniu krwawienia. Egy különleges anyagú kötszer sebek betakarására, amelyet a vérzés elállítása után helyeznek fel. - Una benda apposita, utilizzata per coprire una ferita, la quale è applicata sopra di essa una volta fermata l'emorragia. + Una benda apposita, utilizzata per coprire una ferita, la quale viene applicata su di essa una volta fermata l'emorragia. Uma curativo, material específico para cobrir um ferimento que é aplicado assim que o sangramento é estancando. Obvaz je vhodným způsobem upravený sterilní materiál, určený k překrytí rány, případně k fixaci poranění. @@ -825,7 +825,7 @@ Utilisé pour couvrir des blessures de taille moyenne à grande. Arrête l'hémorragies Używany w celu opatrywania średnich i dużych ran oraz tamowania krwawienia. Közepestől nagyig terjedő sebek betakarására és vérzés elállítására használt kötszer - Usato su medie o larghe ferite per fermare emorragie. + 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. Používá se k zastavení středních až silnějších krvácení @@ -850,7 +850,7 @@ Bandaż (elastyczny) Obvaz (elastický) Rögzító kötszer - Benda (Elastica) + Benda (elastica) Bandagem (Elástica) @@ -861,7 +861,7 @@ Bandage compressif élastique Zestaw bandaży elastycznych. Rugalmas kötszercsomag, "rögzítő" - Kit bendaggio, elastico + Kit di bendaggio, elastico Kit de Bandagem, Elástica Sada obvazů, Elastická @@ -873,7 +873,7 @@ Elastyczna opaska podtrzymująca opatrunek oraz usztywniająca okolice stawów. Brinda una compresión uniforme y ofrece soporte extra a una zona lesionada Egyenletes nyomást és támogatást biztosít a sebesült felületnek. - Permette di comprimevere e aiutare la zone ferita. + Permette di comprimere e aiutare la zone ferita. Esta bandagem pode ser utilizada para comprimir o ferimento e diminuir o sangramento e garantir que o ferimento não abra em movimento. Hodí se k fixačním účelům a to i v oblastech kloubů. @@ -915,7 +915,7 @@ Morphine autoinjector - Morphium Autoinjektor + Morphium-Autoinjektor Морфин в пневмошприце Morfina auto-inyectable Auto-injecteur de Morphine @@ -955,10 +955,10 @@ Atropina auto-inyectable Auto-injecteur d'Atropine Autostrzykawka AtroPen - Atropin Autoinjektor + Atropin-Autoinjektor Autoinjektor atropin Atropin autoinjektor - Autoiniettore di Atropina + Autoiniettore di atropina Auto-injetor de Atropina @@ -967,7 +967,7 @@ Usado en escenarios NBQ Utilisé en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. - Verwendet bei ABC Kontamination + Verwendet bei ABC-Kontamination NBK helyzetek esetén használandó Usato in situazioni con gas nervino. Usado em casos de ataque QBRN @@ -979,7 +979,7 @@ Medicamento usado por militares en escenarios NBQ Médicament utilisé par l'armée en cas d'attaque CBRN Atropina. Stosowana jako lek rozkurczowy i środek rozszerzający źrenice. Środek stosowany w przypadku zagrożeń NBC. - Ein Medikament, das vom Militär bei ABC Kontamination verwendet wird. + Ein Medikament, das vom Militär bei ABC-Kontamination verwendet wird. Egy instabil alkaloid, NBK helyzetek esetén a katonai szervezetek veszik használatba. E' un farmaco usato in ambito militare in scenari con presenza di gas nervino. Uma droga usada por militares em casos de ataque QBRN. @@ -991,10 +991,10 @@ Epinefrina auto-inyectable Auto-injecteur d'épinéphrine Autostrzykawka EpiPen - Epiniphrin Autoinjektor + Epiniphrin-Autoinjektor Autoinjektor adrenalin Epinefrin autoinjektor - Autoiniettore di Epinefrina + Autoiniettore di epinefrina Auto-injetor de epinefrina @@ -1016,7 +1016,7 @@ Medicament qui fonctionne sur le système nerveux sympathique créant une dilatation des bronches, augmente la fréquence cardiaque et annule les effets d'une réaction allergique (anaphylaxie). Utilisé lors d'arrêt cardio-respiratoire pour augmenter les chances de retrouver un pouls. EpiPen z adrenaliną ma działanie sympatykomimetyczne, tj. pobudza receptory alfa- i beta-adrenergiczne. Pobudzenie układu współczulnego prowadzi do zwiększenia częstotliwości pracy serca, zwiększenia pojemności wyrzutowej serca i przyśpieszenia krążenia wieńcowego. Pobudzenie oskrzelowych receptorów beta-adrenergicznych wywołuje rozkurcz mięśni gładkich oskrzeli, co w efekcie zmniejsza towarzyszące oddychaniu świsty i duszności. Una sostanza che permette di dilatare i bronchi, aumentare il battito cardiaco e combattere effetti di reazioni allergiche. Usato anche in casi di arresto cardiaco. - Ein Medikament, dass die Bronchien erweitert, die Herzfrequenz erhöht und Symptome von allergischen Reaktionen(Anaphylaxie) bekämpft. Wird bei plötzlichem Herzstillstand verabreicht. + Ein Medikament, das die Bronchien erweitert, die Herzfrequenz erhöht und Symptome von allergischen Reaktionen(Anaphylaxie) bekämpft. Wird bei plötzlichem Herzstillstand verabreicht. Uma droga trabalha dilatando os bronquios, aumentando a frequência cardíaca e combate efeitos de reações alérgicas(anáfilaticas). Usado em casos de parada cardiaca com poucas changes de recuperação. Egy hormon, mely a szimpatikus idegrendszer által kitágítja a hörgőket, valamint megnöveli a szívverést, ezzel ellensúlyozva ilyen jellegű allergiás reakciókat (anafilaxiás sokk). Hirtelen szívmegállás esetén is használt, idő alatt csökkenő hatásfokkal. Zúžení periferních cév díky působení na alfa receptory a následné kontrakci hladkých svalů, tím dochází k tzv. centralizaci oběhu, krev se soustřeďuje v životně důležitých centrálních orgánech (srdce, mozek, plíce), působí také pozitivně na srdeční činnost a dochází ke zvýšení krevního tlaku a tepu. Dále se používá při náhlé srdeční zástavě. @@ -1144,7 +1144,7 @@ Saline IV (1000ml) Физраствор для в/в вливания (1000 мл) - Solución Salina IV (1000ml) + Salino IV (1000ml) Solution saline 0.9% IV (1000ml) Sól fizjologiczna IV (1000ml) Kochsalzlösung (1000ml) @@ -1271,6 +1271,7 @@ Elsősegélycsomag, terepen való sebvarráshoz és haladó ellátáshoz Kit de primeiros socorros para sutura ou tratamentos avançados Osobní lékárnička obsahuje zdravotnický materiál umožňující šití a pokročilejší ošetřování raněných v poli + Pronto soccorso personale da campo per mettersi i punti o per trattamenti avanzati. Use Personal Aid Kit @@ -1282,6 +1283,7 @@ Elsősegélycsomag használata Usar o kit de primeiros socorros Použít osobní lékárničku + Usa il pronto soccorso personale Surgical Kit @@ -1583,6 +1585,15 @@ %1 zkontroloval srdeční tep: %2 %1 verificou a frequência cardíaca: %2 + + None + Нет + Żadna + Nada + Keine + Žádný + Nada + Weak Schwach @@ -1777,7 +1788,7 @@ He's lost some blood - Ha perso molto sangue + Ha perso sangue Ha perdido un poco de sangre Есть кровопотеря Er hat etwas Blut verloren @@ -1797,6 +1808,7 @@ Il a perdu beaucoup de sang Ztratil hodně krve Ele perdeu muito sangue + Ha perso molto sangue He hasn't lost blood @@ -2194,6 +2206,22 @@ Pravá noha Perna Direita + + Bandaging removes bloodstains + Bandagieren entfernt Blutflecken + Bandażowanie usuwa ślady krwi + Obvázání odstraňuje skvrny od krve + El vendaje elimina las manchas de sangre + Bandagem remove manchas de sangue + + + Pain is only temporarily suppressed + Schmerzen werden nur vorübergehend unterdrückt + Ból jest tymczasowo zwalczany + Bolest je potlačena pouze dočasně + El dolor se suprime solo temporalmente + Dor é suprimida somente temporáriamente + Pain Effect Type Schmerzeffekt-Typ @@ -2240,6 +2268,7 @@ Styl menu (Zdravotní) Estilo do menu (Médico) Menü stílusa (Orvosi) + Stile del menù (medico) Select the type of menu you prefer; default 3d selections or radial. @@ -2251,6 +2280,7 @@ Selecione o tipo de menu que você prefere; padrão seleções 3d ou radial. Válaszd ki a neked megfelelő menüt: Alapértelmezett 3D válogatás, vagy kerek. Zvolte typ menu: základní 3D výběr nebo kruhový + Seleziona il tipo di menù che preferisci: selezione 3d predefinita o radiale. Selections (3d) @@ -2262,6 +2292,7 @@ Seleção (3d) Választékok (3D) 3D výběr + Selezione (3D) Radial @@ -2273,6 +2304,7 @@ Radial Kerek Kruhový + Radiale Scrape @@ -2680,6 +2712,7 @@ Tratando ... Tratando... Ošetřuji ... + Curando ... Removing Tourniquet ... @@ -2691,6 +2724,918 @@ Érszorító eltávolítása ... Sundavám škrtidlo ... Снятие жгута ... + Togliendo il laccio emostatico ... + + + ACE Medical + ACE: медицина + ACE Opcje medyczne + Médico ACE + ACE-Medicsystem + ACE Zdravotnické + ACE Médico + + + Medical Settings [ACE] + Настройки медицины [ACE] + Ustawienia medyczne [ACE] + Ajustes médicos [ACE] + Medizinische Einstellungen [ACE] + Lékařské nastavení [ACE] + Ajustes médicos [ACE] + + + Medical Level + Сложность медицины + Poziom medyczny + Nivel médico + Medizinisches Level + Úroveň medického + Nível médico + + + What is the medical simulation level? + Каков уровень сложности медицинской системы? + Jaki jest poziom symulacji medycznej? + ¿Cuál es el nivel de simulación médica? + Wie hoch soll das medizinische Simulationslevel sein? + Jaká je úroveň lékařské simulace? + Qual o nível de simulação médica? + + + Basic + Базовый + Podstawowy + Básico + Standard + Základní + Básica + + + Advanced + Усложненный + Zaawansowany + Avanzado + Erweitert + Pokročilé + Avançada + + + Medics setting + Настройки медиков + Poziom medyków + Configuración médica + Medizinische Einstellungen + Úroveň zdravotníků + Configuração médica + + + What is the level of detail prefered for medics? + Каков уровень подробностей для медиков? + Jaki jest poziom detali medycznych wyświetlanych dla medyków? + ¿Cuál es el nivel de detalle preferido para los médicos? + Jaká úroveň detailů je preferována pro zdravotníky? + Qual o nível de detalhe preferido para os médicos? + + + Disable medics + Отключить медиков + Wyłącz medyków + Desactivar médicos + Sanitäter deaktivieren + Zakázat zdravotníky + Desativar médicos + + + Enable Litter + Включить мусор + Aktywuj odpadki + Activar restos médicos + Abfälle aktivieren + Povolit odpadky + Ativar lixo médico + + + Enable litter being created upon treatment + Включить появление мусора после лечения + Twórz odpadki medyczne podczas leczenia + Activar los restos médicos que se crean en el tratamiento + Aktiviere Abfälle, wenn eine Behandlung durchgeführt wurde + Vytváří odpad zdravotnického materiálu pří léčení + Ativar lixo ser criado após tratamento + + + Life time of litter objects + Время удаления мусора + Długość życia odpadków + Tiempo de vida de los restos médicos + Dauer des angezeigten Abfalls + Životnost pro odpadky + Tempo de vida dos objetos do lixo + + + How long should litter objects stay? In seconds. -1 is forever. + Как долго мусор будет оставаться на земле? В секундах. -1 означает бесконечное время. + Ile czasu musi upłynąć, aby odpadki zaczęły znikać? W sekundach. -1 dla nieskończoności. + ¿Por cuánto tiempo deben permanecer los restos médicos? En segundos. -1 es para siempre. + Wie lange sollen Abfälle am Boden liegen (in Sekunden)? -1 ist für immer. + Za jak dlouho začnou odpadky mizet? V sekundách. -1 navždy. + Quanto tempo os objetos do lixo devem ficar? Em segundos. -1 é para sempre. + + + Enable Screams + Включить крики + Aktywuj wrzaski + Activar gritos + Schreie aktivieren + Povolit křik + Ativar gritos + + + Enable screaming by injuried units + Включить крики раненных бойцов + Aktywuj wrzeszczenie z bólu przez ranne jednostki + Activar gritos para unidades heridas + Aktiviere Schreie bei verletzten Einheiten + Povolit křičení zraněných jednotek + Ativa gritos para unidades feridas + + + Player Damage + Урон игроку + Próg obrażeń graczy + Daño de jugador + Spielerschaden + Poškození hráče + Dano do jogador + + + What is the damage a player can take before being killed? + Какой уровень урона необходим, чтобы убить игрока? + Jaki jest próg obrażeń, jakie gracz może otrzymać zanim zostanie zabity? + ¿Cuál es el daño que un jugador puede sufrir antes de morir? + Wie viel Schaden kann ein Spieler erleiden, bevor er getötet wird? + Jaké poškození může hráč dostat než bude zabit? + Qal é o dano que um jogador pode sofrer antes de morrer? + + + AI Damage + Урон ботам + Próg obrażeń AI + Daño IA + KI-Schaden + Poškození AI + Dano da IA + + + What is the damage an AI can take before being killed? + Какой уровень урона необходим, чтобы убить бота? + Jaki jest próg obrażeń, jakie AI może otrzymać zanim zostanie zabite? + ¿Cuál es el daño que la IA puede sufrir antes de morir? + Wie viel Schaden kann eine KI erleiden, bis sie getötet wird? + Jaké poškození může AI dostat než bude zabito? + Qual é o dano que uma IA pode sofrer antes de morrer? + + + AI Unconsciousness + Потеря сознания ботами + Nieprzytomność AI + Inconsciencia IA + KI-Bewusstlosigkeit + Bezvědomí AI + Inconsciência da IA + + + Allow AI to go unconscious + Позволить ботам терять сознание + Czy AI może być nieprzytomne od odniesionych obrażeń? + Permita a la IA caer inconsciente + KI kann bewusstlos werden + Umožňuje AI upadnout do bezvědomí + Permite IA ficar inconsciente + + + Remote Controlled AI + IA controlada remotamente + IA controlada remotamente + Zdalnie sterowane AI + Vzdáleně ovládané AI + + + Treat remote controlled units as AI not players? + ¿Tratar unidades remotamente controladas como IA? + Tratar unidades remotamente controladas como IA? + 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 + Отключить мгновенную смерть + Wył. natychmiast. śmierć + Prevenir muerte instantánea + Verhindere direkten Tod + Zabránit okamžité smrti + Previnir morte instantânea + + + Have a unit move to unconscious instead of death + Бойцы теряют сознание вместо того, чтобы умирать + Spraw, aby jednostka została przeniesiona do stanu nieprzytomności zamiast ginąć na miejscu od śmiertelnych obrażeń + Mover una unidad a inconsciente en vez de a muerta + Lässt eine Einheit bewusstlos werden anstatt zu sterben + Jednotka upadne do bezvědomí namísto smrti + Fazer a unidade ficar inconsciente invés de morrer + + + Bleeding coefficient + Коэффициент потери крови + Mnożnik krwawienia + Coeficiente de sangrado + Verblutungsmultiplikator + Koeficient krvácení + Coeficiente de sangramento + + + Coefficient to modify the bleeding speed + Коэффициент, изменяющий скорость кровопотери + Mnożnik modyfikujący prędkość wykrwawiania się + Coeficiente para modificar la velocidad de sangrado + Multiplikator um die Verblutungsgeschwindigkeit zu verändern + Koeficient rychlosti krvácení + Coeficiente para modificar a velocidade do sangramento + + + Pain coefficient + Коэффициент боли + Mnożnik bólu + Coeficiente de dolor + Schmerzmultiplikator + Koeficient bolesti + Coeficiente de dor + + + Coefficient to modify the pain intensity + Коэффициент, изменяющий уровень боли + Mnożnik modyfikujący intensywność bólu + Coeficiente para modificar la intensidad del dolor + Multiplikator um den Schmerzintensität zu verändern + Koeficient intenzity bolesti + Coeficiente para modificar a instensidade de dor + + + Sync status + Синхронизация статуса + Synchronizuj status + Sincronizador estado + Status synchronisieren + Synchronizovat status + Sincronizar estado + + + Keep unit status synced. Recommended on. + Синхронизировать статус юнитов. Рекомендуется включить. + Utrzymuj synchronizację statusu jednostek. Zalecane zostawienie tej opcji włączonej. + Mantener el estado de la unidad sincronizado. Recomendado activado + Status der Einheit synchron halten. Sollte aktiviert bleiben. + Udržuje status jednotky synchronizovaný. Doporučeno zapnout. + Mater o estado da unidade sincronizado. Recomendado ativado. + + + Provides a medical system for both players and AI. + Включает медицинскую систему как для игроков, так и для ботов. + Moduł ten dostarcza system medyczny dla graczy oraz AI. + Proporciona un sistema médico para jugadores e IA. + Aktiviert ein medizinisches System für Spieler und KI. + Poskytuje zdravotní systém pro hráče a AI. + Proporciona o sistema médico para os jogadores e a IA. + + + Advanced Medical Settings [ACE] + Настройки усложненной медицины [ACE] + Zaawansowane ustawienia medyczne [ACE] + Ajustes médicos avanzados [ACE] + Erweiterte medizinische Einstellungen [ACE] + Pokročilé zdravotnické nastavení [ACE] + Ajustes médicos avançados [ACE] + + + Enabled for + Включено для + Aktywne dla + Hablitado para + Aktiviert für + Povoleno pro + Habilitado para + + + Select what units the advanced medical system will be enabled for + Выберите, на кого будет распространяться усложненная система медицины + Wybierz dla kogo zaawansowany system medyczny będzie aktywny + Seleccione para qué unidades será habilitado el sistema médico avanzado + Wähle aus welche Einheiten das erweiterte medizinische System haben + Vyberte, pro jaké jednotky bude pokročilý zdravotní systém povolen + Selecione quais unidades o sistema médico avançado será habilitado + + + Players only + Игроков + Tylko dla graczy + Solo jugadores + Nur Spieler + Pouze hráči + Somente jogadores + + + Players and AI + Игроков и ботов + Gracze oraz AI + Jugadors e IA + Spieler und KI + Hráči a AI + Jogadores e IA + + + Enable Advanced wounds + Включить усложненные ранения + Akt. zaawansowane rany + Activa heridas avanzadas + Aktiviere erweiterte Wunden + Povolit pokročilé zranění + Ativar ferimentos avançados + + + Allow reopening of bandaged wounds? + Будут ли открываться уже перевязанные раны? + Pozwól na otwieranie się zabandażowanych ran? + Permitir la reapertura de las heridas vendadas? + Erlaube das Öffnen von bandagierten Wunden? + Umožnit znovuotevření zavázané rány? + Permitr reabertura de ferimentos enfaixados? + + + Vehicle Crashes + Аварии транспорта + Obrażenia od kolizji + Accidentes de vehículos + Fahrzeugunfälle + Poškození z kolize + Batidas de veículos + + + Do units take damage from a vehicle crash? + Должны ли юниты получать повреждения от аварий на транспорте? + Czy jednostki otrzymują obrażenia w wyniku kolizji pojazdów? + ¿Las unidades reciben daño de un accidente de tráfico? + Bekommen Einheiten von Fahrzeugunfällen Schaden? + Dostane jednotka poškození při autonehodě? + As unidades recebem dano de uma batida de veículo? + + + Allow PAK + Использование аптечки + Ust. apteczek osobistych + Permitir EPA + Erlaube Erstehilfekasten + Povolit osobní lékárničky + Permitir Kit de Primeiros Socorros + + + Who can use the PAK for full heal? + Кому разрешено выполнять полное лечение с помощью аптечки? + 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? + Kdo může použít osobní lékárničku pro plné vyléčení? + Quem pode usar o KPS para cura completa? + + + Anyone + Кем угодно + Wszyscy + Nadie + Jeder + Kdokoliv + Qualquer um + + + Medics only + Только медиками + Tylko medycy + Solo médicos + Nur Sanitäter + Pouze zdravotník + Somente médicos + + + Doctors only + Только врачами + Tylko doktorzy + Solo doctores + Nur Ärzte + Pouze doktor + Somente doutores + + + Remove PAK on use + Удалять аптечки после использования + Usuń apteczkę po użyciu + Eliminar EPA después del uso + Entferne Erstehilfekasten bei Verwendung + Odebrat osobní lékárničku po použití + Remover o KPS depois do uso + + + Should PAK be removed on usage? + Нужно ли удалять аптечки после использования? + 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? + Má se osobní lékárnička odstranit po použití? + Deve o KPS ser removido depois do uso? + + + Locations PAK + Место использования аптечки + Ogr. apteczek osobistych + Ubicacions del EPA + Orte für Erstehilfekasten + Lokace osobní lékárničky + Localizações do KPS + + + Where can the Personal Aid Kit be used? + Где может использоваться аптечка? + Gdzie można korzystać z apteczek osobistych? + ¿Dónde se puede utilizar el equipo de primeros auxilios? + Wo kann der Erstehilfekasten verwendet werden? + Kde může být použita osobní lékárnička? + Onde o kit de primeiros socorros pode ser utilizado? + + + Condition PAK + Podmínka osobní lékárničky + + + When can the Personal Aid Kit be used? + Kde může být použita osobní lékárnička? + + + Anywhere + Где угодно + Wszędzie + Donde sea + Überall + Kdekoliv + Qualquer lugar + + + Medical vehicles + В медицинском транспорте + Pojazdy medyczne + Vehiculos médicos + Medizinische Fahrzeuge + Zdravotnická vozidla + Veículos médcos + + + Medical facility + В госпитале + Budynki medyczne + Centro médico + Medizinische Einrichtungen + Zdravotnické zařízení + Instalação médica + + + Vehicles & facility + В транспорте и госпитале + Pojazdy i budynki medyczne + Vehículos y centros + Fahrzeuge & Einrichtungen + Vozidla a zařízení + Veículos e instalações + + + Disabled + Отключено + Wyłączone + Desactivado + Deaktiviert + Zakázáno + Desativado + + + Allow Surgical kit (Adv) + Разрешить хирургический набор (усл.) + Ust. zestawu chirurg. + Permitir equipo quirúrgico (Avanzado) + Erlaube Operationskasten + Povolit chirurgickou soupravu (Pokr.) + Permite kit cirúrgico (avançado) + + + Who can use the surgical kit? + Кто может использовать хирургический набор? + Kto może skorzystać z zestawu chirurgicznego w celu zszycia ran? + ¿Quién puede utilizar el equipo quirúrgico? + Wer kann den Operationskasten verwenden? + Kdo může použít chirurgickou soupravu? + Quem pode usar o kit cirúrgico? + + + Remove Surgical kit (Adv) + Удалять хирургический набор (усл.) + Usuń zest. chir. po użyciu + Eliminar equipo quirúrgico (Avanzado) + Enrtferne Operationskasten (erweitert) + Odebrat chirurgickou soupravu (Pokr.) + Remover kit cirúrgico (avançado) + + + Should Surgical kit be removed on usage? + Нужно ли удалять хирургический набор после использования? + Czy zestaw chirurgiczny powinien zniknąć z ekwipunku po jego użyciu? + Eliminar el equipo quirúrgico después del uso + Entferne Operationskästen bei Verwendung? + Odebrat chirurgickou soupravu po použití? + Deve o kit cirúrgico ser removido após o uso? + + + Locations Surgical kit (Adv) + Место использования хирургического набора (усл.) + Ogr. zestawu chirurg. + Ubicaciones del equipo quirúrgico (Avanzado) + Orte für Operationskästen (erweitert) + Lokace chirurgické soupravy (Pokr.) + Localizações do kit cirúrgico (avançado) + + + Where can the Surgical kit be used? + Где может использоваться хирургический набор? + Gdzie można korzystać z zestawu chirurgicznego? + Dónde se puede utilizar el equipo quirúrgico + Wo kann der Operationskasten verwendet werden? + Kde může být použita chirurgická souprava? + Onde o kit cirúrgico pode ser utilizado? + + + Condition Surgical kit (Adv) + Podmínka chirurgické soupravy (Pokr.) + + + When can the Surgical kit be used? + Kde může být použita chirurgická souprava? + + + Bloodstains + Blutflecken + Plamy krwi + Skvrny od krve + Manchas de sangre + Manchas de sangue + + + Bandaging removes bloodstains + Bandagieren entfernt Blutflecken + Bandażowanie usuwa ślady krwi + Obvázání odstraňuje skvrny od krve + El vendaje elimina las manchas de sangre + Bandagem remove manchas de sangue + + + Pain suppression + Schmerzunterdrückung + Zwalczanie bólu + Potlačení bolesti + Supresión del dolor + Supressão de dor + + + Pain is only temporarily suppressed, not removed + Schmerzen werden nur vorübergehend unterdrückt, nicht entfernt + Ból jest tylko tymczasowo zwalczany, nie jest usuwany trwale + Bolest je potlačena, ale jen dočastně + El dolor se suprime solo temporalmente, no se elimina. + Dor é somente temporáriamente suprimida, não removida + + + Configure the treatment settings from ACE Medical + Настройка лечения в медицинской системе ACE + Skonfiguruj zaawansowane ustawienia leczenia systemu medycznego ACE + Configure las opciones de tratamiento del ACE Médico + Behandlungseinstellungen vom ACE-Medical konfigurieren + Konfigurace nastavení léčby ze zdravotnické systému ACE + Configure as opções de tratamento do ACE Médico + + + Revive Settings [ACE] + Настройки реанимации [ACE] + Ustawienia wskrzeszania [ACE] + Sistema de resucitado [ACE] + Wiederbelebungseinstellungen [ACE] + Nastavení oživení [ACE] + Sistema de reavivamento [ACE] + + + Enable Revive + Включить реанимацию + Aktywuj wskrzeszanie + Habilitar resucitado + Erlaube Wiederbelebung + Povolit oživení + Habilitar reavivamento + + + Enable a basic revive system + Включить базовую систему реанимации + Aktywuj podstawowy system wskrzeszania + Habilitar un sistema básico de resucitado + Aktiviere Standard-Wiederbelebungssystem + Povolit základní systém oživení + Habilitar um sistema básico de reavivamento + + + Max Revive time + Макс. время реанимации + Maks. czas agonii + Tiempo máximo de resucitado + Maximale Wiederbelebungszeit + Maximální čas pro oživení + Tempo máximo de reavivamento + + + Max amount of seconds a unit can spend in revive state + Максимальное время в секундах, в течение которого бойца можно реанимировать + Maksymalna długość agonii w sekundach (czas na wskrzeszenie) + Cantidad máxima de segundos que una unidad puede gastar en estado de resucitación + Maximale Zeitspanne in Sekunden die eine Einheit im Wiederbelebungszustand verbringen kann + Maximální doba v agónii v sekundách + Quantidade máxima de segundos que uma unidade pode gastar em um estado de reavivamento + + + Max Revive lives + Макс. кол-во жизней + Maks. ilość wskrzeszeń + Vidas máximas de resucitado + Maximale Leben bei Wiederbelebung + Maximální počet oživení + Vidas máximas do reavivado + + + Max amount of lives a unit. 0 or -1 is disabled. + Максимальное количество жизней у бойца. Чтобы отключить, укажите 0 или -1. + Maksymalna ilość wskrzeszeń. Wpisz 0 lub -1 aby wyłączyć. + Cantidad máxima de vidas por unidad. 0 o -1 es desactivado. + Maximale Anzahl von Leben einer Einheit. 0 or -1 bedeutet deaktiviert. + Maximální počet životu pro jednotku. 0 nebo -1 je zakázáno. + Quantidade máxima de vidas por unidade. 0 ou -1 é desativado. + + + Provides a medical system for both players and AI. + Включает медицинскую систему как для игроков, так и для ботов. + Moduł ten aktywuje podstawowy system wskrzeszania. Jednostka po otrzymaniu śmiertelnych obrażeń przechodzi do stanu agonii, która trwa określoną długość czasu. W tym czasie aby wskrzesić i jednocześnie odratować jednostkę należy opatrzeć jej rany i wykonać RKO. + Proporciona un sistema médico para jugadores e IA. + Aktiviert das Medicsystem für Spieler und KI. + Poskytuje zdravotní systém pro hráče a AI. + Proporciona um sistema médico para jogadores e IA. + + + Set Medic Class [ACE] + Сделать медиком [ACE] + Ustaw klasę medyka [ACE] + Establecer case médica [ACE] + Setze Sanitäterklassen [ACE] + Určit třídu medika [ACE] + Definir classe médica [ACE] + + + List + Список + Lista + Lista + Liste + Seznam + Lista + + + List of unit names that will be classified as medic, separated by commas. + Список имен юнитов, которые будут считаться медиками (через запятую). + Lista nazw jednostek, które są sklasyfikowane jako medycy, oddzielone przecinkami. + Lista de los nombres de las unidades que se clasifican como médico, separados por comas. + Liste von Namen, die als Sanitäter verwendet werden. Wird durch Kommas getrennt. + Seznam osob které budou klasifikovány jako zdravotník, oddělené čárkami. + Lista dos nomes das unidades que se classificam como médicos, separados por vírgulas. + + + Is Medic + Является медиком + Klasa medyczna + Es médico + Ist Sanitäter + Je zdravotník + É médico + + + + + Moduł ten pozwala przypisać klasę medyczną wybranym jednostkom. + Dieses Modul legt fest welche Einheit ein Sanitäter ist. + Tento modul určuje, která jednotka je zdravotník. + Este módulo determina qual unidade é um paramédico. + + + None + Нет + Żadna + Nada + Keine + Žádný + Nada + + + Regular medic + Обычный медик + Zwykły medyk + Médico regular + Normaler Sanitäter + Řadový zdravotník + Médico regular + + + Doctor (Only Advanced Medics) + Врач (только усложн.) + Doktor (tylko zaawansowani medycy) + Doctor (Solo medicina avanzada) + Arzt (nur erweiterte Sanitäter) + Doktor (Pouze pokročilý zdravotníci) + Doutor (Somente médicos avançados) + + + Assigns the ACE medic class to a unit + Задает юниту класс медика + Moduł ten przypisuje klasę medyka ACE do jednostek. + Asigna la clase médico ACE a una unidad + Weise die ACE-Sanitäterklasse einer Einheit zu + Přiřadí ACE třídu zdravotníka do jednotky + Atribui a classe médica do ACE a uma unidade + + + Set Medical Vehicle [ACE] + Сделать мед. транспортом [ACE] + Ustaw pojazd medyczny [ACE] + Establecer vehículos médicos [ACE] + Setze medizinisches Fahrzeug [ACE] + Určit zdravotnické vozidlo [ACE] + Definir veículo médico [ACE] + + + List + Список + Lista + Lista + Liste + Seznam + Lista + + + List of vehicles that will be classified as medical vehicle, separated by commas. + Список транспортных средств, которые будут считаться медицинским транспортом (через запятую). + 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. + 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. + + + Is Medical Vehicle + Является мед. транспортом + Jest pojazdem med. + Es vehículo médico + Ist medizinisches Fahrzeug + Je zdravotnické vozidlo + É um veículo médico + + + Whatever or not the objects in the list will be a medical vehicle. + Будут ли объекты в списке считаться медицинским транспортом. + 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. + Se serão ou não os objetos dessa lista veículos médicos. + + + Assigns the ACE medic class to a unit + Задает юниту класс медика + Moduł ten pozwala na przypisanie danym pojazdom statusu pojazdów medycznych. Wewnątrz takiego pojazdu można wykonywać zaawansowane zabiegi medyczne. + Asigna la clase médico ACE a una unidad + Weist die ACE-Sanitäterklasse einer Einheit zu + Přiřadí ACE třídu zdravotníka do jednotky + Atribui a classe médica ACE a uma unidade + + + Set Medical Facility [ACE] + Сделать госпиталем [ACE] + Ustaw budynek medyczny [ACE] + Establece el centro médico [ACE] + Setze medizinische Einrichtung [ACE] + Určit zdravotnické zařízení [ACE] + Definir instalação médica [ACE] + + + Is Medical Facility + Является госпиталем + Jest budynkiem med. + Es centro médico + Ist eine medizinische Einrichtung + Je zdravotnické zařízení + É uma instalação médica + + + Registers an object as a medical facility + Определяет объект в качестве госпиталя + Przypisuje danemu obiektowi status budynku medycznego + Registra un objeto como un centro médico + Definiert ein Objekt als medizinische Einrichtung + Registruje objekt jako zdravotnické zařízení + Registra um objeto como instalacão médica + + + Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. + Определяет объект в качестве госпиталя. Позволяет оказывать более сложную помощь. Может применяться к зданиям и технике. + Moduł ten pozwala przypisać status budynku medycznego danemu obiektowi. Budynek taki pozwala na wykonywanie zaawansowanych zabiegów medycznych. Może być użyte na pojazdach i budynkach. + Define un objeto como un centro médico. Esto permite tratamientos más avanzados. Se puede utilizar en edificios y vehículos. + Definiert ein Objekt als medizinische Einrichtung. Das ermöglicht weitere Behandlungen. Kann bei Gebäuden und Fahrzeugen verwendet werden. + Definuje objekt jako zdravotnické zařízení. To umožňuje více pokročilé léčení. Může být použito na budovy nebo na vozidla. + Define um objeto como instalação médica. Isso permite tratamentos mais avançados. Pode ser utilizado em edifícios e veículos. + + + [ACE] Medical Supply Crate (Basic) + [ACE] Ящик с медикаментами (базовая медицина) + [ACE] Skrzynka z zapasami medycznymi (podstawowa) + [ACE] Caja de suministros médicos (Básica) + [ACE] Medizinische Kiste (standard) + [ACE] Zdravotnické zásoby (základní) + [ACE] Caixa com suprimentos médicos + + + [ACE] Medical Supply Crate (Advanced) + [ACE] Ящик с медикаментами (усложн. медицина) + [ACE] Skrzynka z zapasami medycznymi (zaawansowana) + [ACE] Caja de suministros médicos (Avanzada) + [ACE] Medizinische Kiste (erweitert) + [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 + + + Stable + Stabilní \ No newline at end of file diff --git a/addons/medical/ui/RscTitles.hpp b/addons/medical/ui/RscTitles.hpp index dece0e0a8d..06d1dda866 100644 --- a/addons/medical/ui/RscTitles.hpp +++ b/addons/medical/ui/RscTitles.hpp @@ -60,7 +60,7 @@ class Rsctitles { font = "PuristaMedium"; 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 = "$STR_ACE_Medical_Injuries"; + text = CSTRING(Injuries); }; class InjuryList: ACE_gui_listBoxBase { idc = 200; diff --git a/addons/medical/ui/triagecard.hpp b/addons/medical/ui/triagecard.hpp index c4d3145964..f8b0b21a71 100644 --- a/addons/medical/ui/triagecard.hpp +++ b/addons/medical/ui/triagecard.hpp @@ -49,7 +49,7 @@ class GVAR(triageCard) { font = "PuristaMedium"; colorText[] = {0,0,0,1}; colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_Medical_Actions_TriageCard"; + text = CSTRING(Actions_TriageCard); }; class TriageList: ACE_gui_listBoxBase { idc = 200; @@ -103,7 +103,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_Medical_Triage_Status_None; + text = CSTRING(Triage_Status_None); style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -121,7 +121,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_Medical_Triage_Status_Minor; + text = CSTRING(Triage_Status_Minor); style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -139,7 +139,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_Medical_Triage_Status_Delayed; + text = CSTRING(Triage_Status_Delayed); style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -157,7 +157,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_Medical_Triage_Status_Immediate; + text = CSTRING(Triage_Status_Immediate); style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; @@ -175,7 +175,7 @@ class GVAR(triageCard) { y = 0; w = 0; h = 0; - text = $STR_ACE_Medical_Triage_Status_Deceased; + text = CSTRING(Triage_Status_Deceased); style = 0x02; size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; diff --git a/addons/microdagr/ACE_Settings.hpp b/addons/microdagr/ACE_Settings.hpp new file mode 100644 index 0000000000..db175e7303 --- /dev/null +++ b/addons/microdagr/ACE_Settings.hpp @@ -0,0 +1,7 @@ +class ACE_Settings { + class GVAR(MapDataAvailable) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 0; + }; +}; \ No newline at end of file diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index 833f7bd2f6..49f7a0e65c 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -3,48 +3,38 @@ class CfgVehicles { class CAManBase: Man { class ACE_SelfActions { class ACE_Equipment { - class GVAR(show) { - //Opens the mini map - displayName = "$STR_ACE_microdagr_show"; - condition = QUOTE(([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DISPLAY}); - statement = QUOTE([DISPLAY_MODE_DISPLAY] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.2; - icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; - }; class GVAR(configure) { //Opens the dialog - displayName = "$STR_ACE_microdagr_configure"; + displayName = CSTRING(configure); condition = QUOTE(([DISPLAY_MODE_DIALOG] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DIALOG}); statement = QUOTE([DISPLAY_MODE_DIALOG] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.1; icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; - }; - class GVAR(close) { - displayName = "$STR_ACE_microdagr_closeUnit"; - condition = QUOTE(GVAR(currentShowMode) != DISPLAY_MODE_CLOSED); - statement = QUOTE([DISPLAY_MODE_CLOSED] call FUNC(openDisplay)); - showDisabled = 0; - priority = 0.3; - icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + class GVAR(show) { + //Opens the mini map + displayName = CSTRING(show); + condition = QUOTE(([DISPLAY_MODE_DISPLAY] call FUNC(canShow)) && {GVAR(currentShowMode) != DISPLAY_MODE_DISPLAY}); + statement = QUOTE([DISPLAY_MODE_DISPLAY] call FUNC(openDisplay)); + icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + }; + class GVAR(close) { + displayName = CSTRING(closeUnit); + condition = QUOTE(GVAR(currentShowMode) != DISPLAY_MODE_CLOSED); + statement = QUOTE([DISPLAY_MODE_CLOSED] call FUNC(openDisplay)); + icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; + }; }; }; }; }; - class Logic; - class Module_F: Logic { - class ArgumentsBaseUnits {}; - class ModuleDescription {}; - }; - class GVAR(dagrModule): Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class GVAR(dagrModule): ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "MicroDAGR Map Fill"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleMapFill); scope = 2; isGlobal = 1; @@ -52,25 +42,38 @@ class CfgVehicles { functionPriority = 0; class Arguments { class MapDataAvailable { - displayName = "MicroDAGR Map Fill"; // Argument label - description = "How much map data is filled on MicroDAGR's "; // Tooltip description - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + displayName = CSTRING(MapDataAvailable_DisplayName); + description = CSTRING(MapDataAvailable_Description); + typeName = "NUMBER"; class values { - class None {name = "Full Satellite + Buildings"; value = MAP_DETAIL_SAT; default = 1;}; - class Side {name = "Topographical + Roads"; value = MAP_DETAIL_TOPOROADS;}; - class Unique {name = "None (Cannot use map view)"; value = MAP_DETAIL_NONE;}; + 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 ModuleDescription: ModuleDescription { - description = "Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap.
Source: microDAGR.pbo"; + class ModuleDescription { + description = CSTRING(Module_Description); }; }; - + class Box_NATO_Support_F; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { MACRO_ADDITEM(ACE_microDAGR,10); }; }; + + class Item_Base_F; + class ACE_microDAGR_Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = CSTRING(itemName); + author = ECSTRING(common,ACETeam); + vehicleClass = "Items"; + icon = QUOTE(PATHTOF(UI\icon_microDAGR.paa)); + class TransportItems { + MACRO_ADDITEM(ACE_microDAGR,1); + }; + }; }; diff --git a/addons/microdagr/CfgWeapons.hpp b/addons/microdagr/CfgWeapons.hpp index 73615ea6b6..9776f1c615 100644 --- a/addons/microdagr/CfgWeapons.hpp +++ b/addons/microdagr/CfgWeapons.hpp @@ -3,10 +3,10 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_microDAGR: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; - displayName = "$STR_ACE_microdagr_itemName"; - descriptionShort = "$STR_ACE_microdagr_itemDescription"; + displayName = CSTRING(itemName); + descriptionShort = CSTRING(itemDescription); picture = QUOTE(PATHTOF(images\microDAGR_item.paa)); class ItemInfo: InventoryItem_Base_F { mass = 2; diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index 587bf85ef5..2d33969b56 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -3,33 +3,21 @@ if (!hasInterface) exitWith {}; -//Add Keybinds: -["ACE3 Equipment", QGVAR(openGPS), (localize "STR_ACE_microdagr_toggleUnit"), -{ - // canInteractWith (can use on map) - if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!("ACE_microDAGR" in (items ace_player))) exitWith {false}; - +//Add deviceKey entry: +private ["_conditonCode", "_toggleCode", "_closeCode"]; +_conditonCode = { + ("ACE_microDAGR" in (items ACE_player)) +}; +_toggleCode = { + if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {}; [] call FUNC(openDisplay); //toggle display mode - true; -}, -{false}, -[0xC7, [false, false, false]], false] call cba_fnc_addKeybind; //Home Key +}; +_closeCode = { + if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {}; + [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); +}; +[(localize LSTRING(itemName)), QUOTE(PATHTOF(images\microDAGR_item.paa)), _conditonCode, _toggleCode, _closeCode] call EFUNC(common,deviceKeyRegisterNew); -["ACE3 Equipment", QGVAR(closeGPS), (localize "STR_ACE_microdagr_closeUnit"), -{ - // canInteractWith (can use on map) - if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // Conditions: specific - if (!("ACE_microDAGR" in (items ace_player))) exitWith {false}; - if (GVAR(currentShowMode) == DISPLAY_MODE_CLOSED) exitWith {false}; - - [DISPLAY_MODE_CLOSED] call FUNC(openDisplay); //close unit - true; -}, -{false}, -[0xC7, [false, true, false]], false] call cba_fnc_addKeybind; //CTRL + Home Key //Add Eventhandler: ["RangerfinderData", {_this call FUNC(recieveRangefinderData)}] call EFUNC(common,addEventHandler); diff --git a/addons/microdagr/config.cpp b/addons/microdagr/config.cpp index 4e459c126c..7a39df8980 100644 --- a/addons/microdagr/config.cpp +++ b/addons/microdagr/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {}; + units[] = {"ACE_microDAGR_Item"}; weapons[] = {"ACE_microDAGR"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; @@ -16,11 +16,4 @@ class CfgPatches { #include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "gui.hpp" - -class ACE_Settings { - class GVAR(MapDataAvailable) { - value = 2; - typeName = "SCALAR"; - isClientSettable = 0; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/microdagr/functions/fnc_canShow.sqf b/addons/microdagr/functions/fnc_canShow.sqf index b251a65c10..9e54f927e0 100644 --- a/addons/microdagr/functions/fnc_canShow.sqf +++ b/addons/microdagr/functions/fnc_canShow.sqf @@ -26,11 +26,11 @@ 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"]] call EFUNC(common,canInteractWith)}; + _returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; }; 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"]] call EFUNC(common,canInteractWith)}; + _returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}; }; }; diff --git a/addons/microdagr/functions/fnc_showApplicationPage.sqf b/addons/microdagr/functions/fnc_showApplicationPage.sqf index a9e6d10db7..3c042fdff3 100644 --- a/addons/microdagr/functions/fnc_showApplicationPage.sqf +++ b/addons/microdagr/functions/fnc_showApplicationPage.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_display", "_daylight", "_theMap", "_mapSize"]; +private ["_display", "_theMap", "_mapSize"]; disableSerialization; @@ -27,10 +27,6 @@ if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { }; if (isNull _display) exitWith {ERROR("No Display");}; -//Fade "shell" at night -_daylight = 0.05 max (((1 - overcast)/2 + ((1 - cos (daytime * 360/24)) / 4)) * (linearConversion [0, 1, sunOrMoon, (0.25 * moonIntensity), 1])); -(_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1]; - //TopBar (_display displayCtrl IDC_RANGEFINDERCONNECTEDICON) ctrlShow (GVAR(currentWaypoint) == -2); @@ -88,10 +84,10 @@ if (GVAR(currentApplicationPage) == APP_MODE_MARK) then { if ((count GVAR(newWaypointPosition)) == 0) then { - (_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText (localize "STR_ACE_microdagr_wpEnterCords"); + (_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText (localize LSTRING(wpEnterCords)); (_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText ""; } else { - (_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText format [(localize "STR_ACE_microdagr_wpEnterName"), mapGridPosition GVAR(newWaypointPosition)]; + (_display displayCtrl IDC_MODEMARK_HEADER) ctrlSetText format [(localize LSTRING(wpEnterName)), mapGridPosition GVAR(newWaypointPosition)]; (_display displayCtrl IDC_MODEMARK_CORDSEDIT) ctrlSetText format ["[%1]", mapGridPosition GVAR(newWaypointPosition)]; }; ctrlSetFocus (_display displayCtrl IDC_MODEMARK_CORDSEDIT); diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 26e5ef8638..7e2a1ad53e 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_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", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"]; disableSerialization; _display = displayNull; @@ -26,6 +26,10 @@ if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then { }; if (isNull _display) exitWith {ERROR("No Display");}; +//Fade "shell" at night +_daylight = [] call EFUNC(common,ambientBrightness); +(_display displayCtrl IDC_MICRODAGRSHELL) ctrlSetTextColor [_daylight, _daylight, _daylight, 1]; + (_display displayCtrl IDC_CLOCKTEXT) ctrlSetText ([daytime, "HH:MM"] call bis_fnc_timeToString); _waypoints = [] call FUNC(deviceGetWaypoints); @@ -181,18 +185,18 @@ case (APP_MODE_SETUP): { _settingListBox = _display displayCtrl IDC_MODESETTINGS; lbClear _settingListBox; - _settingListBox lbAdd (localize "STR_ACE_microdagr_settingUseMils"); + _settingListBox lbAdd (localize LSTRING(settingUseMils)); if (GVAR(settingUseMils)) then { - _settingListBox lbSetTextRight [0, (localize "STR_ACE_microdagr_settingMils")]; + _settingListBox lbSetTextRight [0, (localize LSTRING(settingMils))]; } else { - _settingListBox lbSetTextRight [0, (localize "STR_ACE_microdagr_settingDegrees")]; + _settingListBox lbSetTextRight [0, (localize LSTRING(settingDegrees))]; }; - _settingListBox lbAdd (localize "STR_ACE_microdagr_settingShowWP"); + _settingListBox lbAdd (localize LSTRING(settingShowWP)); if (GVAR(settingShowAllWaypointsOnMap)) then { - _settingListBox lbSetTextRight [1, (localize "STR_ACE_microdagr_settingOn")]; + _settingListBox lbSetTextRight [1, (localize LSTRING(settingOn))]; } else { - _settingListBox lbSetTextRight [1, (localize "STR_ACE_microdagr_settingOff")]; + _settingListBox lbSetTextRight [1, (localize LSTRING(settingOff))]; }; }; }; diff --git a/addons/microdagr/gui_controls.hpp b/addons/microdagr/gui_controls.hpp index 9d73393e08..50e9083ed6 100644 --- a/addons/microdagr/gui_controls.hpp +++ b/addons/microdagr/gui_controls.hpp @@ -172,7 +172,7 @@ class controls { class Controls { class MGRSNew: GVAR(RscText) { idc = -1; - text = "$STR_ACE_microdagr_controlMGRS"; + text = CSTRING(controlMGRS); x = W_PART(0.5); y = H_PART(0); w = W_PART(10); @@ -182,7 +182,7 @@ class controls { class WGD: GVAR(RscText) { idc = -1; style = ST_RIGHT; - text = "$STR_ACE_microdagr_controlWGD"; + text = CSTRING(controlWGD); x = W_PART(14.5); y = H_PART(0); w = W_PART(10); @@ -345,7 +345,7 @@ class controls { }; class TargetRangeText: GVAR(RscText) { idc = -1; - text = "$STR_ACE_microdagr_controlRange"; + text = CSTRING(controlRange); x = W_PART(0.5); y = H_PART(2); w = W_PART(7.5); @@ -408,7 +408,7 @@ class controls { class CompassHeader: GVAR(RscText) { idc = -1; style = ST_CENTER; - text = "$STR_ACE_microdagr_compasDirection"; + text = CSTRING(compasDirection); x = W_PART(0); y = H_PART(0); w = W_PART(25); @@ -513,7 +513,7 @@ class controls { class TextTL: GVAR(RscText) { idc = -1; style = ST_CENTER; - text = "$STR_ACE_microdagr_menuMark"; + text = CSTRING(menuMark); x = W_PART(0); y = H_PART(7.5); w = W_PART(14); @@ -521,17 +521,17 @@ class controls { sizeEx = H_PART(1.2); }; class TextTR: TextTL { - text = "$STR_ACE_microdagr_menuWaypoints"; + text = CSTRING(menuWaypoints); x = W_PART(11); y = H_PART(7.5); }; class TextBL: TextTL { - text = "$STR_ACE_microdagr_menuConnectTo"; + text = CSTRING(menuConnectTo); x = W_PART(0); y = H_PART(16.5); }; class TextBR: TextTL { - text = "$STR_ACE_microdagr_menuSettings"; + text = CSTRING(menuSettings); x = W_PART(11); y = H_PART(16.5); }; @@ -678,7 +678,7 @@ class controls { class ButtonSetWP: RscButton { idc = -1; - text = "$STR_ACE_microdagr_waypointsSet"; + text = CSTRING(waypointsSet); x = W_PART(1); y = H_PART(17); w = W_PART(7); @@ -693,12 +693,12 @@ class controls { onbuttonclick = QUOTE(_this call FUNC(appWaypointsButtonSetWP)); }; class ButtonAdd: ButtonSetWP { - text = "$STR_ACE_microdagr_waypointsAdd"; + text = CSTRING(waypointsAdd); x = W_PART(9); onbuttonclick = QUOTE([APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode)); }; class ButtonDelete: ButtonSetWP { - text = "$STR_ACE_microdagr_waypointsDelete"; + text = CSTRING(waypointsDelete); x = W_PART(17); onbuttonclick = QUOTE(_this call FUNC(appWaypointsButtonDeleteWP)); }; diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index 09c96705b4..7d3ac64af5 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -1,7 +1,7 @@  - - + + MicroDAGR GPS MicroDAGR GPS GPS MicroDAGR @@ -10,10 +10,10 @@ MicroDAGR GPS MicroDAGR GPS MicroDAGR GPS - MicroDAGR GPS + GPS MicroDAGR GPS MicroDAGR - + MicroDAGR advanced GPS receiver MicroDAGR - Fortgeschrittener GPS-Empfänger Receptor avanzado GPS MicroDAGR @@ -22,10 +22,10 @@ Récepteur GPS MicroDAGR MicroDAGR pokročílá GPS příjímač MicroDAGR fejlett GPS vevőegység - MicroDAGR ricevitore GPS avanzato + Ricevitore GPS avanzato MicroDAGR Recepitor GPS avançado MicroDAGR - + Angular Unit: Unidad angular: Угловые единицы: @@ -37,7 +37,7 @@ Unità angolare: Unidade Angular: - + Mils Mil Mils @@ -46,10 +46,10 @@ Mils Mils Mil - Miglia + Mils Mils: - + Show Waypoints On Map: Zeige Wegpunkte auf Karte Mostrar puntos de ruta en el mapa: @@ -61,7 +61,7 @@ Mostra waypoint sulla mappa: Mostrar Waypoints no mapa: - + Degrees Grad Grados @@ -73,7 +73,7 @@ Gradi Graus - + On Zapnuto Allumé @@ -85,7 +85,7 @@ Encendido Be - + Off Vypnuto Eteint @@ -97,7 +97,7 @@ Apagado Ki - + Enter Grid Cords: Introducir coordenadas de cuadrícula: Введите сеточные координаты: @@ -109,7 +109,7 @@ Introduci griglia coordinate: Digite as Ccords. do Grid - + Name of [%1] Name von [%1] Nombre de [%1] @@ -121,7 +121,7 @@ Nome di [%1] Nome do [%1] - + MGRS-New UTMREF-NEU Nuevo-MGRS @@ -133,7 +133,7 @@ Nuovo MGRS MGRS-Novo - + WGD WGD WGD @@ -145,7 +145,7 @@ WGD WGD - + Range: Distancia: Distanz: @@ -157,7 +157,7 @@ Distanza: Distância: - + Compass Direction Kompass Richtung Dirección de la brújula @@ -169,7 +169,7 @@ Azimut Direção na bússula - + Mark Markieren Marca @@ -181,7 +181,7 @@ Marca Marca - + Waypoints Puntos de ruta Wegpunkte @@ -193,7 +193,7 @@ waypoints Waypoints - + Connect To Conectar a Подключиться к @@ -205,7 +205,7 @@ Collega a Conectar à - + Settings Paramètres Einstellungen @@ -217,10 +217,10 @@ Impostaizoni Opções - + SetWP WP setzen - Establecer PR + Fijar PR Установить МТ Nastavit WP UstawPT @@ -229,7 +229,7 @@ Definisci WayPoints Definir WP - + Add Hinzufügen Añadir @@ -241,7 +241,7 @@ Aggiungi Adicionar - + Delete Smazat Supprimer @@ -253,7 +253,7 @@ Borrar Törlés - + Toggle MicroDAGR Display Mode MicoDAGR Anzeigemodus wechseln Cambiar modo de pantalla del MicroDAGR @@ -265,41 +265,95 @@ Alterna modalità display MicroDAGR Alternar Modo de Display do MicroDAGR - + Show MicoDAGR Zeige MicroDAGR Mostrar MicroDAGR Показать MicroDAGR - Ukázat MicroDAGR GPS + Ukázat MicroDAGR Pokaż MicroDAGR Afficher MicroDAGR MicroDAGR mutatása Mostra MicroDAGR Mostrar MicroDAGR - + Configure MicroDAGR Konfiguriere MicroDAGR Configurar MicroDAGR Настроить MicroDAGR - Konfigurovat MicroDAGR GPS + Konfigurovat MicroDAGR Konfiguruj MicroDAGR Configurer MicroDAGR MicroDAGR konfigurálása ConfiguraMicroDAGR Configurar MicroDAGR - + Close MicroDAGR Schließe MicroDAGR Cerrar MicroDAGR Закрыть MicroDAGR - Zavřít MicroDAGR GPS + Zavřít MicroDAGR Zamknij MicroDAGR Fermer MicroDAGR MicroDAGR elrejtése Chiudi MicroDAGR Fechar MicroDAGR + + MicroDAGR Map Fill + Wypełnienie mapy MicroDAGR + Relleno del mapa MicroDAGR + MicroDAGR - Vyplnění mapy + Preenchimento de mapa do MicroDAGR + + + MicroDAGR Map Fill + Wypełnienie mapy MicroDAGR + Relleno del mapa MicroDAGR + MicroDAGR - Vyplnění mapy + Preenchimento de mapa do MicroDAGR + + + How much map data is filled on MicroDAGR's + Jak duża część informacji mapy jest załadowana do MicroDAGR? + Cuanta información está disponible en el mapa del MicroDAG + Wie viel Daten auf einem MicroDAGR zu sehen sind + 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 + Satellitenbild + Gebäude + Satelit + Budovy + Satélite completo + Edifícios + + + Topographical + Roads + Topograficzna + drogi + Topografico + Carreteras + Topografisch + Straßen + Topografické + Cesty + Topográfico + Estradas + + + None (Cannot use map view) + Żadna (wyłącza ekran mapy) + Nada (No se puede el mapa) + Keine (kann keine Kartenansicht verwenden) + Žádný (Nelze použít zobrazení mapy) + Nada (Não pode usar a tela de mapa) + + + Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap.<br />Source: microDAGR.pbo + Moduł ten pozwala kontrolować jak duża ilość informacji jest załadowana do przedmiotów MicroDAGR. Mniejsza ilość danych ogranicza widok mapy pokazując mniej rzeczy na minimapie.<br />Źródło: microDAGR.pbo + Controla la cantidad de información disponible en el microDAGR. Menos datos limitan la vista del mapa a mostrar menos en el minimapa.<br />Fuente: microDAGR.pbo + Steuert wie viel Daten auf dem microDAGR zu sehen ist. Weniger Daten schränken die Kartenansicht ein, um mehr auf der Minimap zu sehen.<br />Quelle: microDAGR.pbo + Tento modul umožňuje kontrolovat, kolik informací je obsaženo v MicroDAGR. Menší množství dat omezené zobrazením mapy ukazují méně věcí na minimapě.<br />Zdroj: microDAGR.pbo + 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/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index d489ef15f3..2ec3326a98 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -3,8 +3,8 @@ class ACE_Settings { value = 2; typeName = "SCALAR"; isClientSettable = 1; - displayName = "$STR_ACE_MissileGuidance"; - description = "$STR_ACE_MissileGuidance_Desc"; - values[] = {"Off", "Player Only", "Player and AI"}; + displayName = CSTRING(Title); + description = CSTRING(Desc); + values[] = {CSTRING(Off), CSTRING(PlayerOnly), CSTRING(PlayerAndAi)}; }; }; \ No newline at end of file diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 680a410506..779d2a82eb 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -69,19 +69,19 @@ class CfgAmmo { }; class ACE_Hydra70_DAGR : M_PG_AT { - displayName = "$STR_ACE_Hydra70_DAGR"; - displayNameShort = "$STR_ACE_Hydra70_DAGR_Short"; + displayName = CSTRING(Hydra70_DAGR); + displayNameShort = CSTRING(Hydra70_DAGR_Short); - description = "$STR_ACE_Hydra70_DAGR"; - descriptionShort = "$STR_ACE_Hydra70_DAGR_Desc"; + description = CSTRING(Hydra70_DAGR_Desc); + descriptionShort = CSTRING(Hydra70_DAGR_Desc); }; class ACE_Hellfire_AGM114K : ACE_Hydra70_DAGR { - displayName = "$STR_ACE_Hellfire_AGM114K"; - displayNameShort = "$STR_ACE_Hellfire_AGM114K_Short"; + displayName = CSTRING(Hellfire_AGM114K); + displayNameShort = CSTRING(Hellfire_AGM114K_Short); - description = "$STR_ACE_Hellfire_AGM114K_desc"; - descriptionShort = "$STR_ACE_Hellfire_AGM114K_desc"; + description = CSTRING(Hellfire_AGM114K_desc); + descriptionShort = CSTRING(Hellfire_AGM114K_desc); // @TODO: placeholder model to at least make it look different model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; @@ -94,47 +94,59 @@ class CfgAmmo { }; // Titan - class M_Titan_AT : MissileBase { + class M_Titan_AT : MissileBase {}; + + class ACE_Javelin_FGM148: M_Titan_AT { irLock = 0; laserLock = 0; airLock = 0; // Turn off arma crosshair-guidance manualControl = 0; - + hit = 1400; // default: 800 indirectHit = 20; indirectHitRange = 2; // ACE uses these values //trackOversteer = 1; //trackLead = 0; - + + initTime = 2; + // Begin ACE guidance Configs class ADDON { enabled = 1; - + minDeflection = 0.00005; // Minium flap deflection for guidance maxDeflection = 0.025; // Maximum flap deflection for guidance incDeflection = 0.00005; // The incrmeent in which deflection adjusts. - + canVanillaLock = 0; - + // Guidance type for munitions defaultSeekerType = "Optic"; - seekerTypes[] = { "Optic" }; - + seekerTypes[] = { "Optic" }; + defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; - + seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier - + seekerMinRange = 0; seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - + // Attack profile type selection defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; }; }; -}; \ No newline at end of file + class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 { + //Take config changes from (M_Titan_AT_static: M_Titan_AT) + initTime = 0.25; //"How long (in seconds) the projectile waits before starting it's engine.", - but doesn't seem to do anything + effectsMissileInit = "RocketBackEffectsStaticRPG"; + class ADDON: ADDON { + enabled = 1; + }; + }; +}; diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp index 0d9ef54d07..5069556078 100644 --- a/addons/missileguidance/CfgVehicles.hpp +++ b/addons/missileguidance/CfgVehicles.hpp @@ -20,6 +20,7 @@ class CfgVehicles { class ACE_Comanche_Test : B_Heli_Attack_01_F { scope = 1; + scopeCurator = 0; displayName = "ACE_Comanche_Test"; author = "ACE Team"; class Library { diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index 42b849b902..591a4f1c5e 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -2,7 +2,7 @@ class CfgPatches { class ADDON { - units[] = {}; + units[] = {"ACE_Comanche_Test"}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_laser"}; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index 614323d63f..78f48250dd 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -24,7 +24,7 @@ _seekerParams = _args select 3; _stateParams = _args select 4; _lastRunTime = _stateParams select 0; -_runtimeDelta = diag_tickTime - _lastRunTime; +_runtimeDelta = ACE_diagTime - _lastRunTime; _adjustTime = 1; if(accTime > 0) then { @@ -100,7 +100,7 @@ _PS setDropInterval 3.0; hintSilent format["d: %1", _distanceToTarget]; #endif -_stateParams set[0, diag_tickTime]; +_stateParams set[0, ACE_diagTime]; _args set[4, _stateParams]; _this set[0, _args]; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index a184ba1ef4..f044d8242c 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -88,7 +88,7 @@ _args = [_this, getNumber ( _config >> "seekerAccuracy" ), getNumber ( _config >> "seekerMaxRange" ) ], - [ diag_tickTime, [], [] ] + [ ACE_diagTime, [], [] ] ]; // Hand off to the guiding unit. We just use local player so local PFH fires for now diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index 377469cdee..e2ab97a51e 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT missileguidance -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MISSILEGUIDANCE #define DEBUG_MODE_FULL @@ -9,6 +9,6 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_MISSILEGUIDANCE #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define FIREMODE_DIRECT_LOAL 1 \ No newline at end of file diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index dcb2be486c..2845767f15 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -1,7 +1,7 @@  - - + + Advanced Missile Guidance Guiado Avanzado de Misiles Guidage avancé de missile @@ -18,14 +18,14 @@ Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzału. Jest to wymagana opcja dla broni rakietowych. Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. Продвинутое наведение ракет, или ПНР, обеспечивает множество усовершествований для наведения и стрельбы ракет. Также, это система, необходимая для всех ракетных типов оружия. - Guiado Avanzado de Misiles, o AMG en sus siglas en inglés, ofrece múltiples mejoras en el fijado y disparo de misiles. Es también un sistema requerido para armas de tipo misil. - Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. + El guiado avanzado de misiles, o AMG en sus siglas en inglés, ofrece múltiples mejoras en el fijado y disparo de misiles. Es también un sistema requerido para armas de tipo misil. + Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkter Raketen. Le guidage avancé de missile, ou AMG en anglais, apporte de multiple améliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. A fejlett rakétairányító (vagy AMG) többféle módosítást tartalmaz a rakéták célkövetéséhez és tüzeléséhez. Ez egy szükséges keresztrendszer a rakéta-alapú fegyverekhez. Orientação avançada de mísseis ou OAM, fornece vários aprimoramentos para travamento de mísseis e disparos. Também é um sistema requerido para disparar armas que utilizem mísseis. Pokočilé navádění raket (AMG) poskytuje několik vylepšení pro lepší zaměření a následnou střelbu. Je to prvek vyžadovaný u typu zbraní jako jsou rakety. - + Hydra-70 DAGR Missile Misil Hydra-70 DAGR Hydra-70 DAGR @@ -37,7 +37,7 @@ Hydra-70 DAGR rakéta Hydra-70 DAGR - + DAGR DAGR DAGR @@ -49,7 +49,7 @@ DAGR DAGR - + Hydra-70 DAGR Laser Guided Missile Misil guiado por láser Hydra-70 DAGR Missile à guidage laser Hydra-70 DAGR @@ -61,7 +61,7 @@ Hydra-70 DAGR lézer-irányított rakéta Управляемая ракета лазерного наведения Hydra-70 DAGR - + Hellfire II AGM-114K Missile Misil Hellfire II AGM-114K Hellfire II AGM-114K @@ -73,7 +73,7 @@ Hellfire II AGM-114K rakéta Hellfire II AGM-114K - + AGM-114K AGM-114K AGM-114K @@ -85,7 +85,7 @@ AGM-114K AGM-114K - + Hellfire II AGM-114K Laser Guided Missile Misil guiado por láser Hellfire II AGM-114K Missile à guidage laser Hellfire II AGM-114K @@ -97,5 +97,29 @@ Hellfire II AGM-114K lézer-irányított rakéta Управляемая ракета лазерного наведения Hellfire II AGM-114K + + Off + Wyłącz + Desactivado + Aus + Vypnout + Desligado + + + Player Only + Tylko gracz + Solo jugador + Nur Spieler + Pouze hráči + Somente jogador + + + Player and AI + Gracz oraz AI + Jugador e IA + Spieler und KI + Hráči a AI + Jogador e IA + - + \ No newline at end of file diff --git a/addons/missionmodules/CfgFactionClasses.hpp b/addons/missionmodules/CfgFactionClasses.hpp index 792f4d31e3..fc4abc3606 100644 --- a/addons/missionmodules/CfgFactionClasses.hpp +++ b/addons/missionmodules/CfgFactionClasses.hpp @@ -1,6 +1,6 @@ class CfgFactionClasses { class NO_CATEGORY; class ACE_missionModules: NO_CATEGORY { - displayName = "ACE Mission Modules"; + displayName = CSTRING(Category_DisplayName); }; }; \ No newline at end of file diff --git a/addons/missionmodules/CfgVehicles.hpp b/addons/missionmodules/CfgVehicles.hpp index 6a1dc71705..ebf0b04f66 100644 --- a/addons/missionmodules/CfgVehicles.hpp +++ b/addons/missionmodules/CfgVehicles.hpp @@ -8,61 +8,61 @@ class CfgVehicles { // TODO make a curator variant for this class ACE_moduleAmbianceSound: Module_F { scope = 2; - displayName = "Ambiance Sounds [ACE]"; + displayName = CSTRING(AmbianceSounds_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); category = "ACE_missionModules"; function = QUOTE(FUNC(moduleAmbianceSound)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class soundFiles { - displayName = "Sounds"; - description = "Classnames of the ambiance sounds played. Seperated by ','. "; + displayName = CSTRING(AmbianceSounds_soundFiles_DisplayName); + description = CSTRING(AmbianceSounds_soundFiles_Description); typeName = "STRING"; defaultValue = ""; }; class minimalDistance { - displayName = "Minimal Distance"; - description = "Minimal Distance"; + displayName = CSTRING(AmbianceSounds_minimalDistance_DisplayName); + description = CSTRING(AmbianceSounds_minimalDistance_Description); typeName = "NUMBER"; defaultValue = 400; }; class maximalDistance { - displayName = "Maximal Distance"; - description = "Maximal Distance"; + displayName = CSTRING(AmbianceSounds_maximalDistance_DisplayName); + description = CSTRING(AmbianceSounds_maximalDistance_Description); typeName = "NUMBER"; defaultValue = 900; }; class minimalDelay { - displayName = "Minimal Delay"; - description = "Minimal Delay between sounds played"; + displayName = CSTRING(AmbianceSounds_minimalDelay_DisplayName); + description = CSTRING(AmbianceSounds_minimalDelay_Description); typeName = "NUMBER"; defaultValue = 10; }; class maximalDelay { - displayName = "Maximal Delay"; - description = "Maximal Delay between sounds played"; + displayName = CSTRING(AmbianceSounds_maximalDelay_DisplayName); + description = CSTRING(AmbianceSounds_maximalDelay_Description); typeName = "NUMBER"; defaultValue = 170; }; class followPlayers { - displayName = "Follow Players"; - description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + displayName = CSTRING(AmbianceSounds_followPlayers_DisplayName); + description = CSTRING(AmbianceSounds_followPlayers_Description); typeName = "BOOL"; defaultValue = 0; }; class soundVolume { - displayName = "Volume"; - description = "The volume of the sounds played"; + displayName = CSTRING(AmbianceSounds_soundVolume_DisplayName); + description = CSTRING(AmbianceSounds_soundVolume_Description); typeName = "NUMBER"; defaultValue = 1; }; }; class ModuleDescription { - description = "Ambiance sounds loop (synced across MP)"; + description = CSTRING(AmbianceSounds_Description); sync[] = {}; }; }; -}; +}; \ No newline at end of file diff --git a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf index c02d19aa5f..9b4c46ec10 100644 --- a/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf +++ b/addons/missionmodules/functions/fnc_moduleAmbianceSound.sqf @@ -26,39 +26,39 @@ _activated = [_this,2,true,[true]] call BIS_fnc_param; // We only play this on the locality of the logic, since the sounds are broadcasted across the network if (_activated && local _logic) then { _ambianceSounds = []; - _unparsedSounds = _logic getvariable ["soundFiles", ""]; - _minimalDistance = (_logic getvariable ["minimalDistance", 400]) max 1; - _maximalDistance = (_logic getvariable ["maximalDistance", 10]) max _minimalDistance; - _minDelayBetweensounds = (_logic getvariable ["minimalDelay", 10]) max 1; - _maxDelayBetweenSounds = (_logic getvariable ["maximalDelay", 170]) max _minDelayBetweensounds; - _volume = (_logic getvariable ["soundVolume", 30]) max 1; - _followPlayers = _logic getvariable ["followPlayers", false]; + _unparsedSounds = _logic getVariable ["soundFiles", ""]; + _minimalDistance = (_logic getVariable ["minimalDistance", 400]) max 1; + _maximalDistance = (_logic getVariable ["maximalDistance", 10]) max _minimalDistance; + _minDelayBetweensounds = (_logic getVariable ["minimalDelay", 10]) max 1; + _maxDelayBetweenSounds = (_logic getVariable ["maximalDelay", 170]) max _minDelayBetweensounds; + _volume = (_logic getVariable ["soundVolume", 30]) max 1; + _followPlayers = _logic getVariable ["followPlayers", false]; _splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString; _nilCheckPassedList = ""; { - _x = [_x] call EFUNC(common,string_removeWhiteSpace); - _splittedList set [_foreachIndex, _x]; - }foreach _splittedList; + _x = [_x] call EFUNC(common,stringRemoveWhiteSpace); + _splittedList set [_forEachIndex, _x]; + }forEach _splittedList; _soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; { - if (isclass (missionConfigFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); + if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushBack (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0)); } else { - if (isclass (configFile >> "CfgSounds" >> _x)) then { - _ambianceSounds pushback ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); + if (isClass (configFile >> "CfgSounds" >> _x)) then { + _ambianceSounds pushBack ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0)); }; }; - }foreach _splittedList; + }forEach _splittedList; - if (count _ambianceSounds == 0) exitwith {}; + if (count _ambianceSounds == 0) exitWith {}; { if !([".", _x, true] call BIS_fnc_inString) then { - _ambianceSounds set [_foreachIndex, _x + ".wss"]; + _ambianceSounds set [_forEachIndex, _x + ".wss"]; }; - }foreach _ambianceSounds; + }forEach _ambianceSounds; [{ private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"]; @@ -68,11 +68,11 @@ if (_activated && local _logic) then { _maxDelayBetweenSounds = _args select 5; _lastTimePlayed = _args select 8; - if (!alive _logic) exitwith { + if (!alive _logic) exitWith { [(_this select 1)] call cba_fnc_removePerFrameHandler; }; - if (time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { + if (ACE_time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then { _ambianceSounds = _args select 1; _minimalDistance = _args select 2; _maximalDistance = _args select 3; @@ -113,11 +113,11 @@ if (_activated && local _logic) then { // If no unit is to close to this position, we will play the sound. if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then { playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000]; - _args set [8, time]; + _args set [8, ACE_time]; }; }; }; - }, 0.1, [_logic, _ambianceSounds, _minimalDistance, _maximalDistance, _minDelayBetweensounds, _maxDelayBetweenSounds, _volume, _followPlayers, 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/missionmodules/stringtable.xml b/addons/missionmodules/stringtable.xml new file mode 100644 index 0000000000..b99285850d --- /dev/null +++ b/addons/missionmodules/stringtable.xml @@ -0,0 +1,141 @@ + + + + + ACE Mission Modules + ACE Moduły misji + Módulo de misiones ACE + ACE-Missionsmodule + ACE Moduly mise + Módulo de missões ACE + + + Ambiance Sounds [ACE] + Dźwięki [ACE] + [ACE] Sonidos ambiente + Umgebungsgeräusche [ACE] + Zvuky prostředí [ACE] + [ACE] Sons ambientes + + + Sounds + Dźwięki + Sonidos + Sounds + Zvuky + Sons + + + Class names of the ambiance sounds to be played. Seperated by ',' + Class name-y dźwięków do odtwarzania. Oddzielone przy użyciu ',' + Class names de los sonidos ambiente que se reproducirán. Separados por ',' + Klassennamen der Umgebungsgeräusche, die abgespielt werden sollen. Getrennt durch "," + Class names zvuků prostředí, které budou přehrány. Oddělené ',' + Nomes de classe dos sons de ambiente para serem reproduzidos. Separados por "," + + + Minimal Distance + Minimalny dystans + Distancia mínima + Mindestabstand + Minimální vzdálenost + Distância mínima + + + Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) + Używany do obliczania losowej pozycji a także ustawia minimalny dystans pomiędzy graczami a odtwarzanymi plikami dźwiękowymi + Usado para calcular una posición aleatoria y establecer la distancia mínima entre los jugadores y los ficheros de sonido reproducidos + Wird verwendet, um eine zufällige Position zu bestimmen und setzt den Mindestabstand zwischen Spielern und der/den abzuspielenden Sounddatei(en) fest + Používá se pro výpočet náhodné pozice a určuje minimální vzdálenost mezi hráči a přehrávaným zvukem. + Usada para calcular uma posição aleatória e definir a distância mínima entre os jogadores e os arquivos de sons que estão sendo reproduzidos. + + + Maximum Distance + Maksymalny dystans + Distancia máxima + Maximalabstand + Maximální vzdálenost + Distância máxima + + + Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) + Używany do obliczania losowej pozycji a także ustawia maksymalny dystans pomiędzy graczami a odtwarzanymi plikami dźwiękowymi + Usado para calcular una posición aleatoria y establecer la distancia máxima entre los jugadores y los ficheros de sonido reproducidos + Wird verwendet, um eine zufällige Position zu bestimmen und setzt den Maximalabstand zwischen Spielern und der/den abzuspielenden Sounddatei(en) fest + Používá se pro výpočet náhodné pozice a určuje maximální vzdálenost mezi hráči a přehrávaným zvukem. + Usado para calcular uma posição aleatória e definir uma distância máxima entre os jogadores e os arquivos de sons que estão sendo reproduzidos. + + + Minimal Delay + Minimalne opóźnienie + Retraso mínimo + Minimale Verzögerung + Minimální prodleva + Atraso mínimo + + + Minimal delay between sounds played + Minimalne opóźnienie pomiędzy odtwarzanymi dźwiękami + Retraso mínimo entre los sonidos reproducidos + Minimale Verzögerung zwischen abzuspielenden Sounds + Minimální prodleva mezi přehrávanými zvuky + Atraso mínimo entre os sons reproduzidos + + + Maximum Delay + Maksymalne opóźnienie + Retraso máximo + Maximale Verzögerung + Maximální prodleva + Atraso máximo + + + Maximum delay between sounds played + Maksymalne opóźnienie pomiędzy odtwarzanymi dźwiękami + Retraso máximo entre los sonidos reproducidos + Maximale Verzögerung zwischen abzuspielenden Sounds + Maximální prodleva mezi přehrávanými zvuky + Atraso máximo entre os sons reproduzidos + + + Follow Players + Podążaj za graczami + Seguir jugadores + Spielern folgen + Následovat hráče + Seguir jogadores + + + Follow players. If set to false, loop will play sounds only nearby logic position. + Podążaj za graczami. Jeżeli ustawione na 'Nie', pętla będzie odtwarzana tylko w pobliżu pozycji logiki. + Seguir jugadores. Si esta desabilitado (false), se reproducirán sonidos en bucle solo cerca de la posición lógica. + Spielern folgen. Wenn auf falsch gesetzt, werden Sounds nur in der Nähe des Logikmoduls abgespielt. + Následuj hráče. Pokud je FALSE, smyčka zvuku bude přehrávána na nejbližší pozici logiki. + Segue os jogadores. Se esta desabilitado (falso), o loop reproduzirá os sons somente perto de sua posição lógica. + + + Volume + Głośność + Volumen + Lautstärke + Hlasitost + Volume + + + The volume of the sounds played + Głośność odtwarzanych dźwięków + Volumen de los sonidos reproducidos + Lautstärke der abzuspielenden Sounds + Hlasitost přehrávaného zvuku + O volume em que os sons serão reproduzidos + + + Ambiance sounds loop (synced across MP) + Pętla odtwarzania dzwięków (synchronizowana na MP) + Bucle de sonidos ambiente (sincronizados en MP) + Umgebungsgeräusch-Schleife (im MP synchronisiert) + Smyčka okkolního zvuku (synchronizováno v MP) + Loop de sons ambientes (sincronizados através do MP) + + + \ No newline at end of file diff --git a/addons/mk6mortar/$PBOPREFIX$ b/addons/mk6mortar/$PBOPREFIX$ index a21eaf95f0..c5d6fd3fb2 100644 --- a/addons/mk6mortar/$PBOPREFIX$ +++ b/addons/mk6mortar/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\mk6mortar \ No newline at end of file +z\ace\addons\mk6mortar \ No newline at end of file diff --git a/addons/mk6mortar/ACE_Settings.hpp b/addons/mk6mortar/ACE_Settings.hpp new file mode 100644 index 0000000000..be7625bc3a --- /dev/null +++ b/addons/mk6mortar/ACE_Settings.hpp @@ -0,0 +1,18 @@ +class ACE_Settings { + //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla + class GVAR(airResistanceEnabled) { + value = 0; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowComputerRangefinder) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; + class GVAR(allowCompass) { + value = 1; + typeName = "BOOL"; + isClientSetable = 0; + }; +}; diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index baf74fa2c4..2738a649a9 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -4,12 +4,12 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class GVAR(rangetable) { - displayName = "$STR_ACE_MK6MORTAR_rangetable_action"; + displayName = CSTRING(rangetable_action); condition = QUOTE(_this call FUNC(rangeTableCanUse)); statement = QUOTE(_this call FUNC(rangeTableOpen)); priority = 0; icon = QUOTE(PATHTOF(UI\icon_rangeTable.paa)); - exceptions[] = {"notOnMap", "isNotInside"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; }; }; }; @@ -43,14 +43,11 @@ class CfgVehicles { }; }; - class Logic; - class Module_F: Logic { - class ModuleDescription {}; - }; - class GVAR(module): Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class GVAR(module): ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "MK6 Settings"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleInit); scope = 2; isGlobal = 0; @@ -58,26 +55,26 @@ class CfgVehicles { functionPriority = 0; class Arguments { class airResistanceEnabled { - displayName = "Air Resistance"; - description = "For Player Shots, Model Air Resistance and Wind Effects"; + displayName = CSTRING(airResistanceEnabled_DisplayName); + description = CSTRING(airResistanceEnabled_Description); typeName = "BOOL"; defaultValue = 1; }; class allowComputerRangefinder { - displayName = "Allow MK6 Computer"; - description = "Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance)"; + displayName = CSTRING(allowComputerRangefinder_DisplayName); + description = CSTRING(allowComputerRangefinder_Description); typeName = "BOOL"; defaultValue = 0; }; class allowCompass { - displayName = "Allow MK6 Compass"; - description = "Show the MK6 Digital Compass"; + displayName = CSTRING(allowCompass_DisplayName); + description = CSTRING(allowCompass_Description); typeName = "BOOL"; defaultValue = 1; }; }; - class ModuleDescription: ModuleDescription { - description = ""; + class ModuleDescription { + description = CSTRING(Module_Description); }; }; }; diff --git a/addons/mk6mortar/CfgWeapons.hpp b/addons/mk6mortar/CfgWeapons.hpp index 7d5153e9ad..97952af2d1 100644 --- a/addons/mk6mortar/CfgWeapons.hpp +++ b/addons/mk6mortar/CfgWeapons.hpp @@ -3,10 +3,10 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_RangeTable_82mm: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; - displayName = "$STR_ACE_MK6MORTAR_rangetable_name"; - descriptionShort = "$STR_ACE_MK6MORTAR_rangetable_description"; + displayName = CSTRING(rangetable_name); + descriptionShort = CSTRING(rangetable_description); picture = QUOTE(PATHTOF(UI\icon_rangeTable.paa)); class ItemInfo: InventoryItem_Base_F { mass = 0.5; diff --git a/addons/mk6mortar/config.cpp b/addons/mk6mortar/config.cpp index 6751cea5fb..bbd7a2f892 100644 --- a/addons/mk6mortar/config.cpp +++ b/addons/mk6mortar/config.cpp @@ -26,22 +26,4 @@ class RscActiveText; #include "RscInGameUI.hpp" #include "RscRangeTable.hpp" - -class ACE_Settings { - //These settings effect gameplay difficutly: defaults will leave the mortar the same as vanilla - class GVAR(airResistanceEnabled) { - value = 0; - typeName = "BOOL"; - isClientSetable = 0; - }; - class GVAR(allowComputerRangefinder) { - value = 1; - typeName = "BOOL"; - isClientSetable = 0; - }; - class GVAR(allowCompass) { - value = 1; - typeName = "BOOL"; - isClientSetable = 0; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf index d1e0a8dd05..9d8b292070 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateCalcRangeTableLine.sqf @@ -21,7 +21,7 @@ Example: private ["_startTime", "_muzzleVelocity", "_rangeToHit", "_airFriction", "_vacElevation", "_radicand", "_maxElev", "_minElev", "_error", "_solutionElevation", "_lastTestResult", "_numberOfAttempts", "_lineElevation", "_lineTimeOfFlight", "_lineHeightElevation", "_lineHeightTimeDelta", "_lineCrosswindDeg", "_lineHeadwindMeters", "_lineTailWindMeters", "_result"]; -_startTime = diag_tickTime; +_startTime = ACE_diagTime; _muzzleVelocity = _this select 0; _rangeToHit = _this select 1; @@ -74,6 +74,6 @@ _lineAirDensDec = (_rangeToHit - (_lastTestResult select 0)) / 10; _lastTestResult = [_lineElevation, _muzzleVelocity, _airFriction, 15, 1.1, 0, 0, 0, TIME_STEP] call FUNC(dev_simulateShot); _lineAirDensInc = (_rangeToHit - (_lastTestResult select 0)) / 10; -// systemChat format ["debug: Range %1 - in %2 sec", _rangeToHit, (diag_tickTime - _startTime)]; +// systemChat format ["debug: Range %1 - in %2 sec", _rangeToHit, (ACE_diagTime - _startTime)]; [_rangeToHit, _lineElevation, _lineHeightElevation, _lineHeightTimeDelta, _lineTimeOfFlight, _lineCrosswindDeg, _lineHeadwindMeters, _lineTailWindMeters, _lineTempDec, _lineTempInc, _lineAirDensDec, _lineAirDensInc] diff --git a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf index a45c415b40..cfba7c0e05 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateFindSolution.sqf @@ -51,5 +51,5 @@ while {(_numberOfAttempts < MAX_ATTEMPTS) && {(abs _error) > 0.2}} do { }; if (_numberOfAttempts >= MAX_ATTEMPTS) exitWith {[]}; -//return the elevation and time required +//return the elevation and ACE_time required [_solutionElevation, (_lastTestResult select 1)] diff --git a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf index 0e53807a6b..65f87256fe 100644 --- a/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf +++ b/addons/mk6mortar/functions/fnc_dev_simulateShot.sqf @@ -45,7 +45,7 @@ _currentVelocity = [0, (_muzzleVelocity * cos _angleDeg), (_muzzleVelocity * sin _currentTime = 0; _lastPos = _currentPos; -_kCoefficent = -1 * _relDensity * _airFriction; //save time in the loop and compute once +_kCoefficent = -1 * _relDensity * _airFriction; //save ACE_time in the loop and compute once while {((_currentVelocity select 2) > 0) || ((_currentPos select 2) >= _heightOfTarget)} do { _lastPos = _currentPos; @@ -64,7 +64,7 @@ _linConversion = linearConversion [(_lastPos select 2), (_currentPos select 2), _middlePos = (_lastPos vectorMultiply (1 - _linConversion)) vectorAdd (_currentPos vectorMultiply (_linConversion)); // _middlePosOld = (_lastPos vectorAdd _currentPos) vectorMultiply 0.5; -//Same to find travel time +//Same to find travel ACE_time _middleTotalTravelTime = _currentTime - (_timeStep * (1-_linConversion)); //Find shot offset (from crosswind), in degrees diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf index e2b440c520..3f739aee2f 100644 --- a/addons/mk6mortar/functions/fnc_handleFired.sqf +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -21,7 +21,7 @@ */ #include "script_component.hpp" -private ["_shooterMan", "_bisAirFriction", "_temperature", "_newMuzzleVelocityCoefficent", "_bulletVelocity", "_bulletSpeed", "_muzzleVelocity", "_muzzleVelocityShift"]; +private ["_shooterMan", "_bisAirFriction", "_temperature", "_newMuzzleVelocityCoefficent", "_bulletVelocity", "_bulletSpeed"]; disableSerialization; @@ -42,8 +42,7 @@ if (_bisAirFriction != 0) exitWith {ERROR("Non zero base airFriction");}; //Calculate air density: _altitude = (getPosASL _vehicle) select 2; -#define GET_TEMPERATURE_AT_HEIGHT(h) (EGVAR(weather,currentTemperature) - 0.0065 * (h)) -_temperature = GET_TEMPERATURE_AT_HEIGHT(_altitude); +_temperature = _altitude call EFUNC(weather,calculateTemperatureAtHeight); _pressure = _altitude call EFUNC(weather,calculateBarometricPressure); _relativeHumidity = EGVAR(weather,currentHumidity); _airDensity = [_temperature, _pressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); @@ -58,7 +57,6 @@ if (_newMuzzleVelocityCoefficent != 1) then { _bulletSpeed = vectorMagnitude _bulletVelocity; _bulletVelocity = (vectorNormalized _bulletVelocity) vectorMultiply (_bulletSpeed * _newMuzzleVelocityCoefficent); _projectile setVelocity _bulletVelocity; - _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; }; @@ -71,8 +69,8 @@ if (_newMuzzleVelocityCoefficent != 1) then { [_pfID] call cba_fnc_removePerFrameHandler; }; - _deltaT = time - _time; - _args set[2, time]; + _deltaT = ACE_time - _time; + _args set[2, ACE_time]; _bulletVelocity = velocity _shell; _bulletSpeed = vectorMagnitude _bulletVelocity; @@ -86,4 +84,4 @@ if (_newMuzzleVelocityCoefficent != 1) then { _shell setVelocity _bulletVelocity; -}, 0, [_projectile, MK6_82mm_AIR_FRICTION, time, _relativeDensity]] call CBA_fnc_addPerFrameHandler; +}, 0, [_projectile, MK6_82mm_AIR_FRICTION, ACE_time, _relativeDensity]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index 91657fdbe2..e74cb315f7 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -51,7 +51,7 @@ _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes") _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; _currentChargeMode = _fireModes find _currentFireMode; - _text = format ["%1: %2 ", (localize "STR_ACE_MK6MORTAR_rangetable_charge"), _currentChargeMode, QUOTE(PATHTOF(UI\ui_charges.paa))]; + _text = format ["%1: %2 ", (localize LSTRING(rangetable_charge)), _currentChargeMode, QUOTE(PATHTOF(UI\ui_charges.paa))]; _chargeText ctrlSetStructuredText parseText _text; if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { //Don't like this solution, but it works diff --git a/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf index dfb53842ab..07e0536d24 100644 --- a/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf +++ b/addons/mk6mortar/functions/fnc_rangeTableOpen.sqf @@ -39,7 +39,7 @@ _muzzleVelocities = []; _showToPlayer = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "showToPlayer"); if (_showToPlayer == 1) then { _artilleryCharge = getNumber (configFile >> "CfgWeapons" >> _weaponName >> _x >> "artilleryCharge"); - LIST_CHARGE lbAdd format ["%1: %2", (localize "STR_ACE_MK6MORTAR_rangetable_charge"), (count _muzzleVelocities)]; + LIST_CHARGE lbAdd format ["%1: %2", (localize LSTRING(rangetable_charge)), (count _muzzleVelocities)]; LIST_CHARGE lbSetData [(count _muzzleVelocities), str (_artilleryCharge * _initSpeed)]; _muzzleVelocities pushBack _artilleryCharge; }; diff --git a/addons/mk6mortar/script_component.hpp b/addons/mk6mortar/script_component.hpp index cb74d552de..b140a920cc 100644 --- a/addons/mk6mortar/script_component.hpp +++ b/addons/mk6mortar/script_component.hpp @@ -1,14 +1,14 @@ #define COMPONENT mk6mortar -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MK6MORTAR - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MK6MORTAR - #define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR + #define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" #define MK6_82mm_AIR_FRICTION -0.0001 \ No newline at end of file diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 12472343be..26ab485db2 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -1,7 +1,7 @@  - - + + 82mm Rangetable 82mm Distanztabelle Tabela strzelnicza 82mm @@ -11,8 +11,9 @@ 82mm hatótáv-tábla Tabela de distâncias de para 82mm 82mm Rangetable + Tavola di tiro 82mm - + Range Table for the MK6 82mm Mortar Distanztabelle für den Mk6 82mm Mortar Tabela strzelnicza dla moździerza 82mm MK6 @@ -22,8 +23,9 @@ Hatótáv-tábla a MK6 82mm-es mozsárhoz Tabela de distâncias para morteiro MK6 82mm Rangetable pro MK6 82mm minomet + Tavola di tiro per il mortaio calibro 82mm MK6 - + Open 82mm Rangetable Öffne 82mm Distanztabelle Otwórz tabelę strzelniczą 82mm @@ -33,8 +35,9 @@ 82mm hatótáv-tábla megnyitása Abrir tabela de distâncias para 82mm Otevřít 82mm Rangetable + Apri la tavola di tiro 82mm - + Charge Ladung Charge @@ -44,6 +47,70 @@ Töltés Carregar Nabít + Carica + + + MK6 Settings + Moździerz MK6 - Ustawienia + Ajustes MK6 + MK6-Einstellungen + MK6 - Nastavení + Ajustes do MK6 + + + Air Resistance + Opór powietrza + Resistencia al aire + Luftwiderstand + Odpor vzduchu + Resistência do Ar + + + For Player Shots, Model Air Resistance and Wind Effects + Modeluj opór powietrza oraz wpływ wiatru na tor lotu pocisku dla strzałów z moździerza MK6 przez graczy + Para disparos del jugador, modelo de resistencia al aire y efectos de viento + Für Spielerschüsse, Luftwiderstand und Windeffekte + Pro hráčovu střelbu, Model odporu vzduchu a povětrných podmínek + Para disparos do jogador, modelo de resistência de ar e efeitos de vento + + + Allow MK6 Computer + Komputer MK6 + Habilitar ordenador del MK6 + Erlaube MK6-Computer + MK6 - Povolit počítač + Permitir computador do MK6 + + + Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) + Zezwól na komputer i dalmierz (opcja ta MUSI zostać wyłączona jeżeli aktywowałeś opór powietrza) + Muestra el ordenador y el medidor de distancia (DEBEN ser quitados si se activa la resistecia al aire) + Zeige den Computer und den Entfernungsmesser an (diese MÜSSEN entfernt werden, wenn der Luftwiderstand aktiviert ist) + Zobrazit počítač a dálkoměr (toto MUSÍ být odstraněno pokud je zapnut odpor vzduchu) + Mostra o computador e o medidor de distância (estes DEVEM ser removidos se você habilitar resistência do ar) + + + Allow MK6 Compass + Kompas MK6 + Habilitar brujula del MK6 + Erlaube MK6-Kompass + MK6 - Povolit kompas + Permitir bússula do MK6 + + + Show the MK6 Digital Compass + Pokaż kompas MK6 + Muestra la brujula digital en el MK6 + Zeige MK6-Digitaler-Kompass + MK6 - Zobrazit digitální kompas + Mostra a bússula digital do MK6 + + + + Moduł ten pozwala dostosować ustawienia moździerza MK6. + Dieses Modul erlaubt das Einstellen des MK6-Mörsers. + Tento modul umožňuje nastavení minometu MK6. + Este módulo permite que você ajuste o morteiro MK6. - + \ No newline at end of file diff --git a/addons/modules/XEH_postInit.sqf b/addons/modules/XEH_postInit.sqf index b6aecf5f90..62d16f42ce 100644 --- a/addons/modules/XEH_postInit.sqf +++ b/addons/modules/XEH_postInit.sqf @@ -1,44 +1,47 @@ #include "script_component.hpp" -// TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it. -// We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution. -{ - [_x] call { - private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"]; - _logic = _this select 0; - _logicType = typeof _logic; - _logic hideobject true; +["InitSettingsFromModules", { + // TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it. + // We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution. + { + [_x] call { + private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"]; + _logic = _this select 0; + _logicType = typeof _logic; + _logic hideobject true; - if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; - _config = (configFile >> "CfgVehicles" >> _logicType); - if !(isClass _config) exitwith {}; + if (_logic getvariable [QGVAR(initalized), false]) exitwith {}; + _config = (configFile >> "CfgVehicles" >> _logicType); + if !(isClass _config) exitwith {}; - // isGlobal = 1; - _isGlobal = getNumber (_config >> "isGlobal") > 0; - _isDisposable = getNumber (_config >> "isDisposable") > 0; - _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; - _function = getText (_config >> "function"); - if (isnil _function) then { - _function = compile _function; - } else { - _function = missionNamespace getvariable _function; - }; + // isGlobal = 1; + _isGlobal = getNumber (_config >> "isGlobal") > 0; + _isDisposable = getNumber (_config >> "isDisposable") > 0; + _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1; + _function = getText (_config >> "function"); + if (isnil _function) then { + _function = compile _function; + } else { + _function = missionNamespace getvariable _function; + }; - if (_isGlobal) then { - [_logic, [], true] call _function; - } else { - if (isServer) then { - [_logic, [], true] call _function; + if (_isGlobal || isServer) then { + [_logic, (synchronizedObjects _logic), true] call _function; + }; + + if !(_isPersistent) then { + _logic setvariable [QGVAR(initalized), true]; + }; + + if (_isDisposable) then { + deleteVehicle _logic; }; }; - - if !(_isPersistent) then { - _logic setvariable [QGVAR(initalized), true]; - }; - - if (_isDisposable) then { - deleteVehicle _logic; - }; + }foreach GVAR(moduleInitCollection); + + if (isServer) then { + GVAR(serverModulesRead) = true; + publicVariable QGVAR(serverModulesRead); }; -}foreach GVAR(moduleInitCollection); +}] call EFUNC(common,addEventhandler); diff --git a/addons/modules/XEH_preInit.sqf b/addons/modules/XEH_preInit.sqf index dfbbe2c2b9..7573d34352 100644 --- a/addons/modules/XEH_preInit.sqf +++ b/addons/modules/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(moduleInit); -PREP(bi_moduleProjectile); GVAR(moduleInitCollection) = []; diff --git a/addons/modules/config.cpp b/addons/modules/config.cpp index 4fc3b8b60d..d25e193d32 100644 --- a/addons/modules/config.cpp +++ b/addons/modules/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; + requiredAddons[] = {"ace_main"}; author[] = {"Glowbal"}; authorUrl = ""; VERSION_CONFIG; @@ -23,9 +23,6 @@ class CfgVehicles { init = QUOTE(_this call DFUNC(moduleInit)); }; }; - class ModuleOrdnance_F: Module_F { - function = "ace_modules_fnc_bi_moduleProjectile"; - }; }; -#include "CfgEventHandlers.hpp" +#include "CfgEventHandlers.hpp" \ No newline at end of file diff --git a/addons/movement/ACE_Settings.hpp b/addons/movement/ACE_Settings.hpp new file mode 100644 index 0000000000..8424f9cba9 --- /dev/null +++ b/addons/movement/ACE_Settings.hpp @@ -0,0 +1,8 @@ +class ACE_Settings { + class GVAR(useImperial) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(UseImperial); + }; +}; \ No newline at end of file diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 0e451832d9..ebe97e879d 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -14,13 +14,13 @@ if (!hasInterface) exitWith {}; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize "STR_ACE_Movement_Weight", [ACE_player] call FUNC(getWeight)]; + _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize LSTRING(Weight), [ACE_player] call FUNC(getWeight)]; }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; }] call EFUNC(common,addEventHandler); -["ACE3 Movement", QGVAR(climb), localize "STR_ACE_Movement_Climb", +["ACE3 Movement", QGVAR(climb), localize LSTRING(Climb), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 6cf2c9470c..496e4982ac 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -16,12 +16,4 @@ class CfgPatches { #include "CfgFatigue.hpp" //#include "CfgInventoryGlobalVariable.hpp" #include "CfgMoves.hpp" - -class ACE_Settings { - class GVAR(useImperial) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Movement_UseImperial"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index f88884195e..a395e834b8 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -20,7 +20,7 @@ private "_unit"; _unit = _this select 0; if !([_unit] call FUNC(canClimb)) exitWith { - [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); + [localize LSTRING(CanNotClimb)] call EFUNC(common,displayTextStructured); }; if !(_unit getVariable [QGVAR(isClimbInit), false]) then { diff --git a/addons/mx2a/$PBOPREFIX$ b/addons/mx2a/$PBOPREFIX$ new file mode 100644 index 0000000000..1042853ad7 --- /dev/null +++ b/addons/mx2a/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\mx2a \ No newline at end of file diff --git a/addons/mx2a/CfgVehicles.hpp b/addons/mx2a/CfgVehicles.hpp new file mode 100644 index 0000000000..c450133ba7 --- /dev/null +++ b/addons/mx2a/CfgVehicles.hpp @@ -0,0 +1,20 @@ +class CfgVehicles { + class Item_Base_F; + class ACE_Item_MX2A: Item_Base_F { + author[] = {"Spooner", "tcp"}; + scope = 2; + scopeCurator = 2; + displayName = CSTRING(DisplayName); + vehicleClass = "Items"; + class TransportWeapons { + MACRO_ADDWEAPON(ACE_MX2A,1); + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportWeapons { + MACRO_ADDWEAPON(ACE_MX2A,6); + }; + }; +}; diff --git a/addons/mx2a/CfgWeapons.hpp b/addons/mx2a/CfgWeapons.hpp new file mode 100644 index 0000000000..6f590e2ed4 --- /dev/null +++ b/addons/mx2a/CfgWeapons.hpp @@ -0,0 +1,26 @@ + +class CfgWeapons { + class Binocular; + class ACE_MX2A: Binocular { + author = ECSTRING(common,ACETeam); + displayName = CSTRING(DisplayName); + descriptionShort = CSTRING(Description); + model = PATHTOF(data\ace_mx2a.p3d); + modelOptics = QUOTE(PATHTOEF(apl,LWTS_optic.p3d)); + picture = PATHTOF(UI\w_mx2a_ca.paa); + opticsZoomMax = 0.1; + distanceZoomMax = 120; + opticsZoomMin = 0.05; + distanceZoomMin = 400; + opticsZoomInit = 0.1; + visionMode[] = {"Ti"}; + thermalMode[] = {0,1}; + discretefov[] = {0.33333/1, 0.33333/2}; // 1x/2x -- http://www.drs.com/Products/RSTA/PDF/MX2A.pdf + discreteInitIndex = 0; + discreteDistance[] = {120,400}; + discreteDistanceInitIndex = 1; + class WeaponSlotsInfo { + mass = 20; + }; + }; +}; diff --git a/addons/mx2a/README.md b/addons/mx2a/README.md new file mode 100644 index 0000000000..cbaf9add1b --- /dev/null +++ b/addons/mx2a/README.md @@ -0,0 +1,10 @@ +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) diff --git a/addons/mx2a/UI/w_mx2a_ca.paa b/addons/mx2a/UI/w_mx2a_ca.paa new file mode 100644 index 0000000000..748a01d5f4 Binary files /dev/null and b/addons/mx2a/UI/w_mx2a_ca.paa differ diff --git a/addons/mx2a/config.cpp b/addons/mx2a/config.cpp new file mode 100644 index 0000000000..45b1643ed2 --- /dev/null +++ b/addons/mx2a/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_MX2A"}; + weapons[] = {"ACE_MX2A"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_apl"}; + author[] = {"Spooner", "tcp"}; + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/mx2a/data/ace_mx2a.p3d b/addons/mx2a/data/ace_mx2a.p3d new file mode 100644 index 0000000000..f2664de20b Binary files /dev/null and b/addons/mx2a/data/ace_mx2a.p3d differ diff --git a/addons/mx2a/data/mx2A_ti_ca.paa b/addons/mx2a/data/mx2A_ti_ca.paa new file mode 100644 index 0000000000..1315a56aa8 Binary files /dev/null and b/addons/mx2a/data/mx2A_ti_ca.paa differ diff --git a/addons/mx2a/data/mx2a.rvmat b/addons/mx2a/data/mx2a.rvmat new file mode 100644 index 0000000000..d614433dce --- /dev/null +++ b/addons/mx2a/data/mx2a.rvmat @@ -0,0 +1,81 @@ +ambient[]={1,1,1,1}; +diffuse[]={1,1,1,1}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.1,0.1,0.1,1}; +specularPower=30; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 { + texture="z\ace\addons\mx2a\data\mx2a_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="a3\weapons_f\data\detailmaps\metal_detail_dt.paa"; + uvSource="tex"; + class uvTransform { + aside[]={2,-1.568,0}; + up[]={1.568,4,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[]={0.98480773,-0.17364819,0}; + up[]={0.17364819,0.98480773,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; +class Stage4 { + texture="z\ace\addons\mx2a\data\mx2a_as.paa"; + 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\mx2a\data\mx2a_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(1.5,1.22)"; + uvSource="tex"; + class uvTransform { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + 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}; + }; +}; +class StageTI { + texture="z\ace\addons\mx2a\data\mx2a_ti_ca.paa"; +}; \ No newline at end of file diff --git a/addons/mx2a/data/mx2a_as.paa b/addons/mx2a/data/mx2a_as.paa new file mode 100644 index 0000000000..4bf1b49b8a Binary files /dev/null and b/addons/mx2a/data/mx2a_as.paa differ diff --git a/addons/mx2a/data/mx2a_co.paa b/addons/mx2a/data/mx2a_co.paa new file mode 100644 index 0000000000..28db7f08b2 Binary files /dev/null and b/addons/mx2a/data/mx2a_co.paa differ diff --git a/addons/mx2a/data/mx2a_nohq.paa b/addons/mx2a/data/mx2a_nohq.paa new file mode 100644 index 0000000000..adff9a6fb0 Binary files /dev/null and b/addons/mx2a/data/mx2a_nohq.paa differ diff --git a/addons/mx2a/data/mx2a_smdi.paa b/addons/mx2a/data/mx2a_smdi.paa new file mode 100644 index 0000000000..9eab8a9cb4 Binary files /dev/null and b/addons/mx2a/data/mx2a_smdi.paa differ diff --git a/addons/mx2a/script_component.hpp b/addons/mx2a/script_component.hpp new file mode 100644 index 0000000000..aabb74660a --- /dev/null +++ b/addons/mx2a/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT mx2a +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MX2A + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MX2A + #define DEBUG_SETTINGS DEBUG_SETTINGS_MX2A +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/mx2a/stringtable.xml b/addons/mx2a/stringtable.xml new file mode 100644 index 0000000000..88d6bef6b5 --- /dev/null +++ b/addons/mx2a/stringtable.xml @@ -0,0 +1,20 @@ + + + + + MX-2A + MX-2A + MX-2A + MX-2A + MX-2A + + + Thermal imaging device + Wärmebildgerät + Monokular termowizyjny + Dispositivo de imagen térmica + Termální dalekohled + Dispositivo de imagem térmica + + + \ No newline at end of file diff --git a/addons/nametags/ACE_Settings.hpp b/addons/nametags/ACE_Settings.hpp new file mode 100644 index 0000000000..e976c4adc8 --- /dev/null +++ b/addons/nametags/ACE_Settings.hpp @@ -0,0 +1,65 @@ +class ACE_Settings { + class GVAR(defaultNametagColor) { + value[] = {0.77, 0.51, 0.08, 1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = CSTRING(DefaultNametagColor); + }; + class GVAR(showPlayerNames) { + value = 1; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(ShowPlayerNames); + description = CSTRING(ShowPlayerNames_Desc); + values[] = {CSTRING(Disabled), CSTRING(Enabled), CSTRING(OnlyCursor), CSTRING(OnlyKeypress), CSTRING(OnlyCursorAndKeypress)}; + }; + class GVAR(showPlayerRanks) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(ShowPlayerRanks); + }; + class GVAR(showVehicleCrewInfo) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(ShowVehicleCrewInfo); + }; + class GVAR(showNamesForAI) { + value = 0; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(ShowNamesForAI); + }; + class GVAR(showCursorTagForVehicles) { + value = 0; + typeName = "BOOL"; + isClientSettable = 0; + }; + class GVAR(showSoundWaves) { + value = 1; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(ShowSoundWaves); + description = CSTRING(ShowSoundWaves_Desc); + values[] = {CSTRING(Disabled), CSTRING(NameTagSettings), CSTRING(AlwaysShowAll)}; + }; + class GVAR(playerNamesViewDistance) { + value = 5; + typeName = "SCALAR"; + isClientSettable = 0; + }; + class GVAR(playerNamesMaxAlpha) { + value = 0.8; + typeName = "SCALAR"; + isClientSettable = 0; + }; + class GVAR(tagSize) { + value = 2; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(TagSize_Name); + description = CSTRING(TagSize_Description); + values[] = {"$str_very_small", "$str_small", "$str_medium", "$str_large", "$str_very_large"}; + }; +}; diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index ec005c8218..6c0c148e47 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -1,69 +1,101 @@ class CfgVehicles { - class Module_F; - class ACE_ModuleNameTags : Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleNameTags: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Name Tags"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleNameTags); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa)); class Arguments { - class PlayerNamesViewDistance { - displayName = "Player Names View Dist."; - description = "Distance in meters at which player names are shown. Default: 5"; - typeName = "NUMBER"; - defaultValue = 5; - }; - class showNamesForAI { - displayName = "Show name tags for AI?"; - description = "Show the name and rank tags for friendly AI units? Default: Do not force"; + class showPlayerNames { + displayName = CSTRING(ShowPlayerNames); + description = CSTRING(ShowPlayerNames_Desc); typeName = "NUMBER"; class values { class DoNotForce { default = 1; - name = "Do Not Force"; + name = CSTRING(DoNotForce); value = -1; }; class ForceHide { - name = "Force Hide"; + name = CSTRING(ForceHide); value = 0; }; class ForceShow { - name = "Force show"; + name = CSTRING(ForceShow); + value = 1; + }; + class ForceShowOnlyCursor { + name = CSTRING(ForceShowOnlyCursor); + value = 2; + }; + class ForceShowOnlyKeypress { + name = CSTRING(ForceShowOnlyKeypress); + value = 3; + }; + class ForceShowOnlyCursorAndKeypress { + name = CSTRING(ForceShowOnlyCursorAndKeypress); + value = 4; + }; + }; + }; + class playerNamesViewDistance { + displayName = CSTRING(PlayerNamesViewDistance_DisplayName); + description = CSTRING(PlayerNamesViewDistance_Description); + typeName = "NUMBER"; + defaultValue = 5; + }; + class showNamesForAI { + displayName = CSTRING(showNamesForAI_DisplayName); + description = CSTRING(showNamesForAI_Description); + typeName = "NUMBER"; + class values { + class DoNotForce { + default = 1; + name = CSTRING(DoNotForce); + value = -1; + }; + class ForceHide { + name = CSTRING(ForceHide); + value = 0; + }; + class ForceShow { + name = CSTRING(ForceShow); value = 1; }; }; }; class showVehicleCrewInfo { - displayName = "Show crew info?"; - description = "Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force"; + displayName = CSTRING(showVehicleCrewInfo_DisplayName); + description = CSTRING(showVehicleCrewInfo_Description); typeName = "NUMBER"; class values { class DoNotForce { default = 1; - name = "Do Not Force"; + name = CSTRING(DoNotForce); value = -1; }; class ForceHide { - name = "Force Hide"; + name = CSTRING(ForceHide); value = 0; }; class ForceShow { - name = "Force Show"; + name = CSTRING(ForceShow); value = 1; }; }; }; class showCursorTagForVehicles { - displayName = "Show for Vehicles"; - description = "Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No"; + displayName = CSTRING(showCursorTagForVehicles_DisplayName); + description = CSTRING(showCursorTagForVehicles_Description); typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; + defaultValue = 0; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; }; diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index cea2025dcc..efc634be6c 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -5,16 +5,16 @@ if (!hasInterface) exitWith {}; -GVAR(ShowNamesTime) = -10; +GVAR(showNamesTime) = -10; // Add keybinds -["ACE3 Common", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", +["ACE3 Common", QGVAR(showNameTags), localize LSTRING(ShowNames), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Statement - GVAR(ShowNamesTime) = time; + GVAR(showNamesTime) = ACE_time; if (call FUNC(canShow)) then{ call FUNC(doShow); }; // Return false so it doesn't block other actions false @@ -22,6 +22,52 @@ GVAR(ShowNamesTime) = -10; {false}, [29, [false, false, false]], false] call cba_fnc_addKeybind; //LeftControl Key +// Monitor the assigned teams, and propegate them appropriately for the player +// This allows for assigned team colors to match across the entire group +[{ + private["_leader", "_playerIsLeader", "_unitTeam"]; + if (!(isNull ACE_player) && { alive ACE_player } ) then { + _leader = leader (group ACE_player); + _playerIsLeader = false; + + if(alive _leader) then { + if(_leader == ACE_player) then { + _playerIsLeader = true; + }; + }; + + if (_playerIsLeader) then { + { + if(alive _x) then { + _unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"]; + if (_unitTeam != assignedTeam _x) then { + _x setVariable [QGVAR(teamAssignment), assignedTeam _x,true]; + }; + }; + } forEach units (group ACE_player); + } else { + { + if(alive _x) then { + _unitTeam = _x getVariable [QGVAR(teamAssignment),"MAIN"]; + if (_unitTeam != assignedTeam _x) then { + _x assignTeam _unitTeam; + }; + }; + } forEach units (group ACE_player); + }; + }; +}, 5, []] call CBA_fnc_addPerFrameHandler; -// Draw handle -addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}]; +// Wait until the colors are defined before starting to draw the nametags +["SettingsInitialized", { + // Draw handle + call FUNC(updateSettings); +}] call EFUNC(common,addEventHandler); + +// Change settings accordingly when they are changed +["SettingChanged", { + PARAMS_1(_name); + if (_name == QGVAR(showPlayerNames)) then { + call FUNC(updateSettings); + }; +}] call EFUNC(common,addEventHandler); diff --git a/addons/nametags/XEH_preInit.sqf b/addons/nametags/XEH_preInit.sqf index f3c9a97cba..51b926cbb3 100644 --- a/addons/nametags/XEH_preInit.sqf +++ b/addons/nametags/XEH_preInit.sqf @@ -10,5 +10,6 @@ PREP(initIsSpeaking); PREP(moduleNameTags); PREP(onDraw3d); PREP(setText); +PREP(updateSettings); ADDON = true; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index dce054a9ec..a2d38254f1 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -13,62 +13,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" #include "CfgVehicles.hpp" -class ACE_Settings { - class GVAR(defaultNametagColor) { - value[] = {0.77, 0.51, 0.08, 1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_DefaultNametagColor"; - }; - class GVAR(showPlayerNames) { - value = 1; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_ShowPlayerNames"; - values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; - }; - class GVAR(showPlayerRanks) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; - }; - class GVAR(showVehicleCrewInfo) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_ShowVehicleCrewInfo"; - }; - class GVAR(showNamesForAI) { - value = 0; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_ShowNamesForAI"; - }; - class GVAR(showCursorTagForVehicles) { - value = 0; - typeName = "BOOL"; - isClientSettable = 0; - }; - class GVAR(showSoundWaves) { - value = 1; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_NameTags_ShowSoundWaves"; - values[] = {"Disabled", "Use Nametag settings", "Always Show All"}; - }; - class GVAR(PlayerNamesViewDistance) { - value = 5; - typeName = "SCALAR"; - isClientSettable = 0; - }; - class GVAR(PlayerNamesMaxAlpha) { - value = 0.8; - typeName = "SCALAR"; - isClientSettable = 0; - }; -}; - #include diff --git a/addons/nametags/functions/common.hpp b/addons/nametags/functions/common.hpp index caa7a3e982..6aeb24fc5a 100644 --- a/addons/nametags/functions/common.hpp +++ b/addons/nametags/functions/common.hpp @@ -1,12 +1,8 @@ /* - Author: aeroson - - Description: - Images, index in images and order of roles. - Defined number also implies order, lower number shows more on top of the list. -*/ - -#include "script_component.hpp" + * Author: aeroson + * Images, index in images and order of roles. + * Defined number also implies order, lower number shows more on top of the list. + */ #define PILOT 0 #define DRIVER 1 diff --git a/addons/nametags/functions/fnc_canShow.sqf b/addons/nametags/functions/fnc_canShow.sqf index 0e187fee0f..b53f50c93e 100644 --- a/addons/nametags/functions/fnc_canShow.sqf +++ b/addons/nametags/functions/fnc_canShow.sqf @@ -1,19 +1,22 @@ /* - Author: aeroson - - Description: - Might be called several times a second - - Parameters: - None - - Returns: - true if CrewInfo can be shown, false otherwise -*/ - + * Author: aeroson + * Checks if crew info can be shown. + * Might be called several times a second. + * + * Arguments: + * None + * + * Return Value: + * Can show Crew Info + * + * Example: + * call ace_nametags_fnc_doShow + * + * Public: No + */ #include "script_component.hpp" -private["_player"]; +private ["_player"]; _player = ACE_player; diff --git a/addons/nametags/functions/fnc_doShow.sqf b/addons/nametags/functions/fnc_doShow.sqf index 16a6329347..1b7323921f 100644 --- a/addons/nametags/functions/fnc_doShow.sqf +++ b/addons/nametags/functions/fnc_doShow.sqf @@ -1,16 +1,18 @@ /* - Author: aeroson - - Description: - Shows the actual text and sets text the crew info - - Parameters: - None - - Returns: - Nothing -*/ - + * Author: aeroson + * Shows the actual text and sets text the crew info. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_nametags_fnc_doShow + * + * Public: No + */ #include "script_component.hpp" #include "common.hpp"; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index 6a7db7d5ac..021a4e2a0b 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -1,39 +1,46 @@ /* * Author: commy2, esteldunedain - * * Draw the nametag and rank icon. * - * Argument: + * Arguments: * 0: Unit (Player) * 1: Target - * 2: alpha (Number) - * 4: Height offset (Number) + * 2: Alpha + * 4: Height offset * 5: Draw Type * * Return value: - * None. + * None + * + * Example: + * [ACE_player, _target, _alpha, _distance * 0.026, _icon] call ace_nametags_fnc_drawNameTagIcon + * + * 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" \ - ] - -private ["_height", "_position", "_color", "_name", "_rank", "_size", "_icon"]; - PARAMS_5(_player,_target,_alpha,_heightOffset,_iconType); -if (_alpha < 0) exitWith {}; //Don't waste time if not visable +private ["_position", "_color", "_name", "_rank", "_size", "_icon", "_scale"]; + if (_iconType == ICON_NONE) exitWith {}; //Don't waste time if not visable +//Set Icon: +_icon = ""; +_size = 0; +if ((_iconType == ICON_NAME_SPEAK) || (_iconType == ICON_SPEAK)) then { + _icon = QUOTE(PATHTOF(UI\soundwave)) + str (floor (random 10)) + ".paa"; + _size = 1; + _alpha = _alpha max 0.6;//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))]; + _size = 1; + }; +}; + +if (_alpha < 0) exitWith {}; //Don't waste time if not visable //Set Text: _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { @@ -42,41 +49,28 @@ _name = if (_iconType in [ICON_NAME, ICON_NAME_RANK, ICON_NAME_SPEAK]) then { "" }; -//Set Icon: -_icon = ""; -_size = 0; -if ((_iconType == ICON_NAME_SPEAK) || (_iconType == ICON_SPEAK)) then { - _icon = QUOTE(PATHTOF(UI\soundwave)) + str (floor (random 10)) + ".paa"; - _size = 0.75; - _alpha = _alpha + 0.6;//Boost alpha when speaking -} else { - if (_iconType == ICON_NAME_RANK) then { - _icon = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find (rank _target)) + 1); - _size = 0.75; - }; -}; - //Set Color: 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 { - _color = [[1, 1, 1, _alpha], [1, 0, 0, _alpha], [0, 1, 0, _alpha], [0, 0, 1, _alpha], [1, 1, 0, _alpha]] select (["MAIN", "RED", "GREEN", "BLUE", "YELLOW"] find (if (_target == _player) then {0} else {assignedTeam _target})) max 0 + _color = [[1, 1, 1, _alpha], [1, 0, 0, _alpha], [0, 1, 0, _alpha], [0, 0, 1, _alpha], [1, 1, 0, _alpha]] select ((["MAIN", "RED", "GREEN", "BLUE", "YELLOW"] find (assignedTeam _target)) max 0); }; -_height = [2, 1.5, 1, 1.5, 1] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find (stance _target)); // Convert position to ASLW (expected by drawIcon3D) and add height offsets -_position = _target modelToWorldVisual [0, 0, (_height + _heightOffset)]; +_position = _target modelToWorldVisual ((_target selectionPosition "pilot") vectorAdd [0,0,(_heightOffset + .35)]); + +_scale = [0.333, 0.5, 0.666, 0.83333, 1] select GVAR(tagSize); drawIcon3D [ _icon, _color, _position, -_size, -_size, +(_size * _scale), +(_size * _scale), 0, _name, 2, -0.033, +(0.05 * _scale), "PuristaMedium" ]; diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf index 1538c345a1..6d83b0f573 100644 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ b/addons/nametags/functions/fnc_getVehicleData.sqf @@ -1,46 +1,38 @@ /* - Author: aeroson - - Description: - Gathers and caches data needed by AGM_CrewInfo_fnc_doShow - What really does make difference for the engine is simulation of CfgAmmo - Priority of roles is: driver/pilot, gunner, copilot, commander, ffv, cargo - - Parameters: - None - - Returns: - [ - Is vehicle inherited from Air ? - Array categorizing each vehicle's turret - ] -*/ - + * Author: aeroson + * Gathers and caches data needed by AGM_CrewInfo_fnc_doShow. + * What really does make difference for the engine is simulation of CfgAmmo. + * Priority of roles is: driver/pilot, gunner, copilot, commander, FFV, cargo. + * + * Arguments: + * None + * + * Return Value: + * Data + * 0: Vehicle inherits from Air + * 1: Categorized vehicle's turrets + * + * Example: + * call ace_nametags_fnc_updateSettings + * + * Public: No + */ #include "script_component.hpp" #include "common.hpp"; +private ["_type", "_varName", "_data", "_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"]; -private ["_type", "_varName", "_data"]; - -_type = _this select 0; +PARAMS_1(_type); _varName = format ["ACE_CrewInfo_Cache_%1", _type]; _data = + (uiNamespace getVariable _varName); -if (!isNil "_data") exitWith { - _data -}; +if (!isNil "_data") exitWith {_data}; _data = []; - - - -private ["_isAir", "_config", "_fnc_addTurret", "_fnc_addTurretUnit"]; - _isAir = _type isKindOf "Air"; _fnc_addTurretUnit = { - private ["_config", "_path", "_role", "_simulationEmpty", "_simulationLaserDesignate", "_simulationOther", "_magazine", "_ammo", "_simulation"]; _config = _this select 0; @@ -83,7 +75,6 @@ _fnc_addTurretUnit = { }; _data pushBack [_path, _role]; - }; @@ -108,9 +99,7 @@ _fnc_addTurret = { } else { _offset = _offset + 1; }; - }; - }; diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index c6087541a8..897d223930 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -4,13 +4,13 @@ * Compatiblity with TFR/ACRE and Arma's VON * * Arguments: - * NONE + * None * * Return Value: - * NONE + * None * * Example: - * [] call ACE_nametags_fnc_initIsSpeaking + * [] call ace_nametags_fnc_initIsSpeaking * * Public: No */ diff --git a/addons/nametags/functions/fnc_moduleNameTags.sqf b/addons/nametags/functions/fnc_moduleNameTags.sqf index 1bbd4d8efb..7373d85de1 100644 --- a/addons/nametags/functions/fnc_moduleNameTags.sqf +++ b/addons/nametags/functions/fnc_moduleNameTags.sqf @@ -20,9 +20,14 @@ if !(_activated) exitWith {}; GVAR(Module) = true; -[_logic, QGVAR(PlayerNamesViewDistance), "PlayerNamesViewDistance" ] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(ShowNamesForAI), "ShowNamesForAI" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(playerNamesViewDistance), "playerNamesViewDistance" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(showNamesForAI), "showNamesForAI" ] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(showVehicleCrewInfo), "showVehicleCrewInfo" ] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(showCursorTagForVehicles), "showCursorTagForVehicles" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(showCursorTagForVehicles), "showCursorTagForVehicles" ] call EFUNC(common,readSettingFromModule); + +// Do Not Force - read module setting only non-default is set due to using SCALAR +if ((_logic getVariable "showPlayerNames") != -1) then { + [_logic, QGVAR(showPlayerNames), "showPlayerNames" ] call EFUNC(common,readSettingFromModule); +}; diag_log text "[ACE]: NameTags Module Initialized."; diff --git a/addons/nametags/functions/fnc_onDraw3d.sqf b/addons/nametags/functions/fnc_onDraw3d.sqf index 9efc70aeb9..43996e17b2 100644 --- a/addons/nametags/functions/fnc_onDraw3d.sqf +++ b/addons/nametags/functions/fnc_onDraw3d.sqf @@ -1,12 +1,30 @@ +/* + * Author: + * Draws names and icons. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_nametags_fnc_onDraw3d + * + * Public: No + */ #include "script_component.hpp" -private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target"]; +private ["_onKeyPressAlphaMax", "_defaultIcon", "_distance", "_alpha", "_icon", "_targets", "_pos2", "_vecy", "_relPos", "_projDist", "_pos", "_target", "_targetEyePosASL", "_ambientBrightness", "_maxDistance"]; //don't show nametags in spectator -if (!alive ACE_player) exitWith {}; +if ((isNull ACE_player) || {!alive ACE_player}) exitWith {}; + +_ambientBrightness = ((([] call EFUNC(common,ambientBrightness)) + ([0, 0.4] select ((currentVisionMode ace_player) != 0))) min 1) max 0; +_maxDistance = _ambientBrightness * GVAR(PlayerNamesViewDistance); _onKeyPressAlphaMax = if ((GVAR(showPlayerNames) in [3,4])) then { - 2 + (GVAR(ShowNamesTime) - time); //after release 1 second of full opacity, 1 second of fading to 0 + 2 + (GVAR(showNamesTime) - ACE_time); //after release 1 second of full opacity, 1 second of fading to 0 } else { 1 }; @@ -26,11 +44,10 @@ if (GVAR(showCursorTagForVehicles) && {_onKeyPressAlphaMax > 0}) then { if ((!isNull _target) && {(side (group _target)) == (side (group ACE_player))} && {_target != ACE_player} && - {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && + {GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { _distance = ACE_player distance _target; - _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); - _alpha = _alpha min _onKeyPressAlphaMax; + _alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax; [ACE_player, _target, _alpha, _distance * 0.026, _defaultIcon] call FUNC(drawNameTagIcon); }; }; @@ -43,11 +60,10 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { {_target isKindOf "CAManBase"} && {(side (group _target)) == (side (group ACE_player))} && {_target != ACE_player} && - {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && + {GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { _distance = ACE_player distance _target; - _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); - _alpha = _alpha min _onKeyPressAlphaMax; + _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 _icon = if (([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}) then {ICON_NAME} else {_defaultIcon}; @@ -61,7 +77,7 @@ if ((GVAR(showPlayerNames) in [2,4]) && {_onKeyPressAlphaMax > 0}) then { if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(showSoundWaves) == 2}) then { _pos = positionCameraToWorld [0, 0, 0]; - _targets = _pos nearObjects ["CAManBase", GVAR(PlayerNamesViewDistance) + 5]; + _targets = _pos nearObjects ["CAManBase", _maxDistance + 5]; if (!surfaceIsWater _pos) then { _pos = ATLtoASL _pos; @@ -86,21 +102,17 @@ if (((GVAR(showPlayerNames) in [1,3]) && {_onKeyPressAlphaMax > 0}) || {GVAR(sho if ((_icon != ICON_NONE) && {(side (group _target)) == (side (group ACE_player))} && {_target != ACE_player} && - {GVAR(ShowNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && + {GVAR(showNamesForAI) || {[_target] call EFUNC(common,isPlayer)}} && {!(_target getVariable ["ACE_hideName", false])}) then { - if (lineIntersects [_pos, (visiblePositionASL _target) vectorAdd [0,0,1], vehicle ACE_player, _target]) exitWith {}; // Check if there is line of sight + _targetEyePosASL = eyePos _target; + if (lineIntersects [_pos, _targetEyePosASL, ACE_player, _target]) exitWith {}; // Check if there is line of sight + _relPos = (visiblePositionASL _target) vectorDiff _pos; _distance = vectorMagnitude _relPos; _projDist = _relPos vectorDistance (_vecy vectorMultiply (_relPos vectorDotProduct _vecy)); - _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha); - - if ((GVAR(showSoundWaves) == 2) && {([_target] call FUNC(isSpeaking)) && {(vehicle _target) == _target}}) then { - _alpha = 1; - } else { - _alpha = _alpha min _onKeyPressAlphaMax; - }; + _alpha = (((1 - 0.2 * (_distance - _maxDistance)) min 1) * GVAR(playerNamesMaxAlpha)) min _onKeyPressAlphaMax; [ACE_player, _target, _alpha, _distance * 0.026, _icon] call FUNC(drawNameTagIcon); }; diff --git a/addons/nametags/functions/fnc_setText.sqf b/addons/nametags/functions/fnc_setText.sqf index e7d1b748b1..33112c31d0 100644 --- a/addons/nametags/functions/fnc_setText.sqf +++ b/addons/nametags/functions/fnc_setText.sqf @@ -1,25 +1,28 @@ -/* - Author: aeroson - - Description: - Sets the text on the dialog - - Parameters: - None - - Returns: - Nothing -*/ - +/* + * Author: aeroson + * Sets the text on the dialog. + * + * Arguments: + * 0: Text + * + * Return Value: + * None + * + * Example: + * call ace_nametags_fnc_setText + * + * Public: No + */ #include "script_component.hpp" #define TextIDC 11123 -private["_text", "_ctrl"]; +PARAMS_1(_text); + +private["_ctrl"]; disableSerialization; -_text = _this select 0; _ctrl = (uiNamespace getVariable QGVAR(dialog)) displayCtrl TextIDC; _ctrl ctrlSetStructuredText parseText _text; _ctrl ctrlCommit 0; diff --git a/addons/nametags/functions/fnc_updateSettings.sqf b/addons/nametags/functions/fnc_updateSettings.sqf new file mode 100644 index 0000000000..76110b4f79 --- /dev/null +++ b/addons/nametags/functions/fnc_updateSettings.sqf @@ -0,0 +1,25 @@ +/* + * Author: Jonpas + * Dynamically adds and removes Draw3D based on settings on run-time. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_nametags_fnc_updateSettings + * + * Public: No + */ +#include "script_component.hpp" + +if (isNil QGVAR(drawHandler) && {GVAR(showPlayerNames) != 0}) then { + GVAR(drawHandler) = addMissionEventHandler ["Draw3D", {_this call FUNC(onDraw3d);}]; +} else { + if (!isNil QGVAR(drawHandler) && {GVAR(showPlayerNames) == 0}) then { + removeMissionEventHandler ["Draw3D", GVAR(drawHandler)]; + GVAR(drawHandler) = nil; + }; +}; diff --git a/addons/nametags/script_component.hpp b/addons/nametags/script_component.hpp index e80768a723..7bf0acbc4a 100644 --- a/addons/nametags/script_component.hpp +++ b/addons/nametags/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_NAMETAGS - #define DEBUG_MODE_FULL +#define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_NAMETAGS - #define DEBUG_SETTINGS DEBUG_SETTINGS_NAMETAGS +#define DEBUG_SETTINGS DEBUG_SETTINGS_NAMETAGS #endif #include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 7c2d0356a9..8571b4c537 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -70,8 +70,8 @@ Zobrazit info o posádce vozidla Показывать информацию об экипаже Jármű-legénység adatainak mutatása - Mostra le informazioni sull'equipaggio del veicolo Mostrar tripulantes + Mostra l'elenco del personale a bordo Show name tags for AI units @@ -82,19 +82,19 @@ Wyświetl imiona jednostek AI Afficher les noms des IA Névcímkék mutatása MI-egységeknél - Mostra le tag nomi per le unità AI + Mostra i nomi delle le unità AI Mostrar nomes para unidades de IA Show SoundWaves (requires player names) Schallwellen anzeigen (benötigt Spielernamen) - Mostrar onda sonora (requiere Mostrar nombres de jugadores) + Mostrar onda sonora (requiere Mostrar nombres de jugadores) Индикатор разговора (при вкл. именах) Zobrazit SoundWaves (vyžaduje jména hráčů) Pokaż fale dźwiękowe (wymagana opcja Pokaż imiona graczy) Afficher "qui parle" (si noms affichés) "Hanghullámok" mutatása (a nevek mutatása szükséges) - Mostra barra movimento audio (richiede mostra nomi abilitato) + Mostra movimento audio (richiede mostra nomi abilitato) Mostrar onda sonora (requer nome de jogadores) @@ -106,8 +106,217 @@ Couleur d'affichage par défaut (si dans aucun groupe) Standardní barva jmenovek (pro nečleny jednotky) Alap névcímke-szín (csoporton kívüli személyek) - Colore nametag di default (membri non del gruppo) + Colore dei nomi non appartenenti al gruppo Cor padrão do nome (unidades fora do grupo) + + Name Tags + Ustawienia imion + Etiquetas de nombre + Namensanzeigen + Jmenovky + Etiquetas de nome + + + Player Names View Dist. + Zasięg imion graczy + Distancia de vision para nombres de jugadores + Spielernamen-Distanz + Vzdálenost zobrazení jména hráčů + Distância de visão dos nomes dos jogadores + + + Distance in meters at which player names are shown. Default: 5 + Dystans w metrach, na którym wyświetlane są imiona graczy. Domyślnie: 5 + Distancia en metros a la que se muestran los nombres de los jugadores. Por defecto: 5 + Distanz in Metern bei der Spielernamen angezeigt werden. Standard: 5 + Vzdálenost v metrech pro zobrazení jména. Výchozí: 5 + Distância em metros que os nomes dos jogadores são mostrados. Padrão: 5 + + + Show name tags for AI? + Imiona AI + ¿Mostrar nombres para la IA? + Zeige Namensanzeigen für KI? + Zobrazit jmenovky pro AI? + Mostrar nomes para IA? + + + Show the name and rank tags for friendly AI units? Default: Do not force + Pokaż imiona i rangi przyjaznych jednostek AI? Domyślnie: Nie wymuszaj + Muestra etiquetas de nombre y rango para las unidades IA amigas? Por defecto: No forzar + Zeige den Namen und Rang für freundliche KI-Einheiten? Standard: nicht erwzingen + 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 + Ocultar forzado + Verstecken erzwingen + Vynuceno skrýt + Ocultar forçado + + + Force Show + Wymuś wyświetlanie + Mostrar forzado + Anzeigen erzwingen + Vynuceno zobrazit + Mostrar forçado + + + Show crew info? + Pokaż załogę + ¿Mostrar información de la tripulación? + Zeige Besatzungsinfo? + Zobrazit informace o posádce? + Mostrar informação de tripulação? + + + Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force + Pokaż informacje o obsadzie pojazdu, lub pozwól graczom ustawić tą opcje według własnego uznania. Domyślnie: Nie wymuszaj + Muestra información de la tripulación, o por defecto permite a los jugadores elegirlo. Por defecto: No forzar + Zeige Fahrzeugbesatzungsinfo oder erlaube Spielern es auszuwählen. Standard: nicht erzwingen. + Zobrazit informace o posádce, nebo nechat aby si hráč vybral sám. Výchozí: Nevynucovat + Mostrar informações de tripulação ou por padrão permitir a escolha dos jogadores. Padrão: Não forçar. + + + Show for Vehicles + Pokaż dla pojazdów + Mostrar para vehiculos + Zeige bei Fahrzeugen + Zobrazit pro vozidla + Mostrar para veículos + + + Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No + Pokazuj imię dowódcy pojazdu nad pojazdem (tylko jeżeli klient ma włączone imiona graczy). Domyślnie: Nie + Muestra etiquetas de nombre en el cursor para el comandante del vehiculo (solo si el cliente tiene las etiquetas de nombre activadas) Por defecto: No + Zeige Maus-Namensanzeigen für Fahrzeugkommandanten (nur wenn der Client Namensanzeigen aktiviert hat). Standard: Nein + Zobrazit jmenovky pro velitele vozidla (pouze pokud má klient jmenovky povolené). Výchozí: Ne + Mostrar o nome no cursor para o comandante do veículo (somente se o cliente tiver etiquetas de nomes ativada). Padrão: Não + + + This module allows you to customize settings and range of Name Tags. + Moduł ten pozwala dostosować ustawienia i zasięg wyświetlania imion. + Dieses Modul erlaubt die Einstellungen der Anzeigenamen zu verändern. + Este módulo permite personalizar la configuración y la distancia de las Etiquetas de nombre. + 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 + Solo cursor + Nur bei Maus + Pouze na kurzor + Somente no cursor + + + Only on Keypress + Tylko po wciśnięciu klawisza + Solo al pulsar tecla + Nur bei Tastendruck + Pouze na klávesu + Somente em tecla ativada + + + Only on Cursor and Keypress + Tylko pod kursorem i po wciśnięciu klawisza + En cursor y al pulsar tecla + Nur Maus und Tastendruck + Pouze na kurzor a klávesu + Somente em cursor ou tecla ativada + + + Force Show Only on Cursor + Wymuś pod kursorem + Forzar mostrar solo en el cursor + Vynuceno zobrazit pouze na kurzor + Forçar mostrar somente no cursor + + + Force Show Only on Keypress + Wymuś po wciśnięciu klawisza + Forzar mostrar solo al pulsar tecla + Vynuceno zobrazit pouze na klávesu + Forçar somente mostrar em tecla ativada + + + Force Show Only on Cursor and Keypress + Wymuś pod kursorem i po wciśnięciu klawisza + Forzar mostrar en el cursor y al pulsar tecla + Vynuceno zobrazit pouze na kurzor a klávesu + Forçar mostrar somente em cursor e tecla ativada + + + Use Nametag settings + Użyj ustawień imion + Usar ajustes de etiquetas de nombre + Verwende Namenanzeigen + Použít nastavení jmenovky + Usar ajustes de etiquetas de nome + + + Always Show All + Zawsze pokazuj wszystkie + Mostrar siempre todo + Immer alle zeigen + Vždy zobrazit vše + Sempre mostrar tudo + + + Show player names and set their activation. Default: Enabled + Opcja ta pozwala dostosować sposób wyświetlania imion nad głowami graczy. Opcja "Tylko po wciśnięciu klawisza" wyświetla imiona tylko przytrzymania klawisza "Modyfikator" dostępnego w menu ustawień addonów -> ACE3. + Mostrar nombres de los jugadores y establecer su activación. Predeterminado: Habilitado + Zobrazit jména hráčů a nastavit jejich aktivaci. Výchozí: Povoleno + Mostrar os nomes dos jogadores e definir sua ativação. Padrão: Ativado + + + Effect of sound waves above the heads of speaking players after holding the PTT key. This option works with TFAR and ACRE2. + Opcja ta pozwala dostosować sposób wyświetlania efektu fal dźwiękowych nad głowami mówiących graczy, wyświetlanych po przytrzymaniu klawisza PTT. Opcja ta współpracuje z TFAR oraz ACRE2. + Efecto de ondas sonoras encima de las cabezas de los jugadores que hablan después de mantener la tecla PTT. Esta opción funciona con TFAR y ACRE2. + Efekt zvukových vln nad hlavami hráčů když mluví skrz PTT klávesu. Tato volba funguje s TFAR a ACRE2. + Efeito de ondas sonoras acima das cabeças dos jogadores que falam depois mantendo pressionada a tecla PTT. Esta opção funciona com TFAR e ACRE2. + + + Nametags Size + Rozmiar imion + Tamaño de las Etiquetas de nombre + Velikost jmenovky + Tamanho das etiquetas de nome + + + Text and Icon Size Scaling + Skalowanie tekstu oraz ikon + Escala del texto y el icono + Velikost textu a ikon + Escala de tamanho dos ícones e textos + - + \ No newline at end of file diff --git a/addons/nightvision/$PBOPREFIX$ b/addons/nightvision/$PBOPREFIX$ new file mode 100644 index 0000000000..4a3d560db5 --- /dev/null +++ b/addons/nightvision/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\nightvision \ No newline at end of file diff --git a/addons/nightvision/CfgWeapons.hpp b/addons/nightvision/CfgWeapons.hpp index c40885c2c4..8a053a3262 100644 --- a/addons/nightvision/CfgWeapons.hpp +++ b/addons/nightvision/CfgWeapons.hpp @@ -1,54 +1,54 @@ class CfgWeapons { class Binocular; class NVGoggles: Binocular { - displayName = "$STR_ACE_NightVision_NVG_Gen3_brown"; + displayName = CSTRING(NVG_Gen3_brown); ACE_NightVision_grain = 0.75; ACE_NightVision_blur = 0.055; ACE_NightVision_radBlur = 0.001; }; class NVGoggles_OPFOR: NVGoggles { - displayName = "$STR_ACE_NightVision_NVG_Gen3_black"; + displayName = CSTRING(NVG_Gen3_black); }; class NVGoggles_INDEP: NVGoggles { - displayName = "$STR_ACE_NightVision_NVG_Gen3_green"; + displayName = CSTRING(NVG_Gen3_green); }; class ACE_NVG_Gen1: NVGoggles_OPFOR { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen1"; + displayName = CSTRING(NVG_Gen1); ACE_NightVision_grain = 2.25; ACE_NightVision_blur = 0.22; ACE_NightVision_radBlur = 0.004; }; class ACE_NVG_Gen2: NVGoggles_INDEP { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen2"; + displayName = CSTRING(NVG_Gen2); ACE_NightVision_grain = 1.5; ACE_NightVision_blur = 0.11; ACE_NightVision_radBlur = 0.002; }; /*class ACE_NVG_Gen3: NVGoggles { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen3"; + displayName = CSTRING(NVG_Gen3); ACE_NightVision_grain = 0.75; ACE_NightVision_blur = 0.055; ACE_NightVision_radBlur = 0.001; };*/ class ACE_NVG_Gen4: NVGoggles { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); modelOptics = "\A3\weapons_f\reticle\optics_night"; - displayName = "$STR_ACE_NightVision_NVG_Gen4"; + displayName = CSTRING(NVG_Gen4); ACE_NightVision_grain = 0.0; ACE_NightVision_blur = 0.0; ACE_NightVision_radBlur = 0.0; }; class ACE_NVG_Wide: NVGoggles { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); modelOptics = QUOTE(PATHTOF(models\ACE_nvg_wide_optics)); - displayName = "$STR_ACE_NightVision_NVG_FullScreen"; + displayName = CSTRING(NVG_FullScreen); ACE_NightVision_grain = 0.75; ACE_NightVision_blur = 0.055; ACE_NightVision_radBlur = 0.001; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 3edc3edad5..2839f6e5f9 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -37,10 +37,10 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); // Add keybinds -["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", +["ACE3 Equipment", QGVAR(IncreaseNVGBrightness), localize LSTRING(IncreaseNVGBrightness), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; @@ -51,10 +51,10 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; {false}, [201, [false, false, true]], false] call cba_fnc_addKeybind; //PageUp + ALT -["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", +["ACE3 Equipment", QGVAR(DecreaseNVGBrightness), localize LSTRING(DecreaseNVGBrightness), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index e1894aba00..22f96ce9b1 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -22,12 +22,12 @@ PARAMS_2(_player,_changeInBrightness); _brightness = _player getVariable [QGVAR(NVGBrightness), 0]; -_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 1) max -1; +_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 0.5) max -0.5; _player setVariable [QGVAR(NVGBrightness), _brightness, false]; -GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; +GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, (_brightness + 1), 0, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]]; GVAR(ppEffectNVGBrightness) ppEffectCommit 0; -[format [(localize "STR_ACE_NightVision_NVGBrightness"), (_brightness * 100)]] call EFUNC(common,displayTextStructured); +[format [(localize LSTRING(NVGBrightness)), (_brightness * 10)]] call EFUNC(common,displayTextStructured); playSound "ACE_Sound_Click"; diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index b6f2431eef..050945d5d8 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -5,7 +5,7 @@ NV Goggles (Gen1) Noktovizor (Gen1) JVN (Gen1) - NS-Brille (Gen1) + NS-Brille (1. Gen.) Occhiali notturni (Gen1) Gogle noktowizyjne (Gen1) Óculos de visão noturna (Gen1) @@ -17,7 +17,7 @@ NV Goggles (Gen2) Noktovizor (Gen2) JVN (Gen2) - NS-Brille (Gen2) + NS-Brille (2. Gen.) Occhiali notturni (Gen2) Gogle noktowizyjne (Gen2) Óculos de visão noturna (Gen2) @@ -29,7 +29,7 @@ NV Goggles (Gen3) Noktovizor (Gen3) JVN (Gen3) - NS-Brille (Gen3) + NS-Brille (3. Gen.) Occhiali notturni (Gen3) Gogle noktowizyjne (Gen3) Óculos de visão noturna (Gen3) @@ -41,7 +41,7 @@ NV Goggles (Gen3, Brown) Noktovizor (Gen3, hnědý) JVN (Gen3, marron) - NS-Brille (Gen3, Braun) + NS-Brille (3. Gen., braun) Occhiali notturni (Gen3, marroni) Gogle noktowizyjne (Gen3, brązowe) Óculos de visão noturna (Gen3, marrons) @@ -53,7 +53,7 @@ NV Goggles (Gen3, Green) Noktovizor (Gen3, zelený) JVN (Gen3, vertes) - NS-Brille (Gen3, Grün) + NS-Brille (3. Gen., grün) Occhiali notturni (Gen3, verdi) Gogle noktowizyjne (Gen3, zielone) Óculos de visão noturna (Gen3, verdes) @@ -65,7 +65,7 @@ NV Goggles (Gen3, Black) Noktovizor (Gen3, černý) JVN (Gen3, noires) - NS-Brille (Gen3, Schwarz) + NS-Brille (3. Gen., schwarz) Occhiali notturni (Gen3, neri) Gogle noktowizyjne (Gen3, czarne) Óculos de visão noturna (Gen3, pretos) @@ -77,7 +77,7 @@ NV Goggles (Gen4) Noktovizor (Gen4) JVN (Gen4) - NS-Brille (Gen4) + NS-Brille (4. Gen.) Occhiali notturni (Gen4) Gogle noktowizyjne (Gen4) Óculos de visão noturna (Gen4) @@ -95,6 +95,7 @@ JVN (Large) Éjjellátó szemüveg (széles látószögű) Óculos de visão noturna (Panorâmico) + Occhiali notturni (Larghi) Brightness: %1 @@ -133,4 +134,4 @@ Riduci la luminosità dell'NVG - + \ No newline at end of file diff --git a/addons/noradio/config.cpp b/addons/noradio/config.cpp index 5709806d8f..86697535f8 100644 --- a/addons/noradio/config.cpp +++ b/addons/noradio/config.cpp @@ -1,15 +1,15 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"commy2"}; - authorUrl = "https://github.com/commy2/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; }; #include "CfgEventhandlers.hpp" diff --git a/addons/optics/CfgRscTitles.hpp b/addons/optics/CfgRscTitles.hpp index 068bb0aa20..b7d2005d77 100644 --- a/addons/optics/CfgRscTitles.hpp +++ b/addons/optics/CfgRscTitles.hpp @@ -41,7 +41,7 @@ class RscInGameUI { }; class ACE_RscWeapon_base: RscWeaponZeroing { - controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay"}; // don't change this order + controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay", "trippleHeadLeft", "trippleHeadRight"}; // don't change this order class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used idc = 154; @@ -70,9 +70,9 @@ class RscInGameUI { colorText[] = {1,1,1,0}; colorBackground[] = {0,0,0,0}; x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); w = SIZEX; - h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + h = SIZEX*(4/3); }; class ReticleNight: ReticleDay { @@ -86,15 +86,32 @@ class RscInGameUI { idc = 1713005; text = ""; x = safezoneX+0.5*safezoneW-0.5*SIZEX; - y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + y = safezoneY+0.5*safezoneH-0.5*SIZEX*(4/3); w = SIZEX; - h = SIZEX*safezoneW/safezoneH*(16/9)/(getResolution select 4); + h = SIZEX*(4/3); }; class BodyNight: BodyDay { idc = 1713006; text = ""; }; + + //These are just black side panels to cover the areas that the optics p3d doesn't cover + //It will ONLY effect tripple head users as (safezoneX == safeZoneXAbs) for everyone else + //Reference PR #1156: + class trippleHeadLeft: RscText { + idc = 1713010; + x = "safeZoneXAbs"; + Y = "safezoneY"; + W = "(safezoneX - safeZoneXAbs) * ((getResolution select 4)/(16/3))"; + H = "safeZoneH"; + colorBackground[] = {0,0,0,1}; + }; + class trippleHeadRight: trippleHeadLeft { + idc = 1713011; + x = "safeZoneXAbs + safeZoneWAbs - (safezoneX - safeZoneXABS) * ((getResolution select 4)/(16/3))"; + colorBackground[] = {0,0,0,1}; + }; }; class ACE_RscWeapon_Hamr: ACE_RscWeapon_base { @@ -177,12 +194,12 @@ _ctrl = (D displayCtrl 1713006); _sizeX = 1.54/(getResolution select 5); _sizeY = _sizeX*safezoneW/safezoneH; -_ctrl ctrlSetPosition [ +_ctrl ctrlSetPosition [ safezoneX+0.5*safezoneW-0.5*_sizeX, safezoneY+0.5*safezoneH-0.5*_sizeY, - _sizeX, - _sizeY + _sizeX, + _sizeY ]; _ctrl ctrlCommit 0 -*/ + */ diff --git a/addons/optics/CfgWeapons.hpp b/addons/optics/CfgWeapons.hpp index 5aa06f41a0..11fdb1f427 100644 --- a/addons/optics/CfgWeapons.hpp +++ b/addons/optics/CfgWeapons.hpp @@ -31,7 +31,7 @@ class CfgWeapons { }; /*class ACE_optic_DMS: optic_DMS { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_DMS"; scope = 1; displayName = "LOCALIZE ACE DMS"; @@ -71,9 +71,9 @@ class CfgWeapons { GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\hamr-reticle65_ca.paa)); GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\hamr-reticle65Illum_ca.paa)); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_Hamr_2D"; - displayName = "$STR_ACE_optic_hamr"; + displayName = CSTRING(hamr); weaponInfoType = "ACE_RscWeapon_Hamr"; class ItemInfo: ItemInfo { @@ -96,10 +96,10 @@ class CfgWeapons { }; class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_Hamr_PIP"; //scopeArsenal = 1; - displayName = "$STR_ACE_optic_hamr_pip"; + displayName = CSTRING(hamr_pip); class ItemInfo: ItemInfo { modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d)); @@ -121,9 +121,9 @@ class CfgWeapons { GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\arco-reticle65_ca.paa)); GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\arco-reticle65Illum_ca.paa)); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_Arco_2D"; - displayName = "$STR_ACE_optic_arco"; + displayName = CSTRING(arco); weaponInfoType = "ACE_RscWeapon_Arco"; class ItemInfo: ItemInfo { @@ -145,10 +145,10 @@ class CfgWeapons { }; class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_Arco_PIP"; //scopeArsenal = 1; - displayName = "$STR_ACE_optic_arco_pip"; + displayName = CSTRING(arco_pip); class ItemInfo: ItemInfo { modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d)); @@ -170,9 +170,9 @@ class CfgWeapons { GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\mrco-reticle556_ca.paa)); GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\mrco-reticle556Illum_ca.paa)); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_MRCO_2D"; - displayName = "$STR_ACE_optic_valdada"; + displayName = CSTRING(valdada); weaponInfoType = "ACE_RscWeapon_MRCO"; class ItemInfo: ItemInfo { @@ -194,11 +194,11 @@ class CfgWeapons { }; class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_MRCO_PIP"; scope = 1; //scopeArsenal = 1; - displayName = "$STR_ACE_optic_valdada_pip"; + displayName = CSTRING(valdada_pip); class ItemInfo: ItemInfo { modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d)); @@ -220,9 +220,9 @@ class CfgWeapons { GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa)); GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa)); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_SOS_2D"; - displayName = "$STR_ACE_optic_sos"; + displayName = CSTRING(sos); weaponInfoType = "ACE_RscWeapon_SOS"; class ItemInfo: ItemInfo { @@ -237,10 +237,10 @@ class CfgWeapons { }; class ACE_optic_SOS_PIP: ACE_optic_SOS_2D { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_SOS_PIP"; //scopeArsenal = 1; - displayName = "$STR_ACE_optic_sos_pip"; + displayName = CSTRING(sos_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { @@ -266,9 +266,9 @@ class CfgWeapons { GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa)); GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa)); - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_LRPS_2D"; - displayName = "$STR_ACE_optic_lrps"; + displayName = CSTRING(lrps); weaponInfoType = "ACE_RscWeapon_SOS"; class ItemInfo: ItemInfo { @@ -288,10 +288,10 @@ class CfgWeapons { }; class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); _generalMacro = "ACE_optic_LRPS_PIP"; //scopeArsenal = 1; - displayName = "$STR_ACE_optic_lrps_pip"; + displayName = CSTRING(lrps_pip); class ItemInfo: ItemInfo { class OpticsModes: OpticsModes { diff --git a/addons/optics/XEH_postInit.sqf b/addons/optics/XEH_postInit.sqf index 7f68aece74..df6d0ae486 100644 --- a/addons/optics/XEH_postInit.sqf +++ b/addons/optics/XEH_postInit.sqf @@ -23,7 +23,7 @@ if (!hasInterface) exitWith {}; }; }] call EFUNC(common,addEventHandler); -// camera has to be re-created every time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. +// camera has to be re-created every ACE_time another camera is created. Otherwise r2t is either black or transparent. @todo Add popular custom cameras to the event in ACE_common. ["activeCameraChanged", { if !(_this select 1) then { deleteVehicle GVAR(camera); diff --git a/addons/optics/functions/fnc_handleFired.sqf b/addons/optics/functions/fnc_handleFired.sqf index 51da4c8ead..f0399c37fc 100644 --- a/addons/optics/functions/fnc_handleFired.sqf +++ b/addons/optics/functions/fnc_handleFired.sqf @@ -52,7 +52,7 @@ _scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN private ["_sizeX", "_sizeY"]; _sizeX = (0.75+_recoilScope)/(getResolution select 5); -_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); +_sizeY = _sizeX*(4/3); private "_positionReticle"; _positionReticle = [ @@ -83,7 +83,7 @@ _positionBody = [ // Bring them all back _sizeX = 0.75/(getResolution select 5); -_sizeY = _sizeX*safezoneW/safezoneH*(16/9)/(getResolution select 4); +_sizeY = _sizeX*(4/3); _positionReticle = [ safezoneX+0.5*safezoneW-0.5*_sizeX, diff --git a/addons/optics/functions/fnc_onDrawScope2D.sqf b/addons/optics/functions/fnc_onDrawScope2D.sqf index 30cdb927c7..7abee8f122 100644 --- a/addons/optics/functions/fnc_onDrawScope2D.sqf +++ b/addons/optics/functions/fnc_onDrawScope2D.sqf @@ -12,24 +12,29 @@ if (!ctrlShown (_display displayCtrl 154)) exitWith { (_display displayCtrl 1713002) ctrlShow false; (_display displayCtrl 1713005) ctrlShow false; (_display displayCtrl 1713006) ctrlShow false; -}; - -GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; -GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; -GVAR(camera) camCommitPrepared 0; - -// @todo, check if that needs to be done at all -if (cameraView == "GUNNER") then { - GVAR(camera) camsetFOV 0.7; - GVAR(camera) camcommit 0; -} else { - GVAR(camera) camsetFOV 0.01; - GVAR(camera) camcommit 0; + (_display displayCtrl 1713010) ctrlShow false; + (_display displayCtrl 1713011) ctrlShow false; }; // @todo, all weapon types -private "_optic"; +private ["_optic", "_isPIP"]; _optic = (primaryWeaponItems ACE_player) select 2; +_isPIP = (getText (configFile >> "CfgWeapons" >> _optic >> "ItemInfo" >> "modelOptics")) == QUOTE(PATHTOF(models\ace_optics_pip.p3d)); + +if (_isPIP) then { + GVAR(camera) setposATL positioncameratoworld [0,0,0.4]; + GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50]; + GVAR(camera) camCommitPrepared 0; + + // @todo, check if that needs to be done at all + if (cameraView == "GUNNER") then { + GVAR(camera) camsetFOV 0.7; + GVAR(camera) camcommit 0; + } else { + GVAR(camera) camsetFOV 0.01; + GVAR(camera) camcommit 0; + }; +}; // calculate lighting private ["_dayOpacity", "_nightOpacity"]; @@ -48,9 +53,11 @@ _nightOpacity = [1,0] select (_dayOpacity == 1); (_display displayCtrl 1713002) ctrlCommit 0; (_display displayCtrl 1713005) ctrlCommit 0; (_display displayCtrl 1713006) ctrlCommit 0; -*/ + */ (_display displayCtrl 1713001) ctrlShow true; (_display displayCtrl 1713002) ctrlShow true; (_display displayCtrl 1713005) ctrlShow true; (_display displayCtrl 1713006) ctrlShow true; +(_display displayCtrl 1713010) ctrlShow _isPIP; +(_display displayCtrl 1713011) ctrlShow _isPIP; diff --git a/addons/optics/stringtable.xml b/addons/optics/stringtable.xml index f9964c4310..a6818a90d3 100644 --- a/addons/optics/stringtable.xml +++ b/addons/optics/stringtable.xml @@ -1,7 +1,7 @@  - + RCO (2D) RCO (2D) RCO (2D) @@ -13,7 +13,7 @@ RCO (2D) RCO (2D) - + RCO (PIP) RCO (PIP) RCO (PIP) @@ -25,7 +25,7 @@ RCO (PIP) RCO (PIP) - + ARCO (2D) ARCO (2D) ARCO (2D) @@ -37,7 +37,7 @@ ARCO (2D) ARCO (2D) - + ARCO (PIP) ARCO (PIP) ARCO (PIP) @@ -49,7 +49,7 @@ ARCO (PIP) ARCO (PIP) - + MRCO (2D) MRCO (2D) MRCO (2D) @@ -61,7 +61,7 @@ MRCO (2D) MRCO (2D) - + MRCO (PIP) MRCO (PIP) MRCO (PIP) @@ -73,7 +73,7 @@ MRCO (PIP) MRCO (PIP) - + MOS (2D) MOS (2D) MOS (2D) @@ -85,7 +85,7 @@ MOS (2D) MOS (2D) - + MOS (PIP) MOS (PIP) MOS (PIP) @@ -97,7 +97,7 @@ MOS (PIP) MOS (PIP) - + LRPS (2D) LRPS (2D) LRPS (2D) @@ -109,7 +109,7 @@ MPLD (2D) LRPS (2D) - + LRPS (PIP) LRPS (PIP) LRPS (PIP) diff --git a/addons/optionsmenu/ACE_Settings.hpp b/addons/optionsmenu/ACE_Settings.hpp new file mode 100644 index 0000000000..0badbad660 --- /dev/null +++ b/addons/optionsmenu/ACE_Settings.hpp @@ -0,0 +1,15 @@ +class ACE_Settings { + class GVAR(optionMenuDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSettable = 1; + displayName = CSTRING(uiScaing); + values[] = {"$str_medium", "$str_large", "$str_very_large"}; + }; + class GVAR(showNewsOnMainMenu) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = CSTRING(showNewsOnMainMenu_name); + }; +}; diff --git a/addons/optionsmenu/CfgVehicles.hpp b/addons/optionsmenu/CfgVehicles.hpp index 2a19aa2966..1357417add 100644 --- a/addons/optionsmenu/CfgVehicles.hpp +++ b/addons/optionsmenu/CfgVehicles.hpp @@ -1,28 +1,26 @@ class CfgVehicles { class ACE_Module; - // TODO localization for all the modules class ACE_moduleAllowConfigExport: ACE_Module { scope = 2; - displayName = "Allow Config Export [ACE]"; + displayName = CSTRING(AllowConfigExport_Module_DisplayName); //icon = ""; category = "ACE"; function = QUOTE(DFUNC(moduleAllowConfigExport)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class allowconfigurationExport { - displayName = "Allow"; - description = "Allow export of all settings to a server config formatted."; + displayName = CSTRING(AllowConfigExport_allowconfigurationExport_DisplayName); + description = CSTRING(AllowConfigExport_allowconfigurationExport_Description); typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = "When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard."; + description = CSTRING(AllowConfigExport_Module_Description); sync[] = {}; }; }; - -}; \ No newline at end of file +}; diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf index 42f50287f2..e35784560a 100644 --- a/addons/optionsmenu/XEH_preInit.sqf +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(debugDumpToClipboard); PREP(onListBoxSettingsChanged); PREP(onListBoxShowSelectionChanged); PREP(onSettingsMenuOpen); diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 36389568d3..17e4887db6 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -27,16 +27,7 @@ class CfgAddons { #include "gui\pauseMenu.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(optionMenuDisplaySize) { - value = 0; - typeName = "SCALAR"; - isClientSettable = 1; - displayName = "$STR_ACE_optionsMenu_uiScaing"; - values[] = {"$str_medium", "$str_large", "$str_very_large"}; - }; -}; +#include "ACE_Settings.hpp" class ACE_Extensions { extensions[] += {"ace_clipboard"}; diff --git a/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf new file mode 100644 index 0000000000..755982e569 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf @@ -0,0 +1,87 @@ +/* + * Author: PabstMirror + * Dumps debug info to clipboard. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_debugDumpToClipboard + * + * Public: No + */ +#include "script_component.hpp" + +private ["_var", "_unit", "_outputText", "_text"]; + +#define MIN_ARRAY_SIZE 10 + +_outputText = { + diag_log text (_this select 0); + "ace_clipboard" callExtension ((_this select 0) + " +"); +}; + +_text = format ["~~~~~~~~~ACE Debug~~~~~~~~~ +time = %1 + +------Performance------ +diag_fps = %2 +count ace_common_waitAndExecArray = %3 +count cba_common_perFrameHandlerArray = %4 (max %5) +count diag_activeSQFScripts = %6 +count diag_activeSQSScripts = %7 +count diag_activeMissionFSMs = %8", +time, diag_fps, count ace_common_waitAndExecArray, {!isNil "_x"} count cba_common_perFrameHandlerArray, count cba_common_perFrameHandlerArray, count diag_activeSQFScripts, count diag_activeSQSScripts,count diag_activeMissionFSMs]; +[_text] call _outputText; + + +_text = format [" +------Player------ +typeOf = %1 +animationState = %2", +if (isNull ace_player) then {"null"} else {typeOf ace_player}, +if (isNull ace_player) then {"null"} else {animationState ace_player}]; +[_text] call _outputText; + + +_text = format [" +------ACE Settings------"]; +[_text] call _outputText; + + +{ + _var = missionNamespace getVariable [(_x select 0), "ERROR: Not Defined"]; + _text = format ["%1 - %2", (_x select 0), _var]; + [_text] call _outputText; +} forEach EGVAR(common,settings); + + +_text = format [" +------Array Info (count >= %1)------", MIN_ARRAY_SIZE]; +[_text] call _outputText; + + +{ + _var = missionNamespace getVariable [_x, nil]; + if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then { + _text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)]; + [_text] call _outputText; + }; +} forEach (allVariables missionNamespace); + +{ + _unit = _x; + { + _var = _unit getVariable [_x, nil]; + if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then { + _text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)]; + [_text] call _outputText; + }; + } forEach (allVariables _unit); +} forEach allUnits; + +"ace_clipboard" callExtension "--COMPLETE--"; diff --git a/addons/optionsmenu/functions/fnc_exportSettings.sqf b/addons/optionsmenu/functions/fnc_exportSettings.sqf index 68dc7fbecd..fa76b8752a 100644 --- a/addons/optionsmenu/functions/fnc_exportSettings.sqf +++ b/addons/optionsmenu/functions/fnc_exportSettings.sqf @@ -18,8 +18,6 @@ private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"]; -_compiledConfig = " -"; { /*_settingData = [ _name, @@ -55,26 +53,12 @@ class %1 { force = 1; };", _name, _value, format['"%1"', _typeName]]; - _compiledConfig = _compiledConfig + _compiledConfigEntry; + "ace_clipboard" callExtension _compiledConfigEntry; }; } forEach EGVAR(common,settings); -FUNC(clipboardExport) = { - private["_chunks"]; - _chunks = []; - - _chunks = [_this select 0, ";"] call CBA_fnc_split; - - { - private["_chunk"]; - _chunk = _x + ";"; - "ace_clipboard" callExtension format["%1", _chunk]; - } forEach _chunks; - - "ace_clipboard" callExtension "--COMPLETE--"; -}; -[_compiledConfig] call FUNC(clipboardExport); + "ace_clipboard" callExtension "--COMPLETE--"; -["STR_ACE_OptionsMenu_settingsExported"] call EFUNC(common,displayTextStructured); +[LSTRING(settingsExported)] call EFUNC(common,displayTextStructured); diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index 25fd99b5d8..0ddcc8d2a9 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -26,7 +26,7 @@ _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_OPTIONS): { - _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabOptions")]; + _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -39,7 +39,7 @@ case (MENU_TAB_OPTIONS): { (_settingsMenu displayCtrl 413) ctrlShow false; }; case (MENU_TAB_COLORS): { - _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabColors")]; + _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; ctrlSetText [13, _localizedHeader]; lbClear 400; diff --git a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf index aaeec2d9ac..669faf74ed 100644 --- a/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onServerListBoxShowSelectionChanged.sqf @@ -26,7 +26,7 @@ _settingsMenu = uiNamespace getVariable 'ACE_serverSettingsMenu'; switch (GVAR(optionMenu_openTab)) do { case (MENU_TAB_SERVER_OPTIONS): { - _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabOptions")]; + _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabOptions))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -43,7 +43,7 @@ case (MENU_TAB_SERVER_OPTIONS): { (_settingsMenu displayCtrl 416) ctrlEnable false; }; case (MENU_TAB_SERVER_COLORS): { - _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabColors")]; + _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabColors))]; ctrlSetText [13, _localizedHeader]; lbClear 400; @@ -67,7 +67,7 @@ case (MENU_TAB_SERVER_COLORS): { (_settingsMenu displayCtrl 416) ctrlEnable false; }; case (MENU_TAB_SERVER_VALUES): { - _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabValues")]; + _localizedHeader = format ["%1: %2", (localize LSTRING(OpenConfigMenu)), (localize LSTRING(TabValues))]; ctrlSetText [13, _localizedHeader]; lbClear 400; diff --git a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf index f5501d0860..4f96438042 100644 --- a/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onServerSettingsMenuOpen.sqf @@ -61,7 +61,7 @@ _menu = uiNamespace getvariable "ACE_serverSettingsMenu"; (_menu displayCtrl 1003) ctrlEnable false; if (GVAR(ClientSettingsExportIncluded)) then { - (_settingsMenu displayCtrl 1102) ctrlSetText localize ("STR_ACE_OptionsMenu_exClientSettings"); + (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(exClientSettings)); } else { - (_settingsMenu displayCtrl 1102) ctrlSetText localize ("STR_ACE_OptionsMenu_inClientSettings"); + (_settingsMenu displayCtrl 1102) ctrlSetText localize (LSTRING(inClientSettings)); }; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf index 52984b78f3..9daee053bb 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateKeyView.sqf @@ -56,8 +56,8 @@ if (count _collection > 0) then { // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + lbAdd [400, (localize LSTRING(Disabled))]; + lbAdd [400, (localize LSTRING(Enabled))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; @@ -77,10 +77,10 @@ if (count _collection > 0) then { // Created disable/enable options for bools _expectedType = switch (_setting select 1) do { - case "STRING": {"STR_ACE_OptionsMenu_stringType"}; - case "ARRAY": {"STR_ACE_OptionsMenu_arrayType"}; - case "SCALAR": {"STR_ACE_OptionsMenu_scalarType"}; - default {"STR_ACE_optionsMenu_unknownType"}; + case "STRING": {LSTRING(stringType)}; + case "ARRAY": {LSTRING(arrayType)}; + case "SCALAR": {LSTRING(scalarType)}; + default {LSTRING(unknownType)}; }; (_settingsMenu displayCtrl 414) ctrlSetText format["%1", _settingsValue]; (_settingsMenu displayCtrl 415) ctrlSetText format[localize _expectedType]; diff --git a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf index dad3012e1b..f3e393bbfd 100644 --- a/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_serverSettingsMenuUpdateList.sqf @@ -37,7 +37,7 @@ switch (GVAR(optionMenu_openTab)) do { // Created disable/enable options for bools _settingsText = if ((_x select 1) == "BOOL") then { - [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; } else { (_x select 5) select _settingsValue; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index 39bbdb8c94..3777093ccd 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -56,8 +56,8 @@ if (count _collection > 0) then { // Created disable/enable options for bools if ((_setting select 1) == "BOOL") then { lbClear 400; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + lbAdd [400, (localize LSTRING(Disabled))]; + lbAdd [400, (localize LSTRING(Enabled))]; _settingsValue = [0, 1] select _settingsValue; } else { lbClear 400; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 513b187d7d..fdd9128ca3 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -34,7 +34,7 @@ switch (GVAR(optionMenu_openTab)) do { // Created disable/enable options for bools _settingsText = if ((_x select 1) == "BOOL") then { - [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + [(localize LSTRING(Disabled)), (localize LSTRING(Enabled))] select _settingsValue; } else { (_x select 5) select _settingsValue; }; diff --git a/addons/optionsmenu/gui/define.hpp b/addons/optionsmenu/gui/define.hpp index cb4fe1b509..2a3fffc736 100644 --- a/addons/optionsmenu/gui/define.hpp +++ b/addons/optionsmenu/gui/define.hpp @@ -7,6 +7,9 @@ class ACE_gui_staticBase; class ACE_gui_listNBox; class ACE_gui_comboBoxBase; class RscXSliderH; +class RscControlsGroupNoScrollbars; +class RscHTML; +class RscText; #ifndef ACE_DEFINE_H diff --git a/addons/optionsmenu/gui/pauseMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp index c4cbae9916..d80547f2b6 100644 --- a/addons/optionsmenu/gui/pauseMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -60,7 +60,7 @@ class ACE_Open_SettingsMenu_BtnBase : ACE_gui_buttonBase { soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1}; soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1}; style = "0x02 + 0xC0"; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + text = CSTRING(OpenConfigMenu); textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; tooltip = ""; tooltipColorBox[] = {1,1,1,1}; @@ -98,12 +98,73 @@ class RscDisplayInterruptEditor3D: RscStandardDisplay { class RscDisplayMain: RscStandardDisplay { //Hide the button if there is no world (-world=empty) //Seems odd to use onMouseMoving, but I don't want to overload onLoad - onMouseMoving = "((_this select 0) displayCtrl 80085) ctrlShow (missionName != '');"; + onMouseMoving = QUOTE(((_this select 0) displayCtrl 80085) ctrlShow (missionName != ''); _this execVM QUOTE(QUOTE(PATHTOF(script_loadMainMenuBox.sqf)));); + class controls { class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase { action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};"; y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; idc = 80085; }; + + class ACE_news: RscControlsGroupNoScrollbars { + idc = 80086; + x = "safezoneX + safezoneW - (16 *(((safezoneW / safezoneH) min 1.2) / 40))"; + y = "safezoneY + (18.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.95 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + class controls { + class ACE_NewsTitle: RscText { + text = CSTRING(aceNews); + colorBackground[] = {(162/255),(28/255),(28/255),0.8}; + idc = -1; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 *(((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class ACE_VersionInfo: RscText { + idc = 68; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; + }; + class ACE_NewsBackground: RscText { + idc = -1; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "5.75 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0,0,0,0.5}; + }; + class ACE_NewsText: RscHTML { + idc = 69; + x = "0.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "2.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "14 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "2.75 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + + shadow = 0; + class H1 { + font = "PuristaMedium"; + fontBold = "PuristaLight"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + }; + class H2: H1 { + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + font = "PuristaLight"; + }; + class P: H1 { + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + fontBold = "PuristaLight"; + }; + colorBold[] = {0.6,0.6,0.6,1}; + colorLink[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + colorLinkActive[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])",1}; + }; + }; + }; }; }; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 04e7ee5aaa..fc3a90c66e 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -71,7 +71,7 @@ class ACE_settingsMenu { SizeEx = H_PART(1); colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + text = CSTRING(OpenConfigMenu); }; class labelSubHeader: ACE_gui_staticBase { idc = 13; @@ -83,7 +83,7 @@ class ACE_settingsMenu { }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; + text = CSTRING(TabOptions); x = X_PART(1); y = Y_PART(2.1); w = W_PART(9.5); @@ -109,7 +109,7 @@ class ACE_settingsMenu { }; class selectionAction_2: selectionAction_1 { idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; + text = CSTRING(TabColors); x = X_PART(10.5); action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); }; @@ -158,7 +158,7 @@ class ACE_settingsMenu { class Label2: labelKey { idc = 301; y = Y_PART(7.3); - text = "$STR_ACE_OptionsMenu_Setting"; + text = CSTRING(Setting); SizeEx = H_PART(1); }; class comboBox1: ACE_gui_comboBoxBase { @@ -238,15 +238,22 @@ class ACE_settingsMenu { }; class action_reset: actionClose { idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; + text = CSTRING(ResetAll); x = X_PART(9.5); action = QUOTE([] call FUNC(resetSettings)); }; class action_exportServerConfig: actionClose { idc = 1102; - text = "$STR_ACE_OptionsMenu_OpenExport"; + text = CSTRING(OpenExport); x = X_PART(18); action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; }); + }; + class action_debug: actionClose { + idc = 1102; + text = CSTRING(DumpDebug); + x = X_PART(26.5); + action = QUOTE([] call FUNC(debugDumpToClipboard)); + tooltip = CSTRING(DumpDebugTooltip); }; }; }; @@ -266,7 +273,7 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { SizeEx = H_PART(1); colorText[] = {0.95, 0.95, 0.95, 0.75}; colorBackground[] = {0,0,0,0}; - text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + text = CSTRING(OpenConfigMenu); }; class labelSubHeader: ACE_gui_staticBase { idc = 13; @@ -278,7 +285,7 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { }; class selectionAction_1: ACE_gui_buttonBase { idc = 1000; - text = "$STR_ACE_OptionsMenu_TabOptions"; + text = CSTRING(TabOptions); x = X_PART(1); y = Y_PART(2.1); w = W_PART(9.5); @@ -302,13 +309,13 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { }; class selectionAction_2: selectionAction_1 { idc = 1001; - text = "$STR_ACE_OptionsMenu_TabColors"; + text = CSTRING(TabColors); x = X_PART(10.5); action = QUOTE([MENU_TAB_SERVER_COLORS] call FUNC(onServerListBoxShowSelectionChanged);); }; class selectionAction_3: selectionAction_1 { idc = 1002; - text = "$STR_ACE_OptionsMenu_TabValues"; + text = CSTRING(TabValues); x = X_PART(20); action = QUOTE([MENU_TAB_SERVER_VALUES] call FUNC(onServerListBoxShowSelectionChanged);); }; @@ -351,7 +358,7 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { class Label2: labelKey { idc = 301; y = Y_PART(7.3); - text = "$STR_ACE_OptionsMenu_Setting"; + text = CSTRING(Setting); SizeEx = H_PART(1); }; class comboBox1: ACE_gui_comboBoxBase { @@ -411,7 +418,7 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { }; class saveInputButton: selectionAction_1 { idc = 416; - text = "$STR_ACE_OptionsMenu_SaveInput"; + text = CSTRING(SaveInput); x = X_PART(27.1); y = Y_PART(9.1); w = W_PART(11); @@ -432,19 +439,19 @@ class ACE_serverSettingsMenu: ACE_settingsMenu { class actionClose; class action_reset: actionClose { idc = 1100; - text = "$STR_ACE_OptionsMenu_ResetAll"; + text = CSTRING(ResetAll); x = X_PART(26.1); action = QUOTE([] call FUNC(serverResetSettings)); }; class action_exportServerConfig: actionClose { idc = 1101; - text = "$STR_ACE_OptionsMenu_Export"; + text = CSTRING(Export); x = X_PART(1); action = QUOTE([] call FUNC(exportSettings)); }; class action_toggleIncludeClientSettings: actionClose { idc = 1102; - text = "$STR_ACE_OptionsMenu_inClientSettings"; + text = CSTRING(inClientSettings); x = X_PART(9); action = QUOTE([] call FUNC(toggleIncludeClientSettings)); }; diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp index 7b86dbe0dd..d25caa2c42 100644 --- a/addons/optionsmenu/script_component.hpp +++ b/addons/optionsmenu/script_component.hpp @@ -1,6 +1,6 @@ #define COMPONENT optionsmenu -#define DEBUG_MODE_FULL +// #define DEBUG_MODE_FULL #include "\z\ace\addons\main\script_mod.hpp" diff --git a/addons/optionsmenu/script_loadMainMenuBox.sqf b/addons/optionsmenu/script_loadMainMenuBox.sqf new file mode 100644 index 0000000000..9c556e5128 --- /dev/null +++ b/addons/optionsmenu/script_loadMainMenuBox.sqf @@ -0,0 +1,31 @@ +/* + * Author: PabstMirror + * Loads the version info HTML box from main menu + * + * Arguments: + * 0: Display (from onMouseMoving) + * + * Return Value: + * None + * + * Example: + * onMouseMovingEvent execVM "script_loadMainMenuBox.sqf"; + * + * Public: No + */ +#include "script_component.hpp" + +if (missionNamespace getVariable [QGVAR(newsLoaded), false]) exitWith {}; +GVAR(newsLoaded) = true; + +//Need to load from profileNamespace because ace_settings might not be init if world = empty +if (profileNamespace getVariable [QGVAR(showNewsOnMainMenu), true]) then { + ((_this select 0) displayCtrl 80086) ctrlShow true; + + private ["_version"]; + _version = getText (configFile >> "CfgPatches" >> "ace_main" >> "versionStr"); + ((_this select 0) displayCtrl 68) ctrlSetText format ["Installed Version: %1", _version]; + ((_this select 0) displayCtrl 69) htmlLoad "http://ace3mod.com/version.html"; +} else { + ((_this select 0) displayCtrl 80086) ctrlShow false; +}; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 378661da50..d1b6199413 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -3,7 +3,7 @@ ACE Options - ACE Optionen + ACE-Optionen Opciones ACE Ustawienia ACE ACE Nastavení @@ -169,7 +169,7 @@ Numero Número - + Uknown input type Unbekannter Eingabetyp Tipo de entrada desconocida @@ -229,7 +229,7 @@ Parametri esportati alla clipboard Opções exportadas para o clipboard. - + Option Menu UI Scaling Menu option: taille de l'UI Skalowanie UI menu ustawień @@ -239,6 +239,123 @@ UI Skalierung Beállításmenü kezelőfelületének skálázása Escalar o menu de opções + Proporzioni della interfaccia utente + + + Allow Config Export [ACE] + Pozwól na eksport ustawień [ACE] + [ACE] Permitir exportar configuración + Erlaube Config-Export [ACE] + Povolit export natavení [ACE] + [ACE] Permitir exportação de configurações + + + Allow + Zezwól + Permitir + Erlaube + Povolit + Permitir + + + Allow export of all settings to a server config formatted. + Zezwól na eksport wszystkich ustawień do formatu konfiguracji serwera. + Permitir la exportación de todos los ajustes de configuración a un servidor con formato. + Erlaube alle Einstellungen in einer Server-Config zu exportieren. + Povolit exportovat všechna nastavení do formátu server configu. + Permitir exportação de todas as configurações para uma configuração formatada de servidor. + + + When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. + Jeżeli ustawione na zezwól, wtedy będziesz mieć dostęp do ekranu modyfikacji wszystich ustawień i zmiennych ACE, a także będziesz mieć możliwość eksportu tychże ustawień do formatu rozpoznawalnego przez userconfig serwera. Kliknięcie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Działa tylko w trybie SP. + Cuando esta permitido, se tiene acceso a los ajustes de modificación y exportación en SP. Pulsar en exportar copiara la configuración al portapapeles. + Wenn erlaubt, können die Einstellungsmodifikationen angezeigt und im SP exportiert werden. Wenn auf "Exportieren" geklickt wird, wird eine formatierte Config-Datei in der Zwischenablage abgespeichert. + Pokud je povoleno, budete mít přístup k modifikaci nastavení a exportování v SP. Kliknutím na export umístníte formátovaný config do vaší schránky. + Quando permitido, você tem acesso à modificação de definições e exportação em SP. Clicando em exportação colocará a configuração formatada em sua área de transferência. + + + Hide + Ukryj + Ocultar + Verstecken + Skrýt + Ocultar + + + Top right, downwards + Po prawej u góry, w dół + Arriba a la derecha, hacia abajo + Open rechts, nach unten + Vpravo nahoře, dolů + Superior direito, para baixo + + + Top right, to the left + Po prawej u góry, do lewej + Arriba a la derecha, hacia la izquierda + Von rechts nach links + Vpravo nahoře, do leva + Superior direito, à esquerda + + + Top left, downwards + Po lewej u góry, w dół + Arriba a la izquierda, hacia abajo + Von links, nach unten + Vlevo nahoře, dolů + Superior esquerdo, para baixo + + + Top left, to the right + Po lewej u góry, do prawej + Arriba a la izquierda, hacia la derecha + Oben links nach rechts + Vlevo nahoře, do prava + Superior esquerdo, para a direita + + + Top + Góra + Arriba + Oben + Nahoře + Acima + + + Bottom + Dół + Abajo + Unten + Dole + Abaixo + + + Debug To Clipboard + Debuguj do schowka + Depurar al portapapeles + Debug do schránky + Depuração para área de transferência + + + Sends debug information to RPT and clipboard. + Wysyła informacje o debugowaniu do RPT oraz schowka. + Envía información de depuración al RPT y el portapapeles. + Pošle debug informace do RPT a schránky. + Envia informação de depuração para RPT e área de transferência. + + + ACE News + Noticias ACE + Notícias do ACE + Wiadomości ACE + ACE Novinky + + + Show News on Main Menu + Mostrar noticias en el menú principal + Mostrar notícias no menu principal + Pokazuj wiadomości ACE w menu głównym + Zobrazit novinky v hlavním menu \ No newline at end of file diff --git a/addons/overheating/ACE_Settings.hpp b/addons/overheating/ACE_Settings.hpp new file mode 100644 index 0000000000..2d63614a40 --- /dev/null +++ b/addons/overheating/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayTextOnJam) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = CSTRING(SettingDisplayTextName); + description = CSTRING(SettingDisplayTextDesc); + }; +}; diff --git a/addons/overheating/CfgVehicles.hpp b/addons/overheating/CfgVehicles.hpp index 5c7f7b9eb6..a198ef71b6 100644 --- a/addons/overheating/CfgVehicles.hpp +++ b/addons/overheating/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class ACE_SwapBarrel { - displayName = "$STR_ACE_Overheating_SwapBarrel"; + displayName = CSTRING(SwapBarrel); condition = QUOTE( 'ACE_SpareBarrel' in items _player && {getNumber (configFile >> 'CfgWeapons' >> currentWeapon _player >> 'ACE_Overheating_allowSwapBarrel') == 1} ); statement = QUOTE( [ARR_2(_player, currentWeapon _player)] call FUNC(swapBarrel); ); showDisabled = 0; @@ -14,9 +14,9 @@ class CfgVehicles { hotkey = "B"; }; class ACE_CheckTemperature { - displayName = "$STR_ACE_Overheating_CheckTemperatureShort"; + displayName = CSTRING(CheckTemperatureShort); condition = "switch (currentWeapon _player) do {case (''): {false}; case (primaryWeapon _player); case (secondaryWeapon _player); case (handgunWeapon _player): {true}; default {false}}"; - exceptions[] = {"isNotInside"}; + exceptions[] = {"isNotInside", "isNotSitting"}; statement = QUOTE( [ARR_2(_player, currentWeapon _player)] call FUNC(CheckTemperature); ); showDisabled = 0; priority = 2.9; diff --git a/addons/overheating/CfgWeapons.hpp b/addons/overheating/CfgWeapons.hpp index 12ec43024f..025fa5e280 100644 --- a/addons/overheating/CfgWeapons.hpp +++ b/addons/overheating/CfgWeapons.hpp @@ -3,8 +3,8 @@ class CfgWeapons { class InventoryItem_Base_F; class ACE_SpareBarrel: ACE_ItemCore { - displayname = "$STR_ACE_Overheating_SpareBarrelName"; - descriptionshort = "$STR_ACE_Overheating_SpareBarrelDescription"; + displayname = CSTRING(SpareBarrelName); + descriptionshort = CSTRING(SpareBarrelDescription); //model = ""; picture = QUOTE(PATHTOF(UI\spare_barrel_ca.paa)); scope = 2; @@ -40,7 +40,21 @@ class CfgWeapons { ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; }; + + class MMG_02_base_F: Rifle_Long_Base_F { + ACE_Overheating_allowSwapBarrel = 1; + ACE_Overheating_Dispersion[] = {0, -0.001, 0.001, 0.004}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; + }; + class MMG_01_base_F: Rifle_Long_Base_F { + ACE_Overheating_allowSwapBarrel = 1; + ACE_Overheating_Dispersion[] = {0, -0.001, 0.001, 0.004}; + ACE_Overheating_SlowdownFactor[] = {1, 1, 1, 0.9}; + ACE_Overheating_JamChance[] = {0, 0.0003, 0.0015, 0.0075}; + }; + class arifle_MX_SW_F : arifle_MX_Base_F { ACE_clearJamAction = ""; // Custom jam clearing action. Use empty string to undefine. ACE_Overheating_allowSwapBarrel = 1; // 1 to enable barrel swap. 0 to disable. Meant for machine guns where you can easily swap the barrel without dismantling the whole weapon. diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index 5e7089ab75..0dad0dd32c 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -4,7 +4,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3 Weapons", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", +["ACE3 Weapons", QGVAR(unjamWeapon), localize LSTRING(UnjamWeapon), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index bd6cdbbdd3..0e899e1b25 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -20,13 +20,5 @@ class CfgPatches { #include "CfgWeapons.hpp" -class ACE_Settings { - class GVAR(DisplayTextOnJam) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_overheating_SettingDisplayTextName"; - description = "$STR_ACE_overheating_SettingDisplayTextDesc"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/overheating/functions/fnc_clearJam.sqf b/addons/overheating/functions/fnc_clearJam.sqf index 4bba92eb3f..1c7e959a98 100644 --- a/addons/overheating/functions/fnc_clearJam.sqf +++ b/addons/overheating/functions/fnc_clearJam.sqf @@ -52,6 +52,6 @@ if (_weapon in _jammedWeapons) then { }; if (GVAR(DisplayTextOnJam)) then { - [localize "STR_ACE_Overheating_WeaponUnjammed"] call EFUNC(common,displayTextStructured); + [localize LSTRING(WeaponUnjammed)] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/overheating/functions/fnc_cooldown.sqf b/addons/overheating/functions/fnc_cooldown.sqf index f5a7f68c36..8fb0e0127b 100644 --- a/addons/overheating/functions/fnc_cooldown.sqf +++ b/addons/overheating/functions/fnc_cooldown.sqf @@ -16,7 +16,7 @@ EXPLODE_3_PVT(_this,_temperature,_barrelMass,_totalTime); -// If a long time passed since the last shot, there's no need to calculate anything; the weapon should be cool +// If a long ACE_time passed since the last shot, there's no need to calculate anything; the weapon should be cool if (_totalTime > 1800) exitWith {0}; private ["_barrelSurface", "_time", "_deltaTime"]; diff --git a/addons/overheating/functions/fnc_displayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf index 3012e480e3..521b998fa7 100644 --- a/addons/overheating/functions/fnc_displayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -26,12 +26,12 @@ _time = _overheat select 1; _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; // Calculate cooling -_temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown); +_temperature = [_temperature, _barrelMass, ACE_time - _time] call FUNC(cooldown); //["Overheating", _temperature, {format ["Temperature: %1 °C", _this]}] call EFUNC(common,log); // Store new temperature -_time = time; +_time = ACE_time; _player setVariable [_string, [_temperature, _time], false]; diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 7810fb0ce2..1249cac690 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -62,7 +62,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { playSound3D ["a3\sounds_f\weapons\Other\dry9.wss", _this select 0]; if (!(missionNamespace getVariable [QGVAR(knowAboutJam), false]) && {(_this select 1) ammo currentWeapon (_this select 1) > 0} && {GVAR(DisplayTextOnJam)}) then { - [localize "STR_ACE_Overheating_WeaponJammed"] call EFUNC(common,displayTextStructured); + [localize LSTRING(WeaponJammed)] call EFUNC(common,displayTextStructured); GVAR(knowAboutJam) = true; }; }; @@ -75,7 +75,7 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { [_this select 1, currentWeapon (_this select 1), false] call FUNC(clearJam); }; - //_id = [_unit, format ["%1", localize "STR_ACE_Overheating_UnjamWeapon"], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(common,addActionMenuEventHandler); + //_id = [_unit, format ["%1", localize LSTRING(UnjamWeapon)], "DefaultAction", _condition, _statement, _condition2, _statement2, 10] call EFUNC(common,addActionMenuEventHandler); _id = [_unit, "DefaultAction", _condition, _statement] call EFUNC(common,addActionEventHandler); _unit setVariable [QGVAR(JammingActionID), _id]; diff --git a/addons/overheating/functions/fnc_overheat.sqf b/addons/overheating/functions/fnc_overheat.sqf index 05e5bbba9c..ee1c8f9ff5 100644 --- a/addons/overheating/functions/fnc_overheat.sqf +++ b/addons/overheating/functions/fnc_overheat.sqf @@ -35,8 +35,7 @@ _temperature = _overheat select 0; _time = _overheat select 1; // Get physical parameters -// Bullet mass is read from config in grains and converted to grams -_bulletMass = (getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_BulletMass")) * 0.06480; +_bulletMass = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_BulletMass"); if (_bulletMass == 0) then { // If the bullet mass is not configured, estimate it directly in grams _bulletMass = 3.4334 + 0.5171 * (getNumber (configFile >> "CfgAmmo" >> _ammo >> "hit") + getNumber (configFile >> "CfgAmmo" >> _ammo >> "caliber")); @@ -45,12 +44,12 @@ _energyIncrement = 0.75 * 0.0005 * _bulletMass * (vectorMagnitudeSqr _velocity); _barrelMass = 0.50 * (getNumber (configFile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo" >> "mass") / 22.0) max 1.0; // Calculate cooling -_temperature = [_temperature, _barrelMass, time - _time] call FUNC(cooldown); +_temperature = [_temperature, _barrelMass, ACE_time - _time] call FUNC(cooldown); // Calculate heating _temperature = _temperature + _energyIncrement / (_barrelMass * 466); // Steel Heat Capacity = 466 J/(Kg.K) // set updated values -_time = time; +_time = ACE_time; _unit setVariable [_variableName, [_temperature, _time], false]; _scaledTemperature = (_temperature / 1000) min 1 max 0; diff --git a/addons/overheating/functions/fnc_swapBarrel.sqf b/addons/overheating/functions/fnc_swapBarrel.sqf index 2384fb470e..4bd0f734b9 100644 --- a/addons/overheating/functions/fnc_swapBarrel.sqf +++ b/addons/overheating/functions/fnc_swapBarrel.sqf @@ -22,4 +22,4 @@ _player playActionNow "GestureDismountMuzzle"; _player playAction "GestureMountMuzzle"; playSound "ACE_BarrelSwap"; -[10, [_player, _weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, (localize "STR_ACE_Overheating_SwappingBarrel")] call EFUNC(common,progressBar); +[10, [_player, _weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar); diff --git a/addons/overheating/functions/fnc_swapBarrelCallback.sqf b/addons/overheating/functions/fnc_swapBarrelCallback.sqf index e626bf2aea..5947e381c7 100644 --- a/addons/overheating/functions/fnc_swapBarrelCallback.sqf +++ b/addons/overheating/functions/fnc_swapBarrelCallback.sqf @@ -16,6 +16,6 @@ EXPLODE_2_PVT(_this,_player,_weapon); // don't consume the barrel, but rotate through them. -[localize "STR_ACE_Overheating_SwappedBarrel", QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture); +[localize LSTRING(SwappedBarrel), QUOTE(PATHTOF(UI\spare_barrel_ca.paa))] call EFUNC(common,displayTextPicture); _player setVariable [format [QGVAR(%1), _weapon], [0, 0], false]; diff --git a/addons/overheating/script_component.hpp b/addons/overheating/script_component.hpp index 46a31e6ea3..ff124851ad 100644 --- a/addons/overheating/script_component.hpp +++ b/addons/overheating/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT overheating -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERHEATING #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_OVERHEATING #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index 491b587fc2..28dc8b95c7 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -1,7 +1,7 @@  - + Display text on jam Zeige Text bei Ladehemmung Mostrar texto al encasquillarse @@ -13,7 +13,7 @@ Mostrar texto quando trava acontecer Visualizza testo in caso di inceppamento - + Display a notification whenever your weapon gets jammed Zeige einen Hinweis, wenn die Waffe eine Ladehemmung hat. Mostrar notificación cada vez que el arma se encasquille diff --git a/addons/overpressure/script_component.hpp b/addons/overpressure/script_component.hpp index 21f4cea704..3a44df1f9b 100644 --- a/addons/overpressure/script_component.hpp +++ b/addons/overpressure/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT overpressure -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_OVERPRESSURE #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_ENABLED_OVERPRESSURE #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index 04732d0506..bc5ecbd60f 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -17,9 +17,9 @@ class CfgVehicles { class B_Parachute; class ACE_NonSteerableParachute: B_Parachute { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; - displayName = "$STR_ACE_Parachute_NonSteerableParachute"; + displayName = CSTRING(NonSteerableParachute); //picture = "\A3\Characters_F\data\ui\icon_b_parachute_ca.paa"; // @todo //model = "\A3\Weapons_F\Ammoboxes\Bags\Backpack_Parachute"; // @todo // backpackSimulation = "ParachuteNonSteerable"; //ParachuteSteerable //Bis broke this in 1.40 diff --git a/addons/parachute/CfgWeapons.hpp b/addons/parachute/CfgWeapons.hpp index 067d065bf0..4ca785a1ea 100644 --- a/addons/parachute/CfgWeapons.hpp +++ b/addons/parachute/CfgWeapons.hpp @@ -3,9 +3,9 @@ class CfgWeapons { class ACE_Altimeter: ItemWatch { ACE_hideItemType = "Watch"; - author = "$STR_ACE_Common_ACETeam"; - descriptionShort = "$STR_ACE_Parachute_AltimeterDescription"; - displayName = "$STR_ACE_Parachute_AltimeterDisplayName"; + author = ECSTRING(common,ACETeam); + descriptionShort = CSTRING(AltimeterDescription); + displayName = CSTRING(AltimeterDisplayName); picture = PATHTOF(UI\watch_altimeter.paa); }; }; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index a6c589a39a..a8f83b43a3 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -17,7 +17,7 @@ if (!hasInterface) exitWith {}; -["ACE3 Equipment", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", +["ACE3 Equipment", QGVAR(showAltimeter), localize LSTRING(showAltimeter), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/parachute/functions/fnc_doLanding.sqf b/addons/parachute/functions/fnc_doLanding.sqf index 126a3b0720..a620c5a4ca 100644 --- a/addons/parachute/functions/fnc_doLanding.sqf +++ b/addons/parachute/functions/fnc_doLanding.sqf @@ -19,8 +19,8 @@ _unit = _this select 0; GVAR(PFH) = false; [_unit, "AmovPercMevaSrasWrflDf_AmovPknlMstpSrasWrflDnon", 2] call EFUNC(common,doAnimation); [{ - if (time >= ((_this select 0) select 0) + 1) then { + if (ACE_time >= ((_this select 0) select 0) + 1) then { ((_this select 0) select 1) playActionNow "Crouch"; [(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler); }; -}, 1, [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 45816cc883..9960e3f727 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -39,7 +39,7 @@ GVAR(AltimeterActive) = true; _minute = floor ((daytime - _hour) * 60); _height = (getPosASL _unit) select 2; - _curTime = time; + _curTime = ACE_time; _timeDiff = _curTime - _prevTime; _descentRate = if(_timeDiff > 0) then {floor((_oldHeight - _height) / _timeDiff)} else {0}; @@ -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), 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/ragdolls/script_component.hpp b/addons/ragdolls/script_component.hpp index 3382ff70ce..a0de706e10 100644 --- a/addons/ragdolls/script_component.hpp +++ b/addons/ragdolls/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT ragdolls -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_RAGDOLLS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_RAGDOLLS #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/rangecard/$PBOPREFIX$ b/addons/rangecard/$PBOPREFIX$ new file mode 100644 index 0000000000..b319ce4b0d --- /dev/null +++ b/addons/rangecard/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\rangecard \ No newline at end of file diff --git a/addons/rangecard/CfgEventHandlers.hpp b/addons/rangecard/CfgEventHandlers.hpp new file mode 100644 index 0000000000..3996e3371d --- /dev/null +++ b/addons/rangecard/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) ); + }; +}; \ No newline at end of file diff --git a/addons/rangecard/CfgVehicles.hpp b/addons/rangecard/CfgVehicles.hpp new file mode 100644 index 0000000000..a5832756ff --- /dev/null +++ b/addons/rangecard/CfgVehicles.hpp @@ -0,0 +1,69 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_Actions { + class ACE_Weapon { + class GVAR(copyRangeCard) { + displayName = CSTRING(CopyRangeCard); + distance = 2.0; + condition = QUOTE(_target call FUNC(canCopy)); + statement = QUOTE(_target call FUNC(updateClassNames)); + icon = QUOTE(PATHTOF(UI\RangeCard_Icon.paa)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(open) { + displayName = CSTRING(OpenRangeCard); + condition = QUOTE(call FUNC(canShow) && !GVAR(RangeCardOpened)); + statement = QUOTE(false call FUNC(openRangeCard)); + showDisabled = 0; + priority = 0.1; + icon = QUOTE(PATHTOF(UI\RangeCard_Icon.paa)); + exceptions[] = {"notOnMap"}; + class GVAR(openCopy) { + displayName = CSTRING(OpenRangeCardCopy); + condition = QUOTE(call FUNC(canShowCopy) && !GVAR(RangeCardOpened)); + statement = QUOTE(true call FUNC(openRangeCard)); + showDisabled = 0; + priority = 0.1; + icon = QUOTE(PATHTOF(UI\RangeCard_Icon.paa)); + exceptions[] = {"notOnMap"}; + }; + class GVAR(makeCopy) { + displayName = CSTRING(CopyRangeCard); + condition = QUOTE(call FUNC(canShow) && !GVAR(RangeCardOpened)); + statement = QUOTE(GVAR(ammoClassCopy) = GVAR(ammoClass); GVAR(magazineClassCopy) = GVAR(magazineClass); GVAR(weaponClassCopy) = GVAR(ammoClass);); + showDisabled = 0; + priority = 0.1; + icon = QUOTE(PATHTOF(UI\RangeCard_Icon.paa)); + exceptions[] = {"notOnMap"}; + }; + }; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_RangeCard: Item_Base_F { + author = "Ruthberg"; + scope = 2; + scopeCurator = 2; + displayName = "Range Card"; + vehicleClass = "Items"; + class TransportItems { + class ACE_RangeCard { + name = "ACE_RangeCard"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_RangeCard,6); + }; + }; +}; diff --git a/addons/rangecard/CfgWeapons.hpp b/addons/rangecard/CfgWeapons.hpp new file mode 100644 index 0000000000..7195c0a008 --- /dev/null +++ b/addons/rangecard/CfgWeapons.hpp @@ -0,0 +1,19 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_RangeCard: ACE_ItemCore { + author[] = {"Ruthberg"}; + scope = 2; + displayName = CSTRING(Name); + descriptionShort = CSTRING(Description); + picture = PATHTOF(UI\RangeCard_Icon.paa); + icon = "iconObject_circle"; + mapSize = 0.034; + + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; + }; +}; diff --git a/addons/rangecard/README.md b/addons/rangecard/README.md new file mode 100644 index 0000000000..c96e151869 --- /dev/null +++ b/addons/rangecard/README.md @@ -0,0 +1,10 @@ +ace_rangecards +=============== + +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 diff --git a/addons/rangecard/RscTitles.hpp b/addons/rangecard/RscTitles.hpp new file mode 100644 index 0000000000..c4da1862ca --- /dev/null +++ b/addons/rangecard/RscTitles.hpp @@ -0,0 +1,198 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +class RscListNBox; +class ScrollBar; + +class RangeCard_RscText { + idc=-1; + type=0; + style=ST_CENTER; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={0,0,0,0}; + colorText[]={0,0,0,1}; + text=""; + x=0; + y=0; + h=0.028; + w=0.06; + font="TahomaB"; + SizeEx=0.025; + shadow=0; +}; + +class RangeCard_RscListNBox: RscListNBox { + idc=-1; + type=102; + style=0; + font="TahomaB"; + sizeEx=0.026; + rowHeight=0.027; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={1,1,1,1}; + colorText[]={0,0,0,1}; + colorScrollbar[]={0.95,0.95,0.95,1}; + colorSelect[]={0,0,0,1}; + colorSelect2[]={0,0,0,1}; + colorSelectBackground[]={1,1,1,0}; + colorSelectBackground2[]={1,1,1,0}; + period=0; + LineSpacing=0; + maxHistoryDelay=1.0; + autoScrollSpeed=-1; + autoScrollDelay=5; + autoScrollRewind=0; + soundSelect[]={"",0.09,1}; + drawSideArrows=0; + idcLeft=-1; + idcRight=-1; + + class ScrollBar { + color[]={1,1,1,0.6}; + colorActive[]={1,1,1,1}; + colorDisabled[]={1,1,1,0.3}; + }; + + class ListScrollBar : ScrollBar { + }; +}; + +class ACE_RangeCard_Dialog { + idd = -1; + movingEnable = 1; + onLoad = "uiNamespace setVariable ['RangleCard_Display', (_this select 0)]"; + onUnload = QUOTE(_this call FUNC(onCloseDialog)); + objects[] = {}; + + class controls { + class BACKGROUND { + moving=1; + type=0; + font="TahomaB"; + SizeEX=0.025; + idc=-1; + style=48; + x="safezoneX"; + y="safezoneY+0.181889"; + w="1.62727*3/4"; + h="1.62727"; + colorBackground[]={1,1,1,1}; + colorText[]={1,1,1,1}; + text=QUOTE(PATHTOF(UI\RangeCard.paa)); + }; + class CAPTION_TEXT_1: RangeCard_RscText { + idc=770000; + style=ST_LEFT; + x="safezoneX+0.18"; + y="safezoneY+0.181889+0.0"; + w="0.56*1.62727*3/4"; + text=".408 CheyTac - 410 gr Predator Projectiles"; + }; + class CAPTION_TEXT_2: CAPTION_TEXT_1 { + idc=770001; + SizeEx=0.022; + y="safezoneY+0.181889+0.03"; + text="Drop Tables for B.P.: 1013.25mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C"; + }; + class CAPTION_TEXT_3: CAPTION_TEXT_2 { + idc=770002; + y="safezoneY+0.181889+0.06"; + text="CheyTac Intervention - 29'' 1:13'' twist (M-200)"; + }; + class ZERO_RANGE_TEXT: RangeCard_RscText { + idc=77003; + style=ST_LEFT; + SizeEx=0.028; + x="safezoneX+0.885"; + y="safezoneY+0.181889+0.01"; + w="0.125*1.62727*3/4"; + text="100m ZERO"; + }; + class BAROMETRIC_PRESSURE_TEXT: ZERO_RANGE_TEXT { + idc=77004; + colorText[]={1,0,0,0.8}; + y="safezoneY+0.181889+0.05"; + text="B.P.: 1013.25mb"; + }; + class TARGET_RANGE_TEXT_1: RangeCard_RscText { + idc=770010; + colorText[]={1,1,1,1}; + x="safezoneX+0.185"; + y="safezoneY+0.181889+0.098"; + text="Target"; + }; + class TARGET_RANGE_TEXT_2: TARGET_RANGE_TEXT_1 { + idc=770011; + SizeEx=0.03; + y="safezoneY+0.181889+0.125"; + text="Range"; + }; + class TARGET_RANGE_TEXT_3: TARGET_RANGE_TEXT_1 { + idc=770012; + y="safezoneY+0.181889+0.152"; + text="(m)"; + }; + class BULLET_DROP_TEXT_1: RangeCard_RscText { + idc=770013; + x="safezoneX+0.25"; + y="safezoneY+0.181889+0.095"; + w="0.405*1.62727*3/4"; + text="Bullet Drop (MRADs)"; + }; + class WIND_LEAD_CAPTION_LIST: RangeCard_RscListNBox { + idc=770100; + sizeEx=0.021; + x="safezoneX+0.728"; + y="safezoneY+0.181889+0.091"; + w="0.25*1.62727*3/4"; + h="0.0909445"; + columns[]={(0.03/2), (0.985/2)}; + idcLeft=770101; + idcRight=770102; + }; + class TEMPERATURE_CAPTION_LIST_1: RangeCard_RscListNBox { + idc=770200; + x="safezoneX+0.24"; + y="safezoneY+0.181889+0.125"; + w="0.405*1.62727*3/4"; + h="0.0909445"; + columns[]={(0/9), (1/9), (2/9), (3/9), (4/9), (5/9), (5.9/9), (6.9/9), (7.8/9)}; + idcLeft=770201; + idcRight=770202; + }; + class TEMPERATURE_CAPTION_LIST_2: RangeCard_RscListNBox { + idc=770300; + x="safezoneX+0.728"; + y="safezoneY+0.181889+0.15"; + w="0.25*1.62727*3/4"; + h="0.0909445"; + columns[]={(0/6), (0.9/6), (1.8/6), (2.9/6), (3.8/6), (4.8/6)}; + idcLeft=770301; + idcRight=770302; + }; + class RANGE_CARD_DATA: RangeCard_RscListNBox { + idc=770400; + x="safezoneX+0.182"; + y="safezoneY+0.181889+0.194"; + w="0.72*1.62727*3/4"; + h="1.62727"; + columns[]={(0/16), (1.2/16), (2.2/16), (3.2/16), (4.2/16), (5.1/16), (6.1/16), (7.1/16), (8.1/16), + (9/16), (10.2/16), (11/16), (11.9/16), (12.8/16), (13.7/16), (14.6/16)}; + idcLeft=770401; + idcRight=770402; + }; + class FOOTNOTE_TEXT_1: CAPTION_TEXT_1 { + idc=770020; + SizeEx=0.022; + y="safezoneY+1.72431"; + w="0.705*1.62727*3/4"; + text="For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"; + }; + class FOOTNOTE_TEXT_2: FOOTNOTE_TEXT_1 { + idc=770021; + y="safezoneY+1.72431+0.024"; + text="and load with optic mounted 1.5'' above line of bore."; + }; + }; +}; diff --git a/addons/rangecard/UI/RangeCard.paa b/addons/rangecard/UI/RangeCard.paa new file mode 100644 index 0000000000..56f0bfd30c Binary files /dev/null and b/addons/rangecard/UI/RangeCard.paa differ diff --git a/addons/rangecard/UI/RangeCard_Icon.paa b/addons/rangecard/UI/RangeCard_Icon.paa new file mode 100644 index 0000000000..62cf0156de Binary files /dev/null and b/addons/rangecard/UI/RangeCard_Icon.paa differ diff --git a/addons/rangecard/XEH_postInit.sqf b/addons/rangecard/XEH_postInit.sqf new file mode 100644 index 0000000000..8396d76b39 --- /dev/null +++ b/addons/rangecard/XEH_postInit.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +#include "initKeybinds.sqf" + +GVAR(RangeCardOpened) = false; + +GVAR(controls) = []; + +GVAR(ammoClass) = "B_65x39_Caseless"; +GVAR(magazineClass) = "30Rnd_65x39_caseless_mag"; +GVAR(weaponClass) = "arifle_MXM_F"; + +GVAR(ammoClassCopy) = "";//"ACE_762x51_Ball_M118LR"; +GVAR(magazineClassCopy) = "";//"ACE_20Rnd_762x51_M118LR_Mag"; +GVAR(weaponClassCopy) = "";//srifle_DMR_06_olive_F"; diff --git a/addons/rangecard/XEH_preInit.sqf b/addons/rangecard/XEH_preInit.sqf new file mode 100644 index 0000000000..5e5685d30f --- /dev/null +++ b/addons/rangecard/XEH_preInit.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(calculateSolution); +PREP(canCopy); +PREP(canShow); +PREP(canShowCopy); +PREP(onCloseDialog); +PREP(openRangeCard); +PREP(updateClassNames); +PREP(updateRangeCard); + +ADDON = true; diff --git a/addons/rangecard/config.cpp b/addons/rangecard/config.cpp new file mode 100644 index 0000000000..abe4e859f2 --- /dev/null +++ b/addons/rangecard/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_RangeCard"}; + weapons[] = {"ACE_RangeCard"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ACE_Advanced_Ballistics"}; + author = "Ruthberg"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "RscTitles.hpp" \ No newline at end of file diff --git a/addons/rangecard/functions/fnc_calculateSolution.sqf b/addons/rangecard/functions/fnc_calculateSolution.sqf new file mode 100644 index 0000000000..ea86d9986e --- /dev/null +++ b/addons/rangecard/functions/fnc_calculateSolution.sqf @@ -0,0 +1,218 @@ +/* + * Author: Ruthberg + * Calculates the range card data + * + * Arguments: + * 0: Scope base angle + * 1: Bullet mass + * 2: Bore height + * 3: air friction + * 4: muzzle velocity + * 5: temperature + * 6: barometric pressure + * 7: relative humidity + * 8: simulation steps + * 9: wind speed + * 10: wind direction + * 11: inclination angle + * 12: target speed + * 13: target range + * 14: ballistic coefficient + * 15: drag model + * 16: atmosphere model + * 17: Store range card data? + * 18: Stability factor + * 19: Twist Direction + * 20: Latitude + * 21: Direction of Fire + * 22: Range Card Slot + * 23: Use advanced ballistics config? + * + * Return Value: + * 0: Elevation (MOA) + * 1: Windage (MOA) + * 2: Lead (MOA) + * 3: Time of fligth (SECONDS) + * 4: Remaining velocity (m/s) + * 5: Remaining kinetic energy (ft·lb) + * 6: Vertical coriolis drift (MOA) + * 7: Horizontal coriolis drift (MOA) + * 8: Spin drift (MOA) + * + * Example: + * call ace_rangecard_calculate_range_card_data + * + * Public: No + */ +#include "script_component.hpp" + +private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed1", "_windSpeed2", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_drag", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData", "_stabilityFactor", "_twistDirection", "_latitude", "_directionOfFire", "_rangeCardSlot", "_useABConfig"]; +_scopeBaseAngle = _this select 0; +_bulletMass = _this select 1; +_boreHeight = _this select 2; +_airFriction = _this select 3; +_muzzleVelocity = _this select 4; +_temperature = _this select 5; +_barometricPressure = _this select 6; +_relativeHumidity = _this select 7; +_simSteps = _this select 8; +_windSpeed1 = (_this select 9) select 0; +_windSpeed2 = (_this select 9) select 1; +_windDirection = _this select 10; +_inclinationAngle = _this select 11; +_targetSpeed = _this select 12; +_targetRange = _this select 13; +_bc = _this select 14; +_dragModel = _this select 15; +_atmosphereModel = _this select 16; +_storeRangeCardData = _this select 17; +_stabilityFactor = _this select 18; +_twistDirection = _this select 19; +_latitude = _this select 20; +_directionOfFire = _this select 21; +_rangeCardSlot = _this select 22; +_useABConfig = _this select 23; + +if (_storeRangeCardData) then { + GVAR(rangeCardDataMVs) set [_rangeCardSlot, format[" %1", round(_muzzleVelocity)]]; +}; + +private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_bulletSpeed", "_gravity", "_deltaT", "_speedOfSound"]; +_bulletPos = [0, 0, 0]; +_bulletVelocity = [0, 0, 0]; +_bulletAccel = [0, 0, 0]; +_bulletSpeed = 0; +_gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; +_deltaT = 1 / _simSteps; +_speedOfSound = 0; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _speedOfSound = _temperature call EFUNC(weather,calculateSpeedOfSound); +}; + +private ["_elevation", "_windage1", "_windage2", "_lead", "_TOF", "_trueVelocity", "_trueSpeed", "_kineticEnergy", "_verticalCoriolis", "_verticalDeflection", "_horizontalCoriolis", "_horizontalDeflection", "_spinDrift", "_spinDeflection"]; +_elevation = 0; +_windage1 = 0; +_windage2 = 0; +_lead = 0; +_TOF = 0; +_trueVelocity = [0, 0, 0]; +_trueSpeed = 0; +_verticalCoriolis = 0; +_verticalDeflection = 0; +_horizontalCoriolis = 0; +_horizontalDeflection = 0; +_spinDrift = 0; +_spinDeflection = 0; + +private ["_n", "_range"]; +_n = 0; +_range = 0; + +private ["_wind1", "_wind2", "_windDrift"]; +_wind1 = [cos(270 - _windDirection * 30) * _windSpeed1, sin(270 - _windDirection * 30) * _windSpeed1, 0]; +_wind2 = [cos(270 - _windDirection * 30) * _windSpeed2, sin(270 - _windDirection * 30) * _windSpeed2, 0]; +_windDrift = 0; +if (_useABConfig) then { + _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call EFUNC(advanced_ballistics,calculateAtmosphericCorrection); +}; + +private ["_airFrictionCoef", "_airDensity"]; +_airFrictionCoef = 1; +if (!_useABConfig && (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { + _airDensity = [_temperature, _barometricPressure, _relativeHumidity] call EFUNC(weather,calculateAirDensity); + _airFrictionCoef = _airDensity / 1.22498; +}; + +private ["_speedTotal", "_stepsTotal", "_speedAverage"]; +_speedTotal = 0; +_stepsTotal = 0; +_speedAverage = 0; + +_bulletPos set [0, 0]; +_bulletPos set [1, 0]; +_bulletPos set [2, -(_boreHeight / 100)]; + +_bulletVelocity set [0, 0]; +_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; + +while {_TOF < 6 && (_bulletPos select 1) < _targetRange} do { + _bulletSpeed = vectorMagnitude _bulletVelocity; + + _speedTotal = _speedTotal + _bulletSpeed; + _stepsTotal = _stepsTotal + 1; + _speedAverage = (_speedTotal / _stepsTotal); + + if (_speedAverage > 450 && _bulletSpeed < _speedOfSound) exitWith {}; + if (atan((_bulletPos select 2) / (abs(_bulletPos select 1) + 1)) < -2.254) exitWith {}; + + _trueVelocity = _bulletVelocity vectorDiff _wind1; + _trueSpeed = vectorMagnitude _trueVelocity; + + if (_useABConfig) then { + _drag = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,extensionAvailable), false]) then { + parseNumber(("ace_advanced_ballistics" callExtension format["retard:%1:%2:%3", _dragModel, _bc, _trueSpeed])) + } else { + ([_dragModel, _bc, _trueSpeed] call EFUNC(advanced_ballistics,calculateRetardation)) + }; + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (-1 * _drag); + } else { + _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction * _airFrictionCoef); + }; + + _bulletAccel = _bulletAccel vectorAdd _gravity; + + _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply _deltaT); + + _TOF = _TOF + _deltaT; + + if (_storeRangeCardData) then { + _range = GVAR(rangeCardStartRange) + _n * GVAR(rangeCardIncrement); + if ((_bulletPos select 1) >= _range && _range <= GVAR(rangeCardEndRange)) then { + if ((_bulletPos select 1) > 0) then { + _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + }; + if (_range != 0) then { + _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); + }; + private ["_elevationString", "_windageString", "_leadString"]; + _elevationString = Str(round(-_elevation * 60 / 3.38 * 10) / 10); + if (_elevationString == "0") then { + _elevationString = "-0.0"; + }; + if (_elevationString find "." == -1) then { + _elevationString = _elevationString + ".0"; + }; + _windageString = Str(round(_windage1 * 60 / 3.38 * 10) / 10); + if (_windageString find "." == -1) then { + _windageString = _windageString + ".0"; + }; + _leadString = Str(round(_lead * 10) / 10); + if (_leadString find "." == -1) then { + _leadString = _leadString + ".0"; + }; + (GVAR(rangeCardDataElevation) select _rangeCardSlot) set [_n, _elevationString]; + (GVAR(rangeCardDataWindage) select _rangeCardSlot) set [_n, _windageString]; + (GVAR(rangeCardDataLead) select _rangeCardSlot) set [_n, _leadString]; + _n = _n + 1; + }; + }; +}; + +if ((_bulletPos select 1) > 0) then { + _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); + _windage1 = - atan((_bulletPos select 0) / (_bulletPos select 1)); + _windDrift = (_wind2 select 0) * (_TOF - _targetRange / _muzzleVelocity); + _windage2 = - atan(_windDrift / (_bulletPos select 1)); +}; + +if (_targetRange != 0) then { + _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange); +}; + +_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); +_kineticEnergy = _kineticEnergy * 0.737562149; + +[_elevation * 60, [_windage1 * 60, _windage2 * 60], _lead, _TOF, _bulletSpeed, _kineticEnergy, _verticalCoriolis * 60, _horizontalCoriolis * 60, _spinDrift * 60] \ No newline at end of file diff --git a/addons/rangecard/functions/fnc_canCopy.sqf b/addons/rangecard/functions/fnc_canCopy.sqf new file mode 100644 index 0000000000..c9e0a05d0e --- /dev/null +++ b/addons/rangecard/functions/fnc_canCopy.sqf @@ -0,0 +1,18 @@ +/* + * Authors: Ruthberg + * Checks if the target has a copyable range card + * + * Arguments: + * unit + * + * Return Value: + * canShow (bool) + * + * Example: + * [] call ace_rangecard_fnc_canCopy + * + * Public: No + */ +#include "script_component.hpp" + +((primaryWeapon _this) != "" && [_this] call EFUNC(common,isPlayer) && [_this, "ACE_RangeCard"] call EFUNC(common,hasItem)) diff --git a/addons/rangecard/functions/fnc_canShow.sqf b/addons/rangecard/functions/fnc_canShow.sqf new file mode 100644 index 0000000000..330788ee7c --- /dev/null +++ b/addons/rangecard/functions/fnc_canShow.sqf @@ -0,0 +1,18 @@ +/* + * Authors: Ruthberg + * Tests if the Range Card can be shown + * + * Arguments: + * Nothing + * + * Return Value: + * canShow (bool) + * + * Example: + * [] call ace_rangecard_fnc_canShow + * + * Public: No + */ +#include "script_component.hpp" + +(GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "" && !GVAR(RangeCardOpened) && ("ACE_RangeCard" in (uniformItems ACE_player)) || ("ACE_RangeCard" in (vestItems ACE_player))) diff --git a/addons/rangecard/functions/fnc_canShowCopy.sqf b/addons/rangecard/functions/fnc_canShowCopy.sqf new file mode 100644 index 0000000000..e78c64cc89 --- /dev/null +++ b/addons/rangecard/functions/fnc_canShowCopy.sqf @@ -0,0 +1,18 @@ +/* + * Authors: Ruthberg + * Tests if the Range Card copy can be shown + * + * Arguments: + * Nothing + * + * Return Value: + * canShow (bool) + * + * Example: + * [] call ace_rangecard_fnc_canShowCopy + * + * Public: No + */ +#include "script_component.hpp" + +(GVAR(ammoClassCopy) != "" && GVAR(magazineClassCopy) != "" && GVAR(weaponClassCopy) != "" && !GVAR(RangeCardOpened) && ("ACE_RangeCard" in (uniformItems ACE_player)) || ("ACE_RangeCard" in (vestItems ACE_player))) diff --git a/addons/rangecard/functions/fnc_onCloseDialog.sqf b/addons/rangecard/functions/fnc_onCloseDialog.sqf new file mode 100644 index 0000000000..f5d971f22f --- /dev/null +++ b/addons/rangecard/functions/fnc_onCloseDialog.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +uiNamespace setVariable ['RangleCard_Display', nil]; +GVAR(RangeCardOpened) = false; diff --git a/addons/rangecard/functions/fnc_openRangeCard.sqf b/addons/rangecard/functions/fnc_openRangeCard.sqf new file mode 100644 index 0000000000..3e886eb97a --- /dev/null +++ b/addons/rangecard/functions/fnc_openRangeCard.sqf @@ -0,0 +1,36 @@ +/* + * Authors: Ruthberg + * Opens the range card dialog + * + * Arguments: + * Open copy? + * + * Return Value: + * Nothing + * + * Example: + * call ace_rangecard_fnc_openRangeCard + * + * Public: No + */ +#include "script_component.hpp" + +if (GVAR(RangeCardOpened)) exitWith {}; + +if (_this) then { + if (GVAR(ammoClassCopy) != "" && GVAR(magazineClassCopy) != "" && GVAR(weaponClassCopy) != "") then { + GVAR(RangeCardOpened) = true; + + createDialog "ACE_RangeCard_Dialog"; + + [GVAR(ammoClassCopy), GVAR(magazineClassCopy), GVAR(weaponClassCopy)] call FUNC(updateRangeCard); + }; +} else { + if (ACE_player call FUNC(updateClassNames)) then { + GVAR(RangeCardOpened) = true; + + createDialog "ACE_RangeCard_Dialog"; + + [GVAR(ammoClass), GVAR(magazineClass), GVAR(weaponClass)] call FUNC(updateRangeCard); + }; +}; diff --git a/addons/rangecard/functions/fnc_updateClassNames.sqf b/addons/rangecard/functions/fnc_updateClassNames.sqf new file mode 100644 index 0000000000..70cf25825e --- /dev/null +++ b/addons/rangecard/functions/fnc_updateClassNames.sqf @@ -0,0 +1,49 @@ +/* + * Authors: Ruthberg + * Updates the ammo and weapon class names + * + * Arguments: + * unit + * + * Return Value: + * Update successful? + * + * Example: + * unit call ace_rangecard_fnc_updateClassNames + * + * Public: No + */ +#include "script_component.hpp" + +private ["_unit", "_ammoClass", "_magazineClass", "_weaponClass", "_ammo", "_ammoConfig", "_parentClasses"]; +_unit = _this; + +_ammoClass = ""; +_magazineClass = ""; +_weaponClass = primaryWeapon _unit; + +if (_weaponClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "") }; + +{ + _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); + _ammoConfig = (configFile >> "CfgAmmo" >> _ammo); + _parentClasses = [_ammoConfig, true] call BIS_fnc_returnParents; + if ("BulletBase" in _parentClasses) exitWith { + _ammoClass = _ammo; + _magazineClass = _x; + }; +} forEach (primaryWeaponMagazine _unit); + +if (_ammoClass == "") exitWith { (GVAR(ammoClass) != "" && GVAR(magazineClass) != "" && GVAR(weaponClass) != "") }; + +if (_unit == ACE_player) then { + GVAR(ammoClass) = _ammoClass; + GVAR(magazineClass) = _magazineClass; + GVAR(weaponClass) = _weaponClass; +} else { + GVAR(ammoClassCopy) = _ammoClass; + GVAR(magazineClassCopy) = _magazineClass; + GVAR(weaponClassCopy) = _weaponClass; +}; + +true diff --git a/addons/rangecard/functions/fnc_updateRangeCard.sqf b/addons/rangecard/functions/fnc_updateRangeCard.sqf new file mode 100644 index 0000000000..b5ec9683f4 --- /dev/null +++ b/addons/rangecard/functions/fnc_updateRangeCard.sqf @@ -0,0 +1,249 @@ +/* + * Authors: Ruthberg + * Updates the range card data + * + * Arguments: + * 0: ammo class + * 1: magazine class + * 2: weapon class + * + * Return Value: + * Nothing + * + * Example: + * [mode] call ace_rangecard_fnc_openRangeCard + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; +#define __dsp (uiNamespace getVariable "RangleCard_Display") + +private ["_airFriction", "_ammoConfig", "_atmosphereModel", "_barometricPressure", "_barrelLength", "_barrelTwist", "_bc", "_bulletMass", "_boreHeight", "_cacheEntry", "_column", "_control", "_dragModel", "_i", "_muzzleVelocity", "_mv", "_mvShift", "_offset", "_relativeHumidity", "_result", "_row", "_scopeBaseAngle", "_weaponConfig", "_zeroRange", "_initSpeed", "_initSpeedCoef", "_useABConfig"]; +_useABConfig = (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]); + +PARAMS_3(_ammoClass,_magazineClass,_weaponClass); + +if (_ammoClass == "" || _magazineClass == "" || _weaponClass == "") exitWith {}; + +{ + ctrlDelete _x; +} forEach GVAR(controls); +GVAR(controls) = []; + +for "_row" from 0 to 49 do { + _offset = if (_row < 5) then {0} else {0.003}; + _control = (__dsp ctrlCreate ["RangeCard_RscText", 790000 + _row]); + _control ctrlSetPosition [safeZoneX + 0.183, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.062, 0.025]; + if (_row in [0, 8, 18, 28, 38, 48]) then { + _control ctrlSetTextColor [1, 1, 1, 1]; + } else { + _control ctrlSetTextColor [0, 0, 0, 1]; + }; + _control ctrlCommit 0; + _control ctrlSetText Str(100 + _row * 50); + GVAR(controls) pushBack _control; +}; +for "_column" from 0 to 8 do { + for "_row" from 0 to 49 do { + _offset = if (_row < 5) then {0} else {0.003}; + _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + _column * 100 + _row]); + _control ctrlSetPosition [safeZoneX + 0.249 + _column * 0.055, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.052, 0.025]; + _control ctrlCommit 0; + _control ctrlSetText "-0.0"; + GVAR(controls) pushBack _control; + }; +}; +for "_column" from 0 to 2 do { + for "_row" from 0 to 49 do { + _offset = if (_row < 5) then {0} else {0.003}; + _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (9 +_column) * 100 + _row]); + _control ctrlSetPosition [safeZoneX + 0.743 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; + _control ctrlCommit 0; + _control ctrlSetText "-0.0"; + GVAR(controls) pushBack _control; + }; +}; +for "_column" from 0 to 2 do { + for "_row" from 0 to 49 do { + _offset = if (_row < 5) then {0} else {0.003}; + _control = (__dsp ctrlCreate ["RangeCard_RscText", 90000 + (12 +_column) * 100 + _row]); + _control ctrlSetPosition [safeZoneX + 0.892 + _column * 0.049, safeZoneY + 0.374 + 0.027 * _row + _offset, 0.047, 0.025]; + _control ctrlCommit 0; + _control ctrlSetText "-0.0"; + GVAR(controls) pushBack _control; + }; +}; + +lnbClear 770100; +lnbClear 770200; +lnbClear 770300; +lnbClear 770400; + +GVAR(rangeCardDataElevation) = [[], [], [], [], [], [], [], [], []]; +GVAR(rangeCardDataWindage) = [[], [], [], [], [], [], [], [], []]; +GVAR(rangeCardDataLead) = [[], [], [], [], [], [], [], [], []]; +GVAR(rangeCardDataMVs) = ["", "", "", "", "", "", "", "", ""]; +GVAR(lastValidRow) = []; + +GVAR(currentUnit) = 2; +GVAR(rangeCardStartRange) = 100; +GVAR(rangeCardIncrement) = 50; +GVAR(rangeCardEndRange) = GVAR(rangeCardStartRange) + 49 * GVAR(rangeCardIncrement); + +_ammoConfig = _ammoClass call EFUNC(advanced_ballistics,readAmmoDataFromConfig); +_weaponConfig = _weaponClass call EFUNC(advanced_ballistics,readWeaponDataFromConfig); +_airFriction = _ammoConfig select 0; +_barrelTwist = _weaponConfig select 0; +_barrelLength = _weaponConfig select 2; +_muzzleVelocity = 0; + +_bc = 0; +if (count (_ammoConfig select 6) > 0) then { + _bc = (_ammoConfig select 6) select 0; +}; +_dragModel = _ammoConfig select 5; +_atmosphereModel = _ammoConfig select 8; +_bulletMass = 5; +_boreHeight = 3.81; +_zeroRange = 100; + +if (_bc == 0) then { + _useABConfig = false; +}; + +if (_barrelLength > 0 && _useABConfig) then { + _muzzleVelocity = [_barrelLength, _ammoConfig select 10, _ammoConfig select 11, 0] call EFUNC(advanced_ballistics,calculateBarrelLengthVelocityShift); +} else { + _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "initSpeed"); + _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weaponClass >> "initSpeed"); + if (_initSpeedCoef < 0) then { + _initSpeed = _initSpeed * -_initSpeedCoef; + }; + if (_initSpeedCoef > 0) then { + _initSpeed = _initSpeedCoef; + }; + _muzzleVelocity = _initSpeed; +}; + +if (_useABConfig) then { + ctrlSetText [770000, format["%1'' - %2 gr (%3)", round((_ammoConfig select 1) * 39.3700787) / 1000, round((_ammoConfig select 3) * 15.4323584), _ammoClass]]; + if (_barrelLength > 0 && _barrelTwist > 0) then { + ctrlSetText [770002, format["Barrel: %1'' 1:%2'' twist", round(2 * _barrelLength * 0.0393700787) / 2, round(_barrelTwist * 0.0393700787)]]; + } else { + ctrlSetText [770002, ""]; + }; +} else { + ctrlSetText [770000, getText (configFile >> "CfgMagazines" >> _magazineClass >> "displayNameShort")]; + ctrlSetText [770002, getText (configFile >> "CfgWeapons" >> _weaponClass >> "displayName")]; +}; + +lnbAddRow [770100, ["4mps Wind(MRADs)", "1mps LEAD(MRADs)"]]; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + lnbAddRow [770100, ["Air/Ammo Temp", "Air/Ammo Temp"]]; + + lnbAddRow [770200, ["-15°C", " -5°C", " 5°C", " 10°C", " 15°C", " 20°C", " 25°C", " 30°C", " 35°C"]]; + lnbAddRow [770300, ["-15°C", " 10°C", " 35°C", "-15°C", " 10°C", " 35°C"]]; +}; + +_barometricPressure = 1013.25; +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + _barometricPressure = 1013.25 * (1 - (0.0065 * EGVAR(weather,altitude)) / 288.15) ^ 5.255754495; +}; +_relativeHumidity = 0.5; + +if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + ctrlSetText [770001, format["Drop Tables for B.P.: %1mb; Corrected for MVV at Air/Ammo Temperatures -15-35 °C", round(_barometricPressure * 100) / 100]]; + ctrlSetText [77004 , format["B.P.: %1mb", round(_barometricPressure * 100) / 100]]; +} else { + ctrlSetText [770001, ""]; + ctrlSetText [77004 , ""]; +}; + +_cacheEntry = missionNamespace getVariable format[QGVAR(%1_%2_%3), _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]]; +if (isNil {_cacheEntry}) then { + _result = [0, 0, _boreHeight, _airFriction, _muzzleVelocity, 15, 1013.25, 0.5, 1000, [0, 0], 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false, 1.5, 0, 0, 0, 0, _useABConfig] call FUNC(calculateSolution); + _scopeBaseAngle = (_result select 0) / 60; + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + { + _mvShift = [_ammoConfig select 9, _x] call EFUNC(advanced_ballistics,calculateAmmoTemperatureVelocityShift); + _mv = _muzzleVelocity + _mvShift; + + [_scopeBaseAngle,_bulletMass,_boreHeight,_airFriction,_mv,_x,_barometricPressure,_relativeHumidity,1000,[4,0],3,0,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,true,1.5,1,46,23,_forEachIndex,_useABConfig] call FUNC(calculateSolution); + } forEach [-15, -5, 5, 10, 15, 20, 25, 30, 35]; + } else { + [_scopeBaseAngle,_bulletMass,_boreHeight,_airFriction,_muzzleVelocity,15,_barometricPressure,_relativeHumidity,1000,[4,0],3,0,1,GVAR(rangeCardEndRange),_bc,_dragModel,_atmosphereModel,true,1.5,1,46,23,3,_useABConfig] call FUNC(calculateSolution); + }; + + for "_i" from 0 to 9 do { + GVAR(lastValidRow) pushBack count (GVAR(rangeCardDataElevation) select _i); + while {count (GVAR(rangeCardDataElevation) select _i) < 50} do { + if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + (GVAR(rangeCardDataElevation) select _i) pushBack "###"; + (GVAR(rangeCardDataWindage) select _i) pushBack "##"; + (GVAR(rangeCardDataLead) select _i) pushBack "##"; + } else { + (GVAR(rangeCardDataElevation) select _i) pushBack ""; + (GVAR(rangeCardDataWindage) select _i) pushBack ""; + (GVAR(rangeCardDataLead) select _i) pushBack ""; + }; + }; + }; + + missionNamespace setVariable [format[QGVAR(%1_%2_%3), _ammoClass, _weaponClass, missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]], [GVAR(rangeCardDataElevation), GVAR(rangeCardDataWindage), GVAR(rangeCardDataLead), GVAR(rangeCardDataMVs), GVAR(lastValidRow)]]; +} else { + GVAR(rangeCardDataElevation) = _cacheEntry select 0; + GVAR(rangeCardDataWindage) = _cacheEntry select 1; + GVAR(rangeCardDataLead) = _cacheEntry select 2; + GVAR(rangeCardDataMVs) = _cacheEntry select 3; + GVAR(lastValidRow) = _cacheEntry select 4; +}; + +lnbAddRow [770200, GVAR(rangeCardDataMVs)]; + +for "_column" from 0 to 8 do { + for "_row" from 0 to 49 do { + _control = (__dsp displayCtrl (90000 + _column * 100 + _row)); + _control ctrlSetText ((GVAR(rangeCardDataElevation) select _column) select _row); + if (_row >= (GVAR(lastValidRow) select _column)) then { + _control ctrlSetTextColor [0, 0, 0, 0.6]; + } else { + _control ctrlSetTextColor [0, 0, 0, 1.0]; + }; + _control ctrlCommit 0; + }; +}; +{ + for "_row" from 0 to 49 do { + _control = (__dsp displayCtrl (90000 + (9 + _forEachIndex) * 100 + _row)); + _control ctrlSetText ((GVAR(rangeCardDataWindage) select _x) select _row); + if (_row >= (GVAR(lastValidRow) select _x)) then { + _control ctrlSetTextColor [0, 0, 0, 0.6]; + } else { + _control ctrlSetTextColor [0, 0, 0, 1.0]; + }; + _control ctrlCommit 0; + }; +} forEach [0, 3, 8]; + +{ + for "_row" from 0 to 49 do { + _control = (__dsp displayCtrl (90000 + (12 + _forEachIndex) * 100 + _row)); + _control ctrlSetText ((GVAR(rangeCardDataLead) select _x) select _row); + if (_row >= (GVAR(lastValidRow) select _x)) then { + _control ctrlSetTextColor [0, 0, 0, 0.6]; + } else { + _control ctrlSetTextColor [0, 0, 0, 1.0]; + }; + _control ctrlCommit 0; + }; +} forEach [0, 3, 8]; + +if (_useABConfig) then { + ctrlSetText [770020, "For best results keep ammunition at ambient air temperature. Tables calculated for the above listed barrel"]; + ctrlSetText [770021, "and load with optic mounted 1.5'' above line of bore."]; +} else { + ctrlSetText [770020, ""]; + ctrlSetText [770021, ""]; +}; \ No newline at end of file diff --git a/addons/rangecard/functions/script_component.hpp b/addons/rangecard/functions/script_component.hpp new file mode 100644 index 0000000000..fdc4a3d486 --- /dev/null +++ b/addons/rangecard/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\rangecard\script_component.hpp" \ No newline at end of file diff --git a/addons/rangecard/initKeybinds.sqf b/addons/rangecard/initKeybinds.sqf new file mode 100644 index 0000000000..cb6ff49206 --- /dev/null +++ b/addons/rangecard/initKeybinds.sqf @@ -0,0 +1,31 @@ +["ACE3 Equipment", QGVAR(RangeCardDialogKey), localize "STR_ACE_RangeCard_RangeCardDialogKey", +{ + // Conditions: canInteract, canShow + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (GVAR(RangeCardOpened)) exitWith { + closeDialog 0; + false + }; + if !(call FUNC(canShow)) exitWith {false}; + // Statement + false call FUNC(openRangeCard); + true +}, +{false}, +[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) + +["ACE3 Equipment", QGVAR(RangeCardCopyDialogKey), localize "STR_ACE_RangeCard_RangeCardCopyDialogKey", +{ + // Conditions: canInteract, canShowCopy + if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if (GVAR(RangeCardOpened)) exitWith { + closeDialog 0; + false + }; + if !(call FUNC(canShowCopy)) exitWith {false}; + // Statement + true call FUNC(openRangeCard); + true +}, +{false}, +[0, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // (empty default key) \ No newline at end of file diff --git a/addons/rangecard/script_component.hpp b/addons/rangecard/script_component.hpp new file mode 100644 index 0000000000..8281f77eb3 --- /dev/null +++ b/addons/rangecard/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT rangecard +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_RANGECARD + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_RANGECARD + #define DEBUG_SETTINGS DEBUG_SETTINGS_RANGECARD +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml new file mode 100644 index 0000000000..cf013f2ae3 --- /dev/null +++ b/addons/rangecard/stringtable.xml @@ -0,0 +1,54 @@ + + + + + Range Card + Tabela balistyczna + Tarjeta de distancias + Vzdálenostní tabulka + Tabela de distâncias + + + 50 METER increments -- MRAD/MRAD (reticle/turrets) + Co 50 metrów - MRAD/MRAD (siatka/pokrętło) + Incrementos de 50 METROS -- MRAD/MRAD (retícula/torretas) + Přidat 50 METRŮ -- MRAD/MRAD (síťka/věže) + Incrementos de 50 METROS - MRAD/MRAD (retícula/torres) + + + Open Range Card + Otwórz tabelę balistyczną + Abrir tarjeta de distancias + Otevřít vzdálenostní tabulku + Abrir tabela de distâncias + + + Open Range Card Copy + Otwórz kopię tabeli balistycznej + Abrir copia de tarjeta de distancias + Otevřít kopii vzdálenostní tabulky + Abrir cópia da tabela de distâncias + + + Open Range Card + Otwórz tabelę balistyczną + Abrir tarjeta de distancias + Otevřít vzdálenostní tabulku + Abrir tabela de distäncias + + + Open Range Card Copy + Otwórz kopię tabeli balistycznej + Abrir copia de tarjeta de distancias + Otevřít kopii vzdálenostní tabulky + Abrir cópia da tabela de distâncias + + + Copy Range Card + Skopiuj tabelę balistyczną + Copiar tarjeta de distancias + Kopírovat vzdálenostní tabulku + Copiar tabela de distäncias + + + \ No newline at end of file diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index cf555c9603..69d6cfa579 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -359,61 +359,61 @@ class CfgMagazines { class CA_Magazine; // http://en.wikipedia.org/wiki/M15_mine class ATMine_Range_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_ATMine_Name"; + displayName = CSTRING(ATMine_Name); }; // http://en.wikipedia.org/wiki/VS-50_mine class APERSMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; + displayName = CSTRING(APERSMine_Name); }; // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; + displayName = CSTRING(APERSBoundingMine_Name); }; // http://en.wikipedia.org/wiki/PMR-3_mine class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; + displayName = CSTRING(APERSTripwireMine_Name); }; // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_SLAM_Name"; + displayName = CSTRING(SLAM_Name); }; // claymore class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_Claymore_Name"; + displayName = CSTRING(Claymore_Name); }; // satchels class SatchelCharge_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; + displayName = CSTRING(SatchelCharge_Name); }; class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; + displayName = CSTRING(DemoCharge_Name); }; // hand grenades class HandGrenade: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; + displayName = CSTRING(HandGrenade_Name); }; class SmokeShell: HandGrenade { - displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; + displayName = CSTRING(SmokeShell_Name); }; class SmokeShellBlue: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; + displayName = CSTRING(SmokeShellBlue_Name); }; class SmokeShellGreen: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; + displayName = CSTRING(SmokeShellGreen_Name); }; class SmokeShellOrange: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; + displayName = CSTRING(SmokeShellOrange_Name); }; class SmokeShellPurple: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; + displayName = CSTRING(SmokeShellPurple_Name); }; class SmokeShellRed: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; + displayName = CSTRING(SmokeShellRed_Name); }; class SmokeShellYellow: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; + displayName = CSTRING(SmokeShellYellow_Name); }; }; diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 0fa3111243..aef52578e2 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -3,94 +3,94 @@ class CfgVehicles { // static weapons class StaticMGWeapon; class HMG_01_base_F: StaticMGWeapon { - displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; + displayName = CSTRING(HMG_01_Name); }; class HMG_01_A_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; + displayName = CSTRING(HMG_01_A_Name); }; class HMG_01_high_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; + displayName = CSTRING(HMG_01_high_Name); }; class AT_01_base_F; class B_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + displayName = CSTRING(static_AT_Name); }; class O_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + displayName = CSTRING(static_AT_Name); }; class I_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + displayName = CSTRING(static_AT_Name); }; class AA_01_base_F; class B_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + displayName = CSTRING(static_AA_Name); }; class O_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + displayName = CSTRING(static_AA_Name); }; class I_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + displayName = CSTRING(static_AA_Name); }; class GMG_TriPod; class GMG_01_base_F: GMG_TriPod { - displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; + displayName = CSTRING(GMG_01_Name); }; class GMG_01_A_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; + displayName = CSTRING(GMG_01_A_Name); }; class GMG_01_high_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; + displayName = CSTRING(GMG_01_high_Name); }; // M-ATV class MRAP_01_base_F; class B_MRAP_01_F: MRAP_01_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; + displayName = CSTRING(MRAP_01_Name); }; class MRAP_01_gmg_base_F: MRAP_01_base_F {}; class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; + displayName = CSTRING(MRAP_01_gmg_Name); }; class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; + displayName = CSTRING(MRAP_01_hmg_Name); }; // punisher class MRAP_02_base_F; class O_MRAP_02_F: MRAP_02_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; + displayName = CSTRING(MRAP_02_Name); }; class MRAP_02_hmg_base_F: MRAP_02_base_F {}; class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; + displayName = CSTRING(MRAP_02_hmg_Name); }; class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; + displayName = CSTRING(MRAP_02_gmg_Name); }; // strider class MRAP_03_base_F; class I_MRAP_03_F: MRAP_03_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; + displayName = CSTRING(MRAP_03_Name); }; class MRAP_03_hmg_base_F: MRAP_03_base_F {}; class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; + displayName = CSTRING(MRAP_03_hmg_Name); }; class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; + displayName = CSTRING(MRAP_03_gmg_Name); }; // merkava derivates @@ -98,24 +98,24 @@ class CfgVehicles { class B_MBT_01_base_F: MBT_01_base_F {}; class B_MBT_01_cannon_F: B_MBT_01_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; + displayName = CSTRING(MBT_01_cannon_Name); }; class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; + displayName = CSTRING(MBT_01_TUSK_Name); }; class MBT_01_arty_base_F: MBT_01_base_F {}; class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; class B_MBT_01_arty_F: B_MBT_01_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; + displayName = CSTRING(MBT_01_arty_Name); }; class MBT_01_mlrs_base_F: MBT_01_base_F {}; class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. + displayName = CSTRING(MBT_01_mlrs_Name); // Fictional name, (probably wrong) hebrew translation of storm. }; // T100 derivates @@ -123,307 +123,307 @@ class CfgVehicles { class O_MBT_02_base_F: MBT_02_base_F {}; class O_MBT_02_cannon_F: O_MBT_02_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; + displayName = CSTRING(MBT_02_cannon_Name); }; class MBT_02_arty_base_F: MBT_02_base_F {}; class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; class O_MBT_02_arty_F: O_MBT_02_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; + displayName = CSTRING(MBT_02_arty_Name); }; // leopard sg class I_MBT_03_base_F; class I_MBT_03_cannon_F: I_MBT_03_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; + displayName = CSTRING(MBT_03_cannon_Name); }; // tracked apcs class B_APC_Tracked_01_base_F; class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; + displayName = CSTRING(APC_Tracked_01_rcws_Name); }; class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. + displayName = CSTRING(APC_Tracked_01_AA_Name); // Fictional name, (probably wrong) hebrew translation of cheetah. }; class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; + displayName = CSTRING(APC_Tracked_01_CRV_Name); }; class O_APC_Tracked_02_base_F; class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; + displayName = CSTRING(APC_Tracked_02_cannon_Name); }; class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; + displayName = CSTRING(APC_Tracked_02_AA_Name); }; class I_APC_tracked_03_base_F; class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; + displayName = CSTRING(APC_tracked_03_cannon_Name); }; // wheeled apcs class B_APC_Wheeled_01_base_F; class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; + displayName = CSTRING(APC_Wheeled_cannon_Name); }; class O_APC_Wheeled_02_base_F; class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; + displayName = CSTRING(APC_Wheeled_02_rcws_Name); }; class I_APC_Wheeled_03_base_F; class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; + displayName = CSTRING(APC_Wheeled_03_cannon_Name); }; // trucks class Truck_01_base_F; class B_Truck_01_transport_F: Truck_01_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; + displayName = CSTRING(Truck_01_transport_Name); }; class B_Truck_01_covered_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; + displayName = CSTRING(Truck_01_covered_Name); }; class B_Truck_01_mover_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; + displayName = CSTRING(Truck_01_mover_Name); }; class B_Truck_01_box_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; + displayName = CSTRING(Truck_01_box_Name); }; class B_Truck_01_medical_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; + displayName = CSTRING(Truck_01_medical_Name); }; class B_Truck_01_ammo_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; + displayName = CSTRING(Truck_01_ammo_Name); }; class B_Truck_01_fuel_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; + displayName = CSTRING(Truck_01_fuel_Name); }; class B_Truck_01_Repair_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; + displayName = CSTRING(Truck_01_Repair_Name); }; class Truck_02_transport_base_F; class O_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + displayName = CSTRING(Truck_02_transport_Name); }; class Truck_02_base_F; class O_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + displayName = CSTRING(Truck_02_covered_Name); }; class Truck_02_Ammo_base_F; class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + displayName = CSTRING(Truck_02_ammo_Name); }; class Truck_02_fuel_base_F; class O_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + displayName = CSTRING(Truck_02_fuel_Name); }; class Truck_02_box_base_F; class O_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + displayName = CSTRING(Truck_02_box_Name); }; class Truck_02_medical_base_F; class O_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + displayName = CSTRING(Truck_02_medical_Name); }; class I_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + displayName = CSTRING(Truck_02_transport_Name); }; class I_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + displayName = CSTRING(Truck_02_covered_Name); }; class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + displayName = CSTRING(Truck_02_ammo_Name); }; class I_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + displayName = CSTRING(Truck_02_fuel_Name); }; class I_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + displayName = CSTRING(Truck_02_box_Name); }; class I_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + displayName = CSTRING(Truck_02_medical_Name); }; class Truck_03_base_F; class O_Truck_03_transport_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; + displayName = CSTRING(Truck_03_transport_Name); }; class O_Truck_03_covered_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; + displayName = CSTRING(Truck_03_covered_Name); }; class O_Truck_03_device_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; + displayName = CSTRING(Truck_03_device_Name); }; class O_Truck_03_ammo_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; + displayName = CSTRING(Truck_03_ammo_Name); }; class O_Truck_03_fuel_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; + displayName = CSTRING(Truck_03_fuel_Name); }; class O_Truck_03_repair_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; + displayName = CSTRING(Truck_03_repair_Name); }; class O_Truck_03_medical_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; + displayName = CSTRING(Truck_03_medical_Name); }; // helicopters class Heli_Attack_01_base_F; class B_Heli_Attack_01_F: Heli_Attack_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; + displayName = CSTRING(Heli_Attack_01_Name); }; class Heli_Light_01_unarmed_base_F; class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; + displayName = CSTRING(Heli_Light_01_Name); }; class Heli_Light_01_armed_base_F; class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; + displayName = CSTRING(Heli_Light_01_armed_Name); }; class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; + displayName = CSTRING(Heli_Light_01_civil_Name); }; class Heli_Transport_03_base_F; class B_Heli_Transport_03_F: Heli_Transport_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; + displayName = CSTRING(Heli_Transport_03_Name); }; class Heli_Transport_03_unarmed_base_F; class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; + displayName = CSTRING(Heli_Transport_03_unarmed_Name); }; class Heli_Light_02_base_F; class O_Heli_Light_02_F: Heli_Light_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; + displayName = CSTRING(Heli_Light_02_Name); }; class Heli_Light_02_unarmed_base_F; class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; + displayName = CSTRING(Heli_Light_02_unarmed_Name); }; class Heli_light_03_base_F; class I_Heli_light_03_F: Heli_light_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; + displayName = CSTRING(Heli_light_03_Name); }; class Heli_light_03_unarmed_base_F; class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; + displayName = CSTRING(Heli_light_03_unarmed_Name); }; class Heli_Transport_02_base_F; class I_Heli_Transport_02_F: Heli_Transport_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; + displayName = CSTRING(Heli_Transport_02_Name); }; // planes class Plane_CAS_01_base_F; class B_Plane_CAS_01_F: Plane_CAS_01_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; + displayName = CSTRING(Plane_CAS_01_Name); }; class Plane_CAS_02_base_F; class O_Plane_CAS_02_F: Plane_CAS_02_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; + displayName = CSTRING(Plane_CAS_02_Name); }; class Plane_Fighter_03_base_F; class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; + displayName = CSTRING(Plane_Fighter_03_CAS_Name); }; class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; + displayName = CSTRING(Plane_Fighter_03_AA_Name); }; // uavs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + displayName = CSTRING(UAV_02_Name); }; class O_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + displayName = CSTRING(UAV_02_Name); }; class I_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + displayName = CSTRING(UAV_02_Name); }; class UAV_02_CAS_base_F: UAV_02_base_F {}; class B_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + displayName = CSTRING(UAV_02_CAS_Name); }; class O_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + displayName = CSTRING(UAV_02_CAS_Name); }; class I_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + displayName = CSTRING(UAV_02_CAS_Name); }; // pistols class Pistol_Base_F; class Weapon_hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + displayName = CSTRING(hgun_P07_Name); }; class Weapon_hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + displayName = CSTRING(hgun_Rook40_Name); }; class Weapon_hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + displayName = CSTRING(hgun_ACPC2_Name); }; class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + displayName = CSTRING(hgun_Pistol_heavy_01_Name); }; class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + displayName = CSTRING(hgun_Pistol_heavy_02_Name); }; class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + displayName = CSTRING(hgun_Pistol_Signal_Name); }; // rocket launchers class Launcher_Base_F; class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + displayName = CSTRING(launch_NLAW_Name); }; class Weapon_launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + displayName = CSTRING(launch_RPG32_Name); }; - class Weapon_launch_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + /*class Weapon_launch_Titan_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_Name); }; class Weapon_launch_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + displayName = CSTRING(launch_Titan_short_Name); }; class Weapon_launch_B_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; + displayName = CSTRING(launch_Titan_Name); + };*/ //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; + /*class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + displayName = CSTRING(launch_Titan_short_Name); + };*/ //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; @@ -432,205 +432,205 @@ class CfgVehicles { // MX class Weapon_Base_F; class Weapon_arifle_MX_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + displayName = CSTRING(arifle_MX_Name); }; class Weapon_arifle_MXC_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + displayName = CSTRING(arifle_MXC_Name); }; class Weapon_arifle_MX_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + displayName = CSTRING(arifle_MX_GL_Name); }; class Weapon_arifle_MX_SW_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + displayName = CSTRING(arifle_MX_SW_Name); }; class Weapon_arifle_MXM_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + displayName = CSTRING(arifle_MXM_Name); }; // Katiba class Weapon_arifle_Katiba_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + displayName = CSTRING(arifle_Katiba_Name); }; class Weapon_arifle_Katiba_C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + displayName = CSTRING(arifle_Katiba_C_Name); }; class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + displayName = CSTRING(arifle_Katiba_GL_Name); }; // F2000 class Weapon_arifle_Mk20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + displayName = CSTRING(arifle_Mk20_Name); }; class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + displayName = CSTRING(arifle_Mk20_plain_Name); }; class Weapon_arifle_Mk20C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + displayName = CSTRING(arifle_Mk20C_Name); }; class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + displayName = CSTRING(arifle_Mk20C_plain_Name); }; class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + displayName = CSTRING(arifle_Mk20_GL_Name); }; class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + displayName = CSTRING(arifle_Mk20_GL_plain_Name); }; // TAR-21 class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + displayName = CSTRING(arifle_TRG21_Name); }; class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + displayName = CSTRING(arifle_TRG20_Name); }; class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + displayName = CSTRING(arifle_TRG21_GL_Name); }; // sub machine guns class Weapon_SMG_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + displayName = CSTRING(SMG_01_Name); }; class Weapon_SMG_02_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + displayName = CSTRING(SMG_02_Name); }; class Weapon_hgun_PDW2000_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + displayName = CSTRING(hgun_PDW2000_Name); }; class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + displayName = CSTRING(arifle_SDAR_Name); }; // machine guns class Weapon_LMG_Mk200_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + displayName = CSTRING(LMG_Mk200_Name); }; class Weapon_LMG_Zafir_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + displayName = CSTRING(LMG_Zafir_Name); }; // sniper rifles class Weapon_srifle_EBR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + displayName = CSTRING(srifle_EBR_Name); }; class Weapon_srifle_GM6_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + displayName = CSTRING(srifle_GM6_Name); }; class Weapon_srifle_GM6_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + displayName = CSTRING(srifle_GM6_camo_Name); }; class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + displayName = CSTRING(srifle_LRR_Name); }; class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + displayName = CSTRING(srifle_LRR_camo_Name); }; class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + displayName = CSTRING(srifle_DMR_01_Name); }; // marksmen /*class Weapon_srifle_DMR_02_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; + displayName = CSTRING(srifle_DMR_02); }; class Weapon_srifle_DMR_02_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; + displayName = CSTRING(srifle_DMR_02_camo); }; class Weapon_srifle_DMR_02_sniper_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; + displayName = CSTRING(srifle_DMR_02_sniper); }; class Weapon_srifle_DMR_03_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; + displayName = CSTRING(srifle_DMR_03); }; class Weapon_srifle_DMR_03_khaki_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; + displayName = CSTRING(srifle_DMR_03_khaki); }; class Weapon_srifle_DMR_03_tan_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; + displayName = CSTRING(srifle_DMR_03_tan); }; class Weapon_srifle_DMR_03_multicam_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; + displayName = CSTRING(srifle_DMR_03_multicam); }; class Weapon_srifle_DMR_03_woodland_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; + displayName = CSTRING(srifle_DMR_03_woodland); }; class Weapon_srifle_DMR_04_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; + displayName = CSTRING(srifle_DMR_04); }; class Weapon_srifle_DMR_04_Tan_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; + displayName = CSTRING(srifle_DMR_04_Tan); }; class Weapon_srifle_DMR_05_blk_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; + displayName = CSTRING(srifle_DMR_05_blk); }; class Weapon_srifle_DMR_05_hex_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; + displayName = CSTRING(srifle_DMR_05_hex); }; class Weapon_srifle_DMR_05_tan_f: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; + displayName = CSTRING(srifle_DMR_05_tan); }; class Weapon_srifle_DMR_06_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; + displayName = CSTRING(srifle_DMR_06_camo); }; class Weapon_srifle_DMR_06_olive_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; + displayName = CSTRING(srifle_DMR_06_olive); }; class Weapon_MMG_01_hex_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; + displayName = CSTRING(MMG_01_hex); }; class Weapon_MMG_01_tan_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; + displayName = CSTRING(MMG_01_tan); }; class Weapon_MMG_02_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; + displayName = CSTRING(MMG_02_camo); }; class Weapon_MMG_02_black_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_black"; + displayName = CSTRING(MMG_02_black); }; class Weapon_MMG_02_sand_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; + displayName = CSTRING(MMG_02_sand); };*/ }; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 8eb3c04577..0a83239047 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -7,299 +7,299 @@ class CfgWeapons { // MX class arifle_MX_Base_F; class arifle_MX_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + displayName = CSTRING(arifle_MX_Name); }; class arifle_MX_Black_F: arifle_MX_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; + displayName = CSTRING(arifle_MX_Black_Name); }; class arifle_MXC_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + displayName = CSTRING(arifle_MXC_Name); }; class arifle_MXC_Black_F: arifle_MXC_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; + displayName = CSTRING(arifle_MXC_Black_Name); }; class arifle_MX_GL_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + displayName = CSTRING(arifle_MX_GL_Name); }; class arifle_MX_GL_Black_F: arifle_MX_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; + displayName = CSTRING(arifle_MX_GL_Black_Name); }; class arifle_MX_SW_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + displayName = CSTRING(arifle_MX_SW_Name); }; class arifle_MX_SW_Black_F: arifle_MX_SW_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; + displayName = CSTRING(arifle_MX_SW_Black_Name); }; class arifle_MXM_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + displayName = CSTRING(arifle_MXM_Name); }; class arifle_MXM_Black_F: arifle_MXM_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; + displayName = CSTRING(arifle_MXM_Black_Name); }; // Katiba class arifle_katiba_Base_F; class arifle_Katiba_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + displayName = CSTRING(arifle_Katiba_Name); }; class arifle_Katiba_GL_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + displayName = CSTRING(arifle_Katiba_GL_Name); }; class arifle_Katiba_C_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + displayName = CSTRING(arifle_Katiba_C_Name); }; // SDAR class SDAR_base_F; class arifle_SDAR_F: SDAR_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + displayName = CSTRING(arifle_SDAR_Name); }; // TAR-21 class Tavor_base_F; class arifle_TRG21_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + displayName = CSTRING(arifle_TRG21_Name); }; class arifle_TRG21_GL_F: arifle_TRG21_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + displayName = CSTRING(arifle_TRG21_GL_Name); }; class arifle_TRG20_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + displayName = CSTRING(arifle_TRG20_Name); }; // F2000 class mk20_base_F; class arifle_Mk20_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + displayName = CSTRING(arifle_Mk20_Name); }; class arifle_Mk20_plain_F: arifle_Mk20_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + displayName = CSTRING(arifle_Mk20_plain_Name); }; class arifle_Mk20C_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + displayName = CSTRING(arifle_Mk20C_Name); }; class arifle_Mk20C_plain_F: arifle_Mk20C_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + displayName = CSTRING(arifle_Mk20C_plain_Name); }; class arifle_Mk20_GL_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + displayName = CSTRING(arifle_Mk20_GL_Name); }; class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + displayName = CSTRING(arifle_Mk20_GL_plain_Name); }; // Vector class SMG_01_Base; class SMG_01_F: SMG_01_Base { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + displayName = CSTRING(SMG_01_Name); }; // Scorpion class SMG_02_base_F; class SMG_02_F: SMG_02_base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + displayName = CSTRING(SMG_02_Name); }; // PDW 2000 class pdw2000_base_F; class hgun_pdw2000_F: pdw2000_base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + displayName = CSTRING(hgun_PDW2000_Name); }; // pistols class Pistol_Base_F; class hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + displayName = CSTRING(hgun_P07_Name); }; class hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + displayName = CSTRING(hgun_Rook40_Name); }; class hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + displayName = CSTRING(hgun_ACPC2_Name); }; class hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + displayName = CSTRING(hgun_Pistol_heavy_01_Name); }; class hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + displayName = CSTRING(hgun_Pistol_heavy_02_Name); }; class hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + displayName = CSTRING(hgun_Pistol_Signal_Name); }; // machine guns class Rifle_Long_Base_F; class LMG_Mk200_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + displayName = CSTRING(LMG_Mk200_Name); }; class LMG_Zafir_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + displayName = CSTRING(LMG_Zafir_Name); }; // sniper rifles class EBR_base_F; class srifle_EBR_F: EBR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + displayName = CSTRING(srifle_EBR_Name); }; class LRR_base_F; class srifle_LRR_F: LRR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + displayName = CSTRING(srifle_LRR_Name); }; class srifle_LRR_camo_F: srifle_LRR_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + displayName = CSTRING(srifle_LRR_camo_Name); }; class GM6_base_F; class srifle_GM6_F: GM6_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + displayName = CSTRING(srifle_GM6_Name); }; class srifle_GM6_camo_F: srifle_GM6_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + displayName = CSTRING(srifle_GM6_camo_Name); }; class DMR_01_base_F; class srifle_DMR_01_F: DMR_01_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + displayName = CSTRING(srifle_DMR_01_Name); }; // launchers class Launcher_Base_F; class launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + displayName = CSTRING(launch_RPG32_Name); }; - class launch_Titan_base: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + /*class launch_Titan_base: Launcher_Base_F { + displayName = CSTRING(launch_Titan_Name); }; class launch_Titan_short_base: launch_Titan_base { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; + displayName = CSTRING(launch_Titan_short_Name); + };*/ class launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + displayName = CSTRING(launch_NLAW_Name); }; // marksmen marksman class DMR_02_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_DMR_02"; //MAR-10 .338"; + displayName = CSTRING(DMR_02); //MAR-10 .338; }; class srifle_DMR_02_F: DMR_02_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02"; //MAR-10 .338 (Black)"; + displayName = CSTRING(srifle_DMR_02); //MAR-10 .338 (Black); }; class srifle_DMR_02_camo_F: srifle_DMR_02_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_camo"; //MAR-10 .338 (Camo)"; + displayName = CSTRING(srifle_DMR_02_camo); //MAR-10 .338 (Camo); }; class srifle_DMR_02_sniper_F: srifle_DMR_02_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_02_sniper"; //MAR-10 .338 (Sand)"; + displayName = CSTRING(srifle_DMR_02_sniper); //MAR-10 .338 (Sand); }; class DMR_03_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_DMR_03"; //Mk-I EMR 7.62 mm"; + displayName = CSTRING(DMR_03); //Mk-I EMR 7.62 mm; }; class srifle_DMR_03_F: DMR_03_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03"; //Mk-I EMR 7.62 mm (Black)"; + displayName = CSTRING(srifle_DMR_03); //Mk-I EMR 7.62 mm (Black); }; class srifle_DMR_03_khaki_F: srifle_DMR_03_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_khaki"; //Mk-I EMR 7.62 mm (Khaki)"; + displayName = CSTRING(srifle_DMR_03_khaki); //Mk-I EMR 7.62 mm (Khaki); }; class srifle_DMR_03_tan_F: srifle_DMR_03_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_tan"; //Mk-I EMR 7.62 mm (Sand)"; + displayName = CSTRING(srifle_DMR_03_tan); //Mk-I EMR 7.62 mm (Sand); }; class srifle_DMR_03_multicam_F: srifle_DMR_03_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_multicam"; //Mk-I EMR 7.62 mm (Camo)"; + displayName = CSTRING(srifle_DMR_03_multicam); //Mk-I EMR 7.62 mm (Camo); }; class srifle_DMR_03_woodland_F: srifle_DMR_03_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_woodland"; //Mk-I EMR 7.62 mm (Woodland)"; + displayName = CSTRING(srifle_DMR_03_woodland); //Mk-I EMR 7.62 mm (Woodland); }; class srifle_DMR_03_spotter_F: srifle_DMR_03_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_03_spotter"; //NATO DMR (provisional) spotter"; + displayName = CSTRING(srifle_DMR_03_spotter); //NATO DMR (provisional) spotter; }; class DMR_04_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_DMR_04"; //ASP-1 Kir 12.7 mm"; + displayName = CSTRING(DMR_04); //ASP-1 Kir 12.7 mm; }; class srifle_DMR_04_F: DMR_04_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_04"; //ASP-1 Kir 12.7 mm (Black)"; + displayName = CSTRING(srifle_DMR_04); //ASP-1 Kir 12.7 mm (Black); }; class srifle_DMR_04_Tan_F: srifle_DMR_04_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_04_Tan"; //ASP-1 Kir 12.7 mm (Tan)"; + displayName = CSTRING(srifle_DMR_04_Tan); //ASP-1 Kir 12.7 mm (Tan); }; class DMR_05_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_DMR_05"; //Cyrus 9.3 mm"; + displayName = CSTRING(DMR_05); //Cyrus 9.3 mm; }; class srifle_DMR_05_blk_F: DMR_05_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_blk"; //Cyrus 9.3 mm (Black) + displayName = CSTRING(srifle_DMR_05_blk); //Cyrus 9.3 mm (Black) }; class srifle_DMR_05_hex_F: srifle_DMR_05_blk_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_hex"; //Cyrus 9.3 mm (Hex)"; + displayName = CSTRING(srifle_DMR_05_hex); //Cyrus 9.3 mm (Hex); }; class srifle_DMR_05_tan_f: srifle_DMR_05_blk_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_05_tan"; //Cyrus 9.3 mm (Tan)"; + displayName = CSTRING(srifle_DMR_05_tan); //Cyrus 9.3 mm (Tan); }; class DMR_06_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_DMR_06"; //Mk14 7.62 mm"; + displayName = CSTRING(DMR_06); //Mk14 7.62 mm; }; class srifle_DMR_06_camo_F: DMR_06_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_camo"; //Mk14 7.62 mm (Camo) + displayName = CSTRING(srifle_DMR_06_camo); //Mk14 7.62 mm (Camo) }; class srifle_DMR_06_olive_F: srifle_DMR_06_camo_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_06_olive"; //Mk14 7.62 mm (Olive)"; + displayName = CSTRING(srifle_DMR_06_olive); //Mk14 7.62 mm (Olive); }; // marksmen mgs class MMG_01_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_01"; //Navid 9.3 mm"; + displayName = CSTRING(MMG_01); //Navid 9.3 mm; }; class MMG_01_hex_F: MMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_MMG_01_hex"; //Navid 9.3 mm (Hex)"; + displayName = CSTRING(MMG_01_hex); //Navid 9.3 mm (Hex); }; class MMG_01_tan_F: MMG_01_hex_F { - displayName = "$STR_ACE_RealisticNames_MMG_01_tan"; //Navid 9.3 mm (Tan)"; + displayName = CSTRING(MMG_01_tan); //Navid 9.3 mm (Tan); }; class MMG_02_base_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_MMG_02"; //SPMG .338"; + displayName = CSTRING(MMG_02); //SPMG .338; }; class MMG_02_camo_F: MMG_02_base_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_camo"; //SPMG .338 (MTP)"; + displayName = CSTRING(MMG_02_camo); //SPMG .338 (MTP); }; class MMG_02_black_F: MMG_02_camo_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_black"; //SPMG .338 (Black)"; + displayName = CSTRING(MMG_02_black); //SPMG .338 (Black); }; class MMG_02_sand_F: MMG_02_camo_F { - displayName = "$STR_ACE_RealisticNames_MMG_02_sand"; //SPMG .338 (Sand)"; + displayName = CSTRING(MMG_02_sand); //SPMG .338 (Sand); }; // vehicle weapons diff --git a/addons/realisticnames/script_component.hpp b/addons/realisticnames/script_component.hpp index 1d519dfdef..0dd8e679a7 100644 --- a/addons/realisticnames/script_component.hpp +++ b/addons/realisticnames/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT realisticnames -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_REALISTICNAMES #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_REALISTICNAMES #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 54a6c1e869..483242835f 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -426,7 +426,7 @@ KamAZ Transport KamAZ de transporte KamAZ transportowy - KAMAZ Valník + KamAZ Valník KamAZ Transport КамАЗ Траспортный KamAZ Transporte @@ -438,7 +438,7 @@ KamAZ Transport (bedeckt) KamAZ de transporte (cubierto) KamAZ Transportowy (zakryty) - KAMAZ Valník (krytý) + KamAZ Valník (krytý) KamAZ Transport (bâché) КамАЗ Траспортный (крытый) KamAZ Transporte (coberto) @@ -450,7 +450,7 @@ KamAZ Munition KamAZ de munición KamAZ Amunicyjny - KAMAZ Muniční + KamAZ Muniční KamAZ Munitions КамАЗ Боеприпасы KamAZ Munições @@ -462,7 +462,7 @@ KamAZ Treibstoff KamAZ de combustible KamAZ cysterna - KAMAZ Cisterna + KamAZ Cisterna KamAZ Citerne КамАЗ Заправщик KamAZ Combustível @@ -474,7 +474,7 @@ KamAZ Instandsetzung KamAZ de reparación KamAZ Naprawczy - KAMAZ Opravárenský + KamAZ Opravárenský KamAZ Réparation КамАЗ Ремонтный KamAZ Reparador diff --git a/addons/reload/ACE_Settings.hpp b/addons/reload/ACE_Settings.hpp new file mode 100644 index 0000000000..7b60527449 --- /dev/null +++ b/addons/reload/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayText) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = CSTRING(SettingDisplayTextName); + description = CSTRING(SettingDisplayTextDesc); + }; +}; diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp index b6bd212015..a9fa4deadd 100644 --- a/addons/reload/CfgVehicles.hpp +++ b/addons/reload/CfgVehicles.hpp @@ -4,13 +4,13 @@ class CfgVehicles { class ACE_Actions { class ACE_Weapon { class GVAR(LinkBelt) { - displayName = "$STR_ACE_Reload_LinkBelt"; + displayName = CSTRING(LinkBelt); distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(startLinkingBelt)); }; class GVAR(CheckAmmo) { - displayName = "$STR_ACE_Reload_checkAmmo"; + displayName = CSTRING(checkAmmo); distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); @@ -24,7 +24,7 @@ class CfgVehicles { class ACE_Actions { class ACE_MainActions { class GVAR(CheckAmmo) { - displayName = "$STR_ACE_Reload_checkAmmo"; + displayName = CSTRING(checkAmmo); distance = 2.0; condition = QUOTE([ARR_2(_player, _target)] call FUNC(canCheckAmmo)); statement = QUOTE([ARR_2(_player, _target)] call FUNC(checkAmmo)); diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 149317c136..9d5110d330 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -4,10 +4,10 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3 Weapons", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", +["ACE3 Weapons", QGVAR(checkAmmo), localize LSTRING(checkAmmo), { // Conditions: canInteract - if !([ACE_player, (vehicle ACE_player), ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), ["isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false}; @@ -18,6 +18,11 @@ if !(hasInterface) exitWith {}; {false}, [19, [false, true, false]], false] call cba_fnc_addKeybind; +["setAmmoSync", { + //To propagate the setAmmo change, do it on all clients + PARAMS_3(_unit,_weapon,_ammo); + _unit setAmmo [_weapon, _ammo]; +}] call EFUNC(common,addEventhandler); // Listen for attempts to link ammo ["linkedAmmo", { @@ -45,7 +50,7 @@ if !(hasInterface) exitWith {}; // Add the ammo _ammoAdded = _ammoMissing min (_magazine select 1); - _receiver setAmmo [currentWeapon _receiver, _ammoCount + _ammoAdded]; + ["setAmmoSync", [_receiver, (currentWeapon _receiver), (_ammoCount + _ammoAdded)]] call EFUNC(common,globalEvent); if ((_magazine select 1) - _ammoAdded > 0) then { ["returnedAmmo", [_giver], [_giver,_receiver,[_magazineType,(_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 02f5014379..6ded1cd687 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -22,13 +22,4 @@ class CfgPatches { #include "RscInGameUI.hpp" -class ACE_Settings { - class GVAR(DisplayText) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_reload_SettingDisplayTextName"; - description = "$STR_ACE_reload_SettingDisplayTextDesc"; - }; -}; - +#include "ACE_Settings.hpp" diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 8b9145c237..4bed7f700a 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -66,4 +66,4 @@ _player playActionNow "PutDown"; [_player, _magazineType, _maxAmmo] call EFUNC(common,removeSpecificMagazine); // Call progress bar -[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize "STR_ACE_Reload_LinkingBelt"), _condition] call EFUNC(common,progressBar); +[4, [_player, _target, [_magazineType, _maxAmmo]], _onFinish, _onFailure, (localize LSTRING(LinkingBelt)), _condition] call EFUNC(common,progressBar); diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 316c7f2236..fc0c534e93 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -1,7 +1,7 @@ - + - + Check ammo on weapon reload Prüfe Munition beim Nachladen Comprobar munición al recargar el arma @@ -13,7 +13,7 @@ Controlla le munizioni ricaricando Conferir munição ao recarregar a arma - + Check the ammo in your new magazine on magazine reload. Prüfe nachgeladenes Magazin Comprueba la munición del nuevo cargador al recargar. diff --git a/addons/reloadlaunchers/CfgVehicles.hpp b/addons/reloadlaunchers/CfgVehicles.hpp index 617aa26b5c..3d7a5c9353 100644 --- a/addons/reloadlaunchers/CfgVehicles.hpp +++ b/addons/reloadlaunchers/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class CAManBase: Man { class ACE_Actions { class GVAR(ReloadLauncher) { - displayName = "$STR_ACE_ReloadLaunchers_LoadLauncher"; + displayName = CSTRING(LoadLauncher); selection = "launcher"; distance = 4; condition = ""; diff --git a/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf b/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf index 58cd53699e..a07afe8e22 100644 --- a/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf +++ b/addons/reloadlaunchers/functions/fnc_addMissileReloadActions.sqf @@ -30,7 +30,7 @@ _loadableMissiles = [_unit, _weapon] call FUNC(getLoadableMissiles); private ["_name", "_displayName", "_statement", "_condition", "_action"]; _name = format [QGVAR(Missile_%1), _x]; - _displayName = format [localize "STR_ACE_ReloadLaunchers_LoadMagazine", getText (configFile >> "CfgMagazines" >> _x >> "displayName")]; + _displayName = format [localize LSTRING(LoadMagazine), getText (configFile >> "CfgMagazines" >> _x >> "displayName")]; _statement = { (_this select 2) call DFUNC(load); diff --git a/addons/reloadlaunchers/functions/fnc_load.sqf b/addons/reloadlaunchers/functions/fnc_load.sqf index bf14b9b691..745bb2a5cb 100644 --- a/addons/reloadlaunchers/functions/fnc_load.sqf +++ b/addons/reloadlaunchers/functions/fnc_load.sqf @@ -34,15 +34,15 @@ _onSuccess = { (_this select 0 select 0) removeMagazine (_this select 0 select 3); ["reloadLauncher", _this select 0 select 1, _this select 0] call DEFUNC(common,targetEvent); - [localize "STR_ACE_ReloadLaunchers_LauncherLoaded"] call DEFUNC(common,displayTextStructured); + [localize LSTRING(LauncherLoaded)] call DEFUNC(common,displayTextStructured); }; _onFailure = { - [localize "STR_ACE_Common_ActionAborted"] call DEFUNC(common,displayTextStructured); + [localize LESTRING(common,ActionAborted)] call DEFUNC(common,displayTextStructured); }; _condition = { (_this select 0) call DFUNC(canLoad) && {(_this select 0 select 0) distance (_this select 0 select 1) < 4} }; -[_reloadTime, [_unit, _target, _weapon, _magazine], _onSuccess, _onFailure, localize "STR_ACE_ReloadLaunchers_LoadingLauncher", _condition] call EFUNC(common,progressBar); +[_reloadTime, [_unit, _target, _weapon, _magazine], _onSuccess, _onFailure, localize LSTRING(LoadingLauncher), _condition] call EFUNC(common,progressBar); diff --git a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf index fc802a025c..a14e0dfc1f 100644 --- a/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf +++ b/addons/reloadlaunchers/functions/fnc_reloadLauncher.sqf @@ -21,5 +21,5 @@ _target selectWeapon _weapon; if (currentWeapon _target != _weapon) exitWith {}; if (currentMagazine _target != "") exitWith {}; -// command is wip, reload time for launchers is not intended. +// command is wip, reload ACE_time for launchers is not intended. _target addWeaponItem [_weapon, _magazine]; diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index 2585358591..d82970a3d5 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -1,4 +1,4 @@ - + diff --git a/addons/respawn/$PBOPREFIX$ b/addons/respawn/$PBOPREFIX$ new file mode 100644 index 0000000000..072ffe81e3 --- /dev/null +++ b/addons/respawn/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\respawn \ No newline at end of file diff --git a/addons/respawn/ACE_Settings.hpp b/addons/respawn/ACE_Settings.hpp new file mode 100644 index 0000000000..5c947b8670 --- /dev/null +++ b/addons/respawn/ACE_Settings.hpp @@ -0,0 +1,14 @@ +class ACE_Settings { + class GVAR(SavePreDeathGear) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(RemoveDeadBodiesDisconnected) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(BodyRemoveTimer) { + value = 0; + typeName = "SCALAR"; + }; +}; diff --git a/addons/respawn/CfgAddons.hpp b/addons/respawn/CfgAddons.hpp index 2793ac09da..111613615e 100644 --- a/addons/respawn/CfgAddons.hpp +++ b/addons/respawn/CfgAddons.hpp @@ -1,5 +1,5 @@ class CfgAddons { class GVAR(Rallypoints) { - list[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" }; + list[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"}; }; }; diff --git a/addons/respawn/CfgVehicleClasses.hpp b/addons/respawn/CfgVehicleClasses.hpp index 8d4eeb139c..ab9c9b6c7e 100644 --- a/addons/respawn/CfgVehicleClasses.hpp +++ b/addons/respawn/CfgVehicleClasses.hpp @@ -1,5 +1,5 @@ class CfgVehicleClasses { class GVAR(Rallypoints) { - displayName = "ACE Respawn"; + displayName = CSTRING(EditorCategory); }; }; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 2f963a12d3..aa99b4e942 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,9 +1,9 @@ class CfgVehicles { - class Module_F; - class ACE_ModuleRespawn: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleRespawn: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Respawn System"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(module); scope = 2; isGlobal = 1; @@ -11,43 +11,52 @@ class CfgVehicles { class Arguments { class SavePreDeathGear { - displayName = "Save Gear?"; - description = "Respawn with the gear a soldier had just before his death?"; + displayName = CSTRING(SavePreDeathGear_DisplayName); + description = CSTRING(SavePreDeathGear_Description); typeName = "BOOL"; defaultValue = 0; }; class RemoveDeadBodiesDisconnected { - displayName = "Remove bodies?"; - description = "Remove player bodies after disconnect?"; + displayName = CSTRING(RemoveDeadBodiesDisconnected_DisplayName); + description = CSTRING(RemoveDeadBodiesDisconnected_Description); typeName = "BOOL"; defaultValue = 1; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; - class ACE_ModuleFriendlyFire: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_ModuleFriendlyFire: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Friendly Fire Messages"; + displayName = CSTRING(FriendlyFire_Module_DisplayName); function = QFUNC(moduleFriendlyFire); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_FriendlyFire_ca.paa)); class Arguments {}; + class ModuleDescription { + description = CSTRING(FriendlyFire_Module_Description); + }; }; - class ACE_ModuleRallypoint: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_ModuleRallypoint: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Rallypoint System"; + displayName = CSTRING(Rallypoint_Module_DisplayName); function = QFUNC(moduleRallypoint); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Rallypoint_ca.paa)); class Arguments {}; + class ModuleDescription { + description = CSTRING(Rallypoint_Module_Description); + }; }; // team leader @@ -55,7 +64,7 @@ class CfgVehicles { class CAManBase : Man { class ACE_SelfActions { class ACE_MoveRallypoint { - displayName = "Move Rallypoint"; + displayName = CSTRING(Rallypoint_MoveRallypoint); condition = QUOTE([ARR_2(_player, side group _player)] call FUNC(canMoveRallypoint)); statement = QUOTE([ARR_2(_player, side group _player)] call FUNC(moveRallypoint)); showDisabled = 0; @@ -82,13 +91,13 @@ class CfgVehicles { class ACE_Rallypoint_West_Base: Flag_NATO_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointWestBase"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointWestBase); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + displayName = CSTRING(TeleportToRallypoint); distance = 4; condition = QUOTE(side group _player == west); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West')] call FUNC(teleportToRallypoint)); @@ -102,13 +111,13 @@ class CfgVehicles { class ACE_Rallypoint_East_Base: Flag_CSAT_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointEastBase"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointEastBase); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + displayName = CSTRING(TeleportToRallypoint); distance = 4; condition = QUOTE(side group _player == east); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East')] call FUNC(teleportToRallypoint)); @@ -122,13 +131,13 @@ class CfgVehicles { class ACE_Rallypoint_Independent_Base: Flag_AAF_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointIndependentBase"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointIndependentBase); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToRallypoint"; + displayName = CSTRING(TeleportToRallypoint); distance = 4; condition = QUOTE(side group _player == independent); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent')] call FUNC(teleportToRallypoint)); @@ -143,13 +152,13 @@ class CfgVehicles { class ACE_Rallypoint_West: Flag_NATO_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointWest"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointWest); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToBase"; + displayName = CSTRING(TeleportToBase); distance = 4; condition = QUOTE(side group _player == west); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_West_Base')] call FUNC(teleportToRallypoint)); @@ -163,13 +172,13 @@ class CfgVehicles { class ACE_Rallypoint_East: Flag_CSAT_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointEast"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointEast); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToBase"; + displayName = CSTRING(TeleportToBase); distance = 4; condition = QUOTE(side group _player == east); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_East_Base')] call FUNC(teleportToRallypoint)); @@ -183,13 +192,13 @@ class CfgVehicles { class ACE_Rallypoint_Independent: Flag_AAF_F { XEH_ENABLED; - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Respawn_RallypointIndependent"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(RallypointIndependent); vehicleClass = QGVAR(Rallypoints); class ACE_Actions: ACE_Actions { class ACE_Teleport { - displayName = "$STR_ACE_Respawn_TeleportToBase"; + displayName = CSTRING(TeleportToBase); distance = 4; condition = QUOTE(side group _player == independent); statement = QUOTE([ARR_3(_player,side group _player,'ACE_Rallypoint_Independent_Base')] call FUNC(teleportToRallypoint)); diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 05f4ee2aa8..4a23d1f650 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" }; + weapons[] = {"ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_Rallypoint_West_Base", "ACE_Rallypoint_East_Base", "ACE_Rallypoint_Independent_Base"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; author[] = { "bux578", "commy2" }; @@ -16,18 +16,4 @@ class CfgPatches { #include "CfgAddons.hpp" #include "CfgVehicleClasses.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(SavePreDeathGear) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(RemoveDeadBodiesDisconnected) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(BodyRemoveTimer) { - value = 0; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 199495d75d..1fea488421 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -17,15 +17,15 @@ #include "script_component.hpp" -private ["_killedUnit"]; +PARAMS_1(_killedUnit); -_killedUnit = _this select 0; +// Saves the gear when the player! (and only him) is killed +if (ACE_player == _killedUnit) then { + GVAR(unitGear) = []; -// Saves the gear when the player is killed -GVAR(unitGear) = []; - -if (GVAR(SavePreDeathGear)) then { - GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); + if (GVAR(SavePreDeathGear)) then { + GVAR(unitGear) = [_killedUnit] call EFUNC(common,getAllGear); + }; }; if (missionNamespace getVariable [QGVAR(showFriendlyFireMessage), false]) then { diff --git a/addons/respawn/functions/fnc_moveRallypoint.sqf b/addons/respawn/functions/fnc_moveRallypoint.sqf index da9054e6aa..d512c23886 100644 --- a/addons/respawn/functions/fnc_moveRallypoint.sqf +++ b/addons/respawn/functions/fnc_moveRallypoint.sqf @@ -26,10 +26,12 @@ private ["_rallypoint", "_position"]; _rallypoint = [ objNull, missionNamespace getVariable ["ACE_Rallypoint_West", objNull], - missionNamespace getVariable ["ACE_RallypointExit_East", objNull], - missionNamespace getVariable ["ACE_RallypointExit_Independent", objNull] + missionNamespace getVariable ["ACE_Rallypoint_East", objNull], + missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull] ] select ([west, east, independent] find _side) + 1; +TRACE_3("moving rally",_unit, _rallypoint, (typeOf _rallypoint)); + if (isNull _rallypoint) exitWith {}; _position = getPosATL _unit; @@ -38,7 +40,7 @@ if (count _position == 0) then {_position = getPosATL _unit}; _position set [2, 0]; -[localize "STR_ACE_Respawn_Deploy"] call EFUNC(common,displayTextStructured); +[localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured); [{ _rallypoint = _this select 0; @@ -53,6 +55,6 @@ _position set [2, 0]; ["rallypointMoved", [_rallypoint, _side, _position]] call EFUNC(common,globalEvent); - [localize "STR_ACE_Respawn_Deployed"] call EFUNC(common,displayTextStructured); + [localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured); }, [_rallypoint, _unit, _position, _rallypoint], 5, 1] call EFUNC(common,waitAndExecute); diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index 85863bb6c2..285c560a6c 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -98,7 +98,7 @@ if(format["%1", _backpack] != "") then { // primaryWeapon -if (_primaryweapon != "") then { +if ((_primaryweapon != "") && {_primaryweapon != "ACE_FakePrimaryWeapon"}) then { { _unit addMagazine _x; } forEach _primaryweaponmagazine; diff --git a/addons/respawn/functions/fnc_teleportToRallypoint.sqf b/addons/respawn/functions/fnc_teleportToRallypoint.sqf index dc3cc16b92..59a9766114 100644 --- a/addons/respawn/functions/fnc_teleportToRallypoint.sqf +++ b/addons/respawn/functions/fnc_teleportToRallypoint.sqf @@ -31,4 +31,4 @@ _rallypoint = missionNamespace getVariable [_rallypoint, objNull], if (isNull _rallypoint) exitWith {}; _unit setPosASL getPosASL _rallypoint; -[[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(common,displayTextStructured); +[[localize LSTRING(TeleportedToRallypoint), localize LSTRING(TeleportedToBase)] select _toBase] call EFUNC(common,displayTextStructured); diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index cd0fda2780..4b649173f0 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -1,6 +1,6 @@  - + Deploy in 5 seconds ... Déploiement dans 5 secondes ... @@ -35,6 +35,7 @@ Téléportation à la base Teletransportar para a Base Bázisra teleportálás + Teleporta alla base Teleport to Rallypoint @@ -46,6 +47,7 @@ Téléporation au point de ralliement Teletransportar para o ponto de encontro Gyülekezőpontra teleportálás + Teleporta al rallypoint Teleported to Base @@ -143,5 +145,96 @@ Rallypoint Nezávislý Ponto de encontro Independente + + Respawn System + System odrodzenia + Sistema de reaparición + Respawn-System + Systém znovuzrození + Sistema de Renascimento + + + Save Gear? + Zapisać ekwipunek? + ¿Guardar equipo? + Ausrüstung speichern? + Uložit výbavu? + Salvar equipamento? + + + Respawn with the gear a soldier had just before his death? + Odradzaj z ekwipunkiem jaki żołnierz miał tuż przed swoją śmiercią? + Reaparece con el equipo que el soldado tenía justo antes de morir + Mit der Ausrüstung, die ein Soldat vor seinem Tod hatte, respawnen? + Znovuubjevit s výbavou kterou měl voják před smrtí? + Renascer com o equipamento que um soldado tinha antes de sua morte? + + + Remove bodies? + Usuwać ciała? + ¿Eliminar cuerpos? + Körper entfernen? + Odstranit těla? + Remover corpos? + + + Remove player bodies after disconnect? + Usuwaj ciała graczy po rozłączeniu z serwera? + Elimina los cuerpos de los jugadores cuando se desconecten + Entferne Spielerkörper nach dem Trennen einer Verbindung? + Odstranit hráčova těla po odpojení? + Remover corpos dos jogadores depois de desconectar? + + + + Moduł ten pozwala dostosować ustawienia odrodzenia (respawnu). + Dieses Modul erlaubt es die Respawn-Einstellungen anzupassen. + Tento modul umožňuje nastavení znovuzrození (spawn). + Este módulo permite que você personalize as configurações do renascimento (Spawn). + + + Friendly Fire Messages + Wiadomości Friendly Fire + Mensajes de fuego amigo + Freundbeschuss-Nachrichten + Upozornění na přátelskou střelbu + Mensagens de fogo amigo + + + + Użycie tego modułu na misji spowoduje wyświetlenie wiadomości na czacie w przypadku, kiedy zostanie popełniony friendly fire - wyświetlona zostanie wtedy wiadomość kto kogo zabił. + Zobrazí zprávu v chatu v případě, když budete střílet na vlastní jednotky. Ve zprávě se zobrazí kdo na koho střílel, popř. kdo koho zabil. + Usando este módulo em uma missão para exibir mensagens chat, no caso de quando você faz um fogo amigo - então a mensagem será exibida mostrando quem matou quem. + + + Rallypoint System + System punktu zbiórki + Sistema de punto de reunión + Rallypoint-System + Systém shromáždění + Sistema de ponto de encontro + + + + Moduł ten pozwala zastosować na misji "punkt zbiórki", do którego można szybko przeteleportować się z "bazy". Wymaga postawienia odpowiednich obiektów na mapie - bazy oraz flagi. Obydwa dostępne są w kategorii Puste -> ACE Odrodzenie. + Tento modul umožňuje určit místo shromaždiště, kam se mohou jednokty rychle teleportovat ze "základny". Toto vyžaduje vhodné objekty v mapě - základna a vlajka. Oba dva můžete najít v kategorii Prázdné -> ACE Oživení. + Este módulo permite que você aplique em uma missão "pontos de encontro", que pode rapidamente se teletransportar para a "base". Ele requer colocar objetos apropriados no mapa - base e bandeiras. Ambos estão disponíveis na categoria em branco -> ACE Revival. + + + Move Rallypoint + Przenieś punkt zbiórki + Mover punto de reunión + Bewege Rallypoint + Přesun na shromaždiště + Mover para ponto de encontro + + + ACE Respawn + ACE Odrodzenie + Reaparición ACE + ACE-Respawn + ACE Znovuzrození + ACE Respawn + - + \ No newline at end of file diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 9c3d989425..7ab283f6b6 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -9,7 +9,7 @@ if (!hasInterface) exitWith {}; // Add keybinds -["ACE3 Weapons", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", +["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/safemode/functions/fnc_firstMode.sqf b/addons/safemode/functions/fnc_firstMode.sqf index 821090dd32..d10da3f896 100644 --- a/addons/safemode/functions/fnc_firstMode.sqf +++ b/addons/safemode/functions/fnc_firstMode.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -EXPLODE_1_PVT(_this,_weapon); +PARAMS_1(_weapon); private ["_mode"]; _mode = getArray (configFile >> "CfgWeapons" >> _weapon >> "modes") select 0; diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 0e365fc221..42a8ef89fb 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -EXPLODE_3_PVT(_this,_unit,_weapon,_muzzle); +PARAMS_3(_unit,_weapon,_muzzle); // don't immediately switch back if (inputAction "nextWeapon" > 0) exitWith {}; @@ -10,7 +10,7 @@ private ["_safedWeapons"]; _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) exitWith { - _this call FUNC(unlockSafety); + _this call FUNC(unlockSafety); }; _safedWeapons pushBack _weapon; @@ -18,46 +18,48 @@ _safedWeapons pushBack _weapon; _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (_unit getVariable [QGVAR(actionID), -1] == -1) then { - private ["_condition", "_statement", "_id"]; + private ["_condition", "_statement", "_id"]; - _condition = { - if ( - [_this select 1] call EFUNC(common,canUseWeapon) - && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + _condition = { + if ( + [_this select 1] call EFUNC(common,canUseWeapon) + && { + if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { + if (inputAction "nextWeapon" > 0) exitWith { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + false + }; + true + } else {false} + } + ) then { + // player hud + [false] call FUNC(setSafeModeVisual); + true + } else { + // player hud + [true] call FUNC(setSafeModeVisual); false - }; - true - } else {false} - } - ) then { - // player hud - [false] call FUNC(setSafeModeVisual); - true - } else { - // player hud - [true] call FUNC(setSafeModeVisual); - false - } - }; + } + }; - _statement = { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); - }; + _statement = { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + }; - //_id = [_unit, format ["%1", localize "STR_ACE_SafeMode_TakeOffSafety"], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); - _id = [_unit, "DefaultAction", _condition, {}] call EFUNC(common,addActionEventHandler); + //_id = [_unit, format ["%1", localize LSTRING(TakeOffSafety)], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); + _id = [_unit, "DefaultAction", _condition, {}] call EFUNC(common,addActionEventHandler); - _unit setVariable [QGVAR(actionID), _id]; + _unit setVariable [QGVAR(actionID), _id]; }; -_unit selectWeapon _muzzle;//_weapon +if ((typeName _muzzle) == (typeName "")) then { + _unit selectWeapon _muzzle;//_weapon +}; // play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); private "_picture"; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); -[localize "STR_ACE_SafeMode_PutOnSafety", _picture] call EFUNC(common,displayTextPicture); +[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 6c2c797706..754a02005c 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,23 +1,18 @@ // by commy2 #include "script_component.hpp" -EXPLODE_2_PVT(_this,_unit,_weapon); +PARAMS_2(_unit,_weapon); private ["_sound"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (count _sound == 0) exitWith { - playSound "ACE_Sound_Click"; + playSound "ACE_Sound_Click"; }; // add file extension -if call { - { - if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false}; - true - } forEach [".wav", ".ogg", ".wss"]; -} then { - _sound set [0, (_sound select 0) + ".wss"]; +if ({(toLower (_sound select 0) find _x == (count toArray (_sound select 0) - count toArray _x) - 1)} count [".wav", ".ogg", ".wss"] == 0) then { + _sound set [0, (_sound select 0) + ".wss"]; }; // add default volume, pitch and distance diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index ae449e05e8..cb8c679855 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -EXPLODE_1_PVT(_this,_show); +PARAMS_1(_show); disableSerialization; @@ -11,12 +11,12 @@ _control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl if (isNull _control) exitWith {}; if (_show) then { - private "_config"; - _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; + private "_config"; + _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; - _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - _control ctrlCommit 0; + _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; + _control ctrlCommit 0; } else { - _control ctrlSetPosition [0, 0, 0, 0]; - _control ctrlCommit 0; + _control ctrlSetPosition [0, 0, 0, 0]; + _control ctrlCommit 0; }; diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 341cad182f..2b4f00a4a9 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,57 +1,57 @@ // by commy2 #include "script_component.hpp" -EXPLODE_3_PVT(_this,_unit,_weapon,_muzzle); +PARAMS_3(_unit,_weapon,_muzzle); private ["_safedWeapons"]; _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) then { - _safedWeapons = _safedWeapons - [_weapon]; + _safedWeapons = _safedWeapons - [_weapon]; - _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; + _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; - if (count _safedWeapons == 0) then { - private "_id"; - _id = _unit getVariable [QGVAR(actionID), -1]; + if (count _safedWeapons == 0) then { + private "_id"; + _id = _unit getVariable [QGVAR(actionID), -1]; - //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); - [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; - }; + //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); + [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); + _unit setVariable [QGVAR(actionID), -1]; + }; }; _unit selectWeapon _muzzle; if (inputAction "nextWeapon" > 0) then { - // switch to the last mode to roll over to first after the default nextWeapon action - private ["_modes", "_mode", "_index"]; + // switch to the last mode to roll over to first after the default nextWeapon action + private ["_modes", "_mode", "_index"]; - // get weapon modes - _modes = []; - { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; + // get weapon modes + _modes = []; + { + if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { + _modes pushBack _x; + }; + if (_x == "this") then { + _modes pushBack _weapon; + }; + } forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); + + // select last mode + _mode = _modes select (count _modes - 1); + + // switch to last mode + _index = 0; + while { + _index < 100 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} + } do { + _unit action ["SwitchWeapon", _unit, _unit, _index]; + _index = _index + 1; }; - if (_x == "this") then { - _modes pushBack _weapon; - }; - } forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); - - // select last mode - _mode = _modes select (count _modes - 1); - - // switch to last mode - _index = 0; - while { - _index < 100 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; - }; } else { - // play fire mode selector sound - [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); + // play fire mode selector sound + [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); }; // player hud @@ -59,4 +59,4 @@ if (inputAction "nextWeapon" > 0) then { private "_picture"; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); -[localize "STR_ACE_SafeMode_TookOffSafety", _picture] call EFUNC(common,displayTextPicture); +[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/script_component.hpp b/addons/safemode/script_component.hpp index c68b265489..04f10ed105 100644 --- a/addons/safemode/script_component.hpp +++ b/addons/safemode/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT safemode -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SAFEMODE #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE #endif -#include "\z\ace\Addons\main\script_macros.hpp" +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/safemode/stringtable.xml b/addons/safemode/stringtable.xml index f39ca84614..80097580cd 100644 --- a/addons/safemode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -4,7 +4,7 @@ Safe Mode Waffe sichern - Seguro puesto + Poner seguro Bezpiecznik Pojistka Biztonságos mód @@ -28,13 +28,13 @@ Put on Safety Waffe gesichert - Poner seguro + Seguro puesto Zabezpieczono broń Přepnout pojistku Biztonsági kapcsoló helyretolása Поставить на предохранитель Sécurité mise - Inserisci la sicura + Sicura inserita Colocar Segurança @@ -46,8 +46,8 @@ Biztonságos mód megszüntetve Снят с предохранителя Sécurité enlevée - Togli la sicura + Sicura tolta Tirou Segurança - + \ No newline at end of file diff --git a/addons/sandbag/$PBOPREFIX$ b/addons/sandbag/$PBOPREFIX$ new file mode 100644 index 0000000000..1061a20968 --- /dev/null +++ b/addons/sandbag/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\sandbag \ No newline at end of file diff --git a/addons/sandbag/CfgEventHandlers.hpp b/addons/sandbag/CfgEventHandlers.hpp new file mode 100644 index 0000000000..17911f6b1f --- /dev/null +++ b/addons/sandbag/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + +class Extended_Init_EventHandlers { + class ACE_SandbagObject { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; +}; \ No newline at end of file diff --git a/addons/sandbag/CfgVehicles.hpp b/addons/sandbag/CfgVehicles.hpp new file mode 100644 index 0000000000..b16d2f978d --- /dev/null +++ b/addons/sandbag/CfgVehicles.hpp @@ -0,0 +1,113 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Sandbags { + displayName = CSTRING(DeploySandbag); + condition = QUOTE(call FUNC(canDeploy)); + statement = QUOTE(call FUNC(deploy)); + exceptions[] = {"isNotSwimming"}; + showDisabled = 1; + priority = 4; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + }; + }; + }; + + class Item_Base_F; + class ACE_Item_Sandbag_empty: Item_Base_F { + author = ECSTRING(common,ACETeam); + scope = 2; + scopeCurator = 2; + displayName = CSTRING(sandbagEmpty_displayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_Sandbag_empty { + name = "ACE_Sandbag_empty"; + count = 1; + }; + }; + }; + /* + class ACE_Item_Sandbag: Item_Base_F { + author = ECSTRING(common,ACETeam); + scope = 2; + scopeCurator = 2; + displayName = CSTRING(sandbag_displayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_Sandbag { + name = "ACE_Sandbag"; + count = 1; + }; + }; + }; + */ + class thingX; + class ACE_SandbagObject: thingX { + author = ECSTRING(common,ACETeam); + XEH_ENABLED; + scope = 1; + side = -1; + model = PATHTOF(data\ace_sandbag_build.p3d); + displayName = CSTRING(sandbag_displayName); + typicalCargo[] = {}; + armor = 12000; // Withstand 200 5.56 bullets before sandbag hull is cheese + mapSize = 0.4; + nameSound = "Bunker"; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + accuracy = 1000; + + destrType = "DestructDefault"; + + class DestructionEffects {}; + class Damage { + tex[] = {}; + mat[] = { + "z\ace\addons\sandbag\data\bag_destruct.rvmat", + "z\ace\addons\sandbag\data\bag_destruct.rvmat", + "z\ace\addons\sandbag\data\bag_destruct.rvmat" + }; + }; + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 5; + condition = "true"; + class ACE_PickUp { + selection = ""; + displayName = CSTRING(PICKUPSB); + distance = 4; + condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)])); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + }; + class ACE_Carry { + selection = ""; + displayName = CSTRING(CARRYSB); + distance = 4; + condition = QUOTE(!(_player getVariable [ARR_2('ace_sandbag_usingSandbag',false)])); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(carry)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\icon_sandbag_ca.paa); + }; + }; + }; + }; + class ACE_SandbagObject_NoGeo: ACE_SandbagObject { + scope = 1; + model = PATHTOF(data\ace_sandbag_nogeo.p3d); + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Sandbag_empty,50); + }; + }; +}; diff --git a/addons/sandbag/CfgWeapons.hpp b/addons/sandbag/CfgWeapons.hpp new file mode 100644 index 0000000000..1a26fc78d4 --- /dev/null +++ b/addons/sandbag/CfgWeapons.hpp @@ -0,0 +1,30 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_Sandbag_empty: ACE_ItemCore { + author = ECSTRING(common,ACETeam); + scope = 2; + displayName = CSTRING(sandbagEmpty_displayName); + model = PATHTOF(data\ace_sandbag_m.p3d); + picture = PATHTOF(data\m_sandbag_ca.paa); + + class ItemInfo: InventoryItem_Base_F { + mass = 8; + }; + }; + /* + class ACE_Sandbag: ACE_ItemCore { + author = ECSTRING(common,ACETeam); + scope = 2; + displayName = CSTRING(sandbag_displayName); + model = PATHTOF(data\ace_sandbag_build.p3d); + picture = PATHTOF(data\m_sandbag_ca.paa); + + class ItemInfo: InventoryItem_Base_F { + mass = 160; + }; + }; + */ +}; diff --git a/addons/sandbag/README.md b/addons/sandbag/README.md new file mode 100644 index 0000000000..8c67ed9a6d --- /dev/null +++ b/addons/sandbag/README.md @@ -0,0 +1,10 @@ +ace_sandbag +=============== + +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 diff --git a/addons/sandbag/UI/icon_sandbag_ca.paa b/addons/sandbag/UI/icon_sandbag_ca.paa new file mode 100644 index 0000000000..5d6ea6d4d9 Binary files /dev/null and b/addons/sandbag/UI/icon_sandbag_ca.paa differ diff --git a/addons/sandbag/XEH_postInit.sqf b/addons/sandbag/XEH_postInit.sqf new file mode 100644 index 0000000000..d1c0ad0766 --- /dev/null +++ b/addons/sandbag/XEH_postInit.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +GVAR(placer) = objNull; +GVAR(sandBag) = objNull; +GVAR(deployPFH) = -1; +GVAR(deployDirection) = 0; + +// Cancel deploy sandbag if interact menu opened +["interactMenuOpened", { + if (GVAR(deployPFH) != -1 && {!isNull (GVAR(sandBag))}) then { + call FUNC(deployCancel); + }; +}] call EFUNC(common,addEventHandler); + +[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); diff --git a/addons/sandbag/XEH_preInit.sqf b/addons/sandbag/XEH_preInit.sqf new file mode 100644 index 0000000000..1978913723 --- /dev/null +++ b/addons/sandbag/XEH_preInit.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(canDeploy); +PREP(carry); +PREP(deploy); +PREP(deployCancel); +PREP(deployConfirm); +PREP(drop); +PREP(handleScrollWheel); +PREP(pickup); + +ADDON = true; diff --git a/addons/sandbag/config.cpp b/addons/sandbag/config.cpp new file mode 100644 index 0000000000..6b7ce1a456 --- /dev/null +++ b/addons/sandbag/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_Sandbag", "ACE_Item_Sandbag_empty"}; + weapons[] = {"ACE_Sandbag", "ACE_Sandbag_empty"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Rocko", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" \ No newline at end of file diff --git a/addons/sandbag/data/ace_sandbag_build.p3d b/addons/sandbag/data/ace_sandbag_build.p3d new file mode 100644 index 0000000000..eb24832c31 Binary files /dev/null and b/addons/sandbag/data/ace_sandbag_build.p3d differ diff --git a/addons/sandbag/data/ace_sandbag_m.p3d b/addons/sandbag/data/ace_sandbag_m.p3d new file mode 100644 index 0000000000..3f651a7530 Binary files /dev/null and b/addons/sandbag/data/ace_sandbag_m.p3d differ diff --git a/addons/sandbag/data/ace_sandbag_nogeo.p3d b/addons/sandbag/data/ace_sandbag_nogeo.p3d new file mode 100644 index 0000000000..5a7680ffd8 Binary files /dev/null and b/addons/sandbag/data/ace_sandbag_nogeo.p3d differ diff --git a/addons/sandbag/data/bag.rvmat b/addons/sandbag/data/bag.rvmat new file mode 100644 index 0000000000..d764320caa --- /dev/null +++ b/addons/sandbag/data/bag.rvmat @@ -0,0 +1,132 @@ +/* +ambient[]={0.992157,0.992157,0.992157,1.000000}; +diffuse[]={0.992157,0.992157,0.992157,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.000000,0.000000,0.000000,1.000000}; +specularPower=40.000000; +*/ + +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.250000,0.250000,0.250000,0.250000}; +specularPower=30.000000; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 { + texture="z\ace\addons\sandbag\data\bag_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 { + texture="z\ace\addons\sandbag\data\bag_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; + +/* +ambient[]={1.0, 1.0, 1.0, 1.0}; +diffuse[]={1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[]={0.0, 0.0, 0.0, 0.0}; +emmisive[]={0.0, 0.0, 0.0, 0.0}; +specular[]={0.93, 0.93, 0.93, 0.0}; +specularPower=400.0; +PixelShaderID="Super"; +VertexShaderID="Super"; + +class Stage1 { + texture="z\ace\addons\sandbag\data\bag_nohq.paa"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage2 { + texture="a3\weapons_f\data\detailmaps\metal_detail_dt.paa"; + uvSource="tex"; + + class uvTransform { + aside[]={6.0, 0.0, 0.0}; + up[]={0.0, 3.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0,MC)"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage4 { + texture="#(argb,8,8,3)color(0.8,0,0,1,AS)"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage5 { + texture="z\ace\addons\sandbag\data\bag_smdi.paa"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage6 { + texture="#(ai,64,64,1)fresnel(1.29,0.5)"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; + +class Stage7 { + texture="a3\data_f\env_land_co.paa"; + uvSource="tex"; + + class uvTransform { + aside[]={1.0, 0.0, 0.0}; + up[]={0.0, 1.0, 0.0}; + dir[]={0.0, 0.0, 0.0}; + pos[]={0.0, 0.0, 0.0}; + }; +}; +*/ diff --git a/addons/sandbag/data/bag_co.paa b/addons/sandbag/data/bag_co.paa new file mode 100644 index 0000000000..436b8af955 Binary files /dev/null and b/addons/sandbag/data/bag_co.paa differ diff --git a/addons/sandbag/data/bag_destruct.rvmat b/addons/sandbag/data/bag_destruct.rvmat new file mode 100644 index 0000000000..1a592c973e --- /dev/null +++ b/addons/sandbag/data/bag_destruct.rvmat @@ -0,0 +1,48 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.250000,0.250000,0.250000,0.250000}; +specularPower=30.000000; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 { + texture="z\ace\addons\sandbag\data\bag_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 { + texture="z\ace\addons\apl\data\vehicle_destr1024_1024_mc.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.200000,0.000000,0.000000}; + pos[]={0.200000,0.000000,0.000000}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(1,1,1,0.3)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 { + texture="z\ace\addons\apl\data\vehicle_destr1024_1024_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; diff --git a/addons/sandbag/data/bag_nohq.paa b/addons/sandbag/data/bag_nohq.paa new file mode 100644 index 0000000000..009b9c5525 Binary files /dev/null and b/addons/sandbag/data/bag_nohq.paa differ diff --git a/addons/sandbag/data/bag_smdi.paa b/addons/sandbag/data/bag_smdi.paa new file mode 100644 index 0000000000..8c277264db Binary files /dev/null and b/addons/sandbag/data/bag_smdi.paa differ diff --git a/addons/sandbag/data/m_sandbag_ca.paa b/addons/sandbag/data/m_sandbag_ca.paa new file mode 100644 index 0000000000..b0c2d9e3be Binary files /dev/null and b/addons/sandbag/data/m_sandbag_ca.paa differ diff --git a/addons/sandbag/data/model.cfg b/addons/sandbag/data/model.cfg new file mode 100644 index 0000000000..064073b314 --- /dev/null +++ b/addons/sandbag/data/model.cfg @@ -0,0 +1,21 @@ +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ACE_SB_Skeleton: Default {}; +}; + +class CfgModels { + class Default { + sectionsInherit=""; + sections[] = {""}; + skeletonName = ""; + }; + class ace_sandbag_build { + sectionsInherit = "Default"; + sections[] = {"zbytek"}; + skeletonName = "ACE_SB_Skeleton"; + }; +}; diff --git a/addons/sandbag/functions/fnc_canDeploy.sqf b/addons/sandbag/functions/fnc_canDeploy.sqf new file mode 100644 index 0000000000..a55b9f9875 --- /dev/null +++ b/addons/sandbag/functions/fnc_canDeploy.sqf @@ -0,0 +1,28 @@ +/* + * Author: Ruthberg + * Checks if the player can deploy a sandbag + * + * Arguments: + * None + * + * Return Value: + * can deploy? + * + * Example: + * call ace_sandbag_fnc_canDeploy; + * + * Public: No + */ +#include "script_component.hpp" + +#define SURFACE_BLACKLIST ["water", "concrete", "tarmac", "wood", "metal", "roof_tin", "roof_tiles", "wood_int", "concrete_int", "tiles_int", "metal_int", "stony", "rock", "int_concrete", "int_tiles", "int_wood", "tiling", "wavymetal", "int_metal"] + +if !([ACE_player, "ACE_Sandbag_empty"] call EFUNC(common,hasItem)) exitWith { false }; +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"); + +!(_surfaceType in SURFACE_BLACKLIST) diff --git a/addons/sandbag/functions/fnc_carry.sqf b/addons/sandbag/functions/fnc_carry.sqf new file mode 100644 index 0000000000..f2ba3dff8a --- /dev/null +++ b/addons/sandbag/functions/fnc_carry.sqf @@ -0,0 +1,56 @@ +/* + * Author: Ruthberg + * Carry sandbag + * + * Arguments: + * 0: sandbag + * 1: unit + * + * Return Value: + * None + * + * Example: + * [_sandbag, _unit] call ace_sandbag_fnc_carry; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_sandbag,_unit); + +_unit playActionNow "PutDown"; + +_unit setVariable [QGVAR(usingSandbag), true]; +[{ + PARAMS_2(_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) enableSimulationGlobal false; + + // Force physx update + { + _x setPosASL (getPosASL _x); + } forEach (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) setDir (GVAR(deployDirection) + getDir ACE_player); + }, 0, []] call CBA_fnc_addPerFrameHandler; + + [localize LSTRING(DropSandbag), "", ""] call EFUNC(interaction,showMouseHint); + + GVAR(carrier) setVariable [QGVAR(drop), + [GVAR(carrier), "DefaultAction", + {GVAR(carryPFH) != -1 && !isNull (GVAR(sandBag))}, + {call FUNC(drop);} + ] call EFUNC(common,AddActionEventHandler)]; +}, [_sandbag, _unit], 1, 0.5] call EFUNC(common,waitAndExecute); diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf new file mode 100644 index 0000000000..1e1121409b --- /dev/null +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -0,0 +1,47 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Starts the deploy process for sandbags. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_sandbag_fnc_deploy; + * + * Public: No + */ +#include "script_component.hpp" + +closeDialog 0; + +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) 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) setDir (GVAR(deployDirection) + getDir ACE_player); +}, 0, []] call CBA_fnc_addPerFrameHandler; + +[localize LSTRING(ConfirmDeployment), localize LSTRING(CancelDeployment), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); + +GVAR(placer) setVariable [QGVAR(Deploy), + [GVAR(placer), "DefaultAction", + {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, + {call FUNC(deployConfirm);} +] call EFUNC(common,AddActionEventHandler)]; + +GVAR(placer) setVariable [QGVAR(Cancel), + [GVAR(placer), "zoomtemp", + {GVAR(deployPFH) != -1 && !isNull (GVAR(sandBag))}, + {call FUNC(deployCancel);} +] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf new file mode 100644 index 0000000000..65677ea887 --- /dev/null +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -0,0 +1,35 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Cancels sandbag deployment + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_sandbag_fnc_deployCancel; + * + * Public: No + */ +#include "script_component.hpp" + +if (isNull GVAR(placer)) exitWith {}; + +[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler; + +if (!isNull (GVAR(sandBag))) then { + deleteVehicle GVAR(sandBag); +}; + +[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); + +call EFUNC(interaction,hideMouseHint); +[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); + +GVAR(placer) addItem "ACE_Sandbag_empty"; + +GVAR(sandBag) = objNull; +GVAR(placer) = objNull; diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf new file mode 100644 index 0000000000..2cb297c51e --- /dev/null +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -0,0 +1,51 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Confirms sandbag deployment + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_sandbag_fnc_deployConfirm; + * + * Public: No + */ +#include "script_component.hpp" + +if (isNull GVAR(sandBag) || isNull GVAR(placer)) exitWith {}; + +[GVAR(deployPFH)] call cba_fnc_removePerFrameHandler; + +[GVAR(placer), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); +[GVAR(placer), "DefaultAction", GVAR(placer) getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[GVAR(placer), "zoomtemp", GVAR(placer) getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); + +call EFUNC(interaction,hideMouseHint); + +GVAR(placer) playActionNow "PutDown"; + +GVAR(placer) setVariable [QGVAR(usingSandbag), true]; +[{ + _this setVariable [QGVAR(usingSandbag), false]; +}, GVAR(placer), 1.5, 0.5] call EFUNC(common,waitAndExecute); + +[{ + 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 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 new file mode 100644 index 0000000000..1ef61289bf --- /dev/null +++ b/addons/sandbag/functions/fnc_drop.sqf @@ -0,0 +1,47 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Drop sandbag + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_sandbag_fnc_deployCancel; + * + * Public: No + */ +#include "script_component.hpp" + +if (isNull GVAR(sandBag) || isNull GVAR(carrier)) exitWith {}; + +[GVAR(carryPFH)] call cba_fnc_removePerFrameHandler; + +[GVAR(carrier), "ACE_Sandbag", false] call EFUNC(Common,setForceWalkStatus); +[GVAR(carrier), "DefaultAction", GVAR(carrier) getVariable [QGVAR(drop), -1]] call EFUNC(Common,removeActionEventHandler); + +call EFUNC(interaction,hideMouseHint); + +GVAR(carrier) playActionNow "PutDown"; + +[{ + _this setVariable [QGVAR(usingSandbag), false]; +}, GVAR(carrier), 1.5, 0.5] call EFUNC(common,waitAndExecute); + +[{ + 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 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 new file mode 100644 index 0000000000..2b831f5cdc --- /dev/null +++ b/addons/sandbag/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,24 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Handles sandbag rotation + * + * Arguments: + * 0: scroll amount + * + * Return Value: + * handled + * + * Example: + * 1.2 call ace_sandbag_fnc_handleScrollWheel; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_scroll); + +if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(deployPFH) == -1) exitWith { false }; + +GVAR(deployDirection) = GVAR(deployDirection) + (_scroll * 5); + +true diff --git a/addons/sandbag/functions/fnc_pickup.sqf b/addons/sandbag/functions/fnc_pickup.sqf new file mode 100644 index 0000000000..360a18983a --- /dev/null +++ b/addons/sandbag/functions/fnc_pickup.sqf @@ -0,0 +1,35 @@ +/* + * Author: Ruthberg + * Pick up sandbag + * + * Arguments: + * 0: sandbag + * 1: unit + * + * Return Value: + * None + * + * Example: + * [_sandbag, _unit] call ace_sandbag_fnc_pickup; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_sandbag,_unit); + +_unit playActionNow "PutDown"; + +_unit setVariable [QGVAR(usingSandbag), true]; +[{ + PARAMS_2(_sandbag,_unit); + _unit setVariable [QGVAR(usingSandbag), false]; + deletevehicle _sandbag; + + // Force physx update + { + _x setPosASL (getPosASL _x); + } forEach (_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/sandbag/functions/script_component.hpp b/addons/sandbag/functions/script_component.hpp new file mode 100644 index 0000000000..1d6f10c806 --- /dev/null +++ b/addons/sandbag/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\sandbag\script_component.hpp" \ No newline at end of file diff --git a/addons/sandbag/script_component.hpp b/addons/sandbag/script_component.hpp new file mode 100644 index 0000000000..8737beef07 --- /dev/null +++ b/addons/sandbag/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT sandbag +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SANDBAG + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SANDBAG + #define DEBUG_SETTINGS DEBUG_SETTINGS_SANDBAG +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/sandbag/stringtable.xml b/addons/sandbag/stringtable.xml new file mode 100644 index 0000000000..70dde0da56 --- /dev/null +++ b/addons/sandbag/stringtable.xml @@ -0,0 +1,161 @@ + + + + + Sandbag + Sandsack + Мешок с песком + Worek z piaskiem + Sandbag + Sac de sable + Pytel s pískem + Sacco di Sabbia + Homokzsák + Saco de Areia + + + Sandbag (empty) + Sandsack (leer) + Мешок с песком (пустой) + Worek na piasek + Sandbag (empty) + Sac de sable (vide) + Pytel na písek (prázdný) + Sacco di Sabbia (Vuoto) + Homokzsák (üres) + Saco de Areia (vazio) + + + Cannot build here + Nicht möglich + Установка на этом месте невозможна + Nie można tu budować + Cannot build here + Impossible de construire ici + Zde nelze postavit + Impossibile costruire qui + Nem teheted ide + Não pode contruir aqui + + + Pick up Sandbag + Sandsack abbauen + Взять мешок с песком + Zabierz worek + Pick up sandbag + Prendre sac de sable + Zvednout pytel + Prendi Sacco di Sabbia + Homokzsák felvétele + Pegar saco de areia + + + Carry Sandbag + Sandsack tragen + Нести мешок с песком + Przenieś worek + Carry sandbag + Porter sac de sable + Nést pytel + Trasporta Sacco di Sabbia + Homokzsák cipelése + Carregar saco de areia + + + End Carrying + Tragen beenden + Завершить переноску + Zostaw worek + End carrying + Arreter de porter + Položit + Fine Trasporto + Cipelés abbahagyása + Parar de carregar + + + Drop Sandbag + Sandsack ablegen + Положить мешок + Upuść worek + Drop sandbag + Lacher sac de sable + Odložit pytel + Lascia Sacco di Sabbia + Homokzsák eldobása + Derrubar saco de areia + + + Confirm Deployment + Aufbauen + Подтвердить установку + Potwierdź rozłożenie + Confirm Deployment + Confirmer Déploiement + Potvrdit Položení + Conferma Posizionamento + Lerak + Confirmar implantação + + + Cancel Deployment + Abbrechen + Отменить установку + Anuluj rozłożenie + Cancel Deployment + Annuler Déploiement + Zrušit Položení + Cancella Posizionamento + Visszavonás + Cancelar implantação + + + Deploy Sandbag + Sandsack aufbauen + Установить мешок с песком + Rozłóż worek z piaskiem + Deploy sandbag + Deployer sac de sable + Umístit pytel + Posiziona Sacco di Sabbia + Homokzsák lerakása + Implantar saco de areia + + + Sandbag Box + Sandsack Kiste + Ящик мешков с песком + Skrzynia worków na piasek + Sandbag box + Caisse de sacs de sable + Bedna na pytle s pískem + Contenitore Sacchi di Sabbia + Homokzsákos láda + Caixa de saco de areia + + + Here is no sand + Hier gibt es keinen Sand + Здесь нет песка + Tu nie ma piasku + Here is no sand + Pas de sable ici + Tady není písek + Qui non cè Sabbia + Itt nincs homok + Aqui não tem areia + + + + Modifier, rotates + + Modifikator, drehen + + Modificador, girar + + Modificateur, tourner + + Modificatore, rotazione + + Modifikátor, otočit + + Változtatás, forgatás + + Modyfikator, obrót + + Modificador, rotaciona + + Bращать + + + \ No newline at end of file diff --git a/addons/scopes/CfgEventHandlers.hpp b/addons/scopes/CfgEventHandlers.hpp index b3d70a2861..5c23e0c462 100644 --- a/addons/scopes/CfgEventHandlers.hpp +++ b/addons/scopes/CfgEventHandlers.hpp @@ -10,10 +10,10 @@ class Extended_PostInit_EventHandlers { }; }; -class Extended_Fired_EventHandlers { +class Extended_FiredBIS_EventHandlers { class CAManBase { class ADDON { - fired = QUOTE(_this call FUNC(firedEH);); + firedBIS = QUOTE(_this call FUNC(firedEH);); }; }; }; diff --git a/addons/scopes/CfgVehicles.hpp b/addons/scopes/CfgVehicles.hpp index 7653fe0443..81756249e1 100644 --- a/addons/scopes/CfgVehicles.hpp +++ b/addons/scopes/CfgVehicles.hpp @@ -5,13 +5,13 @@ class CfgVehicles { class ACE_Equipment { class GVAR(adjustZero) { // Updates the zero reference - displayName = "$STR_ACE_Scopes_AdjustZero"; + displayName = CSTRING(AdjustZero); condition = QUOTE([ACE_player] call FUNC(canAdjustZero)); statement = QUOTE([ACE_player] call FUNC(adjustZero)); showDisabled = 0; priority = 0.2; //icon = QUOTE(PATHTOF(UI\...)); // TODO - exceptions[] = {"notOnMap", "isNotInside"}; + exceptions[] = {"notOnMap", "isNotInside", "isNotSitting"}; }; }; }; diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp index 526282a1b6..442d4c39d0 100644 --- a/addons/scopes/CfgWeapons.hpp +++ b/addons/scopes/CfgWeapons.hpp @@ -5,7 +5,8 @@ class CfgWeapons { class optic_LRPS : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 30 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class Snip { @@ -19,7 +20,8 @@ class CfgWeapons { class optic_SOS : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 30 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class Snip { @@ -33,7 +35,8 @@ class CfgWeapons { class optic_DMS : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 20 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class Snip { @@ -47,7 +50,8 @@ class CfgWeapons { class optic_AMS_base : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 30 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class AMS { @@ -61,7 +65,8 @@ class CfgWeapons { class optic_KHS_base : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 30 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class KHS { @@ -75,7 +80,8 @@ class CfgWeapons { class optic_KHS_old : ItemCore { ACE_ScopeAdjust_Vertical[] = { -4, 30 }; ACE_ScopeAdjust_Horizontal[] = { -6, 6 }; - ACE_ScopeAdjust_Increment = 0.1; + ACE_ScopeAdjust_VerticalIncrement = 0.1; + ACE_ScopeAdjust_HorizontalIncrement = 0.1; class ItemInfo : InventoryOpticsItem_Base_F { class OpticsModes { class KHS { diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index d7affc0534..e96ac43960 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -33,7 +33,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize "STR_ACE_Scopes_AdjustUpMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustUpMinor), localize LSTRING(AdjustUpMinor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -46,7 +46,7 @@ if !(hasInterface) exitWith {}; {false}, [201, [false, false, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize "STR_ACE_Scopes_AdjustDownMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustDownMinor), localize LSTRING(AdjustDownMinor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -59,7 +59,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [false, false, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize "STR_ACE_Scopes_AdjustLeftMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMinor), localize LSTRING(AdjustLeftMinor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -72,7 +72,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [false, true, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize "STR_ACE_Scopes_AdjustRightMinor", +["ACE3 Scope Adjustment", QGVAR(AdjustRightMinor), localize LSTRING(AdjustRightMinor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -85,7 +85,7 @@ if !(hasInterface) exitWith {}; {false}, [201, [false, true, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize "STR_ACE_Scopes_AdjustUpMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustUpMajor), localize LSTRING(AdjustUpMajor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -98,7 +98,7 @@ if !(hasInterface) exitWith {}; {false}, [201, [true, false, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize "STR_ACE_Scopes_AdjustDownMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustDownMajor), localize LSTRING(AdjustDownMajor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -111,7 +111,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [true, false, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize "STR_ACE_Scopes_AdjustLeftMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustLeftMajor), localize LSTRING(AdjustLeftMajor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -124,7 +124,7 @@ if !(hasInterface) exitWith {}; {false}, [209, [true, true, false]], true] call cba_fnc_addKeybind; -["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize "STR_ACE_Scopes_AdjustRightMajor", +["ACE3 Scope Adjustment", QGVAR(AdjustRightMajor), localize LSTRING(AdjustRightMajor), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 31b85f309e..ac03046803 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -19,7 +19,7 @@ PARAMS_3(_unit,_turretAndDirection,_majorStep); if (!(_unit isKindOf "Man")) exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; -private ["_weaponIndex", "_zeroing", "_optic", "_increment", "_maxVertical", "_maxHorizontal", "_elevation", "_windage", "_zero", "_adjustment"]; +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}; @@ -34,28 +34,28 @@ if (isNil QGVAR(Optics)) then { }; _optic = GVAR(Optics) select _weaponIndex; -_increment = getNumber (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Increment"); +_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"); -if ((_increment == 0) or (count _maxHorizontal < 2) or (count _maxVertical < 2)) exitWith {false}; +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; -switch (_turretAndDirection) do -{ - case ELEVATION_UP: { _elevation = _elevation + _increment }; - case ELEVATION_DOWN: { _elevation = _elevation - _increment }; - case WINDAGE_LEFT: { _windage = _windage - _increment }; - case WINDAGE_RIGHT: { _windage = _windage + _increment }; +switch (_turretAndDirection) do { + case ELEVATION_UP: { _elevation = _elevation + _verticalIncrement }; + case ELEVATION_DOWN: { _elevation = _elevation - _verticalIncrement }; + case WINDAGE_LEFT: { _windage = _windage - _horizontalIncrement }; + case WINDAGE_RIGHT: { _windage = _windage + _horizontalIncrement }; }; if (_majorStep) then { - switch (_turretAndDirection) do - { + switch (_turretAndDirection) do { case ELEVATION_UP: { _elevation = ceil(_elevation) }; case ELEVATION_DOWN: { _elevation = floor(_elevation) }; case WINDAGE_LEFT: { _windage = floor(_windage) }; diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index 8753019931..020431c27b 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -3,12 +3,13 @@ * Adjusts the flight path of the bullet according to the zeroing * * Argument: - * 0: Unit - * 1: Weapon - * 3: Muzzle - * 4: Magazine - * 5: Ammo - * 6: Projectile + * 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 @@ -17,26 +18,23 @@ */ #include "script_component.hpp" -private ["_unit", "_adjustment", "_weapon", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; - +private ["_unit", "_adjustment", "_projectile", "_weaponIndex", "_zeroing", "_adjustment"]; _unit = _this select 0; +_projectile = _this select 6; -// Exit if the unit doesn't have any adjusment variable -_adjustment = _unit getVariable QGVAR(Adjustment); -if (isNil "_adjustment") exitWith {}; - -// Exit if the unit isn't a player if !([_unit] call EFUNC(common,isPlayer)) exitWith {}; -_weapon = _this select 1; -_projectile = _this select 5; +_adjustment = _unit getVariable [QGVAR(Adjustment), []]; +if (_adjustment isEqualTo []) exitWith {}; _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; _zeroing = _adjustment select _weaponIndex; +if (_zeroing isEqualTo [0,0,0]) exitWith {}; + // Convert zeroing from mils to degrees -_zeroing = [_zeroing, {_this * 0.05625}] call EFUNC(common,map); +_zeroing = _zeroing vectorMultiply 0.05625; [_projectile, (_zeroing select 1), (_zeroing select 0) + (_zeroing select 2), 0] call EFUNC(common,changeProjectileDirection); diff --git a/addons/scopes/functions/fnc_showZeroing.sqf b/addons/scopes/functions/fnc_showZeroing.sqf index a8df650374..7cefc68563 100644 --- a/addons/scopes/functions/fnc_showZeroing.sqf +++ b/addons/scopes/functions/fnc_showZeroing.sqf @@ -40,15 +40,15 @@ _horizontal = _display displayCtrl 13; _vertical ctrlSetText (str (_zeroing select 0)); _horizontal ctrlSetText (str (_zeroing select 1)); -// Set the time when to hide the knobs -GVAR(timeToHide) = diag_tickTime + 3.0; +// Set the ACE_time when to hide the knobs +GVAR(timeToHide) = ACE_diagTime + 3.0; if !(isNil QGVAR(fadePFH)) exitWith {}; // Launch a PFH to wait and fade out the knobs GVAR(fadePFH) = [{ - if (diag_tickTime >= GVAR(timeToHide)) exitWith { + if (ACE_diagTime >= GVAR(timeToHide)) exitWith { private "_layer"; _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; _layer cutFadeOut 2; diff --git a/addons/sitting/$PBOPREFIX$ b/addons/sitting/$PBOPREFIX$ new file mode 100644 index 0000000000..419bf892be --- /dev/null +++ b/addons/sitting/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\sitting \ No newline at end of file diff --git a/addons/sitting/ACE_Settings.hpp b/addons/sitting/ACE_Settings.hpp new file mode 100644 index 0000000000..d4ebb61e83 --- /dev/null +++ b/addons/sitting/ACE_Settings.hpp @@ -0,0 +1,7 @@ +class ACE_Settings { + class GVAR(enable) { + value = 1; + typeName = "BOOL"; + displayName = CSTRING(Enable); + }; +}; diff --git a/addons/sitting/CfgEventHandlers.hpp b/addons/sitting/CfgEventHandlers.hpp new file mode 100644 index 0000000000..1e804e8cc9 --- /dev/null +++ b/addons/sitting/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call DFUNC(handleInterrupt)); + }; + }; +}; diff --git a/addons/sitting/CfgVehicles.hpp b/addons/sitting/CfgVehicles.hpp new file mode 100644 index 0000000000..c915750d02 --- /dev/null +++ b/addons/sitting/CfgVehicles.hpp @@ -0,0 +1,128 @@ +class CfgVehicles { + class ACE_Module; + class ACE_ModuleSitting: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(ModuleDisplayName); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa)); + class Arguments { + class enable { + displayName = CSTRING(Enable); + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = CSTRING(ModuleDescription); + }; + }; + + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class GVAR(Stand) { + displayName = CSTRING(Stand); + condition = QUOTE(_player call FUNC(canStand)); + exceptions[] = {"isNotSitting"}; + statement = QUOTE(_player call FUNC(stand)); + priority = 0; + icon = PATHTOF(UI\stand_ca.paa); + }; + }; + }; + + #define MACRO_SEAT_ACTION \ + class ACE_Actions { \ + class ACE_MainActions { \ + displayName = ECSTRING(interaction,MainAction); \ + selection = ""; \ + distance = 1.25; \ + condition = "true"; \ + class GVAR(Sit) { \ + displayName = CSTRING(Sit); \ + condition = QUOTE(_this call FUNC(canSit)); \ + statement = QUOTE(_this call FUNC(sit)); \ + showDisabled = 0; \ + priority = 0; \ + icon = PATHTOF(UI\sit_ca.paa); \ + }; \ + }; \ + }; + + class ThingX; + // Folding Chair + class Land_CampingChair_V1_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, -0.1, -0.45}; + GVAR(sitRotation) = 10; + }; + // Camping Chair + class Land_CampingChair_V2_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, -0.1, -0.45}; + GVAR(sitRotation) = 45; + }; + // Chair (Plastic) + class Land_ChairPlastic_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 90; + GVAR(sitPosition[]) = {0, 0, -0.5}; + GVAR(sitRotation) = 5; + }; + // Chair (Wooden) + class Land_ChairWood_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, -0.05, 0}; + GVAR(sitRotation) = 75; + }; + // Office Chair + class Land_OfficeChair_01_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, 0, -0.6}; + GVAR(sitRotation) = 15; + }; + // Rattan Chair + class Land_RattanChair_01_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, -0.1, -1}; // Z must be -1 due to chair's geometry (magic floating seat point) + GVAR(sitRotation) = 2; + }; + // Field Toilet + class Land_FieldToilet_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, 0.75, -1.1}; + GVAR(sitRotation) = 10; + }; + // Toiletbox + class Land_ToiletBox_F: ThingX { + XEH_ENABLED; + MACRO_SEAT_ACTION + GVAR(canSit) = 1; + GVAR(sitDirection) = 180; + GVAR(sitPosition[]) = {0, 0.75, -1.1}; + GVAR(sitRotation) = 10; + }; +}; diff --git a/addons/sitting/README.md b/addons/sitting/README.md new file mode 100644 index 0000000000..41db2ce8ee --- /dev/null +++ b/addons/sitting/README.md @@ -0,0 +1,10 @@ +ace_sitting +=============== + +The Sitting module introduces ability to sit on different chairs and toilets. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Jonpas] (https://github.com/jonpas) diff --git a/addons/sitting/UI/Icon_Module_Sitting_ca.paa b/addons/sitting/UI/Icon_Module_Sitting_ca.paa new file mode 100644 index 0000000000..1d4bbccb70 Binary files /dev/null and b/addons/sitting/UI/Icon_Module_Sitting_ca.paa differ diff --git a/addons/sitting/UI/sit_ca.paa b/addons/sitting/UI/sit_ca.paa new file mode 100644 index 0000000000..1191c3b1e0 Binary files /dev/null and b/addons/sitting/UI/sit_ca.paa differ diff --git a/addons/sitting/UI/stand_ca.paa b/addons/sitting/UI/stand_ca.paa new file mode 100644 index 0000000000..08c136f668 Binary files /dev/null and b/addons/sitting/UI/stand_ca.paa differ diff --git a/addons/sitting/XEH_clientInit.sqf b/addons/sitting/XEH_clientInit.sqf new file mode 100644 index 0000000000..e2bf1b23c1 --- /dev/null +++ b/addons/sitting/XEH_clientInit.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +// Exit on Headless +if !(hasInterface) exitWith {}; + +// Add interaction menu exception +["isNotSitting", {!((_this select 0) getVariable [QGVAR(isSitting), false])}] call EFUNC(common,addCanInteractWithCondition); + +// Handle interruptions +["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); +["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); +["SetSurrendered", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler); diff --git a/addons/sitting/XEH_preInit.sqf b/addons/sitting/XEH_preInit.sqf new file mode 100644 index 0000000000..86912ada6b --- /dev/null +++ b/addons/sitting/XEH_preInit.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(canSit); +PREP(canStand); +PREP(getRandomAnimation); +PREP(handleInterrupt); +PREP(moduleInit); +PREP(sit); +PREP(stand); + +ADDON = true; diff --git a/addons/sitting/config.cpp b/addons/sitting/config.cpp new file mode 100644 index 0000000000..f12fa530fa --- /dev/null +++ b/addons/sitting/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Jonpas"}; + authorUrl = "https://github.com/jonpas"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/sitting/functions/fnc_canSit.sqf b/addons/sitting/functions/fnc_canSit.sqf new file mode 100644 index 0000000000..c9762e265c --- /dev/null +++ b/addons/sitting/functions/fnc_canSit.sqf @@ -0,0 +1,22 @@ +/* + * Author: Jonpas + * Check if the player can sit down. + * + * Arguments: + * 0: Seat + * 1: Player + * + * Return Value: + * Can Sit Down + * + * Example: + * [seat, player] call ace_sitting_fnc_canSit; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_seat,_player); + +// Sitting enabled, is seat object and not occupied +(GVAR(enable) && {getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && {isNil{_seat getVariable QGVAR(seatOccupied)}}) diff --git a/addons/sitting/functions/fnc_canStand.sqf b/addons/sitting/functions/fnc_canStand.sqf new file mode 100644 index 0000000000..4549b9891b --- /dev/null +++ b/addons/sitting/functions/fnc_canStand.sqf @@ -0,0 +1,21 @@ +/* + * Author: Jonpas + * Check if the player can stand up (is in sitting position). + * + * Arguments: + * Player + * + * Return Value: + * Can Stand Up + * + * Example: + * player call ace_sitting_fnc_canStand; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_player); + +// Sitting +(_player getVariable [QGVAR(isSitting),false]) diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf new file mode 100644 index 0000000000..c83d230a90 --- /dev/null +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -0,0 +1,49 @@ +/* + * Author: Jonpas + * Gets a random animations from the list. + * + * Arguments: + * None + * + * Return Value: + * Random Animation + * + * Example: + * _animation = call ace_sitting_fnc_getRandomAnimation; + * + * Public: No + */ +#include "script_component.hpp" + +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" +]; + +// Select random animation +(_animations select (floor (random (count _animations)))) diff --git a/addons/sitting/functions/fnc_handleInterrupt.sqf b/addons/sitting/functions/fnc_handleInterrupt.sqf new file mode 100644 index 0000000000..8127e924ef --- /dev/null +++ b/addons/sitting/functions/fnc_handleInterrupt.sqf @@ -0,0 +1,22 @@ +/* + * Author: Jonpas + * Handles interruptions of sitting, like killed or unconsciousness. + * + * Arguments: + * 0: Player + * + * Return Value: + * None + * + * Example: + * [player] call ace_sitting_fnc_handleInterrupt; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_player); + +if (_player getVariable [QGVAR(isSitting), false]) then { + [_player] call FUNC(stand); +}; diff --git a/addons/sitting/functions/fnc_moduleInit.sqf b/addons/sitting/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..25da5be347 --- /dev/null +++ b/addons/sitting/functions/fnc_moduleInit.sqf @@ -0,0 +1,21 @@ +/* + * Author: Jonpas + * Initializes the Sitting module. + * + * Arguments: + * Whatever the module provides. + * + * Return Value: + * None + */ +#include "script_component.hpp" + +if !(isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); + +if !(_activated) exitWith {}; + +[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Sitting Module Initialized."; diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf new file mode 100644 index 0000000000..1944cb2190 --- /dev/null +++ b/addons/sitting/functions/fnc_sit.sqf @@ -0,0 +1,63 @@ +/* + * Author: Jonpas + * Sits down the player. + * + * Arguments: + * 0: Seat + * 1: Player + * + * Return Value: + * None + * + * Example: + * [seat, player] call ace_sitting_fnc_sit; + * + * Public: No + */ +#include "script_component.hpp" + +private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"]; + +PARAMS_2(_seat,_player); + +// Set global variable for standing up +GVAR(seat) = _seat; + +// Overwrite weird position, because Arma decides to set it differently based on current animation/stance... +_player switchMove "amovpknlmstpsraswrfldnon"; + +// Read config +_configFile = configFile >> "CfgVehicles" >> typeOf _seat; +_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection)); +_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); + +// Set direction and position +_player setDir _sitDirection; +_player setPosASL (_seat modelToWorld _sitPosition) call EFUNC(common,positionToASL); + +// Set variables +_player setVariable [QGVAR(isSitting), true]; +_seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple people sitting on one seat + +// Add rotation control PFH +_sitDirectionVisual = getDirVisual _player; // Needed for precision and issues with using above directly +[{ + EXPLODE_3_PVT(_this select 0,_player,_sitDirectionVisual,_sitRotation); + + // Remove PFH if not sitting any more + if !(_player getVariable [QGVAR(isSitting), false]) exitWith { + [_this select 1] call cba_fnc_removePerFrameHandler; + }; + + // Set direction to boundary when passing it + if (getDir _player > _sitDirectionVisual + _sitRotation) exitWith { + _player setDir (_sitDirectionVisual + _sitRotation); + }; + if (getDir _player < _sitDirectionVisual - _sitRotation) exitWith { + _player setDir (_sitDirectionVisual - _sitRotation); + }; +}, 0, [_player, _sitDirectionVisual, _sitRotation]] call cba_fnc_addPerFrameHandler; diff --git a/addons/sitting/functions/fnc_stand.sqf b/addons/sitting/functions/fnc_stand.sqf new file mode 100644 index 0000000000..df1ee6f169 --- /dev/null +++ b/addons/sitting/functions/fnc_stand.sqf @@ -0,0 +1,26 @@ +/* + * Author: Jonpas + * Stands up the player. + * + * Arguments: + * Player + * + * Return Value: + * None + * + * Example: + * player call ace_sitting_fnc_stand; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_player); + +// Restore animation +[_player, "", 2] call EFUNC(common,doAnimation); + +// Set variables to nil +_player setVariable [QGVAR(isSitting), nil]; +GVAR(seat) setVariable [QGVAR(seatOccupied), nil, true]; +GVAR(seat) = nil; diff --git a/addons/sitting/functions/script_component.hpp b/addons/sitting/functions/script_component.hpp new file mode 100644 index 0000000000..1360c56284 --- /dev/null +++ b/addons/sitting/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\sitting\script_component.hpp" \ No newline at end of file diff --git a/addons/sitting/script_component.hpp b/addons/sitting/script_component.hpp new file mode 100644 index 0000000000..cbc8800cd2 --- /dev/null +++ b/addons/sitting/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT sitting +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SITTING + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SITTING + #define DEBUG_SETTINGS DEBUG_SETTINGS_SITTING +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/sitting/stringtable.xml b/addons/sitting/stringtable.xml new file mode 100644 index 0000000000..cbf63d2117 --- /dev/null +++ b/addons/sitting/stringtable.xml @@ -0,0 +1,35 @@ + + + + + Sit Down + Usiądź + Sentar + Sednout si + + + Stand Up + Wstań + Levantar + Vstát + + + Enable Sitting + Habilitar opção para sentar + Aktywuj siadanie + Povolit sezení + + + Sitting + Sentado + Siadanie + Sedící + + + This module allows you to disable the ability to sit on chairs and toilets. + Este módulo permite que você desabilite a capacidade de sentar-se em cadeiras e banheiros. + Moduł ten pozwala na włączenie lub wyłączenie możliwości siadania na krzesłach i toaletach. + Tento modul dovoluje zakázat možnost sedět na židlých a toaletách. + + + \ No newline at end of file diff --git a/addons/spectator/$PBOPREFIX$ b/addons/spectator/$PBOPREFIX$ new file mode 100644 index 0000000000..42fe4034e9 --- /dev/null +++ b/addons/spectator/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\spectator \ No newline at end of file diff --git a/addons/spectator/ACE_Settings.hpp b/addons/spectator/ACE_Settings.hpp new file mode 100644 index 0000000000..88f4ebfad6 --- /dev/null +++ b/addons/spectator/ACE_Settings.hpp @@ -0,0 +1,26 @@ +class ACE_Settings { + class GVAR(enabled) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(limitSide) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(AI) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(tracking) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(modulePos) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(endMission) { + value = 0; + typeName = "BOOL"; + }; +}; \ No newline at end of file diff --git a/addons/spectator/CfgEventHandlers.hpp b/addons/spectator/CfgEventHandlers.hpp new file mode 100644 index 0000000000..e75956f440 --- /dev/null +++ b/addons/spectator/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/spectator/CfgVehicles.hpp b/addons/spectator/CfgVehicles.hpp new file mode 100644 index 0000000000..8faee1dca7 --- /dev/null +++ b/addons/spectator/CfgVehicles.hpp @@ -0,0 +1,53 @@ +class CfgVehicles { + class ACE_Module; + class ACE_ModuleSpectator: ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Module_DisplayName); + function = QFUNC(moduleSpectator); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Spectator_ca.paa); + class Arguments { + class SpectatorEnabled { + displayName = CSTRING(Enabled_DisplayName); + description = CSTRING(Enabled_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class SpectatorPlayerSide { + displayName = CSTRING(PlayerSide_DisplayName); + description = CSTRING(PlayerSide_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class SpectatorAI { + displayName = CSTRING(AI_DisplayName); + description = CSTRING(AI_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class SpectatorTracking { + displayName = CSTRING(Tracking_DisplayName); + description = CSTRING(Tracking_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class SpectatorPos { + displayName = CSTRING(Pos_DisplayName); + description = CSTRING(Pos_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class SpectatorEnd { + displayName = CSTRING(End_DisplayName); + description = CSTRING(End_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; + }; +}; \ No newline at end of file diff --git a/addons/spectator/README.md b/addons/spectator/README.md new file mode 100644 index 0000000000..180f21c57c --- /dev/null +++ b/addons/spectator/README.md @@ -0,0 +1,10 @@ +ace_spectator +======= + +Spectator. Includes features from Splendid Cam, and much more. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [voiper](https://github.com/voiperr) \ No newline at end of file diff --git a/addons/spectator/UI.hpp b/addons/spectator/UI.hpp new file mode 100644 index 0000000000..eec38066f9 --- /dev/null +++ b/addons/spectator/UI.hpp @@ -0,0 +1,640 @@ +#define PIXEL_X (safeZoneWAbs / (getResolution select 0)) +#define PIXEL_Y (safeZoneH / (getResolution select 1)) +#define XHAIR RESUNITS_X * 4 +#define COMPASS_W RESUNITS_X * 20 +#define COMPASS_H COMPASS_W / 15 +#define COMPASS_X RESCENTRE_X - COMPASS_W / 2 +#define HELP_W RESUNITS_X * 75 +#define HELP_H RESUNITS_Y * 75 + +class ace_spectator_overlay { + + idd = 12200; + enableSimulation = 1; + movingEnable = 1; + enableDisplay = 1; + onLoad = "uiNamespace setVariable ['ace_spectator_overlay', _this select 0]; ['Init', _this] call ace_spectator_fnc_overlay"; + + class controls { + + class Unitlist { + + access = 0; + idc = 0; + type = CT_TREE; + style = ST_LEFT; + default = 0; + blinkingPeriod = 0; + + x = QUOTE(safeZoneX); + y = QUOTE(safeZoneY + RESUNITS_X * 4/3); + w = QUOTE(RESUNITS_X * 30); + h = QUOTE(RESUNITS_Y * 50); + + colorBorder[] = {1,1,1,1}; + + colorBackground[] = {0.1,0.1,0.1,1}; + colorSelect[] = {1,0.5,0,1}; + colorMarked[] = {1,0.5,0,0.5}; + colorMarkedSelected[] = {1,0.5,0,1}; + + sizeEx = QUOTE(RESUNITS_Y * 2); + font = GUI_FONT_NORMAL; + shadow = 1; + colorText[] = {1,1,1,1}; + colorSelectText[] = {1,1,1,1}; + colorMarkedText[] = {1,1,1,1}; + + tooltip = ""; + tooltipColorShade[] = {0,0,0,1}; + tooltipColorText[] = {1,1,1,1}; + tooltipColorBox[] = {1,1,1,1}; + + multiselectEnabled = 0; + expandOnDoubleclick = 0; + hiddenTexture = "A3\ui_f\data\gui\rsccommon\rsctree\hiddenTexture_ca.paa"; + expandedTexture = "A3\ui_f\data\gui\rsccommon\rsctree\expandedTexture_ca.paa"; + maxHistoryDelay = 1; + + class ScrollBar { + width = 0; + height = 0; + scrollSpeed = 0.01; + + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + + color[] = {1,1,1,1}; + }; + + colorDisabled[] = {0,0,0,0}; + colorArrow[] = {0,0,0,0}; + + onDestroy = QUOTE(GVAR(mouseBusy) = false; false); + onMouseEnter = QUOTE(GVAR(mouseBusy) = true; false); + onMouseExit = QUOTE(GVAR(mouseBusy) = false; false); + + onTreeDblClick = "['Select', _this] call ace_spectator_fnc_overlay; false"; + }; + }; +}; + +class ace_spectator_vd { + idd = 12201; + enableSimulation = 1; + enableDisplay = 0; + movingEnable = 0; + + onLoad = "uiNamespace setVariable ['ace_spectator_vd', _this select 0]; ['Init', _this] call ace_spectator_fnc_viewDistance"; + + class Controls { + + class BG: vip_rsc_box { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + y = QUOTE(safeZoneY + COMPASS_H); + w = QUOTE(RESUNITS_X * 30); + h = QUOTE(COMPASS_H); + colorBackground[] = {0.1,0.1,0.1,1}; + onDestroy = QUOTE(GVAR(mouseBusy) = false; false); + }; + + class TitleFrame: vip_rsc_frame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + y = QUOTE(safeZoneY + COMPASS_H); + w = QUOTE(RESUNITS_X * 8); + h = QUOTE(COMPASS_H); + shadow = 2; + colorText[]={1,1,1,1}; + }; + + class Title: vip_rsc_text { + style = ST_CENTER; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + y = QUOTE(safeZoneY + COMPASS_H); + w = QUOTE(RESUNITS_X * 8); + h = QUOTE(COMPASS_H); + sizeEx = QUOTE(RESUNITS_Y * 2); + font = GUI_FONT_NORMAL; + shadow = 2; + colorText[]={1,1,1,1}; + text = CSTRING(VD_Title); + }; + + class DistanceFrame: TitleFrame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5); + w = QUOTE(RESUNITS_X * 5); + }; + + class Distance: Title { + idc = 1; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5); + w = QUOTE(RESUNITS_X * 5); + text = ""; + }; + + class ButtonExit: vip_rsc_button { + idc = 0; + style = ST_CENTER; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5); + y = QUOTE(safeZoneY + COMPASS_H); + w = QUOTE(RESUNITS_X * 5); + h = QUOTE(COMPASS_H); + + colorBackground[] = {1,1,1,1}; + sizeEx = QUOTE(RESUNITS_Y * 2); + font = GUI_FONT_NORMAL; + + text = CSTRING(VD_Button); + + onButtonClick = "closeDialog 0; false"; + onMouseButtonDown = QUOTE(GVAR(mouseBusy) = true; false); + onMouseButtonUp = QUOTE(GVAR(mouseBusy) = false; false); + }; + + class Slider { + idc = 2; + + type = CT_XSLIDER; + style = SL_HORZ; + shadow = 2; + + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5); + y = QUOTE(safeZoneY + COMPASS_H); + w = QUOTE(RESUNITS_X * 9.5); + h = QUOTE(COMPASS_H); + color[] = {1,1,1,1}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.2}; + arrowEmpty = "\A3\ui_f\data\gui\cfg\slider\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\slider\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\slider\border_ca.paa"; + thumb = "\A3\ui_f\data\gui\cfg\slider\thumb_ca.paa"; + + text = ""; + onSliderPosChanged = "['Slider', _this] call ace_spectator_fnc_viewDistance"; + onMouseButtonDown = QUOTE(GVAR(mouseBusy) = true; false); + onMouseButtonUp = QUOTE(GVAR(mouseBusy) = false; false); + }; + }; +}; + +class ace_spectator_map { + + idd = 12202; + enableSimulation = 1; + enableDisplay = 0; + onLoad = "uiNameSpace setVariable ['ace_spectator_map', _this select 0]; ['Init', _this select 0] call ace_spectator_fnc_map"; + onUnload = "['Close', _this select 0] call ace_spectator_fnc_map"; + onKeyDown = "['KeyDown', _this] call ace_spectator_fnc_map"; + + class controls { + //changes stolen from ACE_map + class Map { + access = 0; + idc = 1; + type = CT_MAP_MAIN; + style = ST_PICTURE; + default = 0; + blinkingPeriod = 0; + + x = safeZoneXAbs; + y = safeZoneY; + w = safeZoneWAbs; + h = safeZoneH; + + sizeEx = GUI_GRID_CENTER_H; + font = GUI_FONT_NORMAL; + colorText[] = {0,0,0,1}; + text = "#(argb,8,8,3)color(1,1,1,1)"; + + moveOnEdges = 1; + + ptsPerSquareSea = 5; + ptsPerSquareTxt = 20; + ptsPerSquareCLn = 10; + ptsPerSquareExp = 10; + ptsPerSquareCost = 10; + + ptsPerSquareFor = 9; + ptsPerSquareForEdge = 9; + ptsPerSquareRoad = 6; + ptsPerSquareObj = 9; + + scaleMin = 0.001; + scaleMax = 1.0; + scaleDefault = 0.16; + + alphaFadeStartScale = 2; + alphaFadeEndScale = 2; + maxSatelliteAlpha = 0.5; + + colorBackground[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorOutside[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorSea[] = {0.4,0.6,0.8,0.5}; + colorForest[] = {0.6, 0.8, 0.2, 0.25}; + colorForestBorder[] = {0.6,0.8,0.4,1}; + colorRocks[] = {0.50, 0.50, 0.50, 0.50}; + colorRocksBorder[] = {0,0,0,1}; + colorLevels[] = {0.0, 0.0, 0.0, 1.0}; + colorMainCountlines[] = {0.858824, 0, 0,1}; + colorCountlines[] = {0.647059, 0.533333, 0.286275, 1}; + colorMainCountlinesWater[] = {0.5,0.6,0.7,0.6}; + colorCountlinesWater[] = {0.5,0.6,0.7,0.3}; + colorPowerLines[] = {0.1,0.1,0.1,1}; + colorRailWay[] = {0.8,0.2,0,1}; + colorNames[] = {1.1,0.1,1.1,0.9}; + colorInactive[] = {1,1,0,0.5}; + colorTracks[] = {0.2,0.13,0,1}; + colorTracksFill[] = {1,0.88,0.65,0.3}; + colorRoads[] = {0.2,0.13,0,1}; + colorRoadsFill[] = {1,0.88,0.65,1}; + colorMainRoads[] = {0.0,0.0,0.0,1}; + colorMainRoadsFill[] = {0.94,0.69,0.2,1}; + colorGrid[] = {0.05,0.1,0,0.6}; + colorGridMap[] = {0.05,0.1,0,0.4}; + + fontLabel="PuristaMedium"; + sizeExLabel="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontGrid="TahomaB"; + sizeExGrid = 0.032; + fontUnits="TahomaB"; + sizeExUnits="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontNames="EtelkaNarrowMediumPro"; + sizeExNames="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + fontInfo="PuristaMedium"; + sizeExInfo="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontLevel="TahomaB"; + sizeExLevel=0.03; + showCountourInterval = 1; + + class Task { + icon = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1,1,0,1}; + + iconCreated = "#(argb,8,8,3)color(1,1,1,1)"; + colorCreated[] = {0,0,0,1}; + + iconCanceled = "#(argb,8,8,3)color(1,1,1,1)"; + colorCanceled[] = {0,0,0,0.5}; + + iconDone = "#(argb,8,8,3)color(1,1,1,1)"; + colorDone[] = {0,1,0,1}; + + iconFailed = "#(argb,8,8,3)color(1,1,1,1)"; + colorFailed[] = {1,0,0,1}; + + size = 8; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class ActiveMarker { //includes icons spawned by drawIcon + color[] = {0,0,0,1}; + size = 2; + coefMin = 1; //make sure icon doesnt scale + }; + class Waypoint { + coefMax = 1; + coefMin = 4; + color[] = {0,0,0,1}; + icon = "#(argb,8,8,3)color(0,0,0,1)"; + importance = 1; + size = 2; + }; + class WaypointCompleted: Waypoint{}; + class CustomMark: Waypoint{}; + class Command: Waypoint{}; + class Bush { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 14; + importance = "0.2 * 14 * 0.05"; + coefMin = 0.250000; + coefMax = 4; + }; + class Rock: Waypoint{color[]={0.45,0.64,0.33,0.4}; importance="0.5 * 12 * 0.05";}; + class SmallTree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.6 * 12 * 0.05"; + coefMin = 0.250000; + coefMax = 4; + }; + class Tree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.9 * 16 * 0.05"; + coefMin = 0.250000; + coefMax = 4; + }; + class Legend { + x = SafeZoneX+SafeZoneW-.340; + y = SafeZoneY+SafeZoneH-.152; + font = "PuristaMedium"; + w = .340; + h = .152; + sizeEx = 0.039210; + colorBackground[] = {0.906000, 0.901000, 0.880000, 0.5}; + color[] = {0, 0, 0, 0.75}; + }; + class BusStop: Waypoint{}; + class FuelStation: Waypoint{}; + class Hospital: Waypoint{}; + class Church: Waypoint{}; + class Lighthouse: Waypoint{}; + class Power: Waypoint{}; + class PowerSolar: Waypoint{}; + class PowerWave: Waypoint{}; + class PowerWind: Waypoint{}; + class Quay: Waypoint{}; + class Transmitter: Waypoint{}; + class Watertower: Waypoint{}; + class Cross: Waypoint{}; + class Chapel: Waypoint{}; + class Shipwreck: Waypoint{}; + class Bunker: Waypoint{}; + class Fortress: Waypoint{}; + class Fountain: Waypoint{}; + class Ruin: Waypoint{}; + class Stack: Waypoint{}; + class Tourism: Waypoint{}; + class ViewTower: Waypoint{}; + }; + }; +}; + +class RscTitles { + class ace_spectator_crosshair { + + onLoad = "uiNamespace setVariable ['ace_spectator_crosshair', _this select 0]"; + + idd=-1; + movingEnable=0; + fadein=0; + fadeout=0; + duration=1e+011; + + class controls { + + class X: vip_rsc_picture { + idc = 0; + x = QUOTE(RESCENTRE_X - XHAIR / 2); + y = QUOTE(RESCENTRE_Y - XHAIR * 4/3 / 2); + w = QUOTE(XHAIR); + h = QUOTE(XHAIR * 4/3); + text = "\a3\ui_f\data\IGUI\Cfg\Cursors\select_target_ca.paa"; + colorText[] = {1,1,1,0.8}; + }; + }; + }; + + class ace_spectator_status { + + onLoad = "uiNamespace setVariable ['ace_spectator_status', _this select 0]; [_this select 0] call ace_spectator_fnc_status"; + idd = -1; + movingEnable=0; + fadein=0; + fadeout=0; + duration=1e+011; + + class controls { + + class BGRight: vip_rsc_box { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + y = QUOTE(safeZoneY); + w = QUOTE(RESUNITS_X * 30); + h = QUOTE(COMPASS_H); + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + class BGLeft: BGRight { + x = QUOTE(safeZoneX); + }; + + class SpeedFrame: vip_rsc_frame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5); + y = QUOTE(safeZoneY); + w = QUOTE(RESUNITS_X * 5); + h = QUOTE(COMPASS_H); + shadow = 2; + colorText[]={1,1,1,1}; + }; + + class Speed: vip_rsc_text { + idc = 0; + style = ST_CENTER; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 5); + y = QUOTE(safeZoneY); + w = QUOTE(RESUNITS_X * 5); + h = QUOTE(COMPASS_H); + colorText[]={1,1,1,1}; + sizeEx = QUOTE(RESUNITS_Y * 2); + font = GUI_FONT_NORMAL; + text = ""; + }; + + class FovFrame: SpeedFrame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5); + }; + + class Fov: Speed { + idc = 4; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 10.5); + }; + + class TimeAccFrame: SpeedFrame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5); + }; + + class TimeAcc: Speed { + idc = 5; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 21.5); + }; + + class FocusFrame: SpeedFrame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 16); + }; + + class Focus: Speed { + idc = 6; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 16); + }; + + class NameFrame: SpeedFrame { + x = QUOTE(safeZoneX); + w = QUOTE(RESUNITS_X * 24.5); + }; + + class Name: Speed { + idc = 1; + x = QUOTE(safeZoneX); + w = QUOTE(RESUNITS_X * 24.5); + }; + + class ModeFrame: SpeedFrame { + x = QUOTE(safeZoneX + RESUNITS_X * 25); + }; + + class Mode: Speed { + idc = 2; + x = QUOTE(safeZoneX + RESUNITS_X * 25); + }; + + class TimeFrame: SpeedFrame { + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + w = QUOTE(RESUNITS_X * 8); + }; + + class Time: Speed { + idc = 3; + x = QUOTE(safeZoneX + safeZoneW - RESUNITS_X * 30); + w = QUOTE(RESUNITS_X * 8); + }; + }; + }; + + class ace_spectator_compass { + + onLoad = "uiNamespace setVariable ['ace_spectator_compass', _this select 0]"; + onUnload = ""; + idd=-1; + movingEnable=0; + fadein=0; + fadeout=0; + duration=1e+011; + + class controls { + + class BG: vip_rsc_box { + x = QUOTE(COMPASS_X); + y = QUOTE(safeZoneY); + w = QUOTE(COMPASS_W); + h = QUOTE(COMPASS_H); + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + class 0_90: vip_rsc_picture { + idc = 1; + x = QUOTE(RESCENTRE_X); + y = QUOTE(safeZoneY); + w = QUOTE(COMPASS_W / 2); + h = QUOTE(COMPASS_H); + text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture180_ca.paa"; + }; + + class 90_180: 0_90 { + idc = 2; + x = QUOTE(RESCENTRE_X + COMPASS_W / 2); + text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture270_ca.paa"; + }; + + class 180_270: 0_90 { + idc = 3; + x = QUOTE(RESCENTRE_X + COMPASS_W); + text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture0_ca.paa"; + }; + + class 270_0: 0_90 { + idc = 4; + x = QUOTE(RESCENTRE_X + COMPASS_W * 1.5); + text = "A3\ui_f_curator\data\cfgIngameUI\compass\texture90_ca.paa"; + }; + + class Post: vip_rsc_box { + x = QUOTE(COMPASS_X + COMPASS_W / 2); + y = QUOTE(safeZoneY); + w = QUOTE(PIXEL_X * 2); + h = QUOTE(COMPASS_H); + colorBackground[]={1,0,0,1}; + }; + + class LeftBlocker: vip_rsc_box { + x = QUOTE(COMPASS_X - COMPASS_W / 2); + y = QUOTE(safeZoneY); + w = QUOTE(COMPASS_W / 2); + h = QUOTE(COMPASS_H); + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + class RightBlocker: LeftBlocker { + x = QUOTE(COMPASS_X + COMPASS_W); + }; + + class Frame: vip_rsc_frame { + x = QUOTE(COMPASS_X); + y = QUOTE(safeZoneY); + w = QUOTE(COMPASS_W); + h = QUOTE(COMPASS_H); + shadow=2; + colorText[]={1,1,1,1}; + }; + }; + }; + + class ace_spectator_help { + + onLoad = "uiNamespace setVariable ['ace_spectator_help', _this select 0]; ['Help', _this select 0] call ace_spectator_fnc_camera"; + idd = -1; + movingEnable=0; + fadein=0; + fadeout=0; + duration=1e+011; + + class controls { + + class BG: vip_rsc_box { + idc = -1; + x = QUOTE(RESCENTRE_X - HELP_W / 2); + y = QUOTE(RESCENTRE_Y - HELP_H / 2); + w = QUOTE(HELP_W); + h = QUOTE(HELP_H); + colorBackground[] = {0.1,0.1,0.1,1}; + }; + + class Title: vip_rsc_text { + idc = 0; + style = ST_CENTER; + x = QUOTE(RESCENTRE_X - RESUNITS_X * 25); + y = QUOTE(RESCENTRE_Y - (HELP_H / 2) + RESUNITS_Y * 3); + w = QUOTE(RESUNITS_X * 50); + h = QUOTE(RESUNITS_Y * 4); + colorText[]={1,1,1,1}; + sizeEx = QUOTE(RESUNITS_Y * 4); + font = GUI_FONT_NORMAL; + text = "ACE Spectator Controls"; + }; + + class LeftColumn1 { + idc = 1; + type = CT_STRUCTURED_TEXT; + style = ST_LEFT; + x = QUOTE(RESCENTRE_X - HELP_W / 2 + RESUNITS_X * 3); + y = QUOTE(RESCENTRE_Y - (HELP_H / 2) + RESUNITS_Y * 10); + w = QUOTE(RESUNITS_X * 16.75); + h = QUOTE(RESUNITS_Y * 63); + text = ""; + size = QUOTE(RESUNITS_Y * 2.5); + colorBackground[] = {0,0,0,0}; + }; + + class LeftColumn2: LeftColumn1 { + idc = 2; + x = QUOTE(RESCENTRE_X - HELP_W / 2 + RESUNITS_X * 19.75); + }; + + class RightColumn1: LeftColumn1 { + idc = 3; + x = QUOTE(RESCENTRE_X + HELP_W / 2 - RESUNITS_X * 3 - RESUNITS_X * 29.5); + }; + + class RightColumn2: LeftColumn1 { + idc = 4; + x = QUOTE(RESCENTRE_X + HELP_W / 2 - RESUNITS_X * 3 - RESUNITS_X * 11.75); + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/spectator/UI/Icon_Module_Spectator_ca.paa b/addons/spectator/UI/Icon_Module_Spectator_ca.paa new file mode 100644 index 0000000000..a4d784cea6 Binary files /dev/null and b/addons/spectator/UI/Icon_Module_Spectator_ca.paa differ diff --git a/addons/spectator/XEH_postInit.sqf b/addons/spectator/XEH_postInit.sqf new file mode 100644 index 0000000000..b57d08ac7b --- /dev/null +++ b/addons/spectator/XEH_postInit.sqf @@ -0,0 +1,96 @@ +/* + Author: + voiper +*/ + +#include "script_component.hpp" + +["SettingsInitialized", { + if !GVAR(enabled) exitWith {}; + + //check if respawn is set up properly + _fail = if (getNumber (missionConfigFile >> "respawn") != 3 && getText (missionConfigFile >> "respawn") != "Base") then {true} else {false}; + if (_fail) exitWith { + _text = "[ACE_Spectator] ERROR: This mission does not have respawn set up properly. Add 'respawn=3' or 'respawn=""BASE""' to description.ext."; + systemChat _text; + diag_log text _text; + }; + + if GVAR(endMission) then { + [{ + if (player distance GVAR(penPos) < 200) then { + if ({isPlayer _x && alive _x && (_x distance GVAR(penPos)) > 200} count allUnits == 0) then { + [["endDeath", false], "BIS_fnc_endMission"] call BIS_fnc_MP; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }; + }, 2] call CBA_fnc_addPerFrameHandler; + }; + + if (isDedicated) exitWith {}; + + call FUNC(penPos); + + { + if (getMarkerPos _x isEqualTo [0,0,0]) then { + _marker = createMarkerLocal [_x, [0,0]]; + _marker setMarkerShapeLocal "ICON"; + }; + + _x setMarkerPosLocal GVAR(penPos); + } forEach ["respawn_west", "respawn_east", "respawn_guerrila", "respawn_civilian"]; + + GVAR(playerSide) = side (group player); + + if GVAR(tracking) then { + [FUNC(checkUnits), 2] call CBA_fnc_addPerFrameHandler; + [FUNC(trackUnits), 20] call CBA_fnc_addPerFrameHandler; + }; + + player addEventHandler ["Killed", { + [player] joinSilent grpNull; + if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = true}; + _delay = getNumber (missionConfigFile >> "respawnDelay"); + _delay fadeSound 0; + 999999 cutText ["", "BLACK", _delay]; + }]; + + player addEventHandler ["Respawn", { + if (!isNil QGVAR(cam)) then {["Exit"] call FUNC(camera)}; + if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then {EGVAR(hearing,disableVolumeUpdate) = true}; + if (isClass (configFile >> "CfgPatches" >> "acre_sys_radio")) then {[true] call acre_api_fnc_setSpectator}; + if (isClass (configFile >> "CfgPatches" >> "task_force_radio")) then {[player, true] call TFAR_fnc_forceSpectator}; + + if !GVAR(modulePos) then { + _corpse = _this select 1; + if (!isNil "_corpse") then { + if (!isNull _corpse) then { + GVAR(startingPos) = getPosATL _corpse; + }; + }; + }; + + player addEventHandler ["HandleDamage", {0}]; + [player] joinSilent grpNull; + removeAllWeapons player; + removeAllItems player; + removeAllAssignedItems player; + removeUniform player; + removeVest player; + player linkItem "ItemMap"; + player linkItem "ItemRadio"; + hideObjectGlobal player; + + if (surfaceisWater GVAR(penPos)) then { + player forceAddUniform "U_B_Wetsuit"; + player addVest "V_RebreatherB"; + }; + + player setPosATL GVAR(penPos); + + 0 fadeSound 0; + 999999 cutText ["", "BLACK FADED", 0]; + ["Init", [true]] call FUNC(camera); + }]; + +}] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/spectator/XEH_preInit.sqf b/addons/spectator/XEH_preInit.sqf new file mode 100644 index 0000000000..41b24e8fcc --- /dev/null +++ b/addons/spectator/XEH_preInit.sqf @@ -0,0 +1,31 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(camera); +PREP(cameraIntro); +PREP(canSpectateUnit); +PREP(checkUnits); +PREP(compass); +PREP(crosshair); +PREP(draw3D); +PREP(drawMines2D); +PREP(drawMines3D); +PREP(drawTracks2D); +PREP(drawUnits2D); +PREP(drawUnits3D); +PREP(killed); +PREP(map); +PREP(moduleSpectator); +PREP(overlay); +PREP(penPos); +PREP(respawn); +PREP(sideColour); +PREP(status); +PREP(trackUnits); +PREP(unitInfo); +PREP(unitSide); +PREP(unitVar); +PREP(viewDistance); + +ADDON = true; \ No newline at end of file diff --git a/addons/spectator/config.cpp b/addons/spectator/config.cpp new file mode 100644 index 0000000000..89b0b814b5 --- /dev/null +++ b/addons/spectator/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"voiper"}; + authorUrl = "https://github.com/voiperr/"; + VERSION_CONFIG; + }; +}; + +#include "ACE_Settings.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "rsc_defines.hpp" +#include "UI.hpp" \ No newline at end of file diff --git a/addons/spectator/functions/fnc_camera.sqf b/addons/spectator/functions/fnc_camera.sqf new file mode 100644 index 0000000000..bc4cea88cc --- /dev/null +++ b/addons/spectator/functions/fnc_camera.sqf @@ -0,0 +1,1081 @@ +/* + Author: + voiper, derived in part from BIS_fnc_camera by Karel Moricky + + Description: + Spectator camera and UI. + + Arguments: + 0: Mode: "Init" is the only mission relevant one + 1: (optional): + 0: Whether player can escape from camera (false for MP spectator; true for SP photography) + + Example: + ["Init", [false]] call ace_spectator_fnc_camera; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" +#include "\a3\editor_f\Data\Scripts\dikCodes.h" + +disableSerialization; +_mode = _this select 0; +_this = _this select 1; + +switch _mode do { + + case "Init": { + + GVAR(noEscape) = if (count _this > 0) then {_this select 0} else {false}; + + call FUNC(penPos); + + _camPos = if (!isNil QGVAR(startingPos)) then { + GVAR(startingPos) + } else { + getPos cameraOn + }; + + _camDir = if (!isNil QGVAR(startingDir)) then { + GVAR(startingDir) + } else { + 0 + }; + + _camPos set [2, (_camPos select 2) + 2]; + _cam = "camera" camCreate _camPos; + _cam setDir _camDir; + _cam cameraEffect ["internal", "back"]; + _cam camSetFocus [-1, -1]; + _cam camCommit 0; + showCinemaBorder false; + cameraEffectEnableHUD true; + setViewDistance 3000; + + //variables + GVAR(cam) = _cam; + GVAR(LMB) = false; + GVAR(RMB) = false; + GVAR(vector) = [_camDir, 0, 0]; + GVAR(fov) = 0.7; + GVAR(vision) = 0; + GVAR(moveScale) = 0.1; + GVAR(cameraOn) = true; + GVAR(focus) = [-1, -1]; + GVAR(lock) = [-1]; + GVAR(attach) = objNull; + GVAR(unit) = objNull; + GVAR(mouseBusy) = false; + GVAR(markers) = 3; + GVAR(accTime) = 1; + GVAR(third) = false; + + //define only if doesn't exist (to preserve saved spots from a previous camera) + if (isNil QGVAR(savedSpots)) then { + GVAR(savedSpots) = []; + for "_i" from 0 to 11 do {GVAR(savedSpots) set [_i, []]}; + }; + + if (isNil QGVAR(savedUnits)) then { + GVAR(savedUnits) = []; + for "_i" from 0 to 9 do {GVAR(savedUnits) set [_i, objNull]}; + }; + + GVAR(keys) = []; + _DIKcodes = true call BIS_fnc_keyCode; + _DIKlast = _DIKcodes select (count _DIKcodes - 1); + for "_i" from 0 to (_DIKlast - 1) do { + GVAR(keys) set [_i, false]; + }; + + _display = findDisplay 46; + + GVAR(ehDraw3D) = addMissionEventhandler ["Draw3D", {['Draw3D', _this] call FUNC(draw3D)}]; + addMissionEventHandler ["Ended", {if (!isNil QGVAR(cam)) then {["Exit"] call FUNC(camera)}}]; + GVAR(ehKeyDown) = _display displayAddEventHandler ["keyDown", {['KeyDown', _this] call FUNC(camera)}]; + GVAR(ehKeyUp) = _display displayAddEventHandler ["keyUp", {['KeyUp', _this] call FUNC(camera)}]; + GVAR(ehMouseButtonDown) = _display displayAddEventHandler ["mouseButtonDown", {['MouseButtonDown', _this] call FUNC(camera)}]; + GVAR(ehMouseButtonUp) = _display displayAddEventHandler ["mouseButtonUp", {['MouseButtonUp',_this] call FUNC(camera)}]; + GVAR(ehMouseZChanged) = _display displayAddEventHandler ["mouseZChanged", {['MouseZChanged',_this] call FUNC(camera)}]; + GVAR(ehMouseMoving) = _display displayAddEventHandler ["mouseMoving", {['Mouse',_this] call FUNC(camera)}]; + GVAR(ehMouseHolding) =_display displayAddEventHandler ["mouseHolding", {['Mouse',_this] call FUNC(camera)}]; + + //remove mission layer + _displayMission = call (uiNamespace getVariable "BIS_fnc_displayMission"); + _control = _displayMission displayCtrl 11400; + _control ctrlSetFade 1; + _control ctrlCommit 0; + + //kill layers + cutText ["", "Plain"]; + _layers = missionNamespace getVariable ["BIS_fnc_rscLayer_list", []]; + for "_i" from 1 to (count _layers - 1) step 2 do { + (_layers select _i) cutText ["", "Plain"]; + }; + + clearRadio; + + //crosshair + _layer = [QGVAR(crosshair)] call BIS_fnc_rscLayer; + _layer cutRsc [QGVAR(crosshair), "PLAIN", 2, true]; + + //compass + _layer = [QGVAR(compass)] call BIS_fnc_rscLayer; + _layer cutRsc [QGVAR(compass), "PLAIN", 2, true]; + + //status + _layer = [QGVAR(status)] call BIS_fnc_rscLayer; + _layer cutRsc [QGVAR(status), "PLAIN", 2, true]; + + //help + _layer = [QGVAR(help)] call BIS_fnc_rscLayer; + preloadTitleRsc [QGVAR(help), "PLAIN", 0, true]; + + if (isClass (configFile >> "CfgPatches" >> "ace_nametags")) then { + GVAR(tags) = [EGVAR(nametags,showPlayerNames), EGVAR(nametags,showNamesForAI)]; + EGVAR(nametags,showPlayerNames) = 0; + EGVAR(nametags,showNamesForAI) = false; + }; + + if (isClass (configFile >> "CfgPatches" >> "ace_interact_menu")) then { + [QGVAR(interactCondition), {false}] call EFUNC(common,addCanInteractWithCondition); + }; + + //add unit check, since if tracking were on it would already be present + if !GVAR(tracking) then { + [FUNC(checkUnits), 2] call CBA_fnc_addPerFrameHandler + }; + + [FUNC(cameraIntro), 1] call CBA_fnc_addPerFrameHandler; + }; + + ////////////////////////////////////////// + case "Mouse": { + _mapOn = uiNamespace getVariable QGVAR(map); + if (!isNull _mapOn) exitWith {}; + + _keys = GVAR(keys); + _cam = GVAR(cam); + _dir = GVAR(vector) select 0; + _pitch = GVAR(vector) select 1; + _bank = GVAR(vector) select 2; + _camPos = getPosASL _cam; + _coef = (GVAR(moveScale) * (((getPosATL _cam) select 2) / 2)) min 50 max 0.001; + + _move = { + _inPos = _this; + if !GVAR(cameraOn) exitWith {}; + if (_inPos select 2 > 20000) then {_inPos set [2, 20000]}; + _obj = GVAR(attach); + if !(isNull _obj) then { + if ((GVAR(lock) select 0) < 0) then { + _modelPos = _obj worldToModel (ASLtoATL _inPos); + _cam attachTo [_obj, _modelPos]; + }; + } else { + _cam setPosASL _inPos; + }; + }; + + if (GVAR(LMB) || GVAR(RMB)) then { + if GVAR(mouseBusy) exitWith {}; + _mX = (_this select 1) * (GVAR(accTime) max 0.05); + _mY = (_this select 2) * (GVAR(accTime) max 0.05); + + if GVAR(RMB) then { + + _dX = _mX; + _dY = -_mY; + + _camPos = [_camPos, _dY, getDir _cam] call BIS_fnc_relPos; + _camPos = [_camPos, _dX, getDir _cam + 90] call BIS_fnc_relPos; + + _camPos call _move; + + } else { + if (GVAR(lock) select 0 > -1) exitWith {}; + _dX = _mX / 50 * 180 * GVAR(fov); + _dY = -_mY / 50 * 180 * GVAR(fov); + + if (_keys select DIK_LSHIFT) then { + _pitch = (_pitch + _dY) max -180 min 180; + _bank = (_bank + _dX) max -181 min 181; + if (_bank <= -181) then {_bank = 180} else {if (_bank >= 181) then {_bank = -180}}; + } else { + _dir = _dir + _dX; + _pitch = (_pitch + _dY) max -90 min 90; + }; + GVAR(vector) = [_dir, _pitch, _bank]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + }; + + _camMove = { + _dX = _this select 0; + _dY = _this select 1; + _dZ = _this select 2; + _pos = getPosASL _cam; + _moveDir = (getDir _cam) + _dX * 90; + _camPos = [ + (_pos select 0) + ((sin (_moveDir)) * _coef * _dY), + (_pos select 1) + ((cos (_moveDir)) * _coef * _dY), + (_pos select 2) + _dZ * _coef / 1.5 + ]; + //for some reason, at visual height = 0, cameras report 10cm higher than they actually are + _camPos set [2, (_camPos select 2) max (getTerrainHeightASL _camPos + 0.1)]; + + _camPos call _move; + }; + + _camRotate = { + if ((GVAR(lock) select 0) > -1) exitWith {}; + _dX = (_this select 0) * GVAR(fov) * _rotMod; + _dY = (_this select 1) * GVAR(fov) * _rotMod; + _pitch = ((GVAR(vector) select 1) + _dY) max -90 min 90; + _bank = GVAR(vector) select 2; + _dir = _dir + _dX; + GVAR(vector) = [_dir, _pitch, _bank]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + + _camBank = { + if ((GVAR(lock) select 0) > -1) exitWith {}; + _dZ = (_this select 0) * _rotMod; + _pitch = GVAR(vector) select 1; + _bank = ((GVAR(vector) select 2) + _dZ) max -181 min 181; + if (_bank == -181) then {_bank = 180} else {if (_bank == 181) then {_bank = -180}}; + GVAR(vector) = [_dir, _pitch, _bank]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + + _numPad0 = _keys select DIK_NUMPAD0; + _numPadDel = _keys select DIK_DECIMAL; + _rotMod = if (_numPad0 && !_numPadDel) then { + 5 + } else { + if (!_numPad0 && _numPadDel) then {0.1} else {1}; + }; + + if (_keys select DIK_W) then {[0,1,0] call _camMove}; + if (_keys select DIK_S) then {[0,-1,0] call _camMove}; + if (_keys select DIK_A) then {[-1,1,0] call _camMove}; + if (_keys select DIK_D) then {[1,1,0] call _camMove}; + + if (_keys select DIK_Q) then {[0,0,1] call _camMove}; + if (_keys select DIK_Z) then {[0,0,-1] call _camMove}; + + if (_keys select DIK_NUMPAD1) then {[-1,-1,0] call _camRotate}; + if (_keys select DIK_NUMPAD2) then {[+0,-1,0] call _camRotate}; + if (_keys select DIK_NUMPAD3) then {[+1,-1,0] call _camRotate}; + if (_keys select DIK_NUMPAD4) then {[-1,+0,0] call _camRotate}; + if (_keys select DIK_NUMPAD6) then {[+1,+0,0] call _camRotate}; + if (_keys select DIK_NUMPAD7) then {[-1,+1,0] call _camRotate}; + if (_keys select DIK_NUMPAD8) then {[+0,+1,0] call _camRotate}; + if (_keys select DIK_NUMPAD9) then {[+1,+1,0] call _camRotate}; + if (_keys select DIK_DIVIDE) then {[-1] call _camBank}; + if (_keys select DIK_MULTIPLY) then {[+1] call _camBank}; + + if (_keys select DIK_ADD) then { + GVAR(fov) = GVAR(fov) - (GVAR(fov) / 50 * _rotMod) max 0.01; + _cam camPrepareFOV GVAR(fov); + _cam camCommitPrepared 0; + }; + if (_keys select DIK_SUBTRACT) then { + GVAR(fov) = GVAR(fov) + (GVAR(fov) / 50 * _rotMod) min 2; + _cam camPrepareFOV GVAR(fov); + _cam camCommitPrepared 0; + }; + + if (_keys select DIK_NUMPADENTER) then { + GVAR(fov) = 0.7; + _cam camPrepareFOV GVAR(fov); + _cam camCommitPrepared 0; + }; + + if (_keys select DIK_MINUS) then { + _cur = GVAR(focus) select 0; + if (_cur < 0) then {_cur = 1}; + _cur = _cur - (_cur / 25) max 0.25; + GVAR(focus) = [_cur, 1.5]; + _cam camSetFocus GVAR(focus); + _cam camCommit 0; + }; + + if (_keys select DIK_EQUALS) then { + _cur = GVAR(focus) select 0; + if (_cur < 0) then {_cur = 1}; + _cur = _cur + (_cur / 25) min 5000; + GVAR(focus) = [_cur, 1.5]; + _cam camSetFocus GVAR(focus); + _cam camCommit 0; + }; + + if (_keys select DIK_LBRACKET)then { + if (!isMultiplayer) then { + _cur = GVAR(accTime); + _cur = _cur - (_cur / 25) max 0; + GVAR(accTime) = _cur; + setAccTime GVAR(accTime); + }; + }; + + if (_keys select DIK_RBRACKET)then { + if (!isMultiplayer) then { + _cur = GVAR(accTime); + _cur = _cur + (_cur / 25) min 4; + GVAR(accTime) = _cur; + setAccTime GVAR(accTime); + }; + }; + }; + + ////////////////////////////////////////// + case "MouseButtonDown": { + _mapOn = uiNamespace getVariable QGVAR(map); + if (!isNull _mapOn) exitWith {}; + + _button = _this select 1; + _mX = _this select 2; + _mY = _this select 3; + _shift = _this select 4; + _ctrl = _this select 5; + _alt = _this select 6; + + switch (_button) do { + case 0: {GVAR(LMB) = true}; + case 1: {GVAR(RMB) = true}; + }; + }; + + ////////////////////////////////////////// + case "MouseButtonUp": { + _mapOn = uiNamespace getVariable QGVAR(map); + if (!isNull _mapOn) exitWith {}; + + _button = _this select 1; + switch (_button) do { + case 0: {GVAR(LMB) = false}; + case 1: {GVAR(RMB) = false}; + }; + }; + + ////////////////////////////////////////// + case "MouseZChanged": { + _mapOn = uiNamespace getVariable QGVAR(map); + if (!isNull _mapOn) exitWith {}; + + _diff = _this select 1; + if (_diff > 0) then { + GVAR(moveScale) = GVAR(moveScale) + (GVAR(moveScale) / 10) min 1; + } else { + GVAR(moveScale) = GVAR(moveScale) - (GVAR(moveScale) / 10) max 0.001; + }; + }; + + ////////////////////////////////////////// + case "KeyDown": { + _key = _this select 1; + _shift = _this select 2; + _ctrl = _this select 3; + _alt = _this select 4; + _return = false; + + GVAR(keys) set [_key, true]; + + _cam = GVAR(cam); + _camOn = GVAR(cameraOn); + _unit = GVAR(unit); + _lock = GVAR(lock) select 0; + + _camPos = [getPos _cam, GVAR(vector), GVAR(fov), GVAR(focus)]; + + _camSaveSpot = { + _num = _this select 0; + if (!isNull GVAR(attach)) then { + _vector = _camPos select 1; + _dir = _vector select 0; + _vector set [0, _dir - (getDir GVAR(attach))]; + _camPos set [1, _vector]; + }; + GVAR(savedSpots) set [_num, _camPos]; + }; + + _camLoadSpot = { + _num = _this select 0; + _arr = GVAR(savedSpots) select _num; + if (count (_arr) > 0) then { + if (!_camOn) then { + ["Camera", ["Free"]] call FUNC(camera) + }; + call _detach; + _cam setPos (_arr select 0); + _vector = _arr select 1; + [_cam, _vector] call BIS_fnc_setObjectRotation; + _cam camPrepareFOV (_arr select 2); + _cam camPrepareFocus (_arr select 3); + _cam camCommitPrepared 0; + GVAR(vector) = _vector; + }; + }; + + _camSaveUnit = { + _num = _this select 0; + + if (!isNull _unit) then { + _alreadySaved = GVAR(savedUnits) find _unit; + if (_alreadySaved > -1) then { + GVAR(savedUnits) set [_alreadySaved, objNull]; + }; + GVAR(savedUnits) set [_num, _unit] + }; + }; + + _camLoadUnit = { + _num = _this select 0; + _unit = GVAR(savedUnits) select _num; + if (!isNull _unit) then { + if (_lock > -1) then { + ["Camera", ["Lock"]] call FUNC(camera) + }; + if (GVAR(unit) == _unit) then { + call _detach; + if (_camOn) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + ["Camera", ["SwitchUnit"]] call FUNC(camera); + }; + } else { + GVAR(unit) = _unit; + if ((GVAR(lock) select 0) > -1) then {["Camera", ["Lock"]] call FUNC(camera)}; + if (!_camOn) then { + call _detach; + ["Camera", ["SwitchUnit"]] call FUNC(camera); + }; + }; + }; + }; + + _detach = { + if (!isNull GVAR(attach)) then { + ["Camera", ["Attach"]] call FUNC(camera); + }; + }; + + switch (_key) do { + + case (DIK_F1): {if (_ctrl) then {[0] call _camSaveSpot} else {[0] call _camLoadSpot}; _return = true}; + case (DIK_F2): {if (_ctrl) then {[1] call _camSaveSpot} else {[1] call _camLoadSpot}; _return = true}; + case (DIK_F3): {if (_ctrl) then {[2] call _camSaveSpot} else {[2] call _camLoadSpot}; _return = true}; + case (DIK_F4): {if (_ctrl) then {[3] call _camSaveSpot} else {[3] call _camLoadSpot}; _return = true}; + case (DIK_F5): {if (_ctrl) then {[4] call _camSaveSpot} else {[4] call _camLoadSpot}; _return = true}; + case (DIK_F6): {if (_ctrl) then {[5] call _camSaveSpot} else {[5] call _camLoadSpot}; _return = true}; + case (DIK_F7): {if (_ctrl) then {[6] call _camSaveSpot} else {[6] call _camLoadSpot}; _return = true}; + case (DIK_F8): {if (_ctrl) then {[7] call _camSaveSpot} else {[7] call _camLoadSpot}; _return = true}; + case (DIK_F9): {if (_ctrl) then {[8] call _camSaveSpot} else {[8] call _camLoadSpot}; _return = true}; + case (DIK_F10): {if (_ctrl) then {[9] call _camSaveSpot} else {[9] call _camLoadSpot}; _return = true}; + case (DIK_F11): {if (_ctrl) then {[10] call _camSaveSpot} else {[10] call _camLoadSpot}; _return = true}; + case (DIK_F12): {if (_ctrl) then {[11] call _camSaveSpot} else {[11] call _camLoadSpot}; _return = true}; + + case (DIK_1): {if (_ctrl) then {[0] call _camSaveUnit} else {[0] call _camLoadUnit}; _return = true}; + case (DIK_2): {if (_ctrl) then {[1] call _camSaveUnit} else {[1] call _camLoadUnit}; _return = true}; + case (DIK_3): {if (_ctrl) then {[2] call _camSaveUnit} else {[2] call _camLoadUnit}; _return = true}; + case (DIK_4): {if (_ctrl) then {[3] call _camSaveUnit} else {[3] call _camLoadUnit}; _return = true}; + case (DIK_5): {if (_ctrl) then {[4] call _camSaveUnit} else {[4] call _camLoadUnit}; _return = true}; + case (DIK_6): {if (_ctrl) then {[5] call _camSaveUnit} else {[5] call _camLoadUnit}; _return = true}; + case (DIK_7): {if (_ctrl) then {[6] call _camSaveUnit} else {[6] call _camLoadUnit}; _return = true}; + case (DIK_8): {if (_ctrl) then {[7] call _camSaveUnit} else {[7] call _camLoadUnit}; _return = true}; + case (DIK_9): {if (_ctrl) then {[8] call _camSaveUnit} else {[8] call _camLoadUnit}; _return = true}; + case (DIK_0): {if (_ctrl) then {[9] call _camSaveUnit} else {[9] call _camLoadUnit}; _return = true}; + + case (DIK_NUMPAD5): { + _dir = getDir _cam; + if (!isNull GVAR(attach)) then {_dir = _dir - getDir GVAR(attach)}; + GVAR(vector) = [_dir, 0, 0]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + GVAR(fov) = 0.7; + _cam camPrepareFOV GVAR(fov); + _cam camCommitPrepared 0; + }; + + case (DIK_NUMPADENTER): {_return = true}; + + case (DIK_NUMPAD0): {_return = true}; + + case (DIK_DECIMAL): {_return = true}; + + case (DIK_BACKSPACE): { + GVAR(focus) = if (!_shift) then { + [-1, 1]; + } else { + [-1, -1]; + }; + _cam camPrepareFocus GVAR(focus); + _cam camCommitPrepared 0; + _return = true; + }; + + case (DIK_BACKSLASH): { + if (!isMultiplayer) then { + GVAR(accTime) = 1; + setAccTime GVAR(accTime); + }; + }; + + case (DIK_GRAVE): {_return = true}; + + case (DIK_SPACE): { + if (!_camOn) exitWith {}; + if (_ctrl) then { + ["Camera", ["Attach"]] call FUNC(camera); + } else { + ["Camera", ["Lock"]] call FUNC(camera); + }; + }; + + case (DIK_LEFT): { + ["Camera", ["NewUnit", -1]] call FUNC(camera) + }; + + case (DIK_RIGHT): { + ["Camera", ["NewUnit", 1]] call FUNC(camera) + }; + + case (DIK_UP): { + if (isNull GVAR(unit)) exitWith {}; + if (_lock > -1) then {["Camera", ["Lock"]] call FUNC(camera)}; + call _detach; + if (_camOn) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + if GVAR(third) then { + ["Camera", ["First"]] call FUNC(camera); + }; + }; + }; + + case (DIK_DOWN): { + if (isNull GVAR(unit)) exitWith {}; + if (_lock > -1) then {["Camera", ["Lock"]] call FUNC(camera)}; + call _detach; + if (!_camOn) then { + if !GVAR(third) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + ["Camera", ["Free"]] call FUNC(camera); + }; + }; + }; + + case (DIK_T): { + GVAR(markers) = GVAR(markers) + 1; + if (GVAR(markers) > 3) then {GVAR(markers) = 0}; + if (GVAR(markers) == 0) then {clearRadio}; + }; + + case (DIK_U): { + _map = uiNameSpace getVariable [QGVAR(map), findDisplay 12202]; + if (!isNull _map) exitWith {}; + + _overlay = uiNamespace getVariable [QGVAR(overlay), findDisplay 12200]; + if (isNull _overlay) then { + createDialog QGVAR(overlay); + } else { + closeDialog 0; + }; + }; + + case (DIK_X): { + _layer = [QGVAR(crosshair)] call BIS_fnc_rscLayer; + _xhair = uiNamespace getVariable QGVAR(crosshair); + if (isNull _xhair) then { + _layer cutRsc [QGVAR(crosshair), "PLAIN", 0, true]; + call FUNC(crosshair); + } else { + _layer cutText ["", "PLAIN"]; + }; + }; + + case (DIK_C): { + _layer = [QGVAR(compass)] call BIS_fnc_rscLayer; + if (isNull (uiNamespace getVariable QGVAR(compass))) then { + _layer cutRsc [QGVAR(compass), "PLAIN", 0, true]; + } else { + _layer cutText ["", "PLAIN"]; + }; + + _layer = [QGVAR(status)] call BIS_fnc_rscLayer; + if (isNull (uiNamespace getVariable QGVAR(status))) then { + _layer cutRsc [QGVAR(status), "PLAIN", 0, true]; + } else { + _layer cutText ["", "PLAIN"]; + }; + }; + + case (DIK_G): { + _vd = uiNamespace getVariable [QGVAR(vd), findDisplay 12201]; + if (isNull _vd) then { + createDialog QGVAR(vd); + } else { + closeDialog 0; + } + }; + + case (DIK_H): { + _layer = [QGVAR(help)] call BIS_fnc_rscLayer; + if (isNull (uiNamespace getVariable QGVAR(help))) then { + _layer cutRsc [QGVAR(help), "PLAIN", 0, true]; + } else { + _layer cutText ["", "PLAIN"]; + }; + }; + + case (DIK_M): { + _map = uiNameSpace getVariable [QGVAR(map), findDisplay 12202]; + if (isNull _map) then { + createDialog QGVAR(map); + } else { + closeDialog 0; + }; + }; + + case (DIK_N): { + GVAR(vision) = GVAR(vision) + 1; + if (GVAR(vision) > 4) then {GVAR(vision) = 0}; + switch GVAR(vision) do { + case 0: { + camUseNVG false; + false SetCamUseTi 0; + }; + case 1: { + camUseNVG true; + false SetCamUseTi 0; + }; + case 2: { + camUseNVG false; + true SetCamUseTi 0; + }; + case 3: { + camUseNVG false; + true SetCamUseTi 1; + }; + + case 4: { + camUseNVG false; + true SetCamUseTi 4; + }; + }; + }; + + case (DIK_ESCAPE): { + if !GVAR(noEscape) then { + _return = true; + _this spawn { + disableSerialization; + _display = _this select 0; + _message = ["Do you want to exit spectator?", "ACE Spectator", nil, true, _display] call BIS_fnc_guiMessage; + if (_message) then {["Exit"] call FUNC(camera)}; + }; + }; + }; + default {}; + }; + + _return + }; + + ////////////////////////////////////////// + case "KeyUp": { + GVAR(keys) set [_this select 1, false]; + }; + + ////////////////////////////////////////// + case "Camera": { + + _mode = _this select 0; + + _cam = GVAR(cam); + _camOn = GVAR(cameraOn); + _unit = GVAR(unit); + _lock = GVAR(lock) select 0; + + _findTarget = { + + _ret = []; + _screenPos = screenToWorld [0.5,0.5]; + _camPosASL = getPosASL _cam; + _camPosReal = getPos _cam; + _endPosASL = [_screenPos select 0, _screenPos select 1, getTerrainHeightASL _screenPos]; + _endPosReal = if (surfaceIsWater _endPosASL) then {_endPosASL} else {ASLtoATL _endPosASL}; + _objs = lineIntersectsWith [_camPosASL, _endPosASL, objNull, objNull, true]; + + if (count _objs > 0) then { //if vehicle/object found + _obj = _objs select (count _objs - 1); + _ret = _obj; + } else { //check for units near endpoint instead + _units = allUnits; + if (count _units > 0) then { + _nearestUnit = _units select 0; + {if (_endPosReal distance _x < _endPosReal distance _nearestUnit) then {_nearestUnit = _x}} forEach _units; + _intersect = [_nearestUnit, "FIRE"] intersect [_camPosReal, _endPosReal]; + if (count (_intersect) > 0) then { + _ret = _nearestUnit; + } else { //check for units near camera instead + _nearestUnit = _units select 0; + {if (_cam distance _x < _cam distance _nearestUnit) then {_nearestUnit = _x}} forEach _units; + _intersect = [_nearestUnit, "FIRE"] intersect [_camPosReal, _endPosReal]; + if (count _intersect > 0) then { + _ret = _nearestUnit; + } else { //if nothing else, point at ground position + _ret = _endPosReal; + }; + }; + }; + }; + _ret + }; + + switch (_mode) do { + + case "Free": { + GVAR(cameraOn) = true; + GVAR(third) = false; + detach _cam; + player switchCamera "Internal"; + _cam cameraEffect ["Internal", "Back"]; + cameraEffectEnableHUD true; + _dir = getDir _unit; + _pos = [_unit, -5, _dir] call BIS_fnc_relPos; + _pos set [2, ((getPos _unit) select 2) + 2]; + _cam setPos _pos; + GVAR(vector) set [0, _dir]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + + case "First": { + if (_unit == player) exitWith {}; + GVAR(cameraOn) = false; + GVAR(third) = false; + _cam attachTo [vehicle _unit, [0,0.1,0]]; + _cam cameraEffect ["Terminate", "Back"]; + vehicle _unit switchCamera "Internal"; + }; + + case "Third": { + if (_unit == player) exitWith {}; + GVAR(third) = true; + GVAR(cameraOn) = false; + if (!difficultyEnabled "3rdPersonView") then { + player switchCamera "Internal"; + _cam cameraEffect ["Internal", "Back"]; + cameraEffectEnableHUD true; + if (vehicle _unit == _unit) then { + _cam attachTo [_unit, [0.1, -2.4, 0.6], "head"]; + } else { + _cam attachTo [vehicle _unit, [0, -7, 1.5]]; + }; + } else { + _cam attachTo [vehicle _unit, [0,0.1,0]]; + _cam cameraEffect ["Terminate", "Back"]; + vehicle _unit switchCamera "External"; + }; + }; + + case "NewUnit": { + + _increment = _this select 1; + _units = []; + { + if (alive _x) then {_units pushBack _x}; + } forEach GVAR(units); + + _count = count _units; + + if (_count > 0) then { + + _index = _units find _unit; + _index = _index + _increment; + if (_index < 0) then {_index = _count - 1}; + if (_index > (_count - 1)) then {_index = 0}; + + GVAR(unit) = _units select _index; + if (!_camOn) then {["Camera", ["SwitchUnit"]] call FUNC(camera)}; + }; + }; + + case "SwitchUnit": { + if !GVAR(third) then { + ["Camera", ["First"]] call FUNC(camera); + } else { + ["Camera", ["Third"]] call FUNC(camera); + }; + }; + + case "Lock": { + if (_lock < 0) then { + + _target = call _findTarget; + + if (typeName _target == "OBJECT") then { + GVAR(lock) = [1, _target]; + } else { + if (count _target > 0) then { + GVAR(lock) = [1, _target]; + }; + }; + + _cam camPrepareTarget (GVAR(lock) select 1); + _cam camCommitPrepared 0; + call FUNC(crosshair); + } else { + + _dir = getDir _cam; + _pitchBank = _cam call BIS_fnc_getPitchBank; + GVAR(lock) = [-1]; + _cam cameraEffect ["Terminate", "Back"]; + camDestroy _cam; + _cam = "camera" camCreate (_camPos select 0); + [_cam, _camPos select 1] call BIS_fnc_setObjectRotation; + _cam camPrepareFOV (_camPos select 2); + _cam camPrepareFocus GVAR(focus); + _cam camCommitPrepared 0; + _cam cameraEffect ["Internal", "Back"]; + cameraEffectEnableHUD true; + GVAR(cam) = _cam; + _obj = GVAR(attach); + if !(isNull _obj) then { + _modelPos = _obj worldToModel (_camPos select 0); + _cam attachTo [_obj, _modelPos]; + _dir = _dir - getDir _obj; + }; + GVAR(vector) = [_dir, _pitchBank select 0, 0]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + call FUNC(crosshair); + }; + }; + + case "Attach": { + _dir = getDir _cam; + _pitchBank = _cam call BIS_fnc_getPitchBank; + if (isNull GVAR(attach)) then { + _target = call _findTarget; + if (typeName _target == "OBJECT") then { + if (_target isKindOf "AllVehicles") then { + _dir = _dir - getDir _target; + _cam attachTo [_target]; + GVAR(attach) = _target; + call FUNC(crosshair); + }; + }; + } else { + detach _cam; + GVAR(attach) = objNull; + call FUNC(crosshair); + }; + GVAR(vector) = [_dir, _pitchBank select 0, _pitchBank select 1]; + [_cam, GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + }; + + call FUNC(crosshair); + }; + + ////////////////////////////////////////// + case "Help": { + + _dialog = _this; + +_c1Action = parseText " +Camera:
+
+Move
+Pitch, Yaw
+Roll
+Slide
+Speed Multiplier
+Camera Mode
+Track Pos or Object
+Lock to Object
+Save Pos
+Recall Pos
+Optic Mode
+Focus
+Autofocus
+Disable Focus
+Pitch and Yaw
+Roll
+Pitch/Roll Reset
+Zoom
+Reset Zoom
+Pitch/Yaw/Roll/Zoom Fast
+Pitch/Yaw/Roll/Zoom Slow
+
+"; + +_c1Control = parseText " +
+
+W, A, S, D
+LMB + Mouse
+Shift + LMB + Mouse
+RMB + Mouse
+MouseWheel Up, Down
+Arrow Up, Down
+Space
+Ctrl + Space
+Ctrl + F1...F12
+F1...F12
+N
+Keyboard - and +
+Backspace
+Shift + Backspace
+Numpad 1...9
+Numpad / and *
+Numpad 5
+Numpad - and +
+Numpad Enter
+Numpad 0
+Numpad Decimal
+
+"; + +_c2Action = parseText " +Units:
+
+Cycle Unit
+Save Unit
+Recall Unit
+Unit List
+
+Display:
+
+Toggle Crosshair
+Toggle Status Bar
+View Distance Dialog
+Cycle Marker Mode
+Toggle Help
+
+"; + +_c2Control = parseText " +
+
+Arrow Left, Right
+Ctrl + 1...10
+1...10
+U
+
+
+
+X
+C
+G
+T
+H
+
+"; + +if (!isMultiplayer) then { + +_add1 = parseText " +
+Time:
+
+Faster, Slower
+Reset +
+"; + +_add2 = parseText " +
+
+
+[ and ]
+\
+
+"; + + _c2Action = composeText [_c2Action, _add1]; + _c2Control = composeText [_c2Control, _add2]; +}; + + (_dialog displayCtrl 1) ctrlSetStructuredText _c1Action; + (_dialog displayCtrl 2) ctrlSetStructuredText _c1Control; + (_dialog displayCtrl 3) ctrlSetStructuredText _c2Action; + (_dialog displayCtrl 4) ctrlSetStructuredText _c2Control; + }; + + ////////////////////////////////////////// + case "Exit": { + + if (isClass (configFile >> "CfgPatches" >> "ace_nametags")) then { + EGVAR(nametags,showPlayerNames) = GVAR(tags) select 0; + EGVAR(nametags,showNamesForAI) = GVAR(tags) select 1; + GVAR(tags) = nil; + }; + + if (isClass (configFile >> "CfgPatches" >> "ace_hearing")) then { + EGVAR(hearing,disableVolumeUpdate) = false; + }; + + if (isClass (configFile >> "CfgPatches" >> "ace_interact_menu")) then { + [QGVAR(interactCondition)] call EFUNC(common,removeCanInteractWithCondition); + }; + + GVAR(cam) cameraEffect ["terminate", "back"]; + camUseNVG false; + false SetCamUseTi 0; + camDestroy GVAR(cam); + clearRadio; + + GVAR(noEscape) = nil; + GVAR(cam) = nil; + GVAR(LMB) = nil; + GVAR(RMB) = nil; + GVAR(vector) = nil; + GVAR(fov) = nil; + GVAR(vision) = nil; + GVAR(moveScale) = nil; + GVAR(cameraOn) = nil; + GVAR(focus) = nil; + GVAR(lock) = nil; + GVAR(attach) = nil; + GVAR(unit) = nil; + GVAR(mouseBusy) = nil; + GVAR(markers) = nil; + GVAR(keys) = nil; + GVAR(accTime) = nil; + + _display = findDisplay 46; + + removeMissionEventHandler ["Draw3D", GVAR(ehDraw3D)]; + _display displayRemoveEventHandler ["keyDown", GVAR(ehKeyDown)]; + _display displayRemoveEventHandler ["keyUp", GVAR(ehKeyUp)]; + _display displayRemoveEventHandler ["mouseButtonDown", GVAR(ehMouseButtonDown)]; + _display displayRemoveEventHandler ["mouseButtonUp", GVAR(ehMouseButtonUp)]; + _display displayRemoveEventHandler ["mouseZChanged", GVAR(ehMouseZChanged)]; + _display displayRemoveEventHandler ["mouseMoving", GVAR(ehMouseMoving)]; + _display displayRemoveEventHandler ["mouseHolding", GVAR(ehMouseHolding)]; + GVAR(ehDraw3D) = nil; + GVAR(ehKeyDown) = nil; + GVAR(ehKeyUp) = nil; + GVAR(ehMouseButtonDown) = nil; + GVAR(ehMouseButtonUp) = nil; + GVAR(ehMouseZChanged) = nil; + GVAR(ehMouseMoving) = nil; + GVAR(ehMouseHolding) = nil; + + _layers = missionNamespace getVariable ["BIS_fnc_rscLayer_list", []]; + + for "_i" from 1 to (count _layers - 1) step 2 do { + (_layers select _i) cutText ["", "Plain"]; + }; + + if (!isMultiplayer) then {setAccTime 1}; + ACE_player switchCamera "Internal"; + }; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_cameraIntro.sqf b/addons/spectator/functions/fnc_cameraIntro.sqf new file mode 100644 index 0000000000..22bfa27d57 --- /dev/null +++ b/addons/spectator/functions/fnc_cameraIntro.sqf @@ -0,0 +1,28 @@ +/* + Author: + voiper + + Description: + Curtain, sound, and text intro when camera starts. + + Arguments: + None + + Example: + call ace_spectator_fnc_camIntro; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +999999 cutText ["", "BLACK IN", 2]; +2 fadeSound 1; + +["Press H for spectator controls", 2] call EFUNC(common,displaytextstructured); + +[_this select 1] call CBA_fnc_removePerFrameHandler; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_canSpectateUnit.sqf b/addons/spectator/functions/fnc_canSpectateUnit.sqf new file mode 100644 index 0000000000..1ce9f32d97 --- /dev/null +++ b/addons/spectator/functions/fnc_canSpectateUnit.sqf @@ -0,0 +1,30 @@ +/* + Author: + voiper + + Description: + Check if a unit is suitable to spectate. + + Arguments: + 0: Unit to check + + Example: + [unit] call ace_spectator_canSpectateUnit; + + Return Value: + Whether is suitable to spectate + + Public: + No +*/ + +#include "script_component.hpp" + +_unit = _this select 0; + +if (_unit distance GVAR(penPos) < 200) exitWith {false}; +if (_unit distance [0,0,0] < 100) exitWith {false}; +if (!GVAR(AI) && !isPlayer _unit) exitWith {false}; +if (GVAR(limitSide) && (([_unit] call FUNC(unitSide)) != GVAR(playerSide))) exitWith {false}; + +true \ No newline at end of file diff --git a/addons/spectator/functions/fnc_checkUnits.sqf b/addons/spectator/functions/fnc_checkUnits.sqf new file mode 100644 index 0000000000..5d62aeed12 --- /dev/null +++ b/addons/spectator/functions/fnc_checkUnits.sqf @@ -0,0 +1,37 @@ +/* + Author: + voiper + + Description: + Compile array of units to spectate. + + Arguments: + None. + + Example: + call ace_spectator_fnc_checkUnits; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_units = allUnits; +_units append allDead; +GVAR(units) = []; + +{ + _listed = _x getVariable [QGVAR(listed), false]; + if (!_listed) then { + [_x] call FUNC(unitVar); + _x addEventHandler ["Killed", {_this call FUNC(killed)}]; + _x addEventHandler ["Respawn", {_this call FUNC(respawn)}]; + _x setVariable [QGVAR(listed), true]; + }; + + if ([_x] call FUNC(canSpectateUnit)) then {GVAR(units) pushback _x}; +} forEach _units; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_compass.sqf b/addons/spectator/functions/fnc_compass.sqf new file mode 100644 index 0000000000..4120cd996f --- /dev/null +++ b/addons/spectator/functions/fnc_compass.sqf @@ -0,0 +1,59 @@ +/* + Author: + voiper + + Description: + Orient and set compass. + + Arguments: + 0: Compass + + Example: + [display] call ace_spectator_fnc_compass; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +#define RESUNITS_X safeZoneW / 100 +#define CENTRE safeZoneX + safeZoneW / 2 +#define COMPASS_W RESUNITS_X * 20 +#define COMPASS_X CENTRE - COMPASS_W / 2 +#define ARC_W COMPASS_W / 2 +#define DEGUNIT COMPASS_W / 180 + +_dialog = _this select 0; + +_Q1 = _dialog displayCtrl 1; +_Q2 = _dialog displayCtrl 2; +_Q3 = _dialog displayCtrl 3; +_Q4 = _dialog displayCtrl 4; +_qOrder = []; + +_dir = if GVAR(cameraOn) then {getDir GVAR(cam)} else {getDir GVAR(unit)}; +_angleFromCentre = _dir - floor(_dir / 90) * 90; +_leftEdgePos = _angleFromCentre * DEGUNIT; + +_positions = [ + [CENTRE - _leftEdgePos - ARC_W, safeZoneY], + [CENTRE - _leftEdgePos, safeZoneY], + [CENTRE - _leftEdgePos + ARC_W, safeZoneY], + [0, safeZoneY - 1] +]; + +_qOrder = switch (true) do { + case ((_dir >= 0) && (_dir < 90)): {[_Q4, _Q1, _Q2, _Q3]}; + case ((_dir >= 90) && (_dir < 180)): {[_Q1, _Q2, _Q3, _Q4]}; + case ((_dir >= 180) && (_dir < 270)): {[_Q2, _Q3, _Q4, _Q1]}; + case (_dir >= 270): {[_Q3, _Q4, _Q1, _Q2]}; +}; + +{ + _x ctrlSetPosition (_positions select _forEachIndex); + _x ctrlCommit 0; +} forEach _qOrder; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_crosshair.sqf b/addons/spectator/functions/fnc_crosshair.sqf new file mode 100644 index 0000000000..80a12cd668 --- /dev/null +++ b/addons/spectator/functions/fnc_crosshair.sqf @@ -0,0 +1,29 @@ +/* + Author: + voiper + + Description: + Automatically set crosshair colour. + + Arguments: + None + + Example: + call ace_spectator_fnc_crosshair; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_xhair = uiNamespace getVariable QGVAR(crosshair); +if (!isNull _xhair) then { + _colour = if ((GVAR(lock) select 0) > -1) then {[1,0,0,0.8]} else { + if (!isNull GVAR(attach)) then {[1,1,0,0.8]} else {[1,1,1,0.8]}; + }; + (_xhair displayCtrl 0) ctrlSetTextColor _colour; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_draw3D.sqf b/addons/spectator/functions/fnc_draw3D.sqf new file mode 100644 index 0000000000..26eb319f73 --- /dev/null +++ b/addons/spectator/functions/fnc_draw3D.sqf @@ -0,0 +1,34 @@ +/* + Author: + voiper + + Description: + Draw3D EH for spectator. + + Arguments: + None + + Example: + call ace_spectator_fnc_draw3D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_map = uiNameSpace getVariable QGVAR(map); +if (!isNull _map) exitWith {}; + +_compass = uiNamespace getVariable QGVAR(compass); +_status = uiNamespace getVariable QGVAR(status); +if (!isNull _compass) then {[_compass] call FUNC(compass)}; +if (!isNull _status) then {[_status] call FUNC(status)}; + +if (GVAR(markers) > 0) then { + call FUNC(drawMines3D); + call FUNC(drawUnits3D); +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_drawMines2D.sqf b/addons/spectator/functions/fnc_drawMines2D.sqf new file mode 100644 index 0000000000..c77c589529 --- /dev/null +++ b/addons/spectator/functions/fnc_drawMines2D.sqf @@ -0,0 +1,43 @@ +/* + Author: + voiper + + Description: + Draw mines on spectator map. + + Arguments: + 0: Map control + 1: Zoom level + + Example: + [map, zoomlevel] call ace_spectator_fnc_drawMines2D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +#define SCALE 5 * safeZoneH / 100 +#define MIN 300 * SCALE +#define TEXTURE "\A3\ui_f\data\map\markers\military\triangle_CA.paa" + +_map = _this select 0; +_zoom = _this select 1; + +_size = SCALE / _zoom; +_textSize = ((1/4 * _size) max (SCALE / 2) min (SCALE / 1.5)) / 2; +_iconSize = (20 * _size) max SCALE min MIN; +_showText = (GVAR(markers) > 1); + +{ + _name = ""; + if (_showText) then { + _magName = getText (configFile >> "CfgAmmo" >> (typeOf _x) >> "defaultMagazine"); + _name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName"); + }; + _map drawIcon [TEXTURE, [1,0.5,0,1], getPos _x, _iconSize, _iconSize, getDir _x, _name, 1, _textSize, "PuristaMedium"]; +} forEach allMines; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_drawMines3D.sqf b/addons/spectator/functions/fnc_drawMines3D.sqf new file mode 100644 index 0000000000..7183db574f --- /dev/null +++ b/addons/spectator/functions/fnc_drawMines3D.sqf @@ -0,0 +1,55 @@ +/* + Author: + voiper + + Description: + Draw mines in 3D. + + Arguments: + None + + Example: + call ace_spectator_fnc_drawMines3D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +#define SCALE safeZoneH / 100 +#define TEXTMAX (1.5 * SCALE) +#define TEXTMIN 6 * SCALE +#define ICONMAX (30 * SCALE) +#define ICONMIN (120 * SCALE) +#define TEXTURE "\A3\ui_f\data\map\markers\military\triangle_CA.paa" + +_cam = GVAR(cam); +_showText = (GVAR(markers) > 1); + +{ + _pos = getPos _x; + _dist = (_cam distance _pos) + 0.1; + + if (_dist < 2000) then { + + _distScaled = SCALE / sqrt(_dist); + _iconScale = 300 * _distScaled; + //_iconSize = (20 * _size) max _scale min _min; + _iconSize = _iconScale max ICONMAX min ICONMIN; + _textSize = 0; + + if (_showText) then { + _textScale = 10 * _distScaled; + _textSize = _textScale max TEXTMAX min TEXTMIN; + }; + + _magName = getText (configFile >> "CfgAmmo" >> (typeOf _x) >> "defaultMagazine"); + _name = getText (configFile >> "CfgMagazines" >> _magName >> "displayName"); + + drawIcon3D [TEXTURE, [1,0.5,0,1], _pos, _iconSize, _iconSize, 0, _name, 1, _textSize, "PuristaMedium"]; + }; +} forEach allMines; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_drawTracks2D.sqf b/addons/spectator/functions/fnc_drawTracks2D.sqf new file mode 100644 index 0000000000..32b6d58ae8 --- /dev/null +++ b/addons/spectator/functions/fnc_drawTracks2D.sqf @@ -0,0 +1,56 @@ +/* + Author: + voiper + + Description: + Draw unit tracks in spectator map. + + Arguments: + 0: Map control + 1: Zoom level + + Example: + [map, zoomlevel] call ace_spectator_fnc_drawTracks2D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_map = _this select 0; +_zoom = _this select 1; + +{ + _unit = _x select 0; + + _info = [_unit] call FUNC(unitInfo); + _colour = _info select 2; + + if (_unit == GVAR(unit)) then {_colour = [1,1,0,_colour select 3]}; + + _positions = _x select 1; + _count = count _positions; + _step = floor (10 * _zoom) min 3 max 1; + _lastIndex = 0; + + if (_count > 1) then { + for "_i" from 0 to (_count - 1) step _step do {; + if (_i > 0 && _i < _count) then { + _pos1 = _positions select _i; + _pos2 = _positions select (_i - _step); + _lastIndex = _i; + _map drawLine [_pos1, _pos2, _colour]; + }; + }; + }; + + //((_count - _step + _count mod _step) max 0) + if (alive _unit) then { + _map drawLine [_positions select _lastIndex, getPosVisual _unit, _colour]; + }; + +} forEach GVAR(trackingArray); \ No newline at end of file diff --git a/addons/spectator/functions/fnc_drawUnits2D.sqf b/addons/spectator/functions/fnc_drawUnits2D.sqf new file mode 100644 index 0000000000..858b418c2f --- /dev/null +++ b/addons/spectator/functions/fnc_drawUnits2D.sqf @@ -0,0 +1,81 @@ +/* + Author: + voiper + + Description: + Draw unit icons on spectator map. + + Arguments: + 0: Map control + 1: Zoom level + + Example: + [map, zoomlevel] call ace_spectator_fnc_drawUnits2D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +#define SCALE 5 * safeZoneH / 100 +#define MIN 300 * SCALE + +_map = _this select 0; +_zoom = _this select 1; + +_topIcon = []; + +_size = SCALE / _zoom; +_showText = (GVAR(markers) > 1); +_textSize = (0.25 * _size) max (SCALE / 2) min (SCALE / 1.5); + +{ + _unit = _x; + _isTarget = (_unit == GVAR(unit)); + + if (true) then { + + _veh = vehicle _unit; + _inVeh = (_veh != _unit); + if (!_isTarget && _inVeh && !(_unit == ((crew _veh) select 0))) exitWith {}; + if (!_isTarget && _inVeh && (GVAR(unit) in (crew _veh))) exitWith {}; + + _obj = if (_inVeh) then {_veh} else {_unit}; + _pos = getPosVisual _obj; + _dir = getDir _obj; + + _info = [_unit] call FUNC(unitInfo); + _name = _info select 0; + _colour = _info select 2; + + _icon = getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "Icon"); + _iconSize = 0; + _iconText = ""; + + if (_inVeh) then { + _iconSize = (50 * _size) max SCALE min (MIN * 2); + if (_showText) then { + _iconText = "[" + (getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName")) + "] " + _name; + }; + } else { + _iconSize = (50 * _size) max SCALE min MIN; + if (_showText) then { + _iconText = _name; + }; + }; + + if (_isTarget) exitWith { + _topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaBold", "RIGHT"]; + }; + + _map drawIcon [_icon, _colour, _pos, _iconSize, _iconSize, _dir, _iconText, 1, _textSize, "PuristaMedium", "RIGHT"] + }; +} forEach GVAR(units); + +if (count _topIcon > 0) then { + _map drawIcon _topIcon; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_drawUnits3D.sqf b/addons/spectator/functions/fnc_drawUnits3D.sqf new file mode 100644 index 0000000000..709e7d8fff --- /dev/null +++ b/addons/spectator/functions/fnc_drawUnits3D.sqf @@ -0,0 +1,97 @@ +/* + Author: + voiper + + Description: + Draw unit icons in 3D. + + Arguments: + None + + Example: + call ace_spectator_fnc_drawUnits3D; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +#define SCALE safeZoneH / 100 +#define TEXTMAX (1.5 * SCALE) +#define TEXTMIN 6 * SCALE +#define ICONMAX (30 * SCALE) +#define ICONMIN (120 * SCALE) + +_cam = GVAR(cam); +_showText = (GVAR(markers) > 1); +_topIcon = []; + +{ + _unit = _x; + + if (true) then { + _veh = vehicle _unit; + _inVeh = (_veh != _unit); + _cmdr = if (_inVeh && (_unit == ((crew _veh) select 0))) then {true} else {false}; + + _obj = if (_inVeh && _cmdr) then {_veh} else {_unit}; + _pos = if (surfaceIsWater getPos _obj) then {getPosASLVisual _obj} else {getPosATLVisual _obj}; + _dist = (_cam distance _pos) + 0.1; + + _isTarget = (_unit == GVAR(unit)); + + //exit if too far + if (_dist > 2000 && !_isTarget) exitWith {}; + + //exit if target not on screen + if ((count (worldToScreen _pos) < 1) && !_isTarget) exitWith {}; + + _info = [_unit] call FUNC(unitInfo); + _name = _info select 0; + _colour = _info select 2; + + _pos set [2, (_pos select 2) + 3]; + _distScaled = SCALE / sqrt(_dist); + + _icon = ""; + _iconScale = 300 * _distScaled; + _iconSize = _iconScale max ICONMAX min ICONMIN; + + _text = if (_showText) then {_name} else {""}; + _textScale = 10 * _distScaled; + _textSize = _textScale max TEXTMAX min TEXTMIN; + + if (_inVeh) then { + if (_cmdr) then { + _icon = getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "Icon"); + _text = if (_showText) then { + "[" + (getText (configFile >> "CfgVehicles" >> (typeOf _veh) >> "displayName")) + "] " + _text + } else {""}; + _pos set [2, (_pos select 2) + 3]; + } else { + _iconSize = 0; + _textSize = if (_dist < 25) then {_textSize / 1.5} else {0}; + }; + } else { + _icon = getText (configFile >> "CfgVehicles" >> (typeOf _unit) >> "Icon"); + }; + + if (GVAR(markers) > 2) then { + _text = _text + " [" + str ceil(_dist) + "]"; + }; + + if (_isTarget) exitWith { + _topIcon = [_icon, [1,1,0,1], _pos, _iconSize, _iconSize, 0, _text, 2, _textSize, "PuristaBold", "CENTER", true]; + }; + + drawIcon3D [_icon, _colour, _pos, _iconSize, _iconSize, 0, _text, 2, _textSize, "PuristaMedium"]; + }; +} forEach GVAR(units); + +if ((count _topIcon > 0) && GVAR(cameraOn)) then { + drawIcon3D _topIcon; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_killed.sqf b/addons/spectator/functions/fnc_killed.sqf new file mode 100644 index 0000000000..4774476be4 --- /dev/null +++ b/addons/spectator/functions/fnc_killed.sqf @@ -0,0 +1,65 @@ +/* + Author: + voiper + + Description: + Killed EH for remote units. + + Arguments: + 0: Unit + 1: Killer + + Example: + [unit, killer] call ace_spectator_fnc_killed; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_unit = _this select 0; +_killer = _this select 1; + +if (isNil "_unit") exitWith {}; +if (isNil QGVAR(cam)) exitWith {}; +if (isNull _unit) exitWith {}; + +if (!isNull _killer) then { + if (GVAR(markers) > 2 && !difficultyEnabled "deathMessages") then { + _nameUnit = name _unit; + _nameKiller = name _killer; + + _text = if (_killer == _unit) then { + format ["%1 died", _nameUnit] + } else { + format ["%2 killed by %1", _nameUnit, _nameKiller] + }; + systemChat _text; + }; +}; + +if (_unit == GVAR(unit) && !GVAR(cameraOn)) then { + ["Camera", ["Free"]] call FUNC(camera); + GVAR(unit) = objNull; +}; + +_savedUnit = GVAR(savedUnits) find _unit; +if (_savedUnit > -1) then { + GVAR(savedUnits) set [_savedUnit, objNull]; +}; + +if (!isNil QGVAR(trackingArray)) then { + _pos = getPos _unit; + _pos resize 2; + _index = -1; + {if ((_x select 0) == _unit) then {_index = _forEachIndex}} forEach GVAR(trackingArray); + _unitArray = GVAR(trackingArray) select _index; + _tracks = _unitArray select 1; + _tracks pushBack _pos; + _unitArray set [1, _tracks]; + GVAR(trackingArray) set [_index, _unitArray]; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_map.sqf b/addons/spectator/functions/fnc_map.sqf new file mode 100644 index 0000000000..b58fa8ce2b --- /dev/null +++ b/addons/spectator/functions/fnc_map.sqf @@ -0,0 +1,156 @@ +/* + Author: + voiper + + Description: + Manage spectator map. + + Arguments: + 0: Mode + 1: Elements (depending on situation) + + Example: + ["Init", [map]] call ace_spectator_fnc_map; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" +#include "\a3\editor_f\Data\Scripts\dikCodes.h" + +_mode = _this select 0; +_this = _this select 1; + +switch _mode do { + + case "Init": { + _map = _this displayCtrl 1; + + if (isNil QGVAR(mapPos)) then { + GVAR(mapPos) = [(GVAR(penPos) select 0) / 4, (GVAR(penPos) select 1) / 4]; + }; + + if (isNil QGVAR(mapZoom)) then { + GVAR(mapZoom) = 0.75; + }; + + _map ctrlMapAnimAdd [0, GVAR(mapZoom), GVAR(mapPos)]; + ctrlMapAnimCommit _map; + setMousePosition [0.5, 0.5]; + + _map ctrlAddEventHandler ["Draw", {['Draw', _this] call FUNC(map)}]; + _map ctrlAddEventHandler ["MouseButtonDblClick", {['Click', _this] call FUNC(map)}]; + }; + + case "Close": { + _map = _this displayCtrl 1; + GVAR(mapPos) = _map ctrlMapScreenToWorld [0.5,0.5]; + GVAR(mapZoom) = ctrlMapScale _map; + }; + + case "Draw": { + _map = _this select 0; + _zoom = ctrlMapScale _map; + + if (GVAR(markers) > 0) then { + if ((GVAR(markers) > 2) && GVAR(tracking)) then { + [_map, _zoom] call FUNC(drawTracks2D); + }; + [_map, _zoom] call FUNC(drawMines2D); + [_map, _zoom] call FUNC(drawUnits2D); + }; + + if (GVAR(cameraOn)) then { + _scale = 5 * safeZoneH / 100; + _map drawIcon ["\A3\ui_f\data\gui\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa", [1,1,1,1], getPos GVAR(cam), 500 * _scale, 500 * _scale, getDir GVAR(cam), "", 0, 0, "PuristaMedium"]; + }; + }; + + case "Click": { + _map = _this select 0; + _button = _this select 1; + _shift = _this select 4; + _mapPos = _map ctrlMapScreenToWorld [_this select 2, _this select 3]; + + if (_shift) then { + if (GVAR(cameraOn)) then { + _dir = [getPos GVAR(cam), _mapPos] call BIS_fnc_dirTo; + GVAR(vector) set [0, _dir]; + [GVAR(cam), GVAR(vector)] call BIS_fnc_setObjectRotation; + }; + } else { + + _newUnit = objNull; + + _scale = ctrlMapScale _map; + _radius = _scale * 250; + _units = []; + + //find units near spot, ignoring height (necessary since nearestObjects takes height into account) + { + if (alive _x) then { + _pos = getPos _x; + _pos set [2, 0]; + if (_pos distance _mapPos <= _radius) then { + _units pushBack _x; + }; + }; + } forEach GVAR(units); + + //find closest unit to spot + if (count _units > 0) then { + _nearest = 0; + for "_i" from 1 to (count _units - 1) do { + if (((_units select _i) distance _mapPos) < ((_units select _nearest) distance _mapPos)) then { + _nearest = _i; + }; + }; + _newUnit = _units select _nearest; + }; + + if (!isNull _newUnit) then { + + if (vehicle _newUnit != _newUnit) then { + _crew = crew (vehicle _newUnit); + _newUnit = _crew select 0; + }; + + GVAR(unit) = _newUnit; + if (GVAR(cameraOn)) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + if (GVAR(third)) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + ["Camera", ["First"]] call FUNC(camera); + }; + }; + } else { + + if (!GVAR(cameraOn)) then { + ["Camera", ["Free"]] call FUNC(camera); + }; + _mapPos set [2, 10]; + GVAR(cam) setPosATL _mapPos; + }; + }; + }; + + case "KeyDown": { + _key = _this select 1; + _shift = _this select 2; + _ctrl = _this select 3; + _alt = _this select 4; + _return = false; + + switch (_key) do { + case (DIK_DELETE): {_return = true}; + }; + + _return + }; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_moduleSpectator.sqf b/addons/spectator/functions/fnc_moduleSpectator.sqf new file mode 100644 index 0000000000..a371327b23 --- /dev/null +++ b/addons/spectator/functions/fnc_moduleSpectator.sqf @@ -0,0 +1,28 @@ +/* + * Author: esteldunedain + * Initializes the addon module. + * + * Arguments: + * Whatever the module provides. + * + * Return Value: + * None + */ + +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); + +if !(_activated) exitWith {}; + +[_logic, QGVAR(enabled), "SpectatorEnabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(limitSide), "SpectatorPlayerSide"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(AI), "SpectatorAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(tracking), "SpectatorTracking"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(modulePos), "SpectatorPos"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(endMission), "SpectatorEnd"] call EFUNC(common,readSettingFromModule); + +if GVAR(modulePos) then { + GVAR(startingPos) = getPosATL _logic; + GVAR(startingDir) = getDir _logic; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_overlay.sqf b/addons/spectator/functions/fnc_overlay.sqf new file mode 100644 index 0000000000..d998b9a3b2 --- /dev/null +++ b/addons/spectator/functions/fnc_overlay.sqf @@ -0,0 +1,106 @@ +/* + Author: + voiper + + Description: + Spectator unit list. + + Arguments: + 0: Specific function to use + 1: Function params + + Example: + ["Init", [display]] call ace_spectator_fnc_overlay; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_mode = _this select 0; +_this = _this select 1; + +switch _mode do { + + case "Init": { + + _display = _this select 0; + _ctrl = _display displayCtrl 0; + _count = _ctrl tvCount []; + for "_i" from 0 to _count do { + _ctrl tvDelete [_x]; + }; + + _ctrl tvAdd [[], "Blufor"]; + _ctrl tvAdd [[], "Opfor"]; + _ctrl tvAdd [[], "Independent"]; + _ctrl tvAdd [[], "Civilian"]; + + _unitList = []; + + { + _units = units _x; + private ["_groupNum"]; + { + if ((GVAR(units) find _x > -1) && alive _x) then { + _info = [_x] call FUNC(unitInfo); + _text = _info select 0; + _team = _info select 1; + _side = switch (_team) do { + case BLUFOR: {0}; + case OPFOR: {1}; + case INDEPENDENT: {2}; + case CIVILIAN: {3}; + }; + + _icon = getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "Icon"); + _picture = "\a3\ui_f\data\map\VehicleIcons\" + _icon + "_ca.paa"; + _treeIndex = []; + _unitList pushBack _x; + + _savedUnit = GVAR(savedUnits) find _x; + if (_savedUnit > -1) then {_text = _text + " (#" + str (_savedUnit + 1) + ")"}; + + if (_forEachIndex == 0) then { + _groupNum = _ctrl tvAdd [[_side], _text]; + _treeIndex = [_side, _groupNum]; + } else { + _num = _ctrl tvAdd [[_side, _groupNum], _text]; + _treeIndex = [_side, _groupNum, _num]; + }; + + _ctrl tvSetPicture [_treeIndex, _picture]; + _ctrl tvSetData [_treeIndex, [_x] call FUNC(unitVar)]; + _unitList pushBack _treeIndex; + }; + } forEach _units; + } forEach allGroups; + + if (!isNull GVAR(unit)) then { + if (alive GVAR(unit)) then { + _treeIndex = _unitList select ((_unitList find GVAR(unit)) + 1); + _ctrl tvSetCurSel _treeIndex; + }; + }; + }; + + case "Select": { + + _ctrl = _this select 0; + _selection = _this select 1; + if (count _selection < 2) exitWith {}; + + _str = _ctrl tvData _selection; + _unit = missionNamespace getVariable _str; + GVAR(unit) = _unit; + if (GVAR(cameraOn)) then { + ["Camera", ["Third"]] call FUNC(camera); + } else { + ["Camera", ["SwitchUnit"]] call FUNC(camera); + }; + }; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_penPos.sqf b/addons/spectator/functions/fnc_penPos.sqf new file mode 100644 index 0000000000..a176d3e811 --- /dev/null +++ b/addons/spectator/functions/fnc_penPos.sqf @@ -0,0 +1,33 @@ +/* + Author: + voiper + + Description: + Determine spec pen position. + + Arguments: + None + + Example: + call ace_spectator_fnc_penPos; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_mapSize = (configFile >> "CfgWorlds" >> worldName >> "mapSize"); +_worldEdge = if (isNumber _mapSize) then {getNumber _mapSize} else {32768}; +_pos = [_worldEdge * 2, _worldEdge * 2]; + +if (surfaceisWater _pos) then { + _pos set [2, -1.4]; + GVAR(penPos) = ASLtoATL _pos; +} else { + _pos set [2, 0]; + GVAR(penPos) = _pos; +}; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_respawn.sqf b/addons/spectator/functions/fnc_respawn.sqf new file mode 100644 index 0000000000..dba2f6a850 --- /dev/null +++ b/addons/spectator/functions/fnc_respawn.sqf @@ -0,0 +1,25 @@ +/* + Author: + voiper + + Description: + Respawn EH for remote clients. + + Arguments: + 0: Unit + + Example: + ["Init", [false]] call ace_spectator_fnc_camera; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_unit = _this select 0; +_unit setVariable [QGVAR(name), name _unit, true]; +//_unit setVariable [QGVAR(listed), false]; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_sideColour.sqf b/addons/spectator/functions/fnc_sideColour.sqf new file mode 100644 index 0000000000..1262ae5b07 --- /dev/null +++ b/addons/spectator/functions/fnc_sideColour.sqf @@ -0,0 +1,66 @@ +/* + Author: + voiper + + Description: + Determine side colour for spectator GUI. + + Arguments: + 0: Side + + Example: + [0 call ace_spectator_fnc_sideColour; + + Return Value: + Colour + + Public: + No +*/ + +#include "script_component.hpp" +#define FACTOR 1.3 +#define GETCOLOUR(a,b) (profileNameSpace getVariable [QUOTE(a), b]) + +PARAMS_1(_side); + +_colour = switch _side do { + case BLUFOR: { + [ + GETCOLOUR('Map_BLUFOR_R', 0), + GETCOLOUR('Map_BLUFOR_G', 0.3), + GETCOLOUR('Map_BLUFOR_B', 0.6) + ] + }; + + case OPFOR: { + [ + GETCOLOUR('Map_OPFOR_R', 0.5), + GETCOLOUR('Map_OPFOR_G', 0), + GETCOLOUR('Map_OPFOR_B', 0) + ] + }; + + case INDEPENDENT: { + [ + GETCOLOUR('Map_Independent_R', 0), + GETCOLOUR('Map_Independent_G', 0.5), + GETCOLOUR('Map_Independent_B', 0) + ] + }; + + case CIVILIAN: { + [ + GETCOLOUR('Map_Civilian_R', 0.4), + GETCOLOUR('Map_Civilian_G', 0), + GETCOLOUR('Map_Civilian_B', 0.5) + ] + }; +}; + +_colour set [0, (_colour select 0) * FACTOR]; +_colour set [1, (_colour select 1) * FACTOR]; +_colour set [2, (_colour select 2) * FACTOR]; +_colour set [3, 1]; + +_colour \ No newline at end of file diff --git a/addons/spectator/functions/fnc_status.sqf b/addons/spectator/functions/fnc_status.sqf new file mode 100644 index 0000000000..4207ef9c00 --- /dev/null +++ b/addons/spectator/functions/fnc_status.sqf @@ -0,0 +1,60 @@ +/* + Author: + voiper + + Description: + Render status. + + Arguments: + 0: Status element + + Example: + [display] call ace_spectator_fnc_status; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_display = _this select 0; + +_speedText = (str ([GVAR(moveScale), 4] call BIS_fnc_cutDecimals)) + "v"; +(_display displayCtrl 0) ctrlSetText _speedText; + +_name = ""; +_colour = [1,1,1,1]; + +if (!isNull GVAR(unit)) then { + _info = [GVAR(unit)] call FUNC(unitInfo); + _name = _info select 0; + _side = _info select 1; + _colour = _info select 2; + _colour set [3, 1]; +}; +(_display displayCtrl 1) ctrlSetText _name; +(_display displayCtrl 1) ctrlSetTextColor _colour; + +_mode = if (GVAR(cameraOn)) then { + if (isNull GVAR(attach)) then {"FREE"} else {"ATTACH"}; +} else { + if (GVAR(third)) then {"THIRD"} else {"FIRST"}; +}; +(_display displayCtrl 2) ctrlSetText _mode; + +_timeText = [dayTime] call BIS_fnc_timeToString; +(_display displayCtrl 3) ctrlSetText _timeText; + +_fovText = (str ([GVAR(fov), 3] call BIS_fnc_cutDecimals)) + "a"; +(_display displayCtrl 4) ctrlSetText _fovText; + +_timeAccText = (str ([GVAR(accTime), 4] call BIS_fnc_cutDecimals)) + "x"; +(_display displayCtrl 5) ctrlSetText _timeAccText; + +_focusDist = [GVAR(focus) select 0, 1] call BIS_fnc_cutDecimals; +_focusBlur = GVAR(focus) select 1; +_focusText = if (_focusDist == -1 && _focusBlur == 1) then {"Auto"} else {if (_focusDist < 0) then {toString [8734]} else {str _focusDist + "m"}}; +(_display displayCtrl 6) ctrlSetText _focusText; \ No newline at end of file diff --git a/addons/spectator/functions/fnc_trackUnits.sqf b/addons/spectator/functions/fnc_trackUnits.sqf new file mode 100644 index 0000000000..28da75a554 --- /dev/null +++ b/addons/spectator/functions/fnc_trackUnits.sqf @@ -0,0 +1,54 @@ +/* + Author: + voiper + + Description: + Check and record tracking for all units. + + Arguments: + None + + Example: + call ace_spectator_fnc_trackUnits; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +if (isNil QGVAR(trackingArray)) then { + GVAR(trackingArray) = []; +}; + +if (count GVAR(units) < 1) exitWith {}; + +{ + _unit = _x; + _pos = getPos _unit; + _pos resize 2; + + _index = -1; + + {if ((_x select 0) == _unit) then {_index = _forEachIndex}} forEach GVAR(trackingArray); + if (_index == -1) then { + GVAR(trackingArray) pushBack [_unit, [_pos]] + } else { + _unitArray = GVAR(trackingArray) select _index; + _trackingArray = _unitArray select 1; + _latestIndex = (count _trackingArray) - 1; + _latestPos = _trackingArray select _latestIndex; + _diffX = abs((_latestPos select 0) - (_pos select 0)); + _diffY = abs((_latestPos select 1) - (_pos select 1)); + + if !((_diffX < 20) && (_diffY < 20)) then { + _trackingArray pushBack _pos; + _unitArray set [1, _trackingArray]; + GVAR(trackingArray) set [_index, _unitArray]; + }; + }; + +} forEach GVAR(units); \ No newline at end of file diff --git a/addons/spectator/functions/fnc_unitInfo.sqf b/addons/spectator/functions/fnc_unitInfo.sqf new file mode 100644 index 0000000000..a377cabf31 --- /dev/null +++ b/addons/spectator/functions/fnc_unitInfo.sqf @@ -0,0 +1,34 @@ +/* + Author: + voiper + + Description: + Retrieve unit name, side, and colour. + + Arguments: + 0: Unit + + Example: + [player] call ace_spectator_fnc_unitInfo; + + Return Value: + Name , Side , Colour + + Public: + No +*/ + +#include "script_component.hpp" + +PARAMS_1(_unit); + +_name = [_unit] call EFUNC(common,getName); +_side = [_unit] call FUNC(unitSide); +_colour = [_side] call FUNC(sideColour); + +if (!alive _unit) then { + {_colour set [_forEachIndex, _x / 2.5]} forEach _colour; + _colour set [3, 0.8]; +}; + +[_name, _side, _colour] \ No newline at end of file diff --git a/addons/spectator/functions/fnc_unitSide.sqf b/addons/spectator/functions/fnc_unitSide.sqf new file mode 100644 index 0000000000..d33520d5ec --- /dev/null +++ b/addons/spectator/functions/fnc_unitSide.sqf @@ -0,0 +1,39 @@ +/* + Author: + voiper + + Description: + Retrieve unit's side, even after they join grpNull. + + Arguments: + 0: Unit to check + + Example: + [unit] call ace_spectator_unitSide; + + Return Value: + Side + + Public: + No +*/ + +#include "script_component.hpp" + +PARAMS_1(_unit); + +private ["_side"]; + +if (alive _unit) then { + _side = side (group _unit); +} else { + _sideNum = getNumber (configFile >> "CfgVehicles" >> (typeOf _unit) >> "side"); + _side = switch _sideNum do { + case 0: {OPFOR}; + case 1: {BLUFOR}; + case 2: {INDEPENDENT}; + case 3: {CIVILIAN}; + }; +}; + +_side \ No newline at end of file diff --git a/addons/spectator/functions/fnc_unitVar.sqf b/addons/spectator/functions/fnc_unitVar.sqf new file mode 100644 index 0000000000..6d072ae171 --- /dev/null +++ b/addons/spectator/functions/fnc_unitVar.sqf @@ -0,0 +1,38 @@ +/* + Author: Karel Moricky, modified by voiper + + Description: + Set or return an unique object variable (client only). + + Arguments: + 0: Unit + + Returns: + Variable +*/ + +#include "script_component.hpp" + +private ["_object","_var"]; + +_object = [_this, 0, objnull, [objnull]] call BIS_fnc_param; + +if (isNull _object) exitwith {""}; + +_var = _object getVariable [QGVAR(objectVar), ""]; + +if (_var == "") then { + _var = vehicleVarname _object; + + if (_var == "") then { + _var = [_this, 1, QGVAR(obj), [""]] call BIS_fnc_param; + _varID = [_var, 1] call BIS_fnc_counter; + _var = _var + str _varID; + }; + + _object setVariable [QGVAR(objectVar), _var]; + missionNamespace setVariable [_var, _object]; + _object setVehicleVarname _var; +}; + +_var \ No newline at end of file diff --git a/addons/spectator/functions/fnc_viewDistance.sqf b/addons/spectator/functions/fnc_viewDistance.sqf new file mode 100644 index 0000000000..4112ed2a62 --- /dev/null +++ b/addons/spectator/functions/fnc_viewDistance.sqf @@ -0,0 +1,47 @@ +/* + Author: + voiper + + Description: + View distance dialog. + + Arguments: + 0: Mode + 1: Arguemnts + + Example: + ["Init", [dialog]] call ace_spectator_fnc_viewDistance; + + Return Value: + None + + Public: + No +*/ + +#include "script_component.hpp" + +_mode = _this select 0; +_this = _this select 1; + +switch _mode do { + + case "Init": { + _dialog = _this select 0; + _dist = -1; + _text = _dialog displayCtrl 1; + _slider = _dialog displayCtrl 2; + _slider slidersetRange [1000,20000]; + _slider sliderSetSpeed [1000,1000,1000]; + _slider sliderSetPosition viewDistance; + _text ctrlSetText str viewDistance; + }; + + case "Slider": { + _dialog = ctrlParent (_this select 0); + _dist = _this select 1; + _text = _dialog displayCtrl 1; + setViewDistance _dist; + _text ctrlSetText str viewDistance; + }; +}; \ No newline at end of file diff --git a/addons/spectator/functions/script_component.hpp b/addons/spectator/functions/script_component.hpp new file mode 100644 index 0000000000..d5034cb39c --- /dev/null +++ b/addons/spectator/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\spectator\script_component.hpp" \ No newline at end of file diff --git a/addons/spectator/rsc_defines.hpp b/addons/spectator/rsc_defines.hpp new file mode 100644 index 0000000000..e7cb7178c3 --- /dev/null +++ b/addons/spectator/rsc_defines.hpp @@ -0,0 +1,646 @@ +// Control types +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_SHORTCUTBUTTON 16 +#define CT_HITZONES 17 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define CT_LISTNBOX 102 +#define CT_ITEMSLOT 103 +#define CT_CHECKBOX 77 + +// Static styles +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0C + +#define ST_TYPE 0xF0 +#define ST_SINGLE 0x00 +#define ST_MULTI 0x10 +#define ST_TITLE_BAR 0x20 +#define ST_PICTURE 0x30 +#define ST_FRAME 0x40 +#define ST_BACKGROUND 0x50 +#define ST_GROUP_BOX 0x60 +#define ST_GROUP_BOX2 0x70 +#define ST_HUD_BACKGROUND 0x80 +#define ST_TILE_PICTURE 0x90 +#define ST_WITH_RECT 0xA0 +#define ST_LINE 0xB0 +#define ST_UPPERCASE 0xC0 +#define ST_LOWERCASE 0xD0 + +#define ST_SHADOW 0x100 +#define ST_NO_RECT 0x200 +#define ST_KEEP_ASPECT_RATIO 0x800 + +#define ST_TITLE ST_TITLE_BAR + ST_CENTER + +// Slider styles +#define SL_DIR 0x400 +#define SL_VERT 0 +#define SL_HORZ 0x400 + +#define SL_TEXTURES 0x10 + +// progress bar +#define ST_VERTICAL 0x01 +#define ST_HORIZONTAL 0 + +// Listbox styles +#define LB_TEXTURES 0x10 +#define LB_MULTI 0x20 + +// Tree styles +#define TR_SHOWROOT 1 +#define TR_AUTOCOLLAPSE 2 + +// MessageBox styles +#define MB_BUTTON_OK 1 +#define MB_BUTTON_CANCEL 2 +#define MB_BUTTON_USER 4 +#define MB_ERROR_DIALOG 8 + +// Fonts +#define GUI_FONT_NORMAL PuristaMedium +#define GUI_FONT_BOLD PuristaSemibold +#define GUI_FONT_THIN PuristaLight +#define GUI_FONT_MONO EtelkaMonospacePro +#define GUI_FONT_NARROW EtelkaNarrowMediumPro +#define GUI_FONT_CODE LucidaConsoleB +#define GUI_FONT_SYSTEM TahomaB + +//colours + +#define COLOUR_GUI_TEXT {"profilenamespace getvariable ['GUI_TITLETEXT_RGB_R',1]", "profilenamespace getvariable ['GUI_TITLETEXT_RGB_G',1]", "profilenamespace getvariable ['GUI_TITLETEXT_RGB_B',1]", "profilenamespace getvariable ['GUI_TITLETEXT_RGB_A',1]"} + +#define COLOUR_GUI_BG {"profilenamespace getvariable ['GUI_BCG_RGB_R',0.8]", "profilenamespace getvariable ['GUI_BCG_RGB_G',0.8]","profilenamespace getvariable ['GUI_BCG_RGB_B',0.8]","profilenamespace getvariable ['GUI_BCG_RGB_A',0.8]"} + +#define COLOUR_IGUI_TEXT {"profilenamespace getvariable ['IGUI_TEXT_RGB_R',1]", "profilenamespace getvariable ['IGUI_TEXT_RGB_G',1]", "profilenamespace getvariable ['IGUI_TEXT_RGB_B',1]", "profilenamespace getvariable ['IGUI_TEXT_RGB_A',1]"} + +#define COLOUR_IGUI_BG {"profilenamespace getvariable ['IGUI_BCG_RGB_R',0.8]", "profilenamespace getvariable ['IGUI_BCG_RGB_G',0.5]","profilenamespace getvariable ['IGUI_BCG_RGB_B',0]","profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8]"} + +#define COLOUR_IGUI_WARN {"profilenamespace getvariable ['IGUI_TEXT_WARNING_R',0.8]", "profilenamespace getvariable ['IGUI_TEXT_WARNING_G',0.5]", "profilenamespace getvariable ['IGUI_TEXT_WARNING_B',0]", "profilenamespace getvariable ['IGUI_TEXT_WARNING_A',0.8]"} + +// Grids +#define GUI_GRID_CENTER_WAbs ((safezoneW / safezoneH) min 1.2) +#define GUI_GRID_CENTER_HAbs (GUI_GRID_CENTER_WAbs / 1.2) +#define GUI_GRID_CENTER_W (GUI_GRID_CENTER_WAbs / 40) +#define GUI_GRID_CENTER_H (GUI_GRID_CENTER_HAbs / 25) +#define GUI_GRID_CENTER_X (safezoneX + (safezoneW - GUI_GRID_CENTER_WAbs)/2) +#define GUI_GRID_CENTER_Y (safezoneY + (safezoneH - GUI_GRID_CENTER_HAbs)/2) + +#define RESUNITS_X (safeZoneW / 100) +#define RESUNITS_Y (safeZoneH / 100) +#define RESCENTRE_X safeZoneX + safeZoneW / 2 +#define RESCENTRE_Y safeZoneY + safeZoneH / 2 + +#define Q(s) #s + +class vip_rsc_picture { + + access = 0; + idc = -1; + type = CT_STATIC; + style = ST_PICTURE; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + font = "TahomaB"; + sizeEx = 0; + lineSpacing = 0; + text = ""; + fixedWidth = 0; + shadow = 0; +}; + +class vip_rsc_text { + + access = 0; + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + font = "PuristaMedium"; + sizeEx = 0.08; + lineSpacing = 1; + text = ""; + fixedWidth = 0; + moving = 0; +}; + +class vip_rsc_box { + + idc=-1; + type = CT_STATIC; + style = ST_CENTER; + text = ""; + font = "TahomaB"; + sizeEx = 0.04; + + colorBackground[] = {0,0,0,1}; + colorText[] = {1,1,1,1}; +}; + +class vip_rsc_button { + + access = 0; + type = CT_BUTTON; + style = ST_LEFT; + default = 0; + blinkingPeriod = 0; + + x = 0 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; + y = 0 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; + w = 6 * GUI_GRID_CENTER_W; + h = 1 * GUI_GRID_CENTER_H; + + colorBackground[] = {0.8,0.8,0.8,1}; + colorBackgroundDisabled[] = {0.8,0.8,0.8, 0.25}; + colorBackgroundActive[] = {1,1,1,1}; + colorFocused[] = {0.8,0.8,0.8,1}; + + text = ""; + sizeEx = 1 * GUI_GRID_CENTER_H; + font = GUI_FONT_NORMAL; + shadow = 1; + colorText[] = {0,0,0,1}; + colorDisabled[] = {0,0,0,0.25}; + + borderSize = 0.0; + colorBorder[] = {1,1,1,1}; + + colorShadow[] = {0,0,0,0.0}; + offsetX = 0.0075; + offsetY = 0.01; + offsetPressedX = 0.000; + offsetPressedY = 0.00; + + period = 0; + periodFocus = 0; + periodOver = 0.5; + + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + + //onButtonClick = "false"; +}; + +class vip_rsc_listbox { + + access = 0; + idc = 25; + type = CT_COMBO; + style = ST_LEFT + LB_TEXTURES; + default = 0; + blinkingPeriod = 0; + + x = 12 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; + y = 4 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; + w = 9 * GUI_GRID_CENTER_W; + h = 1 * GUI_GRID_CENTER_H; + + colorBackground[] = {0.2,0.2,0.2,1}; + colorSelectBackground[] = {1,0.5,0,1}; + + sizeEx = GUI_GRID_CENTER_H; + font = GUI_FONT_NORMAL; + shadow = 0; + colorText[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.5}; + colorSelect[] = {1,1,1,1}; + + pictureColor[] = {1,0.5,0,1}; + pictureColorSelect[] = {1,1,1,1}; + pictureColorDisabled[] = {1,1,1,0.5}; + + arrowEmpty = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_ca.paa"; + arrowFull = "\A3\ui_f\data\GUI\RscCommon\rsccombo\arrow_combo_active_ca.paa"; + + wholeHeight = 8 * GUI_GRID_CENTER_H; + maxHistoryDelay = 1; + + soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; + soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; + soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; + + class ComboScrollBar + { + width = 0; + height = 0; + scrollSpeed = 0.01; + + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + + color[] = {1,1,1,1}; + }; + + onLBSelChanged = ""; +}; + +class vip_rsc_frame { + type = 0; + idc = -1; + style=ST_FRAME; + shadow=2; + colorBackground[]={0,0,0,0}; + colorText[]={1,1,1,1}; + font="PuristaMedium"; + sizeEx=0.02; + text=""; +}; + +class vip_rsc_map { + moveOnEdges=1; + x="SafeZoneXAbs"; + y="SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w="SafeZoneWAbs"; + h="SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + shadow=0; + ptsPerSquareSea=5; + ptsPerSquareTxt=20; + ptsPerSquareCLn=10; + ptsPerSquareExp=10; + ptsPerSquareCost=10; + ptsPerSquareFor=9; + ptsPerSquareForEdge=9; + ptsPerSquareRoad=6; + ptsPerSquareObj=9; + showCountourInterval=0; + scaleMin=0.001; + scaleMax=1; + scaleDefault=0.16; + maxSatelliteAlpha=0.85000002; + alphaFadeStartScale=2; + alphaFadeEndScale=2; + colorBackground[]={0.96899998,0.95700002,0.949,1}; + colorSea[]={0.46700001,0.63099998,0.85100001,0.5}; + colorForest[]={0.62400001,0.77999997,0.38800001,0.5}; + colorForestBorder[]={0,0,0,0}; + colorRocks[]={0,0,0,0.30000001}; + colorRocksBorder[]={0,0,0,0}; + colorLevels[]={0.28600001,0.177,0.093999997,0.5}; + colorMainCountlines[]={0.57200003,0.354,0.18799999,0.5}; + colorCountlines[]={0.57200003,0.354,0.18799999,0.25}; + colorMainCountlinesWater[]={0.491,0.57700002,0.70200002,0.60000002}; + colorCountlinesWater[]={0.491,0.57700002,0.70200002,0.30000001}; + colorPowerLines[]={0.1,0.1,0.1,1}; + colorRailWay[]={0.80000001,0.2,0,1}; + colorNames[]={0.1,0.1,0.1,0.89999998}; + colorInactive[]={1,1,1,0.5}; + colorOutside[]={0,0,0,1}; + colorTracks[]={0.83999997,0.75999999,0.64999998,0.15000001}; + colorTracksFill[]={0.83999997,0.75999999,0.64999998,1}; + colorRoads[]={0.69999999,0.69999999,0.69999999,1}; + colorRoadsFill[]={1,1,1,1}; + colorMainRoads[]={0.89999998,0.5,0.30000001,1}; + colorMainRoadsFill[]={1,0.60000002,0.40000001,1}; + colorGrid[]={0.1,0.1,0.1,0.60000002}; + colorGridMap[]={0.1,0.1,0.1,0.60000002}; + fontLabel="PuristaMedium"; + sizeExLabel="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontGrid="TahomaB"; + sizeExGrid=0.02; + fontUnits="TahomaB"; + sizeExUnits="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontNames="EtelkaNarrowMediumPro"; + sizeExNames="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + fontInfo="PuristaMedium"; + sizeExInfo="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontLevel="TahomaB"; + sizeExLevel=0.02; + text="#(argb,8,8,3)color(1,1,1,1)"; + class Legend + { + x="SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)"; + y="SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w="10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h="3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + font="PuristaMedium"; + sizeEx="( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + colorBackground[]={1,1,1,0.5}; + color[]={0,0,0,1}; + }; + class Task + { + icon="\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; + iconCreated="\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; + iconCanceled="\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; + iconDone="\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; + iconFailed="\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; + color[]= + { + "(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])", + "(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])", + "(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])", + "(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])" + }; + colorCreated[]={1,1,1,1}; + colorCanceled[]={0.69999999,0.69999999,0.69999999,1}; + colorDone[]={0.69999999,1,0.30000001,1}; + colorFailed[]={1,0.30000001,0.2,1}; + size=27; + importance=1; + coefMin=1; + coefMax=1; + }; + class Waypoint + { + icon="\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + color[]={0,0,0,1}; + }; + class WaypointCompleted + { + icon="\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; + color[]={0,0,0,1}; + }; + class CustomMark + { + icon="\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; + size=24; + importance=1; + coefMin=1; + coefMax=1; + color[]={0,0,0,1}; + }; + class Command + { + icon="\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + size=18; + importance=1; + coefMin=1; + coefMax=1; + color[]={1,1,1,1}; + }; + class Bush + { + icon="\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[]={0.44999999,0.63999999,0.33000001,0.40000001}; + size="14/2"; + importance="0.2 * 14 * 0.05 * 0.05"; + coefMin=0.25; + coefMax=4; + }; + class Rock + { + icon="\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; + color[]={0.1,0.1,0.1,0.80000001}; + size=12; + importance="0.5 * 12 * 0.05"; + coefMin=0.25; + coefMax=4; + }; + class SmallTree + { + icon="\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[]={0.44999999,0.63999999,0.33000001,0.40000001}; + size=12; + importance="0.6 * 12 * 0.05"; + coefMin=0.25; + coefMax=4; + }; + class Tree + { + icon="\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[]={0.44999999,0.63999999,0.33000001,0.40000001}; + size=12; + importance="0.9 * 16 * 0.05"; + coefMin=0.25; + coefMax=4; + }; + class busstop + { + icon="\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class fuelstation + { + icon="\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class hospital + { + icon="\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class church + { + icon="\A3\ui_f\data\map\mapcontrol\church_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class lighthouse + { + icon="\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class power + { + icon="\A3\ui_f\data\map\mapcontrol\power_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class powersolar + { + icon="\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class powerwave + { + icon="\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class powerwind + { + icon="\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class quay + { + icon="\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class transmitter + { + icon="\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class watertower + { + icon="\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={1,1,1,1}; + }; + class Cross + { + icon="\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={0,0,0,1}; + }; + class Chapel + { + icon="\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={0,0,0,1}; + }; + class Shipwreck + { + icon="\A3\ui_f\data\map\mapcontrol\Shipwreck_CA.paa"; + size=24; + importance=1; + coefMin=0.85000002; + coefMax=1; + color[]={0,0,0,1}; + }; + class Bunker + { + icon="\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + size=14; + importance="1.5 * 14 * 0.05"; + coefMin=0.25; + coefMax=4; + color[]={0,0,0,1}; + }; + class Fortress + { + icon="\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + size=16; + importance="2 * 16 * 0.05"; + coefMin=0.25; + coefMax=4; + color[]={0,0,0,1}; + }; + class Fountain + { + icon="\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; + size=11; + importance="1 * 12 * 0.05"; + coefMin=0.25; + coefMax=4; + color[]={0,0,0,1}; + }; + class Ruin + { + icon="\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; + size=16; + importance="1.2 * 16 * 0.05"; + coefMin=1; + coefMax=4; + color[]={0,0,0,1}; + }; + class Stack + { + icon="\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; + size=20; + importance="2 * 16 * 0.05"; + coefMin=0.89999998; + coefMax=4; + color[]={0,0,0,1}; + }; + class Tourism + { + icon="\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; + size=16; + importance="1 * 16 * 0.05"; + coefMin=0.69999999; + coefMax=4; + color[]={0,0,0,1}; + }; + class ViewTower + { + icon="\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; + size=16; + importance="2.5 * 16 * 0.05"; + coefMin=0.5; + coefMax=4; + color[]={0,0,0,1}; + }; +}; \ No newline at end of file diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp new file mode 100644 index 0000000000..c445dc4cdd --- /dev/null +++ b/addons/spectator/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT spectator +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SPECTATOR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SPECTATOR + #define DEBUG_SETTINGS DEBUG_SETTINGS_SPECTATOR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml new file mode 100644 index 0000000000..f271bfabf5 --- /dev/null +++ b/addons/spectator/stringtable.xml @@ -0,0 +1,80 @@ + + + + + Spectator + Obserwator + Pozorovatel + + + Enable Spectator + Aktywuj obserwatora + Povolit pozorovatele + + + Begin spectating on player death? + Włącz obserwatora po śmierci gracza? + Přepnout do pozorovatele po hráčově smrti? + + + Player Side Only + Tylko strona gracza + Pouze strana hráče + + + Only spectate units belonging to player's side? + Pozwól obserwować jednostki będące tylko po stronie gracza? + Pozorovat pouze jednotky patřící k hráčově straně? + + + Spectate AI + Obserwacja AI + Pozorovat AI + + + Allow spectating of AI units? + Pozwól obserwować jednostki AI? + Umožnit pozorovat AI jednotky? + + + Track Units + Śledź jednostki + Sledovat jednotky + + + Track units' movements throughout mission? + Śledź ruch jednostek w trakcie misji? + Sledovat pohyby jednotek napříč misí? + + + Start Position + Pozycja startowa + Počáteční pozice + + + Use this module as a starting position for spectator camera? + Użyj pozycji modułu jako pozycje startową dla kamery obserwatora? + Použít tento modul jako počáteční pozici pro pozorovací kameru? + + + End Mission + Zakończ misję + Konec mise + + + End mission when all players dead (default BIS behaviour)? + Zakończ misję kiedy wszyscy gracze będą martwi (domyślne zachowanie BIS)? + Ukončit misi když umřou všichni hráči (výchozí BIS chování)? + + + View Distance + Zasięg widzenia + Dohlednost + + + OK + OK + OK + + + \ No newline at end of file diff --git a/addons/spottingscope/$PBOPREFIX$ b/addons/spottingscope/$PBOPREFIX$ new file mode 100644 index 0000000000..abab69909d --- /dev/null +++ b/addons/spottingscope/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\spottingscope \ No newline at end of file diff --git a/addons/spottingscope/CfgEventHandlers.hpp b/addons/spottingscope/CfgEventHandlers.hpp new file mode 100644 index 0000000000..81b3aef30e --- /dev/null +++ b/addons/spottingscope/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + +class Extended_Init_EventHandlers { + class ACE_SpottingScopeObject { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; +}; diff --git a/addons/spottingscope/CfgVehicles.hpp b/addons/spottingscope/CfgVehicles.hpp new file mode 100644 index 0000000000..d42946214b --- /dev/null +++ b/addons/spottingscope/CfgVehicles.hpp @@ -0,0 +1,132 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(place) { + displayName = CSTRING(Placedown); + condition = QUOTE([ARR_2(_player,'ACE_SpottingScope')] call EFUNC(common,hasItem)); + statement = QUOTE([ARR_2(_player,'ACE_SpottingScope')] call FUNC(place)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_spottingscope_ca.paa); + }; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_SpottingScope: Item_Base_F { + author[] = {"Rocko", "Scubaman3D"}; + scope = 2; + scopeCurator = 2; + displayName = CSTRING(DisplayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_SpottingScope { + name = "ACE_SpottingScope"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Item_SpottingScope,2); + }; + }; + + class LandVehicle; + class StaticWeapon: LandVehicle { + class Turrets; + class ACE_Actions { + class ACE_MainActions {}; + }; + }; + class StaticATWeapon: StaticWeapon { + class Turrets: Turrets { + class MainTurret; + }; + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions {}; + }; + }; + class ACE_SpottingScopeObject: StaticATWeapon { + XEH_ENABLED; + scope = 1; + side = 1; + typicalCargo[] = {"Soldier"}; + displayName = CSTRING(DisplayName); + model = PATHTOF(data\spottingscope.p3d); + mapSize = 0.5; + transportSoldier = 0; + getInAction = "GetInLow"; + getOutAction = "GetOutLow"; + class Turrets: Turrets { + class MainTurret: MainTurret { + minTurn = -45; + maxTurn = 45; + initTurn = 0; + minElev = -10; + maxElev = 40; + initElev = 0; + + weapons[] = {}; + magazines[] = {}; + gunnerOpticsColor[] = {1,1,1,1}; + gunnerOpticsmodel = PATHTOF(data\m144_optic.p3d); + gunnerOpticsEffect[] = {"OpticsCHAbera1","OpticsBlur2"}; + gunnerOutOpticsShowCursor = 0; + gunnerOpticsShowCursor = 0; + gunnerAction = "gunner_static_low01"; + gunnerGetInAction = "GetInLow"; + gunnerGetOutAction = "GetOutLow"; + gunnerForceOptics = 0; + ejectDeadGunner = 0; + class ViewGunner { + initAngleX = 5; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.7; + minFov = 0.7; + maxFov = 0.7; + }; + class ViewOptics { + initAngleX = 0; + minAngleX = -30; + maxAngleX = 30; + initAngleY = 0; + minAngleY = -100; + maxAngleY = 100; + initFov = 0.014812; + minFov = 0.014812; + maxFov = 0.014812; + }; + }; + }; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,1,0}; + EGVAR(dragging,dragDirection) = 0; + class ACE_Actions: ACE_Actions{ + class ACE_MainActions: ACE_MainActions { + selection = "osaveze"; + class ACE_Pickup { + selection = ""; + displayName = CSTRING(PickUp); + distance = 5; + condition = QUOTE((alive _target) && (count (crew _target) == 0)); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\w_spottingscope_ca.paa); + }; + }; + }; + }; +}; diff --git a/addons/spottingscope/CfgWeapons.hpp b/addons/spottingscope/CfgWeapons.hpp new file mode 100644 index 0000000000..4ba078c057 --- /dev/null +++ b/addons/spottingscope/CfgWeapons.hpp @@ -0,0 +1,17 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_SpottingScope: ACE_ItemCore { + scope = 2; + displayName = CSTRING(DisplayName); + descriptionShort = ""; + picture = PATHTOF(UI\w_spottingscope_ca.paa); + model = PATHTOF(data\w_spottingscope.p3d); + + class ItemInfo: InventoryItem_Base_F { + mass = 40; + }; + }; +}; diff --git a/addons/spottingscope/README.md b/addons/spottingscope/README.md new file mode 100644 index 0000000000..ea9f2b819d --- /dev/null +++ b/addons/spottingscope/README.md @@ -0,0 +1,10 @@ +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 diff --git a/addons/spottingscope/UI/w_spottingscope_ca.paa b/addons/spottingscope/UI/w_spottingscope_ca.paa new file mode 100644 index 0000000000..b6edc66697 Binary files /dev/null and b/addons/spottingscope/UI/w_spottingscope_ca.paa differ diff --git a/addons/spottingscope/XEH_postInit.sqf b/addons/spottingscope/XEH_postInit.sqf new file mode 100644 index 0000000000..421c54b49f --- /dev/null +++ b/addons/spottingscope/XEH_postInit.sqf @@ -0,0 +1 @@ +#include "script_component.hpp" diff --git a/addons/spottingscope/XEH_preInit.sqf b/addons/spottingscope/XEH_preInit.sqf new file mode 100644 index 0000000000..306884e595 --- /dev/null +++ b/addons/spottingscope/XEH_preInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(pickup); +PREP(place); + +ADDON = true; diff --git a/addons/spottingscope/config.cpp b/addons/spottingscope/config.cpp new file mode 100644 index 0000000000..a615e5da79 --- /dev/null +++ b/addons/spottingscope/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_SpottingScope"}; + weapons[] = {"ACE_SpottingScope"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_apl", "ace_interaction"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" \ No newline at end of file diff --git a/addons/spottingscope/data/PSO_ring.paa b/addons/spottingscope/data/PSO_ring.paa new file mode 100644 index 0000000000..e1502aa5e2 Binary files /dev/null and b/addons/spottingscope/data/PSO_ring.paa differ diff --git a/addons/spottingscope/data/ace_reticle.rvmat b/addons/spottingscope/data/ace_reticle.rvmat new file mode 100644 index 0000000000..0d1df7e696 --- /dev/null +++ b/addons/spottingscope/data/ace_reticle.rvmat @@ -0,0 +1,9 @@ +ambient[] = {0, 0, 0, 1}; +diffuse[] = {0, 0, 0, 1}; +forcedDiffuse[] = {0, 0, 0, 0}; +emmisive[] = {1, 1, 1, 1}; +specular[] = {0, 0, 0, 1}; +specularPower = 0; +renderFlags[] = {"NoZWrite"}; +PixelShaderID = "Normal"; +VertexShaderID = "Basic"; diff --git a/addons/spottingscope/data/ace_ssvzs.p3d b/addons/spottingscope/data/ace_ssvzs.p3d new file mode 100644 index 0000000000..a4d58c13f4 Binary files /dev/null and b/addons/spottingscope/data/ace_ssvzs.p3d differ diff --git a/addons/spottingscope/data/m144_ca.paa b/addons/spottingscope/data/m144_ca.paa new file mode 100644 index 0000000000..4d7a63ba0a Binary files /dev/null and b/addons/spottingscope/data/m144_ca.paa differ diff --git a/addons/spottingscope/data/m144_optic.p3d b/addons/spottingscope/data/m144_optic.p3d new file mode 100644 index 0000000000..15ad16fe92 Binary files /dev/null and b/addons/spottingscope/data/m144_optic.p3d differ diff --git a/addons/spottingscope/data/model.cfg b/addons/spottingscope/data/model.cfg new file mode 100644 index 0000000000..e7beb2f2c1 --- /dev/null +++ b/addons/spottingscope/data/model.cfg @@ -0,0 +1,49 @@ +class CfgSkeletons +{ + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ace_spottingscope_skeleton: Default { + isDiscrete = 1; + skeletonInherit = "Default"; + skeletonBones[] = { + "otocvez","", + "otochlaven","otocvez" + }; + }; +}; +class CfgModels { + class Default { + sectionsInherit = ""; + sections[] = {}; + skeletonName = ""; + }; + class spottingscope: Default { + skeletonName = "ace_spottingscope_skeleton"; + sectionsInherit = "Default"; + class animations { + class mainTurret { + type = "rotationY"; + source = "mainTurret"; + selection = "otocvez"; + axis = "osaveze"; + minValue = "rad -360"; + maxValue = "rad +360"; + angle0 = "rad -360"; + angle1 = "rad +360"; + }; + class mainGun { + type = "rotationX"; + source = "mainGun"; + selection = "otochlaven"; + axis = "osahlavne"; + minValue = "rad -360"; + maxValue = "rad +360"; + angle0 = "rad -360"; + angle1 = "rad +360"; + }; + }; + }; +}; diff --git a/addons/spottingscope/data/optic_ssvzs.p3d b/addons/spottingscope/data/optic_ssvzs.p3d new file mode 100644 index 0000000000..ffb5834768 Binary files /dev/null and b/addons/spottingscope/data/optic_ssvzs.p3d differ diff --git a/addons/spottingscope/data/scopering.paa b/addons/spottingscope/data/scopering.paa new file mode 100644 index 0000000000..ecf236b025 Binary files /dev/null and b/addons/spottingscope/data/scopering.paa differ diff --git a/addons/spottingscope/data/sniper_peri.rvmat b/addons/spottingscope/data/sniper_peri.rvmat new file mode 100644 index 0000000000..35069be267 --- /dev/null +++ b/addons/spottingscope/data/sniper_peri.rvmat @@ -0,0 +1,78 @@ +ambient[] = {1.0, 1.0, 1.0, 1.0}; +diffuse[] = {1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; +emmisive[] = {0.0, 0.0, 0.0, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\sniper_peri_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 = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage3 { + texture = "#(argb,8,8,3)color(0,0,0,0)"; + 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(0,1,1,1)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage5 { + texture = "z\ace\addons\spottingscope\data\sniper_peri_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,32,128,1)fresnel(1.58,0.01)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage7 { + texture = "a3\data_f\env_land_co.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; diff --git a/addons/spottingscope/data/sniper_peri_co.paa b/addons/spottingscope/data/sniper_peri_co.paa new file mode 100644 index 0000000000..6466dc6d82 Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_co.paa differ diff --git a/addons/spottingscope/data/sniper_peri_nohq.paa b/addons/spottingscope/data/sniper_peri_nohq.paa new file mode 100644 index 0000000000..cc84eab64d Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_nohq.paa differ diff --git a/addons/spottingscope/data/sniper_peri_smdi.paa b/addons/spottingscope/data/sniper_peri_smdi.paa new file mode 100644 index 0000000000..4cb94ce7d1 Binary files /dev/null and b/addons/spottingscope/data/sniper_peri_smdi.paa differ diff --git a/addons/spottingscope/data/spot_scope.rvmat b/addons/spottingscope/data/spot_scope.rvmat new file mode 100644 index 0000000000..294d3a75b2 --- /dev/null +++ b/addons/spottingscope/data/spot_scope.rvmat @@ -0,0 +1,78 @@ +ambient[] = {1.0, 1.0, 1.0, 1.0}; +diffuse[] = {1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; +emmisive[] = {0.0, 0.0, 0.0, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\spot_scope_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 = "z\ace\addons\apl\data\plastic_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage3 { + texture = "#(argb,8,8,3)color(0,0,0,0)"; + 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(0,1,1,1)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage5 { + texture = "z\ace\addons\spottingscope\data\spot_scope_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,32,128,1)fresnel(1.58,0.01)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage7 { + texture = "a3\data_f\env_land_co.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; diff --git a/addons/spottingscope/data/spot_scope_co.paa b/addons/spottingscope/data/spot_scope_co.paa new file mode 100644 index 0000000000..c0168053a3 Binary files /dev/null and b/addons/spottingscope/data/spot_scope_co.paa differ diff --git a/addons/spottingscope/data/spot_scope_nohq.paa b/addons/spottingscope/data/spot_scope_nohq.paa new file mode 100644 index 0000000000..674ad1d0ec Binary files /dev/null and b/addons/spottingscope/data/spot_scope_nohq.paa differ diff --git a/addons/spottingscope/data/spot_scope_smdi.paa b/addons/spottingscope/data/spot_scope_smdi.paa new file mode 100644 index 0000000000..b6e2d763fe Binary files /dev/null and b/addons/spottingscope/data/spot_scope_smdi.paa differ diff --git a/addons/spottingscope/data/spot_scope_tripod.rvmat b/addons/spottingscope/data/spot_scope_tripod.rvmat new file mode 100644 index 0000000000..0403471e5a --- /dev/null +++ b/addons/spottingscope/data/spot_scope_tripod.rvmat @@ -0,0 +1,79 @@ +ambient[] = {1.0, 1.0, 1.0, 1.0}; +diffuse[] = {1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; +emmisive[] = {0.0, 0.0, 0.0, 1.0}; +specular[] = {0.0, 0.0, 0.0, 0.0}; +specularPower = 0.0; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 { + texture = "z\ace\addons\spottingscope\data\spot_scope_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 = "z\ace\addons\apl\data\metal4_weapons_vehicles_int_512_dt.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {6.0, 0.0, 0.0}; + up[] = {0.0, 6.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage3 { + texture = "#(argb,8,8,3)color(0,0,0,0)"; + 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(0,1,1,1)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage5 { + texture = "z\ace\addons\spottingscope\data\spot_scope_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,32,128,1)fresnel(1.58,0.01)"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; + +class Stage7 { + texture = "a3\data_f\env_land_co.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; diff --git a/addons/spottingscope/data/spottingscope.p3d b/addons/spottingscope/data/spottingscope.p3d new file mode 100644 index 0000000000..c4e0363dcf Binary files /dev/null and b/addons/spottingscope/data/spottingscope.p3d differ diff --git a/addons/spottingscope/data/w_spottingscope.p3d b/addons/spottingscope/data/w_spottingscope.p3d new file mode 100644 index 0000000000..040ef5158e Binary files /dev/null and b/addons/spottingscope/data/w_spottingscope.p3d differ diff --git a/addons/spottingscope/functions/fnc_pickup.sqf b/addons/spottingscope/functions/fnc_pickup.sqf new file mode 100644 index 0000000000..3730068092 --- /dev/null +++ b/addons/spottingscope/functions/fnc_pickup.sqf @@ -0,0 +1,30 @@ +/* + * Author: Rocko, Ruthberg + * + * Pick up spotting scope + * + * Arguments: + * 0: spotting scope + * 1: unit + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_spottingScope,_unit); + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_2(_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 new file mode 100644 index 0000000000..4967151748 --- /dev/null +++ b/addons/spottingscope/functions/fnc_place.sqf @@ -0,0 +1,41 @@ +/* + * Author: Rocko, Ruthberg + * + * Place down spotting scope + * + * Arguments: + * 0: unit + * 1: scope class + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_scopeClass); + +_unit removeItem _scopeClass; + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_1(_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)); + }; + _unit reveal _spottingScope; + +}, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/spottingscope/functions/script_component.hpp b/addons/spottingscope/functions/script_component.hpp new file mode 100644 index 0000000000..504cde2ca6 --- /dev/null +++ b/addons/spottingscope/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\spottingscope\script_component.hpp" \ No newline at end of file diff --git a/addons/spottingscope/script_component.hpp b/addons/spottingscope/script_component.hpp new file mode 100644 index 0000000000..11bd94a6e5 --- /dev/null +++ b/addons/spottingscope/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT spottingscope +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SPOTTINGSCOPE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SPOTTINGSCOPE + #define DEBUG_SETTINGS DEBUG_SETTINGS_SPOTTINGSCOPE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/spottingscope/stringtable.xml b/addons/spottingscope/stringtable.xml new file mode 100644 index 0000000000..8c5425dc2b --- /dev/null +++ b/addons/spottingscope/stringtable.xml @@ -0,0 +1,41 @@ + + + + + Spotting Scope + Teleskop + Зрительная труба + Teleskop + Spotting Scope + Téléscope de visée + Zaměřovací Dalekohled + Spotting Scope + Megfigyelő távcső + Luneta de observador + + + Pick up Spotting Scope + Teleskop aufnehmen + Поднять зрительная трубу + Zabierz teleskop + Pick up Spotting Scope + Prendre téléscope de visée + Zvednout Zaměřovací dalekohled + Raccogli spottingscope + Mefgigy. távcső felvétele + Pegar luneta de observador + + + Place Spotting Scope + Teleskop aufstellen + Установить зрительная трубу + Ustaw teleskop + Place Spotting Scope + Placer téléscope de visée + Položit Zaměřovací dalekohled + Posiziona spottingscope + Megfigy. távcső elhelyezése + Colocar luneta de observador + + + \ No newline at end of file diff --git a/addons/switchunits/ACE_Settings.hpp b/addons/switchunits/ACE_Settings.hpp new file mode 100644 index 0000000000..06c1ff274c --- /dev/null +++ b/addons/switchunits/ACE_Settings.hpp @@ -0,0 +1,30 @@ +class ACE_Settings { + class GVAR(EnableSwitchUnits) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToWest) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToEast) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToIndependent) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(SwitchToCivilian) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(EnableSafeZone) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(SafeZoneRadius) { + value = 100; + typeName = "SCALAR"; + }; +}; diff --git a/addons/switchunits/CfgEventHandlers.hpp b/addons/switchunits/CfgEventHandlers.hpp index 689e06c529..44b6e8e6ff 100644 --- a/addons/switchunits/CfgEventHandlers.hpp +++ b/addons/switchunits/CfgEventHandlers.hpp @@ -1,12 +1,11 @@ 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 { - clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); }; }; - diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp index 429970b1a0..7951a6cd59 100644 --- a/addons/switchunits/CfgVehicles.hpp +++ b/addons/switchunits/CfgVehicles.hpp @@ -1,65 +1,53 @@ class CfgVehicles { - class Module_F; - class ACE_ModuleSwitchUnits: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module; + class ACE_ModuleSwitchUnits: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "SwitchUnits System"; + displayName = CSTRING(Module_DisplayName); function = FUNC(module); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_SwitchUnits_ca.paa)); class Arguments { class SwitchToWest { - displayName = "Switch to West?"; - description = "Allow switching to west units?"; + displayName = CSTRING(SwitchToWest_DisplayName); + description = CSTRING(SwitchToWest_Description); typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToEast { - displayName = "Switch to East?"; - description = "Allow switching to east units?"; + displayName = CSTRING(SwitchToEast_DisplayName); + description = CSTRING(SwitchToEast_Description); typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToIndependent { - displayName = "Switch to Independent?"; - description = "Allow switching to independent units?"; + displayName = CSTRING(SwitchToIndependent_DisplayName); + description = CSTRING(SwitchToIndependent_Description); typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToCivilian { - displayName = "Switch to Civilian?"; - description = "Allow switching to civilian units?"; + displayName = CSTRING(SwitchToCivilian_DisplayName); + description = CSTRING(SwitchToCivilian_Description); typeName = "BOOL"; - class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; - }; + defaultValue = 0; }; class EnableSafeZone { - displayName = "Enable Safe Zone?"; - description = "Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone."; + displayName = CSTRING(EnableSafeZone_DisplayName); + description = CSTRING(EnableSafeZone_Description); typeName = "BOOL"; - class values { - class Yes {default = 1; name = "Yes"; value = 1;}; - class No {name = "No"; value = 0;}; - }; + defaultValue = 1; }; class SafeZoneRadius { - displayName = "Safe Zone Radius"; - description = "The safe zone around players from a different team. Default: 200"; + displayName = CSTRING(SafeZoneRadius_DisplayName); + description = CSTRING(SafeZoneRadius_Description); typeName = "NUMBER"; defaultValue = 100; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; }; diff --git a/addons/switchunits/XEH_clientInit.sqf b/addons/switchunits/XEH_postInit.sqf similarity index 91% rename from addons/switchunits/XEH_clientInit.sqf rename to addons/switchunits/XEH_postInit.sqf index 6a908071c9..5928804d7b 100644 --- a/addons/switchunits/XEH_clientInit.sqf +++ b/addons/switchunits/XEH_postInit.sqf @@ -16,6 +16,7 @@ #include "script_component.hpp" + if (missionNamespace getVariable [QGVAR(EnableSwitchUnits), false]) then { [player] call FUNC(startSwitchUnits); } else { @@ -24,5 +25,5 @@ if (missionNamespace getVariable [QGVAR(EnableSwitchUnits), false]) then { if ((_name == QGVAR(EnableSwitchUnits)) && {_value}) then { [player] call FUNC(startSwitchUnits); }; - }] call EFUNC(common,addEventhandler); + }] call EFUNC(common,addEventhandler); }; diff --git a/addons/switchunits/config.cpp b/addons/switchunits/config.cpp index cda974d17e..3b1d11f460 100644 --- a/addons/switchunits/config.cpp +++ b/addons/switchunits/config.cpp @@ -14,34 +14,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" - -class ACE_Settings { - class GVAR(EnableSwitchUnits) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToWest) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToEast) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToIndependent) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(SwitchToCivilian) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(EnableSafeZone) { - value = 1; - typeName = "BOOL"; - }; - class GVAR(SafeZoneRadius) { - value = 100; - typeName = "SCALAR"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index bfe36f13ea..e8efa2640f 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -28,14 +28,9 @@ _sideNearest = []; if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then { _sideNearest pushBack _x; }; -} forEach (nearestObjects [_pos, ["Man"], 20]); - +} forEach (nearestObjects [_pos, ["Man"], 15]); if (count _sideNearest > 0) then { - private ["_switchUnit"]; - - _switchUnit = _sideNearest select 0; - [ACE_player, _switchUnit] call FUNC(switchUnit); - + [_sideNearest select 0] call FUNC(switchUnit); openMap false; }; diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index c2857f1091..67669c071c 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -17,8 +17,6 @@ #include "script_component.hpp" -private ["_playerUnit", "_sides"]; - PARAMS_2(_playerUnit,_sides); if (vehicle _playerUnit == _playerUnit) then { diff --git a/addons/switchunits/functions/fnc_startSwitchUnits.sqf b/addons/switchunits/functions/fnc_startSwitchUnits.sqf index ef344475b9..7985bfa094 100644 --- a/addons/switchunits/functions/fnc_startSwitchUnits.sqf +++ b/addons/switchunits/functions/fnc_startSwitchUnits.sqf @@ -16,13 +16,10 @@ #include "script_component.hpp" - -private "_player"; -_player = _this select 0; - +PARAMS_1(_player); if (GVAR(EnableSwitchUnits)) then { - private ["_sides"]; + private "_sides"; _sides = []; if(GVAR(SwitchToWest)) then {_sides pushBack west;}; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index b1879b0999..1fbe8b9b28 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -32,16 +32,16 @@ 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 if (_leave) exitWith { - [localize "STR_ACE_SwitchUnits_TooCloseToEnemy"] call EFUNC(common,displayTextStructured); + [localize LSTRING(TooCloseToEnemy)] call EFUNC(common,displayTextStructured); }; // should switch locality @@ -56,14 +56,14 @@ DFUNC(pfhSwitchUnit) = { private ["_args", "_unit", "_oldUnit", "_respawnEhId", "_oldOwner"]; _args = _this select 0; - + _unit = _args select 0; _oldUnit = _args select 1; - - - + + + if (local _unit) exitWith { - + _oldUnit setVariable [QGVAR(IsPlayerControlled), false, true]; _oldUnit setVariable [QGVAR(PlayerControlledName), "", true]; @@ -88,10 +88,10 @@ DFUNC(pfhSwitchUnit) = { [[_oldUnit, _oldOwner], QUOTE({(_this select 0) setOwner (_this select 1)}), 1] call EFUNC(common,execRemoteFnc); }; - [localize "STR_ACE_SwitchUnits_SwitchedUnit"] call EFUNC(common,displayTextStructured); - + [localize LSTRING(SwitchedUnit)] call EFUNC(common,displayTextStructured); + [(_this select 1)] call cba_fnc_removePerFrameHandler; - + }; }; diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 8121e3e61e..2d0bc91314 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -23,7 +23,117 @@ Cette unité est trop proche des ennemis Ez az egység túl közel van az ellenséghez. Questa unità è troppo vicina al nemico. - Essa unidade está muito perta do inimigo. + Essa unidade está muito perto do inimigo. + + + SwitchUnits System + System zmiany stron + Sistema de cambio de unidad + Einheiten-Switch-System? + Systém výměny stran + Sistema de troca de unidades + + + Switch to West? + Zmiana na Zachód? + ¿Cambiar a Oeste? + Nach BLUFOR wechseln? + Přesunout k BLUFOR? + Trocar para Oeste? + + + Allow switching to west units? + Pozwolić zmieniać graczom stronę na Zachód? + ¿Permitir cambios a unidades del Oeste? + Erlaube das Wechseln zu BLUFOR-Einheiten? + Povolit přesun k BLUFOR? + Permitir troca de unidades para o Oeste? + + + Switch to East? + Zmiana na Wschód? + ¿Cambiar a Este? + Nach OPFOR wechseln? + Přesunout k OPFOR? + Trocar para Leste? + + + Allow switching to east units? + Pozwolić zmieniać graczom stronę na Wschód? + ¿Permitir cambios a unidades del Este? + Erlaube das Wechseln zu OPFOR-Einheiten? + Povolit přesun k OPFOR? + Permitir troca de unidades para o Leste? + + + Switch to Independent? + Zmiana na Ruch Oporu? + ¿Cambiar a Independiente? + Nach INDFOR wechseln? + Přesunout k INDFOR? + Trocar para Indenpendente + + + Allow switching to independent units? + Pozwolić zmieniać stronę na Ruch Oporu? + ¿Permitir cambios a unidades Independientes? + Erlaube das Wechseln zu INDFOR-Einheiten? + Povolit přesun k INDFOR? + Permitir troca de unidades para o Indenpendente? + + + Switch to Civilian? + Zmiana na Cywili? + ¿Cambiar a Civil? + Nach CIVILIAN wechseln? + Přesunout k CIVILISTŮM? + Trocar para Civis? + + + Allow switching to civilian units? + Pozwolić zmieniać stronę na Cywili? + ¿Permitir cambios a unidades Civiles + Erlaube das Wechseln zu CIVILIAN-Einheiten? + Povolit přesun k CIVILISTŮM? + Permitir troca de unidades para o Civil? + + + Enable Safe Zone? + Aktywuj bezp. strefę? + ¿Habilitar zona segura? + Aktiviere Sicherheitszone? + Povolit bezpečné oblasti? + Habilitar zona segura? + + + Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. + Aktywuje bezpieczną strefę wokół jednostek przeciwnika. Gracze nie mogą zmieniać strony wewnątrz tej strefy. + Habilita una zona segura alrededor de las unidades enemigas. Los jugadores no pueden cambiar de unidad dentro de la zona segura. + Aktiviere eine Sicherheitszone um feindliche Einheiten? Spieler können nicht zu Einheiten in der Sicherheitszone wechseln. + Povolit bezpečnou zónu kolem nepřátelských jednotek? Hráči se nemohou změnit strany/jednotky uvnitř bezpečné zóny. + Habilitar uma zona segur ao redor das unidades inimigas? Jogadores não conseguirão trocar para unidades dentro dessa zona segura. + + + Safe Zone Radius + Promień bezp. strefy + Radio de la zona segura + Sicherheitszonenradius + Oblast bezpečné zóny + Raio da zona segura + + + The safe zone around players from a different team. Default: 200 + Promień bezpiecznej strefy wokół graczy z innych drużyn. Domyślnie: 200 + La zona segura alrededor de los jugadores de distintos equipos. Por defecto: 200 + Die Sicherheitszone um Spieler von einem anderen Team. Standard: 200 + Bezpečná zóna kolem hráče z jiných týmu. Výchozí: 200 + A zona segura ao redor dos jogadores de diferentes equipes. Padrão: 200 + + + + Moduł ten pozwala na zmianę strony w trakcie gry. + Tento modul umožňuje přepínání mazi dostupnými stranami. + Este módulo permite mudar o lado à disposição dos jogadores. - + \ No newline at end of file diff --git a/addons/tacticalladder/$PBOPREFIX$ b/addons/tacticalladder/$PBOPREFIX$ new file mode 100644 index 0000000000..7d7735bb9e --- /dev/null +++ b/addons/tacticalladder/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\tacticalladder \ No newline at end of file diff --git a/addons/tacticalladder/CfgEventHandlers.hpp b/addons/tacticalladder/CfgEventHandlers.hpp new file mode 100644 index 0000000000..737cae5e43 --- /dev/null +++ b/addons/tacticalladder/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/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp new file mode 100644 index 0000000000..d180ccae40 --- /dev/null +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -0,0 +1,96 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_TacticalLadders { + displayName = CSTRING(Deploy); + condition = QUOTE((backpack ACE_player) == QUOTE(QUOTE(ACE_TacticalLadder_Pack))); + statement = QUOTE(call FUNC(deployTL)); + exceptions[] = {}; + showDisabled = 1; + priority = 4; + }; + }; + }; + + class Bag_Base; + class ACE_TacticalLadder_Pack: Bag_Base { + scope = 2; + displayName = CSTRING(DisplayName); + descriptionShort = ""; + model = PATHTOF(data\ace_tacticalladder_pack.p3d); + picture = PATHTOF(UI\ace_tactical_ladder_pack_ca.paa); + maximumLoad = 0; + mass = 50; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportBackpacks { + class _xx_ACE_TacticalLadder_Pack { + backpack = "ACE_TacticalLadder_Pack"; + count = 3; + }; + }; + }; + + class House; + class ACE_Tactical_Ladder: House { + XEH_ENABLED; + displayName = CSTRING(DisplayName); + class DestructionEffects {}; + model = PATHTOF(data\ace_tacticalladder.p3d); + animated = 1; + autocenter = 0; + featureSize = 12; + ladders[] = {{"start","end"}}; + class AnimationSources { + class rotate { + source = "user"; + animPeriod = 1e-007; + }; + class extract_1 { + source = "user"; + animPeriod = 1e-007; + }; + class extract_2: extract_1 {}; + class extract_3: extract_1 {}; + class extract_4: extract_1 {}; + class extract_5: extract_1 {}; + class extract_6: extract_1 {}; + class extract_7: extract_1 {}; + class extract_8: extract_1 {}; + class extract_9: extract_1 {}; + class extract_10: extract_1 {}; + class extract_11: extract_1 {}; + }; + class ACE_Actions { + class ACE_MainActions { + selection = "roadway"; + distance = 5; + condition = "true"; + class ACE_PickUp { + selection = ""; + displayName = CSTRING(Pickup); + distance = 4; + condition = QUOTE((backpack ACE_player) == ''); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickupTL)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + }; + class ACE_Position { + selection = ""; + displayName = CSTRING(Position); + distance = 4; + condition = "true"; + statement = QUOTE([ARR_2(_target,_player)] call FUNC(positionTL)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + }; + }; + }; + }; +}; diff --git a/addons/tacticalladder/README.md b/addons/tacticalladder/README.md new file mode 100644 index 0000000000..ff6b8ecad3 --- /dev/null +++ b/addons/tacticalladder/README.md @@ -0,0 +1,10 @@ +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 diff --git a/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa b/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa new file mode 100644 index 0000000000..8388a8e605 Binary files /dev/null and b/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa differ diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf new file mode 100644 index 0000000000..f0091ec7fa --- /dev/null +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +GVAR(ladder) = objNull; +GVAR(cancelTime) = 0; +GVAR(currentStep) = 3; +GVAR(currentAngle) = 0; + +// Cancel tactical ladder deployment if the interact menu is opened +["interactMenuOpened", { + if ((ACE_time > GVAR(cancelTime)) && !isNull GVAR(ladder)) then { + GVAR(ladder) call FUNC(cancelTLdeploy); + }; +}] call EFUNC(common,addEventHandler); + +[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); diff --git a/addons/tacticalladder/XEH_preInit.sqf b/addons/tacticalladder/XEH_preInit.sqf new file mode 100644 index 0000000000..e434974c9a --- /dev/null +++ b/addons/tacticalladder/XEH_preInit.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cancelTLdeploy); +PREP(confirmTLdeploy); +PREP(deployTL); +PREP(handleScrollWheel); +PREP(pickupTL); +PREP(positionTL); + +ADDON = true; diff --git a/optionals/compat_hlc_ar15/config.cpp b/addons/tacticalladder/config.cpp similarity index 54% rename from optionals/compat_hlc_ar15/config.cpp rename to addons/tacticalladder/config.cpp index 51e42dc040..02740639fe 100644 --- a/optionals/compat_hlc_ar15/config.cpp +++ b/addons/tacticalladder/config.cpp @@ -5,10 +5,11 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"hlcweapons_ar15"}; - author[]={"Ruthberg"}; + requiredAddons[] = {"ace_apl", "ace_interaction"}; + author[] = {"Rocko", "Ruthberg"}; VERSION_CONFIG; }; }; -#include "CfgWeapons.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/tacticalladder/data/ace_ladder_co.paa b/addons/tacticalladder/data/ace_ladder_co.paa new file mode 100644 index 0000000000..d550108068 Binary files /dev/null and b/addons/tacticalladder/data/ace_ladder_co.paa differ diff --git a/addons/tacticalladder/data/ace_tacticalladder.p3d b/addons/tacticalladder/data/ace_tacticalladder.p3d new file mode 100644 index 0000000000..3126601117 Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder.p3d differ diff --git a/addons/tacticalladder/data/ace_tacticalladder_pack.p3d b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d new file mode 100644 index 0000000000..e7b565ff11 Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d differ diff --git a/addons/tacticalladder/data/model.cfg b/addons/tacticalladder/data/model.cfg new file mode 100644 index 0000000000..1fc8840d4f --- /dev/null +++ b/addons/tacticalladder/data/model.cfg @@ -0,0 +1,283 @@ +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ace_tacticalladder_skeleton: Default { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "base","", + "1","base", + "2","1", + "3","2", + "4","3", + "5","4", + "6","5", + "7","6", + "8","7", + "9","8", + "10","9", + "11","10", + "step","11" + }; + }; + class OFP2_ManSkeleton { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "Pelvis","", + "Spine","Pelvis", + "Spine1","Spine", + "Spine2","Spine1", + "Spine3","Spine2", + "Camera","Pelvis", + "weapon","Spine1", + "launcher","Spine1", + //Head skeleton in hierarchy + "neck","Spine3", + "neck1","neck", + "head","neck1", + "HeadCutScene","head", + "jaw","head", + "chin","head", + "jaw_rf","head", + "jaw_rm","head", + "jaw_rs","head", + "jaw_lf","head", + "jaw_lm","head", + "jaw_ls","head", + "ear_r","head", + "ear_l","head", + "lip_lc","head", + "lip_lwlb","head", + "lip_lwlf","head", + "lip_lwm","head", + "lip_lwrf","head", + "lip_lwrb","head", + "lip_rc","head", + "lip_uprb","head", + "lip_uprf","head", + "lip_upm","head", + "lip_uplf","head", + "lip_uplb","head", + "nose_tip","head", + "nose_r","head", + "nose_l","head", + "zig_lt","head", + "zig_lm","head", + "zig_lb","head", + "zig_rt","head", + "zig_rm","head", + "zig_rb","head", + "cheek_r","head", + "cheek_l","head", + "eyebrow_lb","head", + "eyebrow_lm","head", + "eyebrow_lf","head", + "corr","head", + "eyebrow_rf","head", + "eyebrow_rm","head", + "eyebrow_rb","head", + "eye_upr","head", + "eye_lwr","head", + "eye_upl","head", + "eye_lwl","head", + "cheek_rf","head", + "cheek_rm","head", + "cheek_rb","head", + "cheek_lf","head", + "cheek_lm","head", + "cheek_lb","head", + "forehead_l","head", + "forehead_m","head", + "forehead_r","head", + "l_eye","head", + "r_eye","head", + "l_pupila","head", + "r_pupila","head", + "neck_t","head", + "neck_b","head", + "neck_r","head", + "neck_l","head", + "tongue_b","head", + "tongue_m","head", + "tongue_f","head", + //Left upper side + "LeftShoulder","Spine3", + "LeftArm","LeftShoulder", + "LeftArmRoll","LeftArm", + "LeftForeArm","LeftArmRoll", + "LeftForeArmRoll","LeftForeArm", + "LeftHand","LeftForeArmRoll", + "LeftHandRing","LeftHand", + "LeftHandRing1","LeftHandRing", + "LeftHandRing2","LeftHandRing1", + "LeftHandRing3","LeftHandRing2", + "LeftHandPinky1","LeftHandRing", + "LeftHandPinky2","LeftHandPinky1", + "LeftHandPinky3","LeftHandPinky2", + "LeftHandMiddle1","LeftHand", + "LeftHandMiddle2","LeftHandMiddle1", + "LeftHandMiddle3","LeftHandMiddle2", + "LeftHandIndex1","LeftHand", + "LeftHandIndex2","LeftHandIndex1", + "LeftHandIndex3","LeftHandIndex2", + "LeftHandThumb1","LeftHand", + "LeftHandThumb2","LeftHandThumb1", + "LeftHandThumb3","LeftHandThumb2", + //Right upper side + "RightShoulder","Spine3", + "RightArm","RightShoulder", + "RightArmRoll","RightArm", + "RightForeArm","RightArmRoll", + "RightForeArmRoll","RightForeArm", + "RightHand","RightForeArmRoll", + "RightHandRing","RightHand", + "RightHandRing1","RightHandRing", + "RightHandRing2","RightHandRing1", + "RightHandRing3","RightHandRing2", + "RightHandPinky1","RightHandRing", + "RightHandPinky2","RightHandPinky1", + "RightHandPinky3","RightHandPinky2", + "RightHandMiddle1","RightHand", + "RightHandMiddle2","RightHandMiddle1", + "RightHandMiddle3","RightHandMiddle2", + "RightHandIndex1","RightHand", + "RightHandIndex2","RightHandIndex1", + "RightHandIndex3","RightHandIndex2", + "RightHandThumb1","RightHand", + "RightHandThumb2","RightHandThumb1", + "RightHandThumb3","RightHandThumb2", + //Left lower side + "LeftUpLeg","Pelvis", + "LeftUpLegRoll","LeftUpLeg", + "LeftLeg","LeftUpLegRoll", + "LeftLegRoll","LeftLeg", + "LeftFoot","LeftLegRoll", + "LeftToeBase","LeftFoot", + //Right lower side + "RightUpLeg","Pelvis", + "RightUpLegRoll","RightUpLeg", + "RightLeg","RightUpLegRoll", + "RightLegRoll","RightLeg", + "RightFoot","RightLegRoll", + "RightToeBase","RightFoot" + }; + // location of pivot points (local axes) for hierarchical animation + //pivotsModel="ca\Anims\Characters\Data\Skeleton\SkeletonPivots.p3d"; + pivotsModel=""; + }; +}; + +class CfgModels { + class Default { + sectionsInherit=""; + sections[] = {""}; + skeletonName = ""; + }; + class ace_tacticalladder { + skeletonName = "ace_tacticalladder_skeleton"; + sections[] = { "roadway" }; + sectionsInherit = ""; + class Animations { + class rotate { + type = "rotation"; + source = ""; + sourceAddress = "clamp"; + selection = "base"; + axis = "axis_rotate"; + minValue = 0; + maxValue = 90; + angle0="rad 0"; + angle1="rad +90"; + }; + class extract_1 { + type = "translation"; + source = ""; + selection = "1"; + axis = "axis_1"; + animPeriod = 0; + minValue = 0; + maxValue = 1; + minPhase = 0; + maxPhase = 1; + offset0 = 0; + offset1 = 0.82; + }; + class extract_2: extract_1 { + selection = "2"; + axis = "axis_2"; + }; + class extract_3: extract_1 { + selection = "3"; + axis = "axis_3"; + }; + class extract_4: extract_1 { + selection = "4"; + axis = "axis_4"; + }; + class extract_5: extract_1 { + selection = "5"; + axis = "axis_5"; + }; + class extract_6: extract_1 { + selection = "6"; + axis = "axis_6"; + }; + class extract_7: extract_1 { + selection = "7"; + axis = "axis_7"; + }; + class extract_8: extract_1 { + selection = "8"; + axis = "axis_8"; + }; + class extract_9: extract_1 { + selection = "9"; + axis = "axis_9"; + }; + class extract_10: extract_1 { + selection = "10"; + axis = "axis_10"; + }; + class extract_11: extract_1 { + selection = "11"; + axis = "axis_11"; + }; + }; + }; + class ArmaMan: Default { + htMin=60; + htMax=1800; + afMax=30; + mfMax=0; + mFact=1; + tBody=37; + sections[]= { + "osobnost", + "Head_Injury", + "Body_Injury", + "l_leg_injury", + "l_arm_injury", + "r_arm_injury", + "r_leg_injury", + "injury_body", + "injury_legs", + "injury_hands", + "clan", + "clan_sign", + "Camo", + "CamoB", + "Camo1", + "Camo2", + "personality", + "hl", + "injury_head" + }; + skeletonName="OFP2_ManSkeleton"; + }; + class ace_tacticalladder_pack: ArmaMan { + }; +}; \ No newline at end of file diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf new file mode 100644 index 0000000000..63a97d97e9 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -0,0 +1,32 @@ +/* + * Author: Rocko, Ruthberg + * Cancel tactical ladder deployment + * + * Arguments: + * 0: ladder + * + * Return Value: + * None + * + * Example: + * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy; + * + * Public: No + */ +#include "script_component.hpp" + +#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); + +detach _ladder; +_ladder animate ["rotate", 0]; +{ + _ladder animate [_x, 0]; +} forEach __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); + +GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf new file mode 100644 index 0000000000..93263c6aa0 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -0,0 +1,32 @@ +/* + * Author: Rocko, Ruthberg + * Confirm tactical ladder deployment + * + * Arguments: + * 0: ladder + * + * Return Value: + * Success? + * + * Example: + * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_ladder); + +private ["_pos1", "_pos2"]; +_pos1 = getPosASL GVAR(ladder); +_pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) call EFUNC(common,positionToASL); +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); + +detach _ladder; +GVAR(ladder) = objNull; + +true diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf new file mode 100644 index 0000000000..7ad135ca90 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -0,0 +1,34 @@ +/* + * Author: Rocko, Ruthberg + * Deploy tactical ladder + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_tacticalladder_fnc_deployTL; + * + * Public: No + */ +#include "script_component.hpp" + +if ((backpack ACE_player) != "ACE_TacticalLadder_Pack") exitWith {}; + +private ["_pos", "_offset", "_ladder"]; + +removeBackpack ACE_player; + +_pos = ACE_player modelToWorld [0,0,0]; +_offset = if ((ACE_player call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; +_pos set [0, (_pos select 0) + (sin (direction ACE_player) * _offset)]; +_pos set [1, (_pos select 1) + (cos (direction ACE_player) * _offset)]; +_pos set [2, [ACE_player] call CBA_fnc_realHeight]; + +_ladder = "ACE_Tactical_Ladder" createVehicle _pos; +_ladder setPos _pos; +_ladder setDir (direction ACE_player); + +ACE_player reveal _ladder; diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..d08cb6e208 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,48 @@ +/* + * Author: Rocko, Ruthberg + * Handles lengthening and tilting of the ladder + * + * Arguments: + * Amount scrolled + * + * Return Value: + * Handled + * + * Example: + * 1 call ace_tacticalladder_fnc_handleScrollWheel; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_scroll); + +if (isNull GVAR(ladder)) exitWith { false }; + +if (GETMVAR(ACE_Modifier,0) == 0) then { + private ["_currentStep"]; + // Lengthening + if (_scroll > 0) then { + _currentStep = GVAR(currentStep); + if (_currentStep == 11) exitWith {}; + _currentStep = _currentStep + 1; + if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 0) then { + GVAR(ladder) animate [format["extract_%1", _currentStep], 1]; + GVAR(currentStep) = _currentStep; + }; + }; + if (_scroll < 0) then { + _currentStep = GVAR(currentStep); + if (_currentStep == 3) exitWith {}; + if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { + GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; + GVAR(currentStep) = _currentStep - 1; + }; + }; +} else { + // Tilting + GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 90; + GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; +}; + +true \ No newline at end of file diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf new file mode 100644 index 0000000000..c603f1feca --- /dev/null +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -0,0 +1,26 @@ +/* + * Author: Rocko, Ruthberg + * Pick up tactical ladder + * + * Arguments: + * 0: ladder + * 1: unit + * + * Return Value: + * Success? + * + * Example: + * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL; + * + * Public: No + */ +#include "script_component.hpp" + +if ((backpack ACE_player) != "") exitWith { false }; + +PARAMS_2(_ladder,_unit); + +deleteVehicle _ladder; +_unit addBackpack "ACE_TacticalLadder_Pack"; + +true diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf new file mode 100644 index 0000000000..103792c851 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -0,0 +1,52 @@ +/* + * Author: Rocko, Ruthberg + * Position tactical ladder + * + * Arguments: + * 0: sandbag + * 1: unit + * + * Return Value: + * None + * + * Example: + * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL; + * + * Public: No + */ +#include "script_component.hpp" + +#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); + +{ + _ladder animate [_x, 0]; +} forEach __ANIMS; + +_unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; +_ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player + +_ladder animate ["rotate", 0]; +{ + _ladder animate [_x, 1]; +} forEach ["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 +GVAR(currentStep) = 3; +GVAR(currentAngle) = 0; + +[localize LSTRING(Deploy), localize LSTRING(Drop), localize LSTRING(Adjust)] call EFUNC(interaction,showMouseHint); + +ACE_player setVariable [QGVAR(Deploy), + [ACE_player, "DefaultAction", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(confirmTLdeploy);} +] call EFUNC(common,AddActionEventHandler)]; + +ACE_player setVariable [QGVAR(Cancel), + [ACE_player, "zoomtemp", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(cancelTLdeploy);} +] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/tacticalladder/functions/script_component.hpp b/addons/tacticalladder/functions/script_component.hpp new file mode 100644 index 0000000000..53bdb8be62 --- /dev/null +++ b/addons/tacticalladder/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\tacticalladder\script_component.hpp" \ No newline at end of file diff --git a/addons/tacticalladder/script_component.hpp b/addons/tacticalladder/script_component.hpp new file mode 100644 index 0000000000..9905216ae7 --- /dev/null +++ b/addons/tacticalladder/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT tacticalladder +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_TACTICALLADDER + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_TACTICALLADDER + #define DEBUG_SETTINGS DEBUG_SETTINGS_TACTICALLADDER +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml new file mode 100644 index 0000000000..4342ac5408 --- /dev/null +++ b/addons/tacticalladder/stringtable.xml @@ -0,0 +1,73 @@ + + + + + Telescopic Ladder + Teleskopleiter + Телескопическая лестница + Drabina teleskopowa + Escalera telescópica + Telescopic Ladder + Teleskopický žebřík + Telescopic Ladder + Telescopic Ladder + Escada telescópica + + + Deploy ladder + Leiter aufbauen + Установить лестницу + Rozłóż drabinę + Despelgar escalera + Deploy ladder + Rozložit žebřík + Deploy ladder + Deploy ladder + Implantar escada + + + Drop ladder + Leiter ablegen + Положить лестницу + Zostaw drabinę + Soltar escalera + Drop ladder + Položit žebřík + Drop ladder + Drop ladder + Derrubar escada + + + Adjust ladder + Leiter einstellen + Reguluj drabinę + Upravit žebřík + Ajustar escalera + Ajustar escada + + + Position ladder + Leiter positionieren + Перенести лестницу + Postaw drabinę + Colocar escalera + Position ladder + Umístit žebřík + Position ladder + Position ladder + Posicionar escada + + + Pickup ladder + Leiter aufnehmen + Взять лестницу + Zabierz drabinę + Recoger escalera + Pickup ladder + Vzít žebřík + Pickup ladder + Pickup ladder + Pegar escada + + + \ No newline at end of file diff --git a/addons/testmissions/$PBOPREFIX$ b/addons/testmissions/$PBOPREFIX$ index 30f861b8ff..c899a56127 100644 --- a/addons/testmissions/$PBOPREFIX$ +++ b/addons/testmissions/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\Addons\testmissions \ No newline at end of file +z\ace\addons\testmissions \ No newline at end of file diff --git a/addons/testmissions/script_component.hpp b/addons/testmissions/script_component.hpp index da17bfb7e2..d1674fb35c 100644 --- a/addons/testmissions/script_component.hpp +++ b/addons/testmissions/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT testmissions -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_TESTMISSIONS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_ENABLED_TESTMISSIONS #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/thermals/config.cpp b/addons/thermals/config.cpp index 252a440535..07d19d1b50 100644 --- a/addons/thermals/config.cpp +++ b/addons/thermals/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {ace_common}; + requiredAddons[] = {"ace_common"}; author[] = {"[TF]Nkey"}; authorUrl = "https://github.com/michail-nikolaev/"; VERSION_CONFIG; diff --git a/addons/thermals/script_component.hpp b/addons/thermals/script_component.hpp index acaf685557..97d7630b50 100644 --- a/addons/thermals/script_component.hpp +++ b/addons/thermals/script_component.hpp @@ -1,5 +1,5 @@ #define COMPONENT thermals -#include "\z\ace\Addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_THERMALS #define DEBUG_MODE_FULL @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_THERMALS #endif -#include "\z\ace\Addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/tripod/$PBOPREFIX$ b/addons/tripod/$PBOPREFIX$ new file mode 100644 index 0000000000..a374eb7994 --- /dev/null +++ b/addons/tripod/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\tripod diff --git a/addons/tripod/CfgEventHandlers.hpp b/addons/tripod/CfgEventHandlers.hpp new file mode 100644 index 0000000000..ed5027f094 --- /dev/null +++ b/addons/tripod/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + +class Extended_Init_EventHandlers { + class ACE_TripodObject { + class ADDON { + init = QUOTE(_this call DEFUNC(dragging,initObject)); + }; + }; +}; diff --git a/addons/tripod/CfgVehicles.hpp b/addons/tripod/CfgVehicles.hpp new file mode 100644 index 0000000000..714d2cafb1 --- /dev/null +++ b/addons/tripod/CfgVehicles.hpp @@ -0,0 +1,92 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(place) { + displayName = CSTRING(Placedown); + condition = QUOTE([ARR_2(_player,'ACE_Tripod')] call EFUNC(common,hasItem)); + statement = QUOTE([ARR_2(_player,'ACE_Tripod')] call FUNC(place)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_sniper_tripod_ca.paa); + }; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_Tripod: Item_Base_F { + author[] = {"Rocko", "Scubaman3D"}; + scope = 2; + scopeCurator = 2; + displayName = CSTRING(DisplayName); + vehicleClass = "Items"; + class TransportItems { + class ACE_Tripod { + name = "ACE_Tripod"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Tripod,2); + }; + }; + + class thingX; + class ACE_TripodObject: thingX { + XEH_ENABLED; + scope = 2; + displayName = CSTRING(DisplayName); + model = PATHTOF(data\sniper_tripod.p3d); + class AnimationSources { + class slide_down_tripod { + source = "user"; + animPeriod = 0.02; + initPhase = 0; + minValue = 0; + maxValue = 1; + }; + class retract_leg_1: slide_down_tripod {}; + class retract_leg_2: retract_leg_1 {}; + class retract_leg_3: retract_leg_2 {}; + }; + EGVAR(dragging,canDrag) = 1; + EGVAR(dragging,dragPosition[]) = {0,1,0}; + EGVAR(dragging,dragDirection) = 0; + class ACE_Actions { + class ACE_MainActions { + selection = ""; + distance = 5; + condition = "true"; + class ACE_Pickup { + selection = ""; + displayName = CSTRING(PickUp); + distance = 5; + condition = "true"; + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickup)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\w_sniper_tripod_ca.paa); + }; + class ACE_Adjust { + selection = ""; + displayName = CSTRING(Adjust); + distance = 5; + condition = "true"; + statement = QUOTE(_target call FUNC(adjust)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + icon = PATHTOF(UI\w_sniper_tripod_ca.paa); + }; + }; + }; + }; +}; diff --git a/addons/tripod/CfgWeapons.hpp b/addons/tripod/CfgWeapons.hpp new file mode 100644 index 0000000000..cc7521f0f2 --- /dev/null +++ b/addons/tripod/CfgWeapons.hpp @@ -0,0 +1,18 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_Tripod: ACE_ItemCore { + author[] = {"Rocko", "Scubaman3D"}; + scope = 2; + displayName = CSTRING(DisplayName); + descriptionShort = ""; + model = PATHTOF(data\w_sniper_tripod.p3d); + picture = PATHTOF(UI\w_sniper_tripod_ca.paa); + + class ItemInfo: InventoryItem_Base_F { + mass = 40; + }; + }; +}; diff --git a/addons/tripod/README.md b/addons/tripod/README.md new file mode 100644 index 0000000000..1f4282f1ab --- /dev/null +++ b/addons/tripod/README.md @@ -0,0 +1,10 @@ +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 diff --git a/addons/tripod/UI/w_sniper_tripod_ca.paa b/addons/tripod/UI/w_sniper_tripod_ca.paa new file mode 100644 index 0000000000..a7ea6b0c31 Binary files /dev/null and b/addons/tripod/UI/w_sniper_tripod_ca.paa differ diff --git a/addons/tripod/XEH_postInit.sqf b/addons/tripod/XEH_postInit.sqf new file mode 100644 index 0000000000..706aaecae9 --- /dev/null +++ b/addons/tripod/XEH_postInit.sqf @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +GVAR(adjuster) = objNull; +GVAR(adjusting) = false; +GVAR(adjustPFH) = -1; + +GVAR(height) = 0; + +// Cancel adjustment if interact menu opens +["interactMenuOpened", { + if (GVAR(adjustPFH) != -1 && GVAR(adjusting)) then { + GVAR(adjusting) = false; + }; +}] call EFUNC(common,addEventHandler); + +[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); diff --git a/addons/tripod/XEH_preInit.sqf b/addons/tripod/XEH_preInit.sqf new file mode 100644 index 0000000000..f27b707936 --- /dev/null +++ b/addons/tripod/XEH_preInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(adjust); +PREP(handleScrollWheel); +PREP(pickup); +PREP(place); + +ADDON = true; diff --git a/addons/tripod/config.cpp b/addons/tripod/config.cpp new file mode 100644 index 0000000000..80379019c3 --- /dev/null +++ b/addons/tripod/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_Tripod"}; + weapons[] = {"ACE_Tripod"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Rocko", "Scubaman3D", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" \ No newline at end of file diff --git a/addons/tripod/data/model.cfg b/addons/tripod/data/model.cfg new file mode 100644 index 0000000000..ee81d26c8e --- /dev/null +++ b/addons/tripod/data/model.cfg @@ -0,0 +1,64 @@ +class CfgSkeletons +{ + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ace_snipertripod_skeleton: Default { + isDiscrete = 1; + skeletonInherit = "Default"; + skeletonBones[] = { + "tripod","", + "leg_1","tripod", + "leg_2","tripod", + "leg_3","tripod", + "leg_slide_1","leg_1", + "leg_slide_2","leg_2", + "leg_slide_3","leg_3" + }; + }; +}; +class CfgModels { + class Default { + sectionsInherit = ""; + sections[] = {}; + skeletonName = ""; + }; + class sniper_tripod: Default { + skeletonName = "ace_snipertripod_skeleton"; + sectionsInherit = "Default"; + class animations { + class slide_down_tripod { + type = "translation"; + selection = "tripod"; + source = "user"; + begin = "slide_end"; + end = "slide_start"; + memory = 1; + minValue = 0; + maxValue = 1; + sourceAddress = "clamp"; + offset0 = 0; + offset1 = 0.855; + }; + class retract_leg_1: slide_down_tripod { + selection = "leg_slide_1"; + begin = "slide_end_1"; + end = "slide_start_1"; + offset0 = 0; + offset1 = -0.95; + }; + class retract_leg_2: retract_leg_1 { + selection = "leg_slide_2"; + begin = "slide_end_2"; + end = "slide_start_2"; + }; + class retract_leg_3: retract_leg_2 { + selection = "leg_slide_3"; + begin = "slide_end_3"; + end = "slide_start_3"; + }; + }; + }; +}; diff --git a/addons/tripod/data/nipertripod_co.paa b/addons/tripod/data/nipertripod_co.paa new file mode 100644 index 0000000000..6f0cbaacf0 Binary files /dev/null and b/addons/tripod/data/nipertripod_co.paa differ diff --git a/addons/tripod/data/sniper_tripod.p3d b/addons/tripod/data/sniper_tripod.p3d new file mode 100644 index 0000000000..5deab7067a Binary files /dev/null and b/addons/tripod/data/sniper_tripod.p3d differ diff --git a/addons/tripod/data/w_sniper_tripod.p3d b/addons/tripod/data/w_sniper_tripod.p3d new file mode 100644 index 0000000000..65758ea807 Binary files /dev/null and b/addons/tripod/data/w_sniper_tripod.p3d differ diff --git a/addons/tripod/functions/fnc_adjust.sqf b/addons/tripod/functions/fnc_adjust.sqf new file mode 100644 index 0000000000..ce50d38cf0 --- /dev/null +++ b/addons/tripod/functions/fnc_adjust.sqf @@ -0,0 +1,43 @@ +/* + * Author: Ruthberg + * + * Adjust tripod height + * + * Arguments: + * 0: tripod + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_1(_tripod); + +GVAR(adjuster) = ACE_player; +GVAR(adjusting) = true; + +GVAR(adjustPFH) = [{ + EXPLODE_1_PVT(_this select 0,_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; + }; + + { + _tripod animate [_x, 1 - GVAR(height)]; + } foreach ["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); + +ACE_player setVariable [QGVAR(Adjust), + [ACE_player, "DefaultAction", + {GVAR(adjustPFH) != -1 && GVAR(adjusting)}, + {GVAR(adjusting) = false;} +] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/tripod/functions/fnc_handleScrollWheel.sqf b/addons/tripod/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..7399bf0c2c --- /dev/null +++ b/addons/tripod/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,24 @@ +/* + * Author: Garth 'L-H' de Wet, Ruthberg + * Handles sandbag rotation + * + * Arguments: + * 0: scroll amount + * + * Return Value: + * handled + * + * Example: + * 1.2 call ace_tripod_fnc_handleScrollWheel; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_scroll); + +if (GETMVAR(ACE_Modifier,0) == 0 || GVAR(adjustPFH) == -1) exitWith { false }; + +GVAR(height) = 0 max (GVAR(height) + (_scroll / 20)) min 1; + +true diff --git a/addons/tripod/functions/fnc_pickup.sqf b/addons/tripod/functions/fnc_pickup.sqf new file mode 100644 index 0000000000..f264eb1e2e --- /dev/null +++ b/addons/tripod/functions/fnc_pickup.sqf @@ -0,0 +1,30 @@ +/* + * Author: Rocko, Ruthberg + * + * Pick up tripod + * + * Arguments: + * 0: tripod + * 1: unit + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_tripod,_unit); + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_2(_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 new file mode 100644 index 0000000000..5e9c783589 --- /dev/null +++ b/addons/tripod/functions/fnc_place.sqf @@ -0,0 +1,50 @@ +/* + * Author: Rocko, Ruthberg + * + * Place down tripod + * + * Arguments: + * 0: unit + * 1: tripod class + * + * Return Value: + * Nothing + * + * Return value: + * None + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_tripodClass); + +_unit removeItem _tripodClass; + +if ((_unit call CBA_fnc_getUnitAnim) select 0 == "stand") then { + _unit playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +[{ + PARAMS_1(_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"]; + + [{ + EXPLODE_3_PVT(_this select 0,_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)); + }; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + }, 0, [_tripod, _direction, _position]] call CBA_fnc_addPerFrameHandler; + +}, [_unit], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/tripod/functions/script_component.hpp b/addons/tripod/functions/script_component.hpp new file mode 100644 index 0000000000..4fa165afc7 --- /dev/null +++ b/addons/tripod/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\tripod\script_component.hpp" \ No newline at end of file diff --git a/addons/tripod/script_component.hpp b/addons/tripod/script_component.hpp new file mode 100644 index 0000000000..b160a14742 --- /dev/null +++ b/addons/tripod/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT tripod +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_TRIPOD + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_TRIPOD + #define DEBUG_SETTINGS DEBUG_SETTINGS_TRIPOD +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/tripod/stringtable.xml b/addons/tripod/stringtable.xml new file mode 100644 index 0000000000..254af3295f --- /dev/null +++ b/addons/tripod/stringtable.xml @@ -0,0 +1,57 @@ + + + + + SSWT Kit + Scharfschützenzweibein + Снайперский штатив + Trójnóg snajperski + SSWT Kit + SSWT Kit + SSWT souprava + SSWT Kit + SSWT Kit + Kit SSWT + + + Place SSWT Kit + Scharfschützenzweibein aufstellen + Установить снайперский штатив + Postaw trójnóg snajperski + Place SSWT Kit + Place SSWT Kit + Rozlož souprava SSWT + Place SSWT Kit + Place SSWT Kit + Colocar kit SSWT + + + Pick up SSWT Kit + Podnieś trójnóg snajperski + Coger equipo SSWT + Zvednout SSWT soupravu + Pegar kit SSWT + + + Adjust SSWT Kit + Reguluj trójnóg snajperski + Ajustar equipo SSWT + Regulovat SSWT soupravu + Ajustar kit SSWT + + + Done + Gotowe + Hecho + Hotovo + Feito + + + + Modifier, adjust + + Modyfikator, regulacja + + Modificador, ajuste + + Modifikátor, regulace + + Modificador, ajuste + + + \ No newline at end of file diff --git a/addons/ui/$PBOPREFIX$ b/addons/ui/$PBOPREFIX$ new file mode 100644 index 0000000000..601bbd5f60 --- /dev/null +++ b/addons/ui/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\ui \ No newline at end of file diff --git a/addons/ui/README.md b/addons/ui/README.md new file mode 100644 index 0000000000..f11027038f --- /dev/null +++ b/addons/ui/README.md @@ -0,0 +1,9 @@ +ace_ui +======= + +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. + diff --git a/addons/ui/config.cpp b/addons/ui/config.cpp new file mode 100644 index 0000000000..e7ea4b32eb --- /dev/null +++ b/addons/ui/config.cpp @@ -0,0 +1,30 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"VKing"}; + authorUrl = "https://github.com/ACEMod/"; + VERSION_CONFIG; + }; +}; + +class RscText; + +class RscDisplayChat { + class controls { + delete Line; + delete Background; + class CA_Background: RscText { + colorBackground[] = {0.5,0.5,0.5,0.33}; // Make the chat entry field slightly darker + }; + }; +}; + +class RscChatListDefault { + colorBackground[] = {0,0,0,0.5}; // Make the chat background darker + colorMessageProtocol[] = {0.85,0.85,0.85,1}; // And the chat text brighter +}; diff --git a/addons/ui/functions/script_component.hpp b/addons/ui/functions/script_component.hpp new file mode 100644 index 0000000000..656228f742 --- /dev/null +++ b/addons/ui/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\ui\script_component.hpp" diff --git a/addons/ui/script_component.hpp b/addons/ui/script_component.hpp new file mode 100644 index 0000000000..a1a210701c --- /dev/null +++ b/addons/ui/script_component.hpp @@ -0,0 +1,13 @@ +#define COMPONENT ui +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_UI + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_UI + #define DEBUG_SETTINGS DEBUG_SETTINGS_UI +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + diff --git a/addons/vector/CfgVehicles.hpp b/addons/vector/CfgVehicles.hpp index e9fd8945de..cf0d50d18f 100644 --- a/addons/vector/CfgVehicles.hpp +++ b/addons/vector/CfgVehicles.hpp @@ -7,10 +7,10 @@ class CfgVehicles { class Item_Base_F; class ACE_Item_Vector: Item_Base_F { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; scopeCurator = 2; - displayName = "$STR_ACE_Vector_VectorName"; + displayName = CSTRING(VectorName); vehicleClass = "Items"; class TransportWeapons { MACRO_ADDWEAPON(ACE_Vector,1); diff --git a/addons/vector/CfgWeapons.hpp b/addons/vector/CfgWeapons.hpp index 6b8757d143..019d774da8 100644 --- a/addons/vector/CfgWeapons.hpp +++ b/addons/vector/CfgWeapons.hpp @@ -2,9 +2,9 @@ class CfgWeapons { class Binocular; class ACE_Vector: Binocular { - author = "$STR_ACE_Common_ACETeam"; - displayName = "$STR_ACE_Vector_VectorName"; - descriptionShort = "$STR_ACE_Vector_VectorDescription"; + author = ECSTRING(common,ACETeam); + displayName = CSTRING(VectorName); + descriptionShort = CSTRING(VectorDescription); model = PATHTOF(ace_vector.p3d); modelOptics = PATHTOF(ace_vector_optics.p3d); picture = PATHTOF(UI\ace_vector_x_ca.paa); diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index feb706bc02..9fa51e9068 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -40,19 +40,19 @@ switch (_this select 0) do { // handle input in option menu if (GVAR(currentMode) == "settings") exitWith { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {}; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 1) exitWith {}; - if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then { + if (ACE_diagTime < GVAR(keyDownTimeAzimuth) + 0.5) then { GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1; } else { GVAR(keyDownTabCountAzimuth) = 1; }; - GVAR(keyDownTimeAzimuth) = diag_tickTime; + GVAR(keyDownTimeAzimuth) = ACE_diagTime; }; if (GVAR(currentMode) == "config") exitWith { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; ["config"] call FUNC(nextMode); }; @@ -66,30 +66,30 @@ switch (_this select 0) do { [false] call FUNC(showP1); // handle 5 times clicking - if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then { + if (ACE_diagTime < GVAR(keyDownTimeAzimuth) + 0.5) then { GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1; - GVAR(keyDownTimeAzimuth) = diag_tickTime; + GVAR(keyDownTimeAzimuth) = ACE_diagTime; } else { GVAR(keyDownTabCountAzimuth) = 1; }; // open settings menu if (GVAR(keyDownTabCountAzimuth) == 5) exitWith { - GVAR(keyDownTimeMenu) = diag_tickTime; - GVAR(keyDownTimeAzimuth) = diag_tickTime; + GVAR(keyDownTimeMenu) = ACE_diagTime; + GVAR(keyDownTimeAzimuth) = ACE_diagTime; GVAR(keyDownTabCountAzimuth) = 0; GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)]; ["settings"] call FUNC(showText); "settings" call _fnc_setPFH; }; - if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith { + if (ACE_diagTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith { "azimuth+inclination" call _fnc_setPFH; }; - GVAR(keyDownTimeAzimuth) = diag_tickTime; + GVAR(keyDownTimeAzimuth) = ACE_diagTime; - if (diag_tickTime > GVAR(keyDownTimeDistance) + 0.5) then { + if (ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5) then { if !(GETGVAR(isKeyDownDistance,false)) then { ["distance"] call FUNC(clearDisplay); "azimuth" call _fnc_setPFH; @@ -110,19 +110,19 @@ switch (_this select 0) do { // handle input in option menu if (GVAR(currentMode) == "config") exitWith { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; - if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then { + if (ACE_diagTime < GVAR(keyDownTimeDistance) + 0.5) then { GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1; } else { GVAR(keyDownTabCountDistance) = 1; }; - GVAR(keyDownTimeDistance) = diag_tickTime; + GVAR(keyDownTimeDistance) = ACE_diagTime; }; if (GVAR(currentMode) == "settings") exitWith { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; ["settings"] call FUNC(nextMode); }; @@ -141,30 +141,30 @@ switch (_this select 0) do { [false] call FUNC(showP1); // handle 5 times clicking - if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then { + if (ACE_diagTime < GVAR(keyDownTimeDistance) + 0.5) then { GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1; - GVAR(keyDownTimeDistance) = diag_tickTime; + GVAR(keyDownTimeDistance) = ACE_diagTime; } else { GVAR(keyDownTabCountDistance) = 1; }; // open config menu if (GVAR(keyDownTabCountDistance) == 5) exitWith { - GVAR(keyDownTimeMenu) = diag_tickTime; - GVAR(keyDownTimeDistance) = diag_tickTime; + GVAR(keyDownTimeMenu) = ACE_diagTime; + GVAR(keyDownTimeDistance) = ACE_diagTime; GVAR(keyDownTabCountDistance) = 0; GVAR(configTemp) = GVAR(modeReticle); ["config"] call FUNC(showText); "config" call _fnc_setPFH; }; - if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith { + if (ACE_diagTime < GVAR(keyDownTimeDistance) + 0.5) exitWith { "height+distance" call _fnc_setPFH; }; - GVAR(keyDownTimeDistance) = diag_tickTime; + GVAR(keyDownTimeDistance) = ACE_diagTime; - if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then { + if (ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.5) then { if !(GETGVAR(isKeyDownAzimuth,false)) then { ["azimuth"] call FUNC(clearDisplay); "distance" call _fnc_setPFH; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index 568ef2050c..ff4e5fc6ad 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -21,7 +21,7 @@ switch (_this select 0) do { case ("azimuth"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + _isReady = ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.2; [false] call FUNC(showCenter); @@ -42,7 +42,7 @@ switch (_this select 0) do { case ("distance"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -66,7 +66,7 @@ switch (_this select 0) do { call FUNC(showAzimuth); private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -89,7 +89,7 @@ switch (_this select 0) do { case ("azimuth+inclination"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + _isReady = ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.2; [false] call FUNC(showCenter); @@ -110,7 +110,7 @@ switch (_this select 0) do { case ("height+distance"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -132,7 +132,7 @@ switch (_this select 0) do { case ("relative_distance"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.5; [_isReady] call FUNC(showCenter); @@ -155,7 +155,7 @@ switch (_this select 0) do { case ("relative_height+length"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.5; [_isReady] call FUNC(showCenter); @@ -178,7 +178,7 @@ switch (_this select 0) do { case ("relative_azimuth+distance"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -201,7 +201,7 @@ switch (_this select 0) do { case ("fall_of_shot"): { private "_isReady"; - _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + _isReady = ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5; [_isReady] call FUNC(showCenter); @@ -223,8 +223,8 @@ switch (_this select 0) do { }; case ("settings"): { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith { - GVAR(keyDownTimeAzimuth) = diag_tickTime; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 1) exitWith { + GVAR(keyDownTimeAzimuth) = ACE_diagTime; }; [["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText); @@ -247,7 +247,7 @@ switch (_this select 0) do { }; }; - if (GVAR(keyDownTabCountAzimuth) > 0 && {diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith { + if (GVAR(keyDownTabCountAzimuth) > 0 && {ACE_diagTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith { ["clear_left"] call FUNC(showText); ["clear_right"] call FUNC(showText); @@ -264,8 +264,8 @@ switch (_this select 0) do { }; case ("config"): { - if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith { - GVAR(keyDownTimeDistance) = diag_tickTime; + if (ACE_diagTime < GVAR(keyDownTimeMenu) + 1) exitWith { + GVAR(keyDownTimeDistance) = ACE_diagTime; }; switch (GVAR(configTemp)) do { @@ -315,7 +315,7 @@ switch (_this select 0) do { }; }; - if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith { + if (GVAR(keyDownTabCountDistance) > 0 && {ACE_diagTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith { ["clear_left"] call FUNC(showText); ["clear_right"] call FUNC(showText); diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index 79df40b0a2..babef0819c 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -1,6 +1,6 @@ // by commy2 -["ACE3 Equipment", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", +["ACE3 Equipment", QGVAR(AzimuthKey), localize LSTRING(AzimuthKey), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -29,7 +29,7 @@ [15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key -["ACE3 Equipment", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", +["ACE3 Equipment", QGVAR(DistanceKey), localize LSTRING(DistanceKey), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/vector/stringtable.xml b/addons/vector/stringtable.xml index 47832c33c1..80135294d4 100644 --- a/addons/vector/stringtable.xml +++ b/addons/vector/stringtable.xml @@ -44,10 +44,10 @@ Vector - Touche Distance Vector - Odległość Vector - Zobrazit vzdálenost - Vecto - Tasto Distanza + Vector - Tasto Distanza Vector - Tecla de Distância Vector - Távolság gomb Vector – Расстояние - \ No newline at end of file + diff --git a/addons/vehiclelock/ACE_Settings.hpp b/addons/vehiclelock/ACE_Settings.hpp new file mode 100644 index 0000000000..9eac505db2 --- /dev/null +++ b/addons/vehiclelock/ACE_Settings.hpp @@ -0,0 +1,14 @@ +class ACE_Settings { + class GVAR(DefaultLockpickStrength) { + value = 10; + typeName = "SCALAR"; + }; + class GVAR(LockVehicleInventory) { + value = 0; + typeName = "BOOL"; + }; + class GVAR(VehicleStartingLockState) { + value = -1; + typeName = "SCALAR"; + }; +}; \ No newline at end of file diff --git a/addons/vehiclelock/CfgMagazines.hpp b/addons/vehiclelock/CfgMagazines.hpp index 100df8065b..62c6fdcec2 100644 --- a/addons/vehiclelock/CfgMagazines.hpp +++ b/addons/vehiclelock/CfgMagazines.hpp @@ -3,8 +3,9 @@ class CfgMagazines { class ACE_key_customKeyMagazine: CA_Magazine { picture = QUOTE(PATHTOF(ui\keyBlack.paa)); displayName = "ACE Vehicle Key"; //!!!CANNOT be localized!!!: because it is used as part of the magazineDetail string - descriptionShort = "$STR_ACE_Vehicle_Item_Custom_Description"; + descriptionShort = CSTRING(Item_Custom_Description); count = 1; mass = 0; + ACE_isUnique = 1; }; }; diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 94bcf34317..9e6f155616 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -1,21 +1,21 @@ #define MACRO_LOCK_ACTIONS \ class ACE_SelfActions { \ class ACE_unlockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ + displayName = CSTRING(Action_UnLock); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ priority = 0.3; \ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lock"; \ + displayName = CSTRING(Action_Lock); \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ priority = 0.2; \ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockpickVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ + displayName = CSTRING(Action_Lockpick); \ condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ priority = 0.1; \ @@ -24,7 +24,7 @@ class ACE_Actions { \ class ACE_MainActions { \ class ACE_unlockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_UnLock"; \ + displayName = CSTRING(Action_UnLock); \ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(2,3)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,false)])] call EFUNC(common,targetEvent)); \ @@ -32,7 +32,7 @@ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lock"; \ + displayName = CSTRING(Action_Lock); \ distance = 4; \ condition = QUOTE(([ARR_2(_player, _target)] call FUNC(hasKeyForVehicle)) && {(locked _target) in [ARR_2(0,1)]}); \ statement = QUOTE([ARR_3('VehicleLock_SetVehicleLock', [_target], [ARR_2(_target,true)])] call EFUNC(common,targetEvent)); \ @@ -40,7 +40,7 @@ icon = QUOTE(PATHTOF(UI\key_menuIcon_ca.paa)); \ }; \ class ACE_lockpickVehicle { \ - displayName = "$STR_ACE_Vehicle_Action_Lockpick"; \ + displayName = CSTRING(Action_Lockpick); \ distance = 4; \ condition = QUOTE([ARR_3(_player, _target, 'canLockpick')] call FUNC(lockpick)); \ statement = QUOTE([ARR_3(_player, _target, 'startLockpick')] call FUNC(lockpick)); \ @@ -64,12 +64,13 @@ class CfgVehicles { class Logic; class Module_F: Logic { - class ModuleDescription {}; + class ModuleDescription; }; - class ACE_VehicleLock_ModuleSetup: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_Module: Module_F {}; + class ACE_VehicleLock_ModuleSetup: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Vehicle Lock Setup"; + displayName = CSTRING(Module_DisplayName); function = QFUNC(moduleInit); scope = 2; isGlobal = 0; @@ -77,37 +78,37 @@ class CfgVehicles { functionPriority = 0; class Arguments { class LockVehicleInventory { - displayName = "Lock Vehicle Inventory"; - description = "Locks the inventory of locked vehicles"; + displayName = CSTRING(LockVehicleInventory_DisplayName); + description = CSTRING(LockVehicleInventory_Description); typeName = "BOOL"; defaultValue = 0; }; class VehicleStartingLockState { - displayName = "Vehicle Starting Lock State"; // Argument label - description = "Set lock state for all vehicles (removes ambiguous lock states)"; // Tooltip description - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + displayName = CSTRING(VehicleStartingLockState_DisplayName); + description = CSTRING(VehicleStartingLockState_Description); + typeName = "NUMBER"; class values { - class None {name = "As Is"; value = 0; default = 1;}; - class Side {name = "Locked"; value = 1;}; - class Unique {name = "Unlocked"; value = 2;}; + class None {name = CSTRING(VehicleStartingLockState_AsIs); value = 0; default = 1;}; + class Side {name = CSTRING(VehicleStartingLockState_Locked); value = 1;}; + class Unique {name = CSTRING(VehicleStartingLockState_Unlocked); value = 2;}; }; }; class DefaultLockpickStrength { - displayName = "Default Lockpick Strength"; - description = "Default Time to lockpick (in seconds). Default: 10"; - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" - defaultValue = "10"; // Default text filled in the input box + displayName = CSTRING(DefaultLockpickStrength_DisplayName); + description = CSTRING(DefaultLockpickStrength_Description); + typeName = "NUMBER"; + defaultValue = "10"; }; }; - class ModuleDescription: ModuleDescription { - description = "Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.
Source: vehiclelock.pbo"; + class ModuleDescription { + description = CSTRING(Module_Description); }; }; - class ACE_VehicleLock_ModuleSyncedAssign: Module_F { - author = "$STR_ACE_Common_ACETeam"; + class ACE_VehicleLock_ModuleSyncedAssign: ACE_Module { + author = ECSTRING(common,ACETeam); category = "ACE"; - displayName = "Vehicle Key Assign"; + displayName = CSTRING(VehicleKeyAssign_Module_DisplayName); function = QFUNC(moduleSync); scope = 2; isGlobal = 0; @@ -115,7 +116,7 @@ class CfgVehicles { functionPriority = 0; class Arguments {}; class ModuleDescription: ModuleDescription { - description = "Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.
Source: vehiclelock.pbo"; + description = CSTRING(VehicleKeyAssign_Module_Description); sync[] = {"AnyPlayer", "AnyVehicle"}; }; }; diff --git a/addons/vehiclelock/CfgWeapons.hpp b/addons/vehiclelock/CfgWeapons.hpp index 4b20de15d7..ee000e218e 100644 --- a/addons/vehiclelock/CfgWeapons.hpp +++ b/addons/vehiclelock/CfgWeapons.hpp @@ -3,9 +3,9 @@ class CfgWeapons { class ACE_ItemCore; class ACE_key_master: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); displayName = "Vehicle Key: Master"; - descriptionShort = "$STR_ACE_Vehicle_Item_Master_Description"; + descriptionShort = CSTRING(Item_Master_Description); model = "\A3\weapons_F\ammo\mag_univ.p3d"; picture = QUOTE(PATHTOF(ui\keyBlack.paa)); scope = 2; @@ -15,27 +15,27 @@ class CfgWeapons { }; class ACE_key_lockpick: ACE_key_master { displayName = "Lockpick"; - descriptionShort = "$STR_ACE_Vehicle_Item_Lockpick_Description"; + descriptionShort = CSTRING(Item_Lockpick_Description); picture = QUOTE(PATHTOF(ui\lockpick.paa)); }; class ACE_key_west: ACE_key_master { displayName = "Vehicle Key: West"; - descriptionShort = "$STR_ACE_Vehicle_Item_West_Description"; + descriptionShort = CSTRING(Item_West_Description); picture = QUOTE(PATHTOF(ui\keyBlue.paa)); }; class ACE_key_east: ACE_key_master { displayName = "Vehicle Key: East"; - descriptionShort = "$STR_ACE_Vehicle_Item_East_Description"; + descriptionShort = CSTRING(Item_East_Description); picture = QUOTE(PATHTOF(ui\keyRed.paa)); }; class ACE_key_indp: ACE_key_master { displayName = "Vehicle Key: Independent"; - descriptionShort = "$STR_ACE_Vehicle_Item_Indp_Description"; + descriptionShort = CSTRING(Item_Indp_Description); picture = QUOTE(PATHTOF(ui\keyPurple.paa)); }; class ACE_key_civ: ACE_key_master { displayName = "Vehicle Key: Civilian"; - descriptionShort = "$STR_ACE_Vehicle_Item_Civ_Description"; + descriptionShort = CSTRING(Item_Civ_Description); picture = QUOTE(PATHTOF(ui\keyGreen.paa)); }; }; diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 76d5817d8d..9ee1343bc8 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -12,21 +12,7 @@ class CfgPatches { }; }; -class ACE_Settings { - class GVAR(DefaultLockpickStrength) { - value = 10; - typeName = "SCALAR"; - }; - class GVAR(LockVehicleInventory) { - value = 0; - typeName = "BOOL"; - }; - class GVAR(VehicleStartingLockState) { - value = -1; - typeName = "SCALAR"; - }; -}; - +#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" #include "CfgVehicles.hpp" diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index fc7fecc693..613a7b35dc 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -54,7 +54,7 @@ case (_funcType == "canLockpick"): { _returnValue = true; }; case (_funcType == "startLockpick"): { - [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize "STR_ACE_Vehicle_Action_LockpickInUse"), _condition] call EFUNC(common,progressBar); + [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize LSTRING(Action_LockpickInUse)), _condition] call EFUNC(common,progressBar); _returnValue = true; }; case (_funcType == "finishLockpick"): { diff --git a/addons/vehiclelock/readme.md b/addons/vehiclelock/readme.md index dc013145aa..64ae01a99c 100644 --- a/addons/vehiclelock/readme.md +++ b/addons/vehiclelock/readme.md @@ -31,7 +31,7 @@ Two key modes (can be used together): * `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_magazine_customKey` to bob and program it to work on car1 +`[bob, car1, true] call ACE_VehicleLock_fnc_addKeyForVehicle;` - will add a `ACE_key_customKeyMagazine` to bob and program it to work on car1 ## Maintainers diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index fc92b72dd2..89a64faf8a 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -1,7 +1,7 @@  - + Unlock Vehicle Fahrzeug aufschließen Abrir vehículo @@ -10,10 +10,10 @@ Odemknout vozidlo Jármű nyitása Открыть машину - Apri il veicolo + Sblocca il veicolo Destravar veículo - + Lock Vehicle Fahrzeug abschließen Cerrar vehículo @@ -22,10 +22,10 @@ Zamknout vozidlo Jármű zárása Закрыть машину - Chiudi il veicolo + Chiudi il veicolo a chiave Travar Veículo - + Lockpick Vehicle Fahrzeug knacken Forzar vehículo @@ -37,7 +37,7 @@ Scassina veicolo Usar mixa no Veículo - + Picking Lock.... Schloss knacken... Forzando cerradura... @@ -49,7 +49,7 @@ Scassino il veicolo.... Usando Mixa... - + A custom key that will open a specific vehicle. Ein Schlüssel der ein bestimmtes Fahrzeug aufschließt. Una llave concreta abrirá un vehículo concreto. @@ -61,7 +61,7 @@ Una chiave personalizzata che apre determinati veicoli. Uma chave específica que abre um veículo específico. - + A Master Key will open any lock, no matter what! Ein Generalschlüssel der jedes Schloss öffnet... Una llave maestra abrirá cualquier cierre, no importa cual! @@ -70,10 +70,10 @@ Hlavní klíč otevře libovolný zámek, bez vyjímek! Egy főkulcs, ami minden zárat kinyit, helyzettől függetlenül! Универсальный ключ, открывающий любой замок. - Una chiave principale che apre qualsiasi serratura! + Un passe-partout che apre qualsiasi serratura! Uma chave mestre irá abrir qualquer fechadura, não importa qual! - + A lockpick set that can pick the locks of most vehicles. Ein Dietrich der die meisten Fahrzeugschlösser knacken kann... Un set de ganzúas que puede abrir las cerraduras de la mayoría vehículos. @@ -85,7 +85,7 @@ Un grimardello per forzare la maggior parte dei veicoli Um set de chave mixas que pode abrir a maioria dos veículos. - + A key that should open most WEST vehicles. Ein Schlüssel der die meisten westlichen Fahrzeuge öffnen sollte... Una llave que abrirá la mayoría de vehículos occidentales. @@ -94,10 +94,10 @@ Klíč který by měl otevřít většinou Západních vozidel. Egy kulcs, ami a NYUGAT egységeinek legtöbb járművét ki tudja nyitni. Ключ для открытия большинства машин Красных. - Una chiave che apre la maggior parte dei veicoli WEST + Una chiave che apre la maggior parte dei veicoli occidentali Uma chave que abre a maioria dos veículos ocidentais - + A key that should open most EAST vehicle. Ein Schlüssel der die meisten östlichen Fahrzeuge öffnen sollte... Una llave que abrirá la mayoría de vehículos orientales. @@ -106,10 +106,10 @@ Egy kulcs, ami a KELET egységeinek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít vetšinu Východních vozidel. Ключ для открытия большинства машин Синих. - Una chaive che apre la maggior parte dei veicoli EAST + Una chaive che apre la maggior parte dei veicoli orientali Uma chave que abre a maioria dos veículos orientais - + A key that should open most INDEP vehicle. Ein Schlüssel der die meisten Fahrzeuge der Aufständischen öffnen sollte... Una llave que abrirá la mayoría de vehículos independientes. @@ -118,10 +118,10 @@ Egy kulcs, ami a FÜGGETLEN egységek legtöbb járművét ki tudja nyitni. Klíč který by měl otevřít většinu Nezávislých vozidel. Ключ для открытия большинства машин Независимых. - Una chaive che apr ela maggior parte dei veicoli INDEP + Una chaive che apre la maggior parte dei veicoli degli indipendenti Uma chave que abre a maioria dos veículos independentes - + A key that should open most CIV vehicle. Ein Schlüssel der die meisten zivilen Fahrzeuge öffnen sollte... Una llave que abrirá la mayoría de vehículos civiles. @@ -130,8 +130,112 @@ Klíč který by měl otevřít většinu Civilních vozidel. Egy kulcs, ami a CIVIL járművek többségét ki tudja nyitni. Ключ для открытия большинства машин Гражданских. - Una chaive che apr ela maggior parte dei veicoli CIV + Una chaive che apr ela maggior parte dei veicoli civili Uma chave que abre a maioria dos veículos civis. + + Vehicle Lock Setup + Ustawienie blokady pojazdów + Configuración del cierre del vehiculo + Fahrzeugsperreinstellungen + Nastavení zámku vozidla + Configuração de fechadura do veículo + + + Lock Vehicle Inventory + Zablokuj ekwipunek pojazdu + Bloquear inventario del vehículo + Sperre Fahrzeuginventar + Inventář zamčeného vozidla + Bloquear inventário do veículo + + + Locks the inventory of locked vehicles + Blokuje dostęp do ekwipunku pojazdu + Bloquea el inventario de los vehículos cerrados + Sperrt das Inventar von gesperrten Fahrzeugen + Zamknout inventář u zamčených vozidel + Bloqueia o inventário de veículos fechados + + + Vehicle Starting Lock State + Początkowy stan blok. poj. + Estado inicial del cierre en vehículos + Fahrzeuge spawnen gesperrt + Počáteční stav zámku vozidla + Estado inicial da fechadura dos veículos + + + Set lock state for all vehicles (removes ambiguous lock states) + Ustawia początkowy stan blokady dla wszystkich pojazdów (usuwa dwuznaczne stany blokady) + Establece el estado de cierre para todos los vehículos (elimina estados de cierre ambiguos) + Setze Sperrstatus für alle Fahrzeuge (entfernt unklare Sperrzustände) + Nastavit stav zámku u všech vozidel (odstraňuje nejednoznačné stavy zámků) + Definir estados de fechadura para todos os veículos (remove estados de fechadura ambíguos) + + + As Is + Jak jest + Está + Unverändert + Jak je + Como está + + + Locked + Zablokowany + Cerrado + Gesperrt + Zamčeno + Fechado + + + Unlocked + Odblokowany + Abierto + Offen + Odemčeno + Aberto + + + Default Lockpick Strength + Czas włamywania + Durabilidad de la ganzua por defecto + Standard-Pick-Stärke + Výchozí síla páčidla + Durabilidade padrão da chave micha + + + Default Time to lockpick (in seconds). Default: 10 + Domyślny czas potrzebny na otwarcie pojazdu (w sekundach). Domyślnie: 10 + Tiempo por defecto para forzar cerradura (en segundos). Por defecto: 10 + Standardzeit um ein Schloss zu knacken (in Sekunden). Standard: 10 + Čas k vypáčení zámku (v sekundách). Výchozí: 10 + Tempo padrão para forçar a fechadura (em segundos). Padrão: 10 + + + Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.<br />Source: vehiclelock.pbo + Ustawienia czasu włamywania oraz domyślnego stanu blokady pojazdów. Wyłącza dwuznaczne ustawienia blokady. Moduł ten umożliwia więc np. zamknięcie pojazdów przeciwnika na klucz tak, że gracze bez odpowiedniego sprzętu (wytrycha) nie będą mogli ich używać.<br />Źródło: vehiclelock.pbo + Ajustes de la durabilidad de la ganzua y el estado inicial del cierre de los vehículos. Elimina estados de cierre ambiguos.<br />Fuente: vehiclelock.pbo + Einstellungen für Pick-Stärke und anfänglichen Fahrzeugsperrzustand. Entfernt unklare Sperrzustände.<br />Quelle: vehiclelock.pbo + Nastavení síly vypáčení a počáteční stav zámku vozidla. Odstraňuje nejednoznačné stavy zámků.<br />Zdroj: vehiclelock.pbo + Definições para a durabilidade da chave micha e estado inicial da fechadura do veículo. Remove estados de fechadura ambíguas <br /> Fonte: Vehiclelock.pbo + + + Vehicle Key Assign + Przydział kluczyka do pojazdu + Asignacion de la llave del vehículo + Fahrzeugschlüsselzuweisung + Přidělení klíče k vozidlu + Atribuição de chave de veículo + + + Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.<br />Source: vehiclelock.pbo + Zsynchronizuj z pojazdami i graczami. Rozda klucze dla graczy dla każdego zsynchronizowanego pojazdu. Działa tylko na pojazdy obecne na misji od samego początku (postawione w edytorze).<br />Źródło: vehiclelock.pbo + Sincronizar con vehiculos y jugadores. Distribuirá llaves personalizadas a los jugadores para todos los vehículos sincronizados. Solo valido para objetos presentes al inicio de la mision.<br />Fuente: vehiclelock.pbo + Synchronisiere mit Fahrzeugen und Spielern. Wird eigene Schlüssel an Spieler für jedes synchronisierte Fahrzeuge aushändigen. Nur gültig für am Missionsstart existierende Fahrzeuge.<br />Quelle: vehiclelock.pbo + Synchronizuj s vozidly a hráči. Hráč dostane klíč ke každému synchonizovanému vozidlu. Platné pouze pro objekty přítomné na začátku mise.<br />Zdroj: vehiclelock.pbo + Sincronizar com veículos e jogadores. Irá distribuir chaves personalizadas para os jogadores para cada veículo sincronizado. Só é válido para objetos presentes no início da missão <br /> Fonte: vehiclelock.pbo + \ No newline at end of file diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 6ff723338b..253f5eab39 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -4,7 +4,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3 Vehicles", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", +["ACE3 Vehicles", QGVAR(speedLimiter), localize LSTRING(SpeedLimiter), { // Conditions: canInteract if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 053d96d470..7ddb07433a 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -7,12 +7,12 @@ _driver = _this select 0; _vehicle = _this select 1; if (GETGVAR(isSpeedLimiter,false)) exitWith { - [localize "STR_ACE_SpeedLimiter_Off"] call EFUNC(common,displayTextStructured); + [localize LSTRING(Off)] call EFUNC(common,displayTextStructured); playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = false; }; -[localize "STR_ACE_SpeedLimiter_On"] call EFUNC(common,displayTextStructured); +[localize LSTRING(On)] call EFUNC(common,displayTextStructured); playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; diff --git a/addons/vehicles/functions/fnc_startEngine.sqf b/addons/vehicles/functions/fnc_startEngine.sqf index 44adb9ed06..63afd78e2e 100644 --- a/addons/vehicles/functions/fnc_startEngine.sqf +++ b/addons/vehicles/functions/fnc_startEngine.sqf @@ -15,11 +15,11 @@ if (!_isEngineOn || {floor abs speed _vehicle > 0}) exitWith {}; _time = _this select 0 select 1; _direction = _this select 0 select 2; - if (time > _time) exitWith { + if (ACE_time > _time) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; }; _vehicle setVelocity [0, 0, 0]; _vehicle setVectorDirAndUp _direction; -} , 0, [_vehicle, time + STARTUP_DELAY, [vectorDir _vehicle, vectorUp _vehicle]]] call CBA_fnc_addPerFrameHandler; +} , 0, [_vehicle, ACE_time + STARTUP_DELAY, [vectorDir _vehicle, vectorUp _vehicle]]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 603f2563dc..e1002bc154 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -1,7 +1,7 @@  - + Speed Limiter on Begrenzer an Limitador de velocidad activado @@ -13,7 +13,7 @@ Limitador de Velocidade Ativo Limitatore Attivo - + Speed Limiter off Begrenzer aus Limitador de velocidad desactivado @@ -25,7 +25,7 @@ Limitador de Velocidade Desativado Limitatore Non Attivo - + Speed Limiter Begrenzer Limitador de velocidad diff --git a/addons/viewdistance/$PBOPREFIX$ b/addons/viewdistance/$PBOPREFIX$ new file mode 100644 index 0000000000..278df54db3 --- /dev/null +++ b/addons/viewdistance/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\viewdistance \ No newline at end of file diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp new file mode 100644 index 0000000000..28ed7471ca --- /dev/null +++ b/addons/viewdistance/ACE_Settings.hpp @@ -0,0 +1,46 @@ +class ACE_Settings { + class GVAR(enabled) { + typeName = "BOOL"; + value = 1; + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); + }; + class GVAR(viewDistanceOnFoot) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 0; // index, NOT value // Can set it to client's actual viewdistance in the init function once ACE_Settings supports numbers (if ever). + values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + displayName = CSTRING(onFoot_DisplayName); + description = CSTRING(onFoot_Description); + }; + class GVAR(viewDistanceLandVehicle) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 0; // index, NOT value + values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + displayName = CSTRING(landVehicle_DisplayName); + description = CSTRING(landVehicle_Description); + }; + class GVAR(viewDistanceAirVehicle) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 0; // index, NOT value + values[] = {CSTRING(videosettings),"500","1000","1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + displayName = CSTRING(airVehicle_DisplayName); + description = CSTRING(airVehicle_Description); + }; + class GVAR(limitViewDistance) { + typeName = "SCALAR"; + value = 10000; // Value, NOT index. 10000 is the maximum in A3 + displayName = CSTRING(limit_DisplayName); + description = CSTRING(limit_setting); + }; + class GVAR(objectViewDistanceCoeff) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 0; // index. Actual coefficient is given by functions/fnc_returnObjectCoeff.sqf + values[] = {CSTRING(object_off),CSTRING(object_verylow),CSTRING(object_low),CSTRING(object_medium),CSTRING(object_high),CSTRING(object_veryhigh)}; + displayName = CSTRING(object_DisplayName); + description = CSTRING(object_Description); + }; +}; diff --git a/addons/viewdistance/CfgEventHandlers.hpp b/addons/viewdistance/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0f1d8878ba --- /dev/null +++ b/addons/viewdistance/CfgEventHandlers.hpp @@ -0,0 +1,12 @@ + +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)); + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp new file mode 100644 index 0000000000..8e4e30d266 --- /dev/null +++ b/addons/viewdistance/CfgVehicles.hpp @@ -0,0 +1,30 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(ModuleSettings) : ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + function = QUOTE(DFUNC(initModule)); + displayName = CSTRING(Module_DisplayName); + scope = 2; + isGlobal = 1; + //icon = ""; // needs an icon + class Arguments { + class moduleViewDistanceEnabled { + displayName = CSTRING(enabled_DisplayName); + description = CSTRING(enabled_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + class moduleViewDistanceLimit { + displayName = CSTRING(limit_DisplayName); + description = CSTRING(limit_Description); + typeName = "NUMBER"; + defaultValue = 10000; + }; + }; + class ModuleDescription { + description = CSTRING(Module_Description); + sync[] = {}; + }; + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf new file mode 100644 index 0000000000..865e5527e5 --- /dev/null +++ b/addons/viewdistance/XEH_postInit.sqf @@ -0,0 +1,34 @@ +#include "script_component.hpp" + +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); + + // 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)) || + (_this select 0 == QGVAR(viewDistanceLandVehicle)) || + (_this select 0 == QGVAR(viewDistanceAirVehicle)) || + (_this select 0 == QGVAR(objectViewDistanceCoeff))) then { + + [true] call FUNC(adaptViewDistance); + }; + }] 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 + ["playerVehicleChanged",{ + [false] call FUNC(adaptViewDistance) + }] call EFUNC(common,addEventHandler); +}] call EFUNC(common,addEventHandler); \ No newline at end of file diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf new file mode 100644 index 0000000000..a68416cada --- /dev/null +++ b/addons/viewdistance/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(initModule); +PREP(returnValue); +PREP(returnObjectCoeff); +PREP(changeViewDistance); +PREP(adaptViewDistance); + +ADDON = true; \ No newline at end of file diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp new file mode 100644 index 0000000000..a1afbcc93f --- /dev/null +++ b/addons/viewdistance/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Winter"}; + authorUrl = "https://github.com/Winter259"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf new file mode 100644 index 0000000000..2ef4b84ae6 --- /dev/null +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -0,0 +1,39 @@ +/* + * Author: Winter + * Sets the player's current view distance according to whether s/he is on foot, in a land vehicle or in an air vehicle. + * + * + * Arguments: + * 0: Show Prompt + * + * Return Value: + * None + * + * Example: + * [] call ace_viewdistance_fnc_adaptViewDistance; + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_1(_show_prompt); + +private["_land_vehicle","_air_vehicle"]; + +if (!GVAR(enabled) || isNull ACE_player) exitWith {}; + +_land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; +_air_vehicle = (vehicle ACE_player) isKindOf "Air"; + +if (!_land_vehicle && !_air_vehicle) exitWith { + [GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance); +}; + +if (_land_vehicle) exitWith { + [GVAR(viewDistanceLandVehicle),_show_prompt] call FUNC(changeViewDistance); +}; + +if (_air_vehicle) exitWith { + [GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance); +}; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf new file mode 100644 index 0000000000..9060254c60 --- /dev/null +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -0,0 +1,46 @@ +/* + * Author: Winter + * Sets the player's current view distance according to allowed values. + * + * + * Arguments: + * 0: View Distance setting INDEX + * 1: Show Prompt + * + * Return Value: + * None + * + * Example: + * [] call ace_viewdistance_fnc_changeViewDistance; + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_text","_new_view_distance","_view_distance_limit","_object_view_distance_coeff"]; + +PARAMS_2(_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 + +setViewDistance (_new_view_distance min _view_distance_limit); + +if (_object_view_distance_coeff > 0) then { + setObjectViewDistance (_object_view_distance_coeff * viewDistance); +}; + +if (_show_prompt) then { + _text = if (_new_view_distance <= _view_distance_limit) then { + format ["%1 %2m", (localize "STR_ACE_ViewDistance_infotext"), str(viewDistance)]; + } else { + format ["%1 %2m", (localize "STR_ACE_ViewDistance_invalid"), str(viewDistance)]; + }; + + if (GVAR(objectViewDistanceCoeff) > 0) then { + _text = _text + format ["
%1 %2%3", (localize "STR_ACE_ViewDistance_objectinfotext"), str(_object_view_distance_coeff * 100),"%"]; + }; + [parseText _text,2] call EFUNC(common,displayTextStructured); +}; diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf new file mode 100644 index 0000000000..7569383d0c --- /dev/null +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -0,0 +1,29 @@ +/* + * Author: Winter + * Initialises the view distance limiter module + * + * + * Arguments: + * 0: logic + * 1: Synchronised Units + * 2: Module Activated + * + * Return Value: + * None + * + */ + +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); + +if (!_activated) exitWith { + diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; +}; + +[_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 diff --git a/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf new file mode 100644 index 0000000000..145b8ae9e6 --- /dev/null +++ b/addons/viewdistance/functions/fnc_returnObjectCoeff.sqf @@ -0,0 +1,34 @@ +/* + * Author: Winter + * Returns the object view distance coefficient according to the given index + * + * + * Arguments: + * 0: Object View Distance setting Index + * + * Return Value: + * Object View Distance + * + * Example: + * [2] call ace_viewdistance_fnc_returnObjectCoeff; + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_1(_index); + +private ["_return"]; + +_return = switch (_index) do { + case 0: {0.00}; // Off + case 1: {0.20}; // Very Low + case 2: {0.40}; // Low + case 3: {0.60}; // Medium + case 4: {0.80}; // High + case 5: {1.00}; // Very High + default {0.50}; // something broke if this returns +}; + +_return; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf new file mode 100644 index 0000000000..fb449cf702 --- /dev/null +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -0,0 +1,43 @@ +/* + * Author: Winter + * Returns the view distance value according to the given index + * + * + * Arguments: + * 0: View Distance Index + * + * Return Value: + * View Distance + * + * Example: + * [2] call ace_viewdistance_fnc_returnViewDistanceValue; + * + * Public: No + */ + +#include "script_component.hpp" + +PARAMS_1(_index); + +private ["_return"]; + +_return = switch (_index) do { + case 0: {-1}; + case 1: {500}; + case 2: {1000}; + case 3: {1500}; + case 4: {2000}; + case 5: {2500}; + case 6: {3000}; + case 7: {3500}; + case 8: {4000}; + case 9: {5000}; + case 10: {6000}; + case 11: {7000}; + case 12: {8000}; + case 13: {9000}; + case 14: {10000}; + default {1000}; +}; + +_return; \ No newline at end of file diff --git a/addons/viewdistance/functions/script_component.hpp b/addons/viewdistance/functions/script_component.hpp new file mode 100644 index 0000000000..4b7df89f37 --- /dev/null +++ b/addons/viewdistance/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\viewdistance\script_component.hpp" \ No newline at end of file diff --git a/addons/viewdistance/script_component.hpp b/addons/viewdistance/script_component.hpp new file mode 100644 index 0000000000..79e0e488cc --- /dev/null +++ b/addons/viewdistance/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT viewdistance +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_VIEWDISTANCE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_VIEWDISTANCE + #define DEBUG_SETTINGS DEBUG_SETTINGS_VIEWDISTANCE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml new file mode 100644 index 0000000000..b8de5321c2 --- /dev/null +++ b/addons/viewdistance/stringtable.xml @@ -0,0 +1,180 @@ + + + + + View Distance Limiter + Ogranicznik zasięgu widzenia + Limitador de distancia de visión + Omezovač dohlednosti + Limitador de distância de visão + + + Allows limiting maximum view distance that can be set by players. + Pozwala ustawić maksymalny limit zasięgu widzenia. + Permite limitar la distancia máxima de visión que se puede establecer por los jugadores. + Umožňuje určit maximální dohlednost, kterou si může hráč nastavit + Permite limitar a distância máxima de visão que pode ser definida pelos jogadores. + + + Enable ACE viewdistance + Wł. zasięg widzenia ACE + Habilitar distancia de visión ACE + Povolit ACE dohlednost + Habilitar distância de visão ACE + + + Enables ACE viewdistance + Aktywuje możliwość zmiany zasięgu widzenia w menu ustawień ACE + Habilita la distancia de visión ACE + Povolit ACE dohlednost + Habilita a distância de visão ACE + + + View Distance Limit + Limit zas. widzenia + Limite de distancia de visión + Limit dohlednosti + Limite da distância de visão + + + Sets the limit for how high clients can raise their view distance (up to 10000) + Ustawia maksymalny limit zasięgu widzenia jaki mogą ustawić gracze (do 10000) + Establece el límite de cuan alta pueden aumentar los clientes la distancia de visión (hasta 10.000) + Stanoví limit jak daleko si může client zvýšit dohlednost (do 10000) + Estabelecer um limite de quão alto os clientes podem aumentar sua distância de visão (até 10000) + + + Limit for client's view distance set here and can overridden by module + Limit zasięgu widzenia jest ustawiany tutaj i może zostać nadpisany poprzez moduł + Establecer aqui el límite para la distancia de visión de los clientes. Puede ser anulado por módulo + Limit dohlednoti pro klienty se nastavuje zde a může být potlačeno pomocí modulu. + Permite limitar a distância de visão máxima que pode ser definida por jogadores. Pode ser substituído por módulo. + + + Client View Distance (On Foot) + Zasięg widzenia (piechota) + Distancia de visión del cliente (A pie) + Dohlednost (Pěšák) + Distância de visão do cliente (A pé) + + + Changes in game view distance when the player is on foot. + Zmienia zasięg widzenia kiedy gracz porusza się na piechotę. + Cambia en juego la distancia de visión cuando el jugador va a pie. + Změna dohlednosti pro hráče pokud jde po svých. + Muda a distância de visão do jogador dentro do jogo quando ele está a pé. + + + Client View Distance (Land Vehicle) + Zasięg widzenia (pojazdy naziemne) + Distancia de visión del cliente (Vehículo terrestre) + Dohlednost (Pozemní technika) + Distância de visão do cliente (Veículo terrestre) + + + Changes in game view distance when the player is in a land vehicle. + Zmienia zasięg widzenia kiedy gracz porusza się pojazdami naziemnymi. + Cambia en juego la distancia de visión cuando el jugador va en un vehículo terrestre. + Změna dohlednosti pro hráče pokud je v pozemní technice. + Muda a distância de visão do jogador dentro do jogo quando ele está dentro de um veículo terrestre. + + + Client View Distance (Air Vehicle) + Zasięg widzenia (pojazdy lotnicze) + Distancia de visión del cliente (Vehículo aéreo) + Dohlednost (Vzdušná technika) + Distância de visão do cliente (Veículo aéreo) + + + Changes in game view distance when the player is in an air vehicle. + Zmienia zasięg widzenia kiedy gracz porusza się pojazdami lotniczymi. + Cambia en juego la distancia de visión cuando el jugador va en un vehículo aéreo. + Změna dohlednosti pro hráče pokud je ve vzdušné technice. + Muda a distância de visão do jogador dentro do jogo quando ele está dentro de um veículo aéreo. + + + Dynamic Object View Distance + Dynamiczny zasięg rysowania obiektów + Distancia de visión dinámica de objetos + Dynamická dohlednost objektů + Distância de visão dinâmica dos objetos + + + Sets the object view distance as a coefficient of the view distance. + Zmienia zasięg rysowania obiektów jako mnożnik zasięgu widzenia. + Establece la distancia de visión de objetos como un coeficiente de la distancia de visión. + Nastaví objekt dohlednosti jako koeficient dohlednosti. + Estabelece a distância de visão dos objetos com um coeficiente da distância de visão. + + + Off + Wyłącz + Apagada + Vypnout + Desligado + + + Very Low + Bardzo niski + Muy baja + Velmi málo + Muito baixo + + + Low + Niski + Baja + Málo + Baixo + + + Medium + Średni + Media + Středně + Médio + + + High + Wysoki + Alta + Hodně + Alto + + + Very High + Bardzo wysoki + Muy alta + Velmi hodně + Muito alto + + + View Distance: + Zasięg widzenia: + Distancia de visión: + Dohlednost: + Distância de visão: + + + Object View Distance is + Zasięg widzenia obiektów wynosi + La distancia de visión de objetos es: + Dohlednost objektů je + Distância de visão do objeto é + + + That option is invalid! The limit is + Ta opcja jest nieprawidłowa! Limit wynosi + Esta opción no es valida! El limite es + Tato volba je neplatná! Limit je + Essa opção é inválida. O limte é + + + Video Settings + Ustawienia wideo + Ajustes de vídeo + Nastavení videa + Ajustes de vídeo + + + \ No newline at end of file diff --git a/addons/weaponselect/ACE_Settings.hpp b/addons/weaponselect/ACE_Settings.hpp new file mode 100644 index 0000000000..7b60527449 --- /dev/null +++ b/addons/weaponselect/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(DisplayText) { + typeName = "BOOL"; + isClientSettable = 1; + value = 1; + displayName = CSTRING(SettingDisplayTextName); + description = CSTRING(SettingDisplayTextDesc); + }; +}; diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index ab77f5d2ee..dfb70f4f71 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -4,7 +4,7 @@ if !(hasInterface) exitWith {}; // Add keybinds -["ACE3 Weapons", QGVAR(SelectPistolNew), localize "STR_ACE_WeaponSelect_SelectPistol", +["ACE3 Weapons", QGVAR(SelectPistolNew), localize LSTRING(SelectPistol), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -16,9 +16,9 @@ if !(hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 1 Key) -["ACE3 Weapons", QGVAR(SelectRifleNew), localize "STR_ACE_WeaponSelect_SelectRifle", +["ACE3 Weapons", QGVAR(SelectRifleNew), localize LSTRING(SelectRifle), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -30,9 +30,9 @@ if !(hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 2 Key) -["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", +["ACE3 Weapons", QGVAR(SelectRifleMuzzleNew), localize LSTRING(SelectRifleMuzzle), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -44,9 +44,9 @@ if !(hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 3 Key) -["ACE3 Weapons", QGVAR(SelectLauncherNew), localize "STR_ACE_WeaponSelect_SelectLauncher", +["ACE3 Weapons", QGVAR(SelectLauncherNew), localize LSTRING(SelectLauncher), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -58,9 +58,9 @@ if !(hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 4 Key) -["ACE3 Weapons", QGVAR(SelectBinocularNew), localize "STR_ACE_WeaponSelect_SelectBinocular", +["ACE3 Weapons", QGVAR(SelectBinocularNew), localize LSTRING(SelectBinocular), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -72,9 +72,9 @@ if !(hasInterface) exitWith {}; false }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 5 Key) -["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", +["ACE3 Weapons", QGVAR(SelectGrenadeFrag), localize LSTRING(SelectGrenadeFrag), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -88,7 +88,7 @@ if !(hasInterface) exitWith {}; {false}, [7, [false, false, false]], false] call cba_fnc_addKeybind; //6 Key -["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", +["ACE3 Weapons", QGVAR(SelectGrenadeOther), localize LSTRING(SelectGrenadeOther), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -102,7 +102,7 @@ if !(hasInterface) exitWith {}; {false}, [8, [false, false, false]], false] call cba_fnc_addKeybind; //7 Key -["ACE3 Weapons", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", +["ACE3 Weapons", QGVAR(HolsterWeapon), localize LSTRING(HolsterWeapon), { // Conditions: canInteract if !([ACE_player, ACE_player, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -110,18 +110,29 @@ if !(hasInterface) exitWith {}; if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; // Statement - [ACE_player] call FUNC(putWeaponAway); + if ((currentWeapon ACE_player) != "") then { + [ACE_player] call FUNC(putWeaponAway); + } else { + private ["_weapon"]; + _weapon = switch (true) do { + case ((primaryWeapon ACE_player) != ""): {primaryWeapon ACE_player}; + case ((handgunWeapon ACE_player) != ""): {handgunWeapon ACE_player}; + case ((secondaryWeapon ACE_player) != ""): {secondaryWeapon ACE_player}; + default {""}; + }; + if (_weapon != "") then {ACE_player selectWeapon _weapon}; + }; true }, {false}, [11, [false, false, false]], false] call cba_fnc_addKeybind; //0 Key -["ACE3 Vehicles", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", +["ACE3 Vehicles", QGVAR(EngineOn), localize LSTRING(EngineOn), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; + if !((ACE_player != vehicle ACE_player) && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; // Statement (vehicle ACE_player) engineOn true; @@ -130,10 +141,10 @@ if !(hasInterface) exitWith {}; {false}, [3, [false, false, false]], false] call cba_fnc_addKeybind; //2 Key -["ACE3 Vehicles", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", +["ACE3 Vehicles", QGVAR(EngineOff), localize LSTRING(EngineOff), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; @@ -144,52 +155,52 @@ if !(hasInterface) exitWith {}; {false}, [2, [false, false, false]], false] call cba_fnc_addKeybind; //1 Key -["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize "STR_ACE_WeaponSelect_SelectMainGun", +["ACE3 Vehicles", QGVAR(SelectMainGunNew), localize LSTRING(SelectMainGun), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); - false + true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //3 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 3 Key) -["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize "STR_ACE_WeaponSelect_SelectMachineGun", +["ACE3 Vehicles", QGVAR(SelectMachineGunNew), localize LSTRING(SelectMachineGun), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); - false + true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //4 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 4 Key) -["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize "STR_ACE_WeaponSelect_SelectMissiles", +["ACE3 Vehicles", QGVAR(SelectMissilesNew), localize LSTRING(SelectMissiles), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; // Statement [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); - false + true }, {false}, -[0, [false, false, false]], false] call cba_fnc_addKeybind; //5 Key +[0, [false, false, false]], false] call cba_fnc_addKeybind; //Unbound (was 5 Key) -["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", +["ACE3 Vehicles", QGVAR(FireSmokeLauncher), localize LSTRING(FireSmokeLauncher), { // Conditions: canInteract - if !([ACE_player, ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, (vehicle ACE_player), []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp index 68d0fe842d..231d167cd0 100644 --- a/addons/weaponselect/config.cpp +++ b/addons/weaponselect/config.cpp @@ -13,13 +13,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Settings { - class GVAR(DisplayText) { - typeName = "BOOL"; - isClientSettable = 1; - value = 1; - displayName = "$STR_ACE_Weaponselect_SettingDisplayTextName"; - description = "$STR_ACE_Weaponselect_SettingDisplayTextDesc"; - }; -}; +#include "ACE_Settings.hpp" diff --git a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index d7a68e7f50..81cb57d9f3 100644 --- a/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -12,12 +12,9 @@ */ #include "script_component.hpp" -private ["_magazine", "_numberofMagazines"]; - if !(GVAR(DisplayText)) exitwith {}; -_magazine = _this select 0; -_numberofMagazines = _this select 1; +PARAMS_2(_magazine,_numberofMagazines); private ["_color", "_name", "_text", "_picture"]; diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf index 02a13ec932..65d62826e5 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_type", "_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines"]; -_type = _this select 0; //"All", "Frag" or "NonFrag" +PARAMS_1(_type); //"All", "Frag" or "NonFrag" _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf index 76b4efd894..0491afa413 100644 --- a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_type", "_allMags", "_allMuzzles", "_magazines"]; +private ["_allMags", "_allMuzzles", "_magazines"]; -_type = _this select 0; //"All", "Frag" or "NonFrag" +PARAMS_1(_type); //"All", "Frag" or "NonFrag" _allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; _allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf index 6b58fc7bc5..37e2b1c873 100644 --- a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -1,9 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_vehicle", "_turret", "_weapons"]; +private ["_turret", "_weapons"]; -_vehicle = _this select 0; +PARAMS_1(_vehicle); _turret = [_vehicle] call EFUNC(common,getTurretCommander); diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index ea671a530d..45e84d631d 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,10 +1,9 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_weapon", "_sound"]; +private ["_sound"]; -_unit = _this select 0; -_weapon = _this select 1; +PARAMS_2(_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 7c0bc47cd7..a4cd743bfb 100644 --- a/addons/weaponselect/functions/fnc_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -11,9 +11,7 @@ */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf index a75a11c202..69ea5cdf99 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -37,7 +37,7 @@ if (_nextMuzzle != "") then { GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + _text = [localize LSTRING(NoGrenadesLeft), [1,0,0]] call EFUNC(common,stringToColoredText); [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf index 0dee3e5c57..91d0023e47 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -36,7 +36,7 @@ if (_nextMuzzle != "") then { // There is a no muzzle with magazines --> select nothing GVAR(CurrentGrenadeMuzzleFrag) = ""; if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + _text = [localize LSTRING(NoFragsLeft), [1,0,0]] call EFUNC(common,stringToColoredText); [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf index 4ab65e5bf3..28cc0e74d8 100644 --- a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -36,7 +36,7 @@ if (_nextMuzzle != "") then { // There is a no muzzle with magazines --> select nothing GVAR(CurrentGrenadeMuzzleOther) = ""; if (GVAR(DisplayText)) then { - _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + _text = [localize LSTRING(NoMiscGrenadeLeft), [1,0,0]] call EFUNC(common,stringToColoredText); [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); }; }; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index aea777d709..012bf94898 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -11,10 +11,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +PARAMS_2(_unit,_weapon); if (_weapon == "") exitWith {}; @@ -32,7 +29,6 @@ private ["_muzzles", "_modes"]; _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); _modes = [_weapon] call EFUNC(common,getWeaponModes); - private ["_index", "_muzzle", "_mode"]; _index = (_modes find currentWeaponMode _unit) + 1; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 011108e448..67e63cd830 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -11,10 +11,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon"]; - -_unit = _this select 0; -_weapon = _this select 1; +PARAMS_2(_unit,_weapon); if (_weapon == "") exitWith {}; @@ -40,7 +37,6 @@ if (_index > count _muzzles - 1) then {_index = 1}; _muzzle = _muzzles select _index; - _index = 0; while { _index < 100 && {currentMuzzle _unit != _muzzle} diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf index 929537b7fa..9507c23a30 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -1,11 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_vehicle", "_index"]; - -_unit = _this select 0; -_vehicle = _this select 1; -_index = _this select 2; +PARAMS_3(_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 81d1a59ed1..4bf970fab1 100644 --- a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -12,10 +12,7 @@ */ #include "script_component.hpp" -private ["_unit", "_muzzle"]; - -_unit = _this select 0; -_muzzle = _this select 1; +PARAMS_2(_unit,_muzzle); private ["_uniformMags", "_vestMags", "_backpackMags", "_i", "_uniformMagsToRemove", "_vestMagsToRemove", "_backpackMagsToRemove", "_firstMagazine", "_throwMuzzleNames"]; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf index e62e118e71..ab06fd5b5d 100644 --- a/addons/weaponselect/functions/fnc_throwGrenade.sqf +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_unit", "_weapon", "_magazine"]; +private ["_unit","_weapon","_magazine"]; _unit = _this select 0; _weapon = _this select 1; diff --git a/addons/weaponselect/stringtable.xml b/addons/weaponselect/stringtable.xml index 2925b66e7d..ea76984097 100644 --- a/addons/weaponselect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -1,7 +1,7 @@  - + Display text on grenade throw Zeige Text beim Granatwurf Mostrar texto al lanzar una granada @@ -13,7 +13,7 @@ Mostra indicazioni nel lancio granate Mostrat texto ao lançar granada - + Display a hint or text on grenade throw. Zeige Hinweis oder Text beim Granatwurf Muestra una notificación o texto al lanzar una granada @@ -22,7 +22,7 @@ Wyświetla powiadomienie lub tekst przy rzucie granatem. Afficher texte/info au lancé de grenade Jelez egy súgót vagy szöveget a gránát eldobásakor. - Mostra un suggerimento quando si lanciano granate + Mostra una notifica quando si lanciano granate Mostra um hint ou texto ao lançar uma granada @@ -47,7 +47,7 @@ Sélectionner Fusil Puska Kiválasztása Selecionar Rifle - Seleziona il Fucile + Seleziona il fucile Select Launcher @@ -59,7 +59,7 @@ Sélectionner Lanceur Rakétavető Kiválasztása Selecionar Lançador - Seleziona il Lanciamissili + Seleziona il lanciamissili Select Grenade Launcher @@ -71,7 +71,7 @@ Sélectionner Lance-grenades Gránátvető Kiválasztása Selecionar Lança-Granadas - Seleziona il Lanciagranate + Seleziona il lanciagranate Select Binoculars @@ -278,4 +278,4 @@ Lançador de fumaça - \ No newline at end of file + diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index 3de925e446..ebdd65c30d 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -2,51 +2,54 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Weather"; + displayName = CSTRING(Module_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class enableServerController { - displayName = "Weather propagation"; - description = "Enables sever side weather propagation"; + displayName = CSTRING(enableServerController_DisplayName); + description = CSTRING(enableServerController_Description); typeName = "BOOL"; defaultValue = 1; }; class 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"; defaultValue = 1; }; class syncRain { - displayName = "Sync Rain"; - description = "Synchronizes rain"; + displayName = CSTRING(syncRain_DisplayName); + description = CSTRING(syncRain_Description); typeName = "BOOL"; defaultValue = 1; }; class syncWind { - displayName = "Sync Wind"; - description = "Synchronizes wind"; + displayName = CSTRING(syncWind_DisplayName); + description = CSTRING(syncWind_Description); typeName = "BOOL"; defaultValue = 1; }; class syncMisc { - displayName = "Sync Misc"; - description = "Synchronizes lightnings, rainbow, fog, ..."; + displayName = CSTRING(syncMisc_DisplayName); + description = CSTRING(syncMisc_Description); typeName = "BOOL"; defaultValue = 1; }; class serverUpdateInterval { - displayName = "Update Interval"; - description = "Defines the interval (seconds) between weather updates"; + displayName = CSTRING(serverUpdateInterval_DisplayName); + description = CSTRING(serverUpdateInterval_Description); typeName = "NUMBER"; defaultValue = 60; }; }; + class ModuleDescription { + description = CSTRING(Module_Description); + }; }; -}; +}; \ No newline at end of file diff --git a/addons/weather/README.md b/addons/weather/README.md index c5b210c70d..a2b719fc11 100644 --- a/addons/weather/README.md +++ b/addons/weather/README.md @@ -1,8 +1,8 @@ ace_weather =========== -Fixes weather synchronisation across clients. - +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 diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 455c336d96..c6f779358f 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -5,11 +5,13 @@ GVAR(temperatureShift) = 3 - random 6; GVAR(badWeatherShift) = (random 1) ^ 2 * 10; GVAR(humidityShift) = (5 - random 10) / 100; -GVAR(wind_period_start_time) = time; -GVAR(rain_period_start_time) = time; +GVAR(wind_period_start_time) = ACE_time; +GVAR(rain_period_start_time) = ACE_time; -"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; }; -"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; }; +GVAR(ACE_rain) = rain; + +"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = ACE_time; }; +"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = ACE_time; }; "ACE_MISC_PARAMS" addPublicVariableEventHandler { if (!isServer) then { if (GVAR(syncMisc)) then { @@ -25,7 +27,7 @@ GVAR(rain_period_start_time) = time; }; }; -["ACE3 Common", QGVAR(WindInfoKey), localize "STR_ACE_Weather_WindInfoKey", +["ACE3 Common", QGVAR(WindInfoKey), localize LSTRING(WindInfoKey), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; @@ -41,4 +43,9 @@ simulWeatherSync; [FUNC(updateTemperature), 20, []] call CBA_fnc_addPerFrameHandler; [FUNC(updateHumidity), 20, []] call CBA_fnc_addPerFrameHandler; [FUNC(updateWind), 1, []] call CBA_fnc_addPerFrameHandler; -[FUNC(updateRain), 2, []] call CBA_fnc_addPerFrameHandler; \ No newline at end of file +[FUNC(updateRain), 2, []] call CBA_fnc_addPerFrameHandler; +[{ + if (GVAR(syncRain)) then { + 0 setRain GVAR(ACE_rain); + }; +}, 0, []] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index 0f49226432..eb5291334a 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -5,6 +5,15 @@ ADDON = false; PREP(calculateAirDensity); PREP(calculateBarometricPressure); +PREP(calculateDensityAltitude); +PREP(calculateDewPoint); +PREP(calculateHeatIndex); +PREP(calculateRoughnessLength); +PREP(calculateSpeedOfSound); +PREP(calculateTemperatureAtHeight); +PREP(calculateWetBulb); +PREP(calculateWindChill); +PREP(calculateWindSpeed); PREP(displayWindInfo); PREP(getMapData); PREP(getWind); diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp index 39cf223518..50e2f8ace0 100644 --- a/addons/weather/config.cpp +++ b/addons/weather/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"q1184", "Rocko", "esteldunedain","Ruthberg"}; + author[] = {"q1184", "Rocko", "esteldunedain", "Ruthberg"}; VERSION_CONFIG; }; }; diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index 298049e51d..921bff3bf3 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -16,12 +16,9 @@ */ #include "script_component.hpp" -private ["_temperature", "_pressure", "_relativeHumidity"]; -_temperature = _this select 0; // in C -_pressure = _this select 1; // in hPa -_relativeHumidity = _this select 2; // as ratio 0-1 +PARAMS_3(_temperature,_pressure,_relativeHumidity); -_pressure = _pressure * 100; +_pressure = _pressure * 100; // hPa to Pa if (_relativeHumidity > 0) then { private ["_pSat", "_vaporPressure", "_partialPressure"]; diff --git a/addons/weather/functions/fnc_calculateBarometricPressure.sqf b/addons/weather/functions/fnc_calculateBarometricPressure.sqf index c65d343c93..e0d8e8f878 100644 --- a/addons/weather/functions/fnc_calculateBarometricPressure.sqf +++ b/addons/weather/functions/fnc_calculateBarometricPressure.sqf @@ -14,7 +14,4 @@ */ #include "script_component.hpp" -private ["_altitude"]; -_altitude = _this; - -(1013.25 * exp(-(GVAR(Altitude) + _altitude) / 7990) - 10 * overcast) +((1013.25 - 10 * overcast) * (1 - (0.0065 * (GVAR(Altitude) + _this)) / (KELVIN(GVAR(currentTemperature)) + 0.0065 * GVAR(Altitude))) ^ 5.255754495); \ No newline at end of file diff --git a/addons/weather/functions/fnc_calculateDensityAltitude.sqf b/addons/weather/functions/fnc_calculateDensityAltitude.sqf new file mode 100644 index 0000000000..97889e2499 --- /dev/null +++ b/addons/weather/functions/fnc_calculateDensityAltitude.sqf @@ -0,0 +1,19 @@ +/* + * Author: Ruthberg + * + * Calculates density altitude for a given air density + * + * Arguments: + * density of air - kg * m^(-3) + * + * Return Value: + * density altitude - m + * + * Return value: + * None + */ +#include "script_component.hpp" + +// Source: http://wahiduddin.net/calc/density_altitude.htm + +((44.3308 - 42.2665 * _this ^ 0.2349692456) * 1000) diff --git a/addons/weather/functions/fnc_calculateDewPoint.sqf b/addons/weather/functions/fnc_calculateDewPoint.sqf new file mode 100644 index 0000000000..76656b1f55 --- /dev/null +++ b/addons/weather/functions/fnc_calculateDewPoint.sqf @@ -0,0 +1,30 @@ +/* + * Author: Ruthberg + * + * Calculates dew point based on temperature and relative humidity + * + * Arguments: + * 0: temperature - degrees celcius + * 2: relativeHumidity - value between 0.0 and 1.0 + * + * Return Value: + * 0: dew point + * + * Return value: + * None + */ +#include "script_component.hpp" + +#define __b 17.67 +#define __c 243.5 + +PARAMS_2(_t,_rh); + +if (_rh == 0) exitWith { CELSIUS(0) }; + +// Source: https://en.wikipedia.org/wiki/Dew_point + +private ["_gamma"]; +_gamma = ln(_rh) + (__b * _t) / (__c + _t); + +(__c * _gamma) / (__b - _gamma) diff --git a/addons/weather/functions/fnc_calculateHeatIndex.sqf b/addons/weather/functions/fnc_calculateHeatIndex.sqf new file mode 100644 index 0000000000..473360c867 --- /dev/null +++ b/addons/weather/functions/fnc_calculateHeatIndex.sqf @@ -0,0 +1,34 @@ +/* + * Author: Ruthberg + * + * Calculates heat index based on temperature and relative humidity + * + * Arguments: + * 0: temperature - degrees celcius + * 2: relativeHumidity - value between 0.0 and 1.0 + * + * Return Value: + * 0: heat index + * + * Return value: + * None + */ +#include "script_component.hpp" + +#define __C1 0.363445176 +#define __C2 0.988622465 +#define __C3 4.777114035 +#define __C4 -0.114037667 +#define __C5 -0.000850208 +#define __C6 -0.020716198 +#define __C7 0.000687678 +#define __C8 0.000274954 + +PARAMS_2(_t,_rh); + +// Source: https://en.wikipedia.org/wiki/Heat_index + +_t = TO_FAHRENHEIT(_t); +_rh = _rh * 100; // relative humidity in % + +TO_CELSIUS(__C1 + __C2 * _t + __C3 * _rh + __C4 * _t * _rh + __C5 * _t^2 + __C6 * _rh^2 + __C7 * _t^2 * _rh + __C8 * _t * _rh^2) diff --git a/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf b/addons/weather/functions/fnc_calculateRoughnessLength.sqf similarity index 100% rename from addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf rename to addons/weather/functions/fnc_calculateRoughnessLength.sqf diff --git a/addons/weather/functions/fnc_calculateSpeedOfSound.sqf b/addons/weather/functions/fnc_calculateSpeedOfSound.sqf new file mode 100644 index 0000000000..322ba75ac5 --- /dev/null +++ b/addons/weather/functions/fnc_calculateSpeedOfSound.sqf @@ -0,0 +1,17 @@ +/* + * Author: Ruthberg + * + * Calculates the speed of sound for a given temperature + * + * Arguments: + * temperature - degrees celcius + * + * Return Value: + * speed of sound - m/s + * + * Return value: + * None + */ +#include "script_component.hpp" + +(331.3 + (0.6 * _this)) diff --git a/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf new file mode 100644 index 0000000000..dd31dfe05e --- /dev/null +++ b/addons/weather/functions/fnc_calculateTemperatureAtHeight.sqf @@ -0,0 +1,17 @@ +/* + * Author: Ruthberg + * + * Calculates the temperature based on altitude and weather + * + * Arguments: + * 0: height - meters + * + * Return Value: + * 0: temperature - degrees celsius + * + * Return value: + * None + */ +#include "script_component.hpp" + +(GVAR(currentTemperature) - 0.0065 * _this) diff --git a/addons/weather/functions/fnc_calculateWetBulb.sqf b/addons/weather/functions/fnc_calculateWetBulb.sqf new file mode 100644 index 0000000000..c180cf8384 --- /dev/null +++ b/addons/weather/functions/fnc_calculateWetBulb.sqf @@ -0,0 +1,41 @@ +/* + * Author: Ruthberg + * + * Calculates wet bulb based on temperature and relative humidity + * + * Arguments: + * 0: temperature - degrees celcius + * 1: pressure - hPa + * 2: relativeHumidity - value between 0.0 and 1.0 + * + * Return Value: + * 0: wet bulb + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_es", "_e", "_eDiff", "_eGuessPrev", "_cTempDelta", "_twGuess", "_eguess"]; + +PARAMS_3(_temperature,_pressure,_relativeHumidity); + +// Source: http://cosmoquest.org/forum/showthread.php?155366-Calculating-Wet-Bulb-Temperature-from-RH-amp-Dry-Bulb +_es = 6.112 * exp((17.67 * _temperature) / (_temperature + 243.5)); +_e = _es * _relativeHumidity; +_eDiff = _es - _e; +_eGuessPrev = _es; +_cTempDelta = 3.3145; +_twGuess = _temperature; + +for "_j" from 1 to 50 do { + _twGuess = _twGuess - _cTempDelta; + _eguess = 6.112 * exp((17.67 * _twGuess) / (_twGuess + 243.5)); + _eguess = _eguess - (_pressure * (_temperature - _twGuess) * 0.00066 * (1 + (0.00115 * _twGuess))); + _eDiff = _eguess - _e; + if (abs(_eDiff) <= 0.001) exitWith {}; + _cTempDelta = _eDiff / ((_eguessprev - _eguess) / _cTempDelta); + _eguessprev = _eguess; +}; + +_twGuess diff --git a/addons/weather/functions/fnc_calculateWindChill.sqf b/addons/weather/functions/fnc_calculateWindChill.sqf new file mode 100644 index 0000000000..021d2f8b99 --- /dev/null +++ b/addons/weather/functions/fnc_calculateWindChill.sqf @@ -0,0 +1,25 @@ +/* + * Author: Ruthberg + * + * Calculates wind chill based on temperature and wind speed + * + * Arguments: + * 0: temperature - degrees celcius + * 2: wind speed - m/s + * + * Return Value: + * 0: wind chill + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_t,_v); + +// Source: https://en.wikipedia.org/wiki/Wind_chill + +if (_t > 10) exitWith { _t }; +if (_v < 1.39) exitWith { _t }; + +_v = _v * 3,6; // wind speed in km/h +(13.12 + 0.6215 * _t - 11.37 * _v ^ 0.16 + 0.3965 * _t * _v ^ 0.16) diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf new file mode 100644 index 0000000000..d991897b97 --- /dev/null +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -0,0 +1,90 @@ +/* + * Author: Ruthberg + * + * Calculates the true wind speed at a given world position + * + * Arguments: + * 0: world position - posASL + * 1: Account for wind gradient + * 2: Account for terrain + * 3: Account for obstacles + * + * Return Value: + * 0: wind speed - m/s + * + * Public: No + */ +#include "script_component.hpp" + +private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; + +PARAMS_4(_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled); + +fnc_polar2vect = { + private ["_mag2D"]; + _mag2D = (_this select 0) * cos((_this select 2)); + [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; +}; + +_windSpeed = vectorMagnitude ACE_wind; +_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); + +// Wind gradient +if (_windGradientEnabled) then { + if (_windSpeed > 0.05) then { + _height = (ASLToATL _position) select 2; + _height = 0 max _height min 20; + if (_height < 20) then { + _roughnessLength = _position call FUNC(calculateRoughnessLength); + _windSpeed = _windSpeed * abs(ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); + }; + }; +}; + +// Terrain effect on wind +if (_terrainEffectEnabled) then { + if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + _windSpeed = _newWindSpeed; + }; +}; + +// Obstacle effect on wind +if (_obstacleEffectEnabled) then { + if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; + _windSpeed = _newWindSpeed; + }; +}; + +_windSpeed = 0 max _windSpeed; + +_windSpeed diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 7996503719..e81463f41a 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -38,15 +38,14 @@ GVAR(WindInfo) = true; _windIndex = 12; _windColor = [1, 1, 1, 1]; - - // Toogle behaviour depending on ace_advanced_ballistics being used or not - // @todo, check ACE_AB is actually enabled - _windSpeed = if (isClass (configFile >> "CfgPatches" >> "ACE_Advanced_Ballistics")) then { - (eyePos ACE_player) call EFUNC(advanced_ballistics,calculateWindSpeed); + _windSpeed = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + // With wind gradient + [eyePos ACE_player, true, true, true] call FUNC(calculateWindSpeed); } else { - vectorMagnitude ACE_wind; + // Without wind gradient + [eyePos ACE_player, false, true, true] call FUNC(calculateWindSpeed); }; - + if (_windSpeed > 0.2) then { _playerDir = getDir ACE_player; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf index 5a090c7388..55c6e9c3c0 100644 --- a/addons/weather/functions/fnc_getMapData.sqf +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -103,7 +103,7 @@ if (toLower worldName in ["takistan", "zargabad", "mountains_acr", "shapur_baf", GVAR(Humidity) = [68, 69, 62, 60, 49, 37, 38, 39, 40, 41, 56, 61]; // Source: https://weatherspark.com/averages/32750/Kabul-Afghanistan - GVAR(WindSpeedMax) = [[4.0, 1.0], [4.1, 1.0], [5.1, 1.1], [6.9, 1.2], [8.9, 1.2], [10.0, 1.1], 0, [8.2, 1.0], [6.9, 1.0], [5.2, 1.0], [3.8, 0.9], [3.7, 0.9]]; + GVAR(WindSpeedMax) = [[4.0, 1.0], [4.1, 1.0], [5.1, 1.1], [6.9, 1.2], [8.9, 1.2], [10.0, 1.1], [9.1,1.0], [8.2, 1.0], [6.9, 1.0], [5.2, 1.0], [3.8, 0.9], [3.7, 0.9]]; GVAR(WindSpeedMean) = [2.2, 2.2, 2.5, 2.8, 3.8, 4.4, 0, 3.3, 2.7, 2.4, 1.8, 1.9]; GVAR(WindSpeedMin) = [[0.2, 0.4], [0.2, 0.4], [0.2, 0.4], [0.3, 0.4], [0.6, 0.4], [0.9, 0.4], [0.7, 0.4], [0.5, 0.4], [0.2, 0.5], [0.1, 0.1], [0, 0.1], [0, 0.1]]; GVAR(WindDirectionProbabilities) = [[0.04, 0.02, 0.05, 0.04, 0.05, 0.04, 0.11, 0.29], // January diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf index a23394e992..5b123afaa0 100644 --- a/addons/weather/functions/fnc_getWind.sqf +++ b/addons/weather/functions/fnc_getWind.sqf @@ -16,7 +16,7 @@ if (isNil "ACE_WIND_PARAMS") exitWith { [0, 0, 0] }; EXPLODE_5_PVT(ACE_WIND_PARAMS,_dir,_dirChange,_spd,_spdChange,_period); private ["_periodPercent", "_periodPosition"]; -_periodPosition = (time - GVAR(wind_period_start_time)) min _period; +_periodPosition = (ACE_time - GVAR(wind_period_start_time)) min _period; _periodPercent = _periodPosition / _period; _spd = _spd + _spdChange * _periodPercent; diff --git a/addons/weather/functions/fnc_updateAceWeather.sqf b/addons/weather/functions/fnc_updateAceWeather.sqf index 8ed0bb0d10..029e1eb89b 100644 --- a/addons/weather/functions/fnc_updateAceWeather.sqf +++ b/addons/weather/functions/fnc_updateAceWeather.sqf @@ -27,11 +27,11 @@ if (GVAR(syncRain) && GVAR(rain_period_count) > GVAR(rain_next_period)) then { _rainOverCast = (overcast - 0.7) / 0.3; if (GVAR(current_rain) == 0) then { // Initialize rain with a random strength depending on the current overcast value - GVAR(current_rain) = 0.25 + (random 0.25) + (random 0.5) * _rainOverCast; + GVAR(current_rain) = -0.25 + (random 0.75) + (random 0.5) * _rainOverCast; }; GVAR(current_rain) = GVAR(current_rain) + GVAR(current_rain) * ((_rainOverCast * _overcastMultiplier) / 8) * GVAR(rain_current_range); - GVAR(current_rain) = 0.01 max GVAR(current_rain) min 1; + GVAR(current_rain) = 0 max GVAR(current_rain) min 1; GVAR(rain_current_range) = -1 + (random 2); } else { @@ -45,7 +45,7 @@ if (GVAR(syncRain) && GVAR(rain_period_count) > GVAR(rain_next_period)) then { ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; TRACE_4("",_lastRain,_rainOverCast,_transitionTime,overcast); - GVAR(rain_period_start_time) = time; + GVAR(rain_period_start_time) = ACE_time; publicVariable "ACE_RAIN_PARAMS"; }; @@ -91,7 +91,7 @@ if (GVAR(syncWind) && GVAR(wind_period_count) > GVAR(wind_next_period)) then { GVAR(current_wind_direction) = _windDirection; GVAR(current_wind_speed) = _windSpeed; - GVAR(wind_period_start_time) = time; + GVAR(wind_period_start_time) = ACE_time; publicVariable "ACE_WIND_PARAMS"; }; diff --git a/addons/weather/functions/fnc_updateRain.sqf b/addons/weather/functions/fnc_updateRain.sqf index d240093443..ced8641f61 100644 --- a/addons/weather/functions/fnc_updateRain.sqf +++ b/addons/weather/functions/fnc_updateRain.sqf @@ -14,12 +14,11 @@ if (!GVAR(syncRain)) exitWith {}; if (!isNil "ACE_RAIN_PARAMS") then { - EXPLODE_3_PVT(ACE_RAIN_PARAMS,_oldRain,_newRain,_period); private ["_periodPosition", "_periodPercent"]; - _periodPosition = (time - GVAR(rain_period_start_time)) min _period; + _periodPosition = (ACE_time - GVAR(rain_period_start_time)) min _period; _periodPercent = (_periodPosition / _period) min 1; - 0 setRain (_oldRain + (_newRain - _oldRain) * _periodPercent); + GVAR(ACE_Rain) = (_oldRain + (_newRain - _oldRain) * _periodPercent); }; diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf index 06bb57d093..b362458fdb 100644 --- a/addons/weather/functions/fnc_updateWind.sqf +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -13,11 +13,16 @@ if (!GVAR(syncWind)) exitWith { ACE_wind = wind }; +private ["_newWaves"]; + ACE_wind = [] call FUNC(getWind); setWind [ACE_wind select 0, ACE_wind select 1, true]; 2 setGusts 0; // Set waves: 0 when no wind, 1 when wind >= 16 m/s -1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); +_newWaves = ((vectorMagnitude ACE_wind) / 16.0) min 1.0; +if (abs(_newWaves - waves) > 0.1) then { + 1 setWaves _newWaves; +}; TRACE_3("Wind/ACE_wind/Deviation(m/s)",wind,ACE_wind,Round((vectorMagnitude (ACE_wind vectorDiff wind)) * 1000) / 1000); diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp index edc1ac64d0..2a6aeb0393 100644 --- a/addons/weather/script_component.hpp +++ b/addons/weather/script_component.hpp @@ -18,3 +18,5 @@ #define WATER_VAPOR_MOLAR_MASS 0.018016 #define DRY_AIR_MOLAR_MASS 0.028964 #define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 +#define TO_CELSIUS(t) ((t - 32) / 1.8) +#define TO_FAHRENHEIT(t) (t * 1.8 + 32) diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 2008fc7bc1..69e2d4a792 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -13,5 +13,117 @@ Zobrazit informace o větru Mostrar informação do vento + + Weather + Pogoda + Clima + Wetter + Počasí + Clima + + + Multiplayer synchronized ACE weather module + Synchronizowana pogoda ACE + Modulo climático del ACE sincronizado en multijugador + ACE-Wettermodul (synchron im Multiplayer) + Synchronizovat ACE počasí v multiplayeru + Módulo climático ACE para sincronismo multiplayer + + + Weather propagation + Zmiany pogody + Propagación del clima + Wetterübertragung + Změny počasí + Propagação do clima + + + Enables server side weather propagation + Aktywuje zmiany pogody po stronie serwera + Permite al servidor controlar la propagación del clima + Aktiviere serverseitige Wetterübertragung + Aktivuje změny počasí na straně serveru + Ativa propagação de clima via server + + + ACE Weather + Pogoda ACE + Clima ACE + ACE-Wetter + ACE počasí + Clima ACE + + + Overrides the default weather (editor, mission settings) with ACE weather (map based) + Nadpisuje domyślne ustawienia pogody (edytor, wywiad) przy użyciu pogody ACE (zależna od mapy) + Sobreescribe el sistema climático por defecto (editor, ajustes de mision) con clima del ACE (basado en el mapa) + Überschreibt das Standardwetter (Editor, Missionseinstellungen) mit dem ACE-Wetter (kartenbasiert) + Přepíše výchozí počasí (editor, nastavení mise) s ACE počasím (podle mapy) + Sobreescreve o clima padrão (editor, ajustes de missão) pelo sistema de clima ACE (baseado por mapa) + + + Sync Rain + Synchronizuj deszcz + Sincronizar lluvia + Regen synchronisieren + Synchronizuj déšť + Sincronizar chuva + + + Synchronizes rain + Synchronizuje deszcz + Sincroniza la lluvia + Synchronisiert den Regen + Synchronizace deště + Sincroniza a chuva + + + Sync Wind + Synchronizuj wiatr + Sincronizar viento + Wind synchronisieren + Synchronizuj vítr + Sincronizar vento + + + Synchronizes wind + Synchronizuje wiatr + Sincroniza el viento + Synchronisiert den Wind + Synchronizace větru + Sincroniza o vento + + + Sync Misc + Synchronizuj różne + Sincronizar otros + Sonstiges synchronisieren + Synchronizuj různé + Sincronizar outros + + + Synchronizes lightnings, rainbow, fog, ... + Synchronizuje pioruny, tęcze, mgłę, ... + Sincroniza relampagos, arcoiris, niebla ... + Synchronisiert Blitze, Regenbögen, Nebel, ... + Synchronizace blesků, duhy, mlhy, ... + Sincroniza relâmpagos, arco-íris, neblina... + + + Update Interval + Interwał aktualizacji + Intervalo de actualización + Aktualisierungsintervall + Interval aktualizace + Intervalo de atualização + + + Defines the interval (seconds) between weather updates + Określa interwał (sekundy) pomiędzy aktualizacjami pogody + Defina el intervalo (en segundos) entre actualizacions de clima + Definiert das Intervall (in Sekunden) zwischen Wetteraktualisierungen + Určit interval (v sekundách) mezi aktualizacemi počasí + Defina o intervalo (em segundos) entre as atualizações de clima + \ No newline at end of file diff --git a/addons/winddeflection/$PBOPREFIX$ b/addons/winddeflection/$PBOPREFIX$ new file mode 100644 index 0000000000..e36be56aec --- /dev/null +++ b/addons/winddeflection/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\winddeflection \ No newline at end of file diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index 1c24c0a386..2694bb1b34 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -2,39 +2,42 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Wind Deflection"; + displayName = CSTRING(windDeflection_DisplayName); icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); class Arguments { class enabled { - displayName = "Wind Deflection"; - description = "Enables wind deflection"; + displayName = CSTRING(deflectionModule_DisplayName); + description = CSTRING(deflectionModule_Description); typeName = "BOOL"; defaultValue = 1; }; class vehicleEnabled { - displayName = "Vehicle Enabled"; - description = "Enables wind deflection for static/vehicle gunners"; + displayName = CSTRING(vehicleEnabled_DisplayName); + description = CSTRING(vehicleEnabled_Description); typeName = "BOOL"; defaultValue = 1; }; class simulationInterval { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = CSTRING(simulationInterval_DisplayName); + description = CSTRING(simulationInterval_Description); typeName = "NUMBER"; defaultValue = 0.05; }; class 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 = "NUMBER"; defaultValue = 3000; }; }; + class ModuleDescription { + description = CSTRING(windDeflection_Description); + }; }; -}; +}; \ No newline at end of file diff --git a/addons/winddeflection/config.cpp b/addons/winddeflection/config.cpp index e0c77420cf..82a51a4b73 100644 --- a/addons/winddeflection/config.cpp +++ b/addons/winddeflection/config.cpp @@ -7,9 +7,9 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_weather"}; versionDesc = "ACE Wind Deflection"; - version = VERSION; - author[] = {$STR_ACE_Common_ACETeam, "Glowbal", "Ruthberg"}; + author[] = {ECSTRING(common,ACETeam), "Glowbal", "Ruthberg"}; authorUrl = "http://csemod.com"; + VERSION_CONFIG; }; }; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 4c2859f9b6..40e349095e 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -30,8 +30,8 @@ [_this select 1] call cba_fnc_removePerFrameHandler; }; - _deltaT = time - _time; - _args set[2, time]; + _deltaT = ACE_time - _time; + _args set[2, ACE_time]; if (vectorMagnitude ACE_wind > 0) then { _trueVelocity = _bulletVelocity vectorDiff ACE_wind; @@ -47,4 +47,4 @@ }; _bullet setVelocity _bulletVelocity; -}, GVAR(simulationInterval), [_this select 0, _this select 1, time]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file +}, GVAR(simulationInterval), [_this select 0, _this select 1, ACE_time]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index af6f05a912..036456e35e 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -1,67 +1,144 @@  - - - Wind Information - Informacje o wietrze - Información del viento - Информация о ветре - Informace o větru - Vent - Windinformationen - Szélinformáció - Informazioni sul vento - Informação do vento - - - Direction: %1 - Kierunek: %1 - Dirección: %1 - Направление: %1° - Směr: %1 - Direction %1 - Windrichtung: %1 - Irány: %1 - Direzione: %1 - Direção: %1 - - - Speed: %1 m/s - Prędkość: %1 - Velocidad: %1 m/s - Скорость: %1 м/с - Rychlost: %1 m/s - Vitesse %1 m/s - Geschwindigkeit: %1 m/s - Sebesség: %1 m/s - Velocità: %1 m/s - Velocidade: %1 m/s - - - Weather Information - Informacje o pogodzie - Información Meteorológica - Информация о погоде - Informace o počasí - Météo - Wetterinformationen - Időjárás-Információ - Meteo - Informação Meteorológica - - - Humidity: %1% - Wilgotność: %1 - Humedad: %1% - Влажность: %1% - Vlhkost: %1% - Humidité: %1% - Luftfeuchtigkeit: %1 - Páratartalom: %1% - Umidità: %1% - Humidade: %1% - - + + Wind Information + Informacje o wietrze + Información del viento + Информация о ветре + Informace o větru + Vent + Windinformationen + Szélinformáció + Informazioni sul vento + Informação do vento + + + Direction: %1 + Kierunek: %1 + Dirección: %1 + Направление: %1° + Směr: %1 + Direction %1 + Windrichtung: %1 + Irány: %1 + Direzione: %1° + Direção: %1 + + + Speed: %1 m/s + Prędkość: %1 + Velocidad: %1 m/s + Скорость: %1 м/с + Rychlost: %1 m/s + Vitesse %1 m/s + Geschwindigkeit: %1 m/s + Sebesség: %1 m/s + Velocità: %1 m/s + Velocidade: %1 m/s + + + Weather Information + Informacje o pogodzie + Información Meteorológica + Информация о погоде + Informace o počasí + Météo + Wetterinformationen + Időjárás-Információ + Meteo + Informação Meteorológica + + + Humidity: %1% + Wilgotność: %1 + Humedad: %1% + Влажность: %1% + Vlhkost: %1% + Humidité: %1% + Luftfeuchtigkeit: %1 + Páratartalom: %1% + Umidità: %1% + Humidade: %1% + + + Wind Deflection + Wpływ wiatru + Desviación por viento + Účinky větru + Desvio de vento + + + Wind Deflection + Wpływ wiatru + Desviación por viento + Windablenkung + Účinky větru + Desvio de vento + + + Enables wind deflection + Aktywuje wpływ wiatru na trajektorię lotu pocisków + Activa la desviación por viento + Aktiviert Windablenkung + Umožňit vliv větru + Ativa o desvio de vento + + + Vehicle Enabled + Włączone dla pojazdów + Habilitada en vehículos + Fahrzeuge aktiviert + Vozidla povolena + Ativado em veículos + + + Enables wind deflection for static/vehicle gunners + Aktywuje wpływ wiatru na trajektorię lotu pocisków dla broni statycznej i na pojazdach + Habilita la desviación por viento para artilleros estaticos/de vehículos + Aktiviere Windablenkung für statische oder Fahrzeugschützen + Umožnit vliv větru pro střelce z vozidla/statiky + Ativa o desvio de vento para atiradores de estáticas e veículos + + + Simulation Interval + Interwał symulacji + Intervalo de simulación + Simulationsintervall + Interval simulace + Intervalo de simulação + + + Defines the interval between every calculation step + Określa interwał pomiędzy każdym krokiem kalkulacji + Define el intervalo entre cada calculo + Definiert das Intervall zwischen jedem Berechnungsschritt + Určuje interval mezi každým výpočtem + Define o intervalo entre cada cálculo + + + Simulation Radius + Zasięg symulacji + Radio de simulación + Simulationsradius + Oblast simulace + Radio da Simulação + + + Defines the radius around the player (in meters) at which projectiles are wind deflected + Określa obszar naokoło gracza (w metrach), na którym pociski są znoszone przez wiatr + Define el radio alrededor del jugador (en metros) en el cual los proyectiles son desviados por el viento + Gibt den Radius (in Metern) um den Spieler an, in dem Projektile vom Wind beeinflusst werden + Definuje oblast kolem hráče (v metrech) v které je projektil ovlivněn větrem + Define o raio ao redor do jogador (em metros) em qual os projéteis são desviados pelo vento + + + Wind influence on projectiles trajectory + Wpływ wiatru na trajektorię lotu pocisków + Influencia del viento en la trayectoria de proyectiles + Windeinfluss auf die Geschossbahnen + Vítr ovlivňuje trajektorii projektilu + Influência do vento na trajetória dos projéteis + - + \ No newline at end of file diff --git a/addons/yardage450/$PBOPREFIX$ b/addons/yardage450/$PBOPREFIX$ new file mode 100644 index 0000000000..7efb31f23f --- /dev/null +++ b/addons/yardage450/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\yardage450 \ No newline at end of file diff --git a/addons/yardage450/CfgEventHandlers.hpp b/addons/yardage450/CfgEventHandlers.hpp new file mode 100644 index 0000000000..2a05b72298 --- /dev/null +++ b/addons/yardage450/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) ); + }; +}; \ No newline at end of file diff --git a/addons/yardage450/CfgVehicles.hpp b/addons/yardage450/CfgVehicles.hpp new file mode 100644 index 0000000000..d8f2ccabe3 --- /dev/null +++ b/addons/yardage450/CfgVehicles.hpp @@ -0,0 +1,20 @@ +class CfgVehicles { + class Item_Base_F; + class ACE_Item_Yardage450: Item_Base_F { + author[] = {"Spooner", "tcp"}; + scope = 2; + scopeCurator = 2; + displayName = CSTRING(DisplayName); + vehicleClass = "Items"; + class TransportWeapons { + MACRO_ADDWEAPON(ACE_Yardage450,1); + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportWeapons { + MACRO_ADDWEAPON(ACE_Yardage450,4); + }; + }; +}; diff --git a/addons/yardage450/CfgWeapons.hpp b/addons/yardage450/CfgWeapons.hpp new file mode 100644 index 0000000000..54e15401a6 --- /dev/null +++ b/addons/yardage450/CfgWeapons.hpp @@ -0,0 +1,23 @@ + +class CfgWeapons { + class Binocular; + class ACE_Yardage450: Binocular { + author = ECSTRING(common,ACETeam); + displayName = CSTRING(DisplayName); + descriptionShort = CSTRING(Description); + model = PATHTOF(data\ace_yardage_pro_450.p3d); + modelOptics = PATHTOF(data\bushnell_optic.p3d); + picture = PATHTOF(UI\w_bushnell_ca.paa); + opticsZoomMin = 0.33333/4; + opticsZoomMax = 0.33333/4; + opticsZoomInit = 0.33333/4; + distanceZoomMin = 400; + distanceZoomMax = 400; + discretefov[] = {0.33333/4}; + discreteInitIndex = 0; + visionMode[] = {"Normal"}; + class WeaponSlotsInfo { + mass = 12; + }; + }; +}; diff --git a/addons/yardage450/README.md b/addons/yardage450/README.md new file mode 100644 index 0000000000..6301233fe4 --- /dev/null +++ b/addons/yardage450/README.md @@ -0,0 +1,10 @@ +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) diff --git a/addons/yardage450/RscTitles.hpp b/addons/yardage450/RscTitles.hpp new file mode 100644 index 0000000000..28fd7735e9 --- /dev/null +++ b/addons/yardage450/RscTitles.hpp @@ -0,0 +1,75 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +class ACE_Yardage450_RscText { + type = 0; + idc = -1; + style = ST_CENTER; + font = "EtelkaMonospacePro"; + sizeEx = "0.027 * SafeZoneH"; + colorText[] = {0, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 0}; +}; + +class RscTitles { + class ACE_RscYardage450 { + idd = -1; + movingEnable = 0; + duration = 100000; + fadein = 0; + fadeout = 0; + name = "ACE_RscYardage450"; + onLoad = "with uiNameSpace do { ACE_RscYardage450 = _this select 0; };"; + onUnload = "with uiNameSpace do { ACE_RscYardage450 = displayNull; };"; + + class Controls { + class ACE_Yardage450_RscTarget : ACE_Yardage450_RscText { + idc = 720041; + style = ST_CENTER; + x = "0.5 - (0.18 * SafeZoneH)"; + y = "0.5 - (0.25 * SafeZoneH)"; + w = "0.4 * SafeZoneH"; + h = "0.05 * SafeZoneH"; + sizeEx = "0.05 * SafeZoneH"; + text = "TARGET ACQUIRED"; + }; + class ACE_Yardage450_RscLaser : ACE_Yardage450_RscTarget { + idc = 720042; + x = "0.5 - (0.14 * SafeZoneH)"; + y = "0.5 - (0.18 * SafeZoneH)"; + w = "0.045 * SafeZoneH"; + h = "0.02 * SafeZoneH"; + sizeEx = "0.02 * SafeZoneH"; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 1}; + text = "LASER"; + }; + class ACE_Yardage450_RscRange : ACE_Yardage450_RscTarget { + idc = 720043; + style = ST_RIGHT; + x = "0.5 - (0.02 * SafeZoneH)"; + y = "0.5 + (0.18 * SafeZoneH)"; + w = "0.08 * SafeZoneH"; + h = "0.06 * SafeZoneH"; + sizeEx = "0.06 * SafeZoneH"; + text = "---"; + }; + class ACE_Yardage450_RscMeters : ACE_Yardage450_RscLaser { + idc = 720044; + x = "0.5 + (0.06 * SafeZoneH)"; + y = "0.5 + (0.19 * SafeZoneH)"; + w = "0.05 * SafeZoneH"; + h = "0.018 * SafeZoneH"; + sizeEx = "0.018 * SafeZoneH"; + text = "METERS"; + }; + class ACE_Yardage450_RscYards : ACE_Yardage450_RscMeters { + idc = 720045; + y = "0.5 + (0.21 * SafeZoneH)"; + w = "0.0417 * SafeZoneH"; + text = "YARDS"; + }; + }; + }; +}; diff --git a/addons/yardage450/UI/w_bushnell_ca.paa b/addons/yardage450/UI/w_bushnell_ca.paa new file mode 100644 index 0000000000..85a6aca23f Binary files /dev/null and b/addons/yardage450/UI/w_bushnell_ca.paa differ diff --git a/addons/yardage450/XEH_postInit.sqf b/addons/yardage450/XEH_postInit.sqf new file mode 100644 index 0000000000..2d4ef89968 --- /dev/null +++ b/addons/yardage450/XEH_postInit.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +#include "initKeybinds.sqf" + +GVAR(active) = false; + +GVAR(useYards) = false; + +GVAR(powerButtonPressed) = false; +GVAR(powerOnTime) = 0; + +GVAR(lasing) = false; +GVAR(targetAcquired) = false; +GVAR(targetRangeText) = "---"; diff --git a/addons/yardage450/XEH_preInit.sqf b/addons/yardage450/XEH_preInit.sqf new file mode 100644 index 0000000000..ad84432e0d --- /dev/null +++ b/addons/yardage450/XEH_preInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(acquireTarget); +PREP(turnOn); + +ADDON = true; diff --git a/addons/yardage450/config.cpp b/addons/yardage450/config.cpp new file mode 100644 index 0000000000..4d0f820aed --- /dev/null +++ b/addons/yardage450/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_Yardage450"}; + weapons[] = {"ACE_Yardage450"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_apl", "ace_laser"}; + author[] = {"Spooner", "tcp", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "RscTitles.hpp" diff --git a/addons/yardage450/data/Bushnell.rvmat b/addons/yardage450/data/Bushnell.rvmat new file mode 100644 index 0000000000..9f8cf9835d --- /dev/null +++ b/addons/yardage450/data/Bushnell.rvmat @@ -0,0 +1,66 @@ +ambient[]={1.000000,1.000000,1.000000,1.000000}; +diffuse[]={1.000000,1.000000,1.000000,1.000000}; +forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000}; +emmisive[]={0.000000,0.000000,0.000000,1.000000}; +specular[]={0.7000000,0.700000,0.700000,1.000000}; +specularPower=20.000000; +PixelShaderID="Super"; +VertexShaderID="Super"; +class Stage1 { + texture="z\ace\addons\yardage450\data\bushnell_nohq.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage2 { + texture="a3\weapons_f\data\detailmaps\plast_dt.paa"; + uvSource="tex"; + class uvTransform { + aside[]={3.0000,0.000000,0.000000}; + up[]={0.000000,3.0000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage3 { + texture="#(argb,8,8,3)color(0,0,0,0)"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage4 { + texture="z\ace\addons\yardage450\data\bushnell_as.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage5 { + texture="z\ace\addons\yardage450\data\bushnell_smdi.paa"; + uvSource="tex"; + class uvTransform { + aside[]={1.000000,0.000000,0.000000}; + up[]={0.000000,1.000000,0.000000}; + dir[]={0.000000,0.000000,0.000000}; + pos[]={0.000000,0.000000,0.000000}; + }; +}; +class Stage6 { + texture="#(ai,64,64,1)fresnel(2,2)"; + uvSource="none"; +}; +class Stage7 { + texture="a3\data_f\env_land_co.paa"; + uvSource="none"; +}; diff --git a/addons/yardage450/data/ace_yardage_pro_450.p3d b/addons/yardage450/data/ace_yardage_pro_450.p3d new file mode 100644 index 0000000000..e63b5021da Binary files /dev/null and b/addons/yardage450/data/ace_yardage_pro_450.p3d differ diff --git a/addons/yardage450/data/bushnell_as.paa b/addons/yardage450/data/bushnell_as.paa new file mode 100644 index 0000000000..44d605d59c Binary files /dev/null and b/addons/yardage450/data/bushnell_as.paa differ diff --git a/addons/yardage450/data/bushnell_co.paa b/addons/yardage450/data/bushnell_co.paa new file mode 100644 index 0000000000..9d2738ca6f Binary files /dev/null and b/addons/yardage450/data/bushnell_co.paa differ diff --git a/addons/yardage450/data/bushnell_nohq.paa b/addons/yardage450/data/bushnell_nohq.paa new file mode 100644 index 0000000000..4500e4b6cf Binary files /dev/null and b/addons/yardage450/data/bushnell_nohq.paa differ diff --git a/addons/yardage450/data/bushnell_optic.p3d b/addons/yardage450/data/bushnell_optic.p3d new file mode 100644 index 0000000000..653a25ec3c Binary files /dev/null and b/addons/yardage450/data/bushnell_optic.p3d differ diff --git a/addons/yardage450/data/bushnell_optic_ca.paa b/addons/yardage450/data/bushnell_optic_ca.paa new file mode 100644 index 0000000000..b9cfa9d1b4 Binary files /dev/null and b/addons/yardage450/data/bushnell_optic_ca.paa differ diff --git a/addons/yardage450/data/bushnell_smdi.paa b/addons/yardage450/data/bushnell_smdi.paa new file mode 100644 index 0000000000..285c120dbe Binary files /dev/null and b/addons/yardage450/data/bushnell_smdi.paa differ diff --git a/addons/yardage450/data/scope_view.paa b/addons/yardage450/data/scope_view.paa new file mode 100644 index 0000000000..626b1caaa0 Binary files /dev/null and b/addons/yardage450/data/scope_view.paa differ diff --git a/addons/yardage450/functions/fnc_acquireTarget.sqf b/addons/yardage450/functions/fnc_acquireTarget.sqf new file mode 100644 index 0000000000..1d89bf5971 --- /dev/null +++ b/addons/yardage450/functions/fnc_acquireTarget.sqf @@ -0,0 +1,60 @@ +/* + * Author: Ruthberg + * Fires the laser to acquire the target + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +// Reference: http://www.optcorp.com/pdf/Bushnell/YardageProSport.pdf +#define MIN_DISTANCE ([9, 10] select GVAR(useYards)) +#define MAX_DISTANCE ([732, 800] select GVAR(useYards)) +#define METERING_POINT_NUMBER 8 + +private ["_result", "_distance", "_min", "_max", "_range"]; + +GVAR(lasing) = true; +GVAR(targetAcquired) = false; + +GVAR(distances) = []; +GVAR(distanceIndex) = -1; + +[{ + if (GVAR(targetAcquired) || !GVAR(powerButtonPressed)) exitWith { + GVAR(lasing) = false; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _result = [eyePos ACE_player, ACE_player weaponDirection (currentWeapon ACE_player)] call EFUNC(laser,shootRay); + _distance = _result select 1; + + _distance = _distance - 1 + (random 2); + + GVAR(distanceIndex) = (GVAR(distanceIndex) + 1) % METERING_POINT_NUMBER; + GVAR(distances) set [GVAR(distanceIndex), _distance]; + + if (count GVAR(distances) == METERING_POINT_NUMBER) then { + _min = MAX_DISTANCE; + _max = MIN_DISTANCE; + { + _min = _x min _min; + _max = _max max _x; + } forEach GVAR(distances); + + if (abs(_max - _min) < 5) then { + _range = (_min + _max) / 2; + if (_range >= MIN_DISTANCE && _range <= MAX_DISTANCE) then { + GVAR(targetAcquired) = true; + GVAR(targetRangeText) = Str(round(_range)); + }; + }; + }; +}, 0.1, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/yardage450/functions/fnc_turnOn.sqf b/addons/yardage450/functions/fnc_turnOn.sqf new file mode 100644 index 0000000000..5f123b8cb2 --- /dev/null +++ b/addons/yardage450/functions/fnc_turnOn.sqf @@ -0,0 +1,56 @@ +/* + * Author: Ruthberg + * Shows the Yardage 450 screen elements + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * + * Public: No + */ +#include "script_component.hpp" + +#define __dsp (uiNamespace getVariable "ACE_RscYardage450") +#define __ctrlTarget (__dsp displayCtrl 720041) +#define __ctrlLaser (__dsp displayCtrl 720042) +#define __ctrlRange (__dsp displayCtrl 720043) +#define __ctrlMeters (__dsp displayCtrl 720044) +#define __ctrlYards (__dsp displayCtrl 720045) + +if (currentWeapon ACE_player != "ACE_Yardage450" || cameraView != "GUNNER") exitWith {}; + +GVAR(powerOnTime) = ACE_time; + +if (GVAR(active)) exitWith {}; + +GVAR(active) = true; + +[{ + if (ACE_time - GVAR(powerOnTime) > 30) exitWith { + GVAR(active) = false; + 74210 cutText ["", "PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + if (currentWeapon ACE_player == "ACE_Yardage450" && cameraView == "GUNNER") then { + 74210 cutRsc ["ACE_RscYardage450", "PLAIN", 1, false]; + + __ctrlLaser ctrlShow GVAR(lasing); + if (GVAR(targetAcquired)) then { + __ctrlTarget ctrlSetText "Target Acquired"; + __ctrlRange ctrlSetText GVAR(targetRangeText); + } else { + __ctrlTarget ctrlSetText ""; + __ctrlRange ctrlSetText "---"; + }; + __ctrlMeters ctrlShow !GVAR(useYards); + __ctrlYards ctrlShow GVAR(useYards); + } else { + 74210 cutText ["", "PLAIN"]; + }; + +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/yardage450/functions/script_component.hpp b/addons/yardage450/functions/script_component.hpp new file mode 100644 index 0000000000..ed5cf1b7c7 --- /dev/null +++ b/addons/yardage450/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\yardage450\script_component.hpp" \ No newline at end of file diff --git a/addons/yardage450/initKeybinds.sqf b/addons/yardage450/initKeybinds.sqf new file mode 100644 index 0000000000..578f55ee40 --- /dev/null +++ b/addons/yardage450/initKeybinds.sqf @@ -0,0 +1,28 @@ + +["ACE3 Equipment", QGVAR(DistanceKey), localize "STR_ACE_Yardage450_PowerButtonKey", +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if !(GVAR(active)) exitWith {false}; + if (currentWeapon ACE_player != "ACE_Yardage450" || cameraView != "GUNNER") exitWith {false}; + + // Statement + if !(GVAR(powerButtonPressed)) then { + GVAR(powerButtonPressed) = true; + call FUNC(acquireTarget); + }; + true +}, +{ + // Conditions: canInteract + if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; + // Conditions: specific + if (currentWeapon ACE_player != "ACE_Yardage450" || cameraView != "GUNNER") exitWith {false}; + + // Statement + GVAR(powerButtonPressed) = false; + call FUNC(turnOn); + true +}, +[19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key diff --git a/addons/yardage450/script_component.hpp b/addons/yardage450/script_component.hpp new file mode 100644 index 0000000000..abff262efc --- /dev/null +++ b/addons/yardage450/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT yardage450 +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_YARDAGE450 + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_YARDAGE450 + #define DEBUG_SETTINGS DEBUG_SETTINGS_YARDAGE450 +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/yardage450/stringtable.xml b/addons/yardage450/stringtable.xml new file mode 100644 index 0000000000..971b3a4889 --- /dev/null +++ b/addons/yardage450/stringtable.xml @@ -0,0 +1,28 @@ + + + + + Yardage 450 + Yardage 450 + Yardage 450 + Yardage 450 + Yardage 450 + + + Laser Rangefinder + Laserentfernungsmesser + Dalmierz laserowy + Telémetro láser + Laserový dálkoměr + Medidor de Distância a laser + + + Yardage 450 - Power Button + Yardage 450 - Einschalt-Taste + Yardage 450 - Przycisk zasilania + Yardage 450 - Botón de encendido + Yardage 450 - Tlačítko napájení + Yardage 450 - Botão de energia + + + \ No newline at end of file diff --git a/addons/zeus/$PBOPREFIX$ b/addons/zeus/$PBOPREFIX$ new file mode 100644 index 0000000000..ae5a20d62d --- /dev/null +++ b/addons/zeus/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\zeus \ No newline at end of file diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp new file mode 100644 index 0000000000..388e3c42cb --- /dev/null +++ b/addons/zeus/ACE_Settings.hpp @@ -0,0 +1,23 @@ +class ACE_Settings { + class GVAR(zeusAscension) { + typeName = "BOOL"; + value = 0; + }; + class GVAR(zeusBird) { + typeName = "BOOL"; + value = 0; + }; + class GVAR(remoteWind) { + typeName = "BOOL"; + value = 0; + }; + class GVAR(radioOrdnance) { + typeName = "BOOL"; + value = 0; + }; + class GVAR(revealMines) { + typeName = "SCALAR"; + value = 0; + values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(revealMines_partial), CSTRING(revealMines_full)}; + }; +}; diff --git a/addons/zeus/CfgEventHandlers.hpp b/addons/zeus/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/zeus/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp new file mode 100644 index 0000000000..79d4ff6f1f --- /dev/null +++ b/addons/zeus/CfgVehicles.hpp @@ -0,0 +1,114 @@ +class CfgVehicles { + class Module_F; + class ModuleEmpty_F; + class ACE_Module; + + class ModuleCurator_F: Module_F { + function = QFUNC(bi_moduleCurator); + }; + class ModuleMine_F: ModuleEmpty_F { + function = QFUNC(bi_moduleMine); + }; + class ModuleOrdnance_F: Module_F { + function = QFUNC(bi_moduleProjectile); + }; + class ModuleRemoteControl_F: Module_F { + function = QFUNC(bi_moduleRemoteControl); + }; + class GVAR(moduleSettings): ACE_Module { + scope = 2; + displayName = CSTRING(Settings_DisplayName); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Settings_ca.paa)); + category = "ACE"; + function = QFUNC(moduleZeusSettings); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "SilentSpike"; + class Arguments { + class zeusAscension { + displayName = CSTRING(ascension_DisplayName); + description = CSTRING(ascension_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class zeusBird { + displayName = CSTRING(bird_DisplayName); + description = CSTRING(bird_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class remoteWind { + displayName = CSTRING(remoteWind_DisplayName); + description = CSTRING(remoteWind_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class radioOrdnance { + displayName = CSTRING(radioOrdnance_DisplayName); + description = CSTRING(radioOrdnance_Description); + typeName = "BOOL"; + defaultValue = 0; + }; + class revealMines { + displayName = CSTRING(revealMines_DisplayName); + description = CSTRING(revealMines_Description); + typeName = "NUMBER"; + class values { + class disable { + name = "$STR_A3_OPTIONS_DISABLED"; + value = 0; + default = 1; + }; + class partial { + name = CSTRING(revealMines_partial); + value = 1; + }; + class full { + name = CSTRING(revealMines_full); + value = 2; + }; + }; + }; + }; + class ModuleDescription { + description = CSTRING(Settings_Description); + sync[] = {}; + }; + }; + class GVAR(moduleBase): Module_F { + author = "SilentSpike"; + category = "ACE"; + scopeCurator = 2; + }; + class GVAR(moduleCaptive): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleCaptive_DisplayName); + function = QFUNC(moduleCaptive); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Captive_ca.paa)); + class ModuleDescription { + description = "Flips the capture state of the specified unit."; + sync[] = {}; + }; + }; + class GVAR(moduleSurrender): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSurrender_DisplayName); + function = QFUNC(moduleSurrender); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Surrender_ca.paa)); + class ModuleDescription { + description = "Flips the surrender state of the specified unit."; + sync[] = {}; + }; + }; + class GVAR(moduleUnconscious): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleUnconscious_DisplayName); + function = QFUNC(moduleUnconscious); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Unconscious_ca.paa)); + class ModuleDescription { + description = "Flips the unconscious state of the specified unit."; + sync[] = {}; + }; + }; +}; diff --git a/addons/zeus/README.md b/addons/zeus/README.md new file mode 100644 index 0000000000..b99edb66bb --- /dev/null +++ b/addons/zeus/README.md @@ -0,0 +1,15 @@ +ace_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) diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf new file mode 100644 index 0000000000..1b2ac19263 --- /dev/null +++ b/addons/zeus/XEH_preInit.sqf @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(bi_moduleCurator); +PREP(bi_moduleMine); +PREP(bi_moduleProjectile); +PREP(bi_moduleRemoteControl); +PREP(handleZeusUnitAssigned); +PREP(moduleCaptive); +PREP(moduleSurrender); +PREP(moduleUnconscious); +PREP(moduleZeusSettings); + +if (isServer) then { + ["zeusUnitAssigned", FUNC(handleZeusUnitAssigned)] call EFUNC(common,addEventHandler); +}; + +ADDON = true; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp new file mode 100644 index 0000000000..7505f2770e --- /dev/null +++ b/addons/zeus/config.cpp @@ -0,0 +1,34 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"SilentSpike"}; + authorUrl = "https://github.com/SilentSpike"; + VERSION_CONFIG; + }; + // Use additional cfgPatches to contextually remove modules from zeus + class GVAR(captives): ADDON { + units[] = { + QGVAR(moduleCaptive), + QGVAR(moduleSurrender) + }; + }; + class GVAR(medical): ADDON { + units[] = { + QGVAR(moduleUnconscious) + }; + }; +}; + +class ACE_Curator { + GVAR(captives) = "ace_captives"; + GVAR(medical) = "ace_medical"; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "ACE_Settings.hpp" diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf new file mode 100644 index 0000000000..a36d8dd458 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -0,0 +1,349 @@ +/* + * Author: Bohemia Interactive + * Module function for initalizing zeus + * Edited to remove eagle and global ascension message + * Added "zeusUnitAssigned" event call + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated) then { + + //--- Terminate when not created on the server + if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { + [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; + deletevehicle _logic; + }; + + //--- Get curator owner + _ownerVar = _logic getvariable ["owner",""]; + _ownerUID = parsenumber _ownerVar; + if (cheatsenabled) then { + _ownerVarArray = toarray _ownerVar; + _ownerVarArray resize 3; + if (tostring _ownerVarArray == "DEV") then {_ownerUID = 1;}; + }; + if (_ownerVar == "" && !ismultiplayer) then { + ["Curator owner not defined, player used instead in singleplayer."] call bis_fnc_error; + _ownerVar = player call bis_fnc_objectvar; + }; + if (_ownerUID > 0 && !ismultiplayer) then { + _ownerVar = player call bis_fnc_objectvar; + }; + _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; + + //--- Wipe out the variable so clients can't access it + _logic setvariable ["owner",nil]; + + //--- Server + if (isserver) then { + + //--- Prepare admin variable + _adminVar = ""; + if (_isAdmin) then { + _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; + _adminVar = "admin_"; + for "_i" from 0 to 9 do {_adminVar = _adminVar + (_letters call bis_fnc_selectrandom);}; + _logic setvariable ["adminVar",_adminVar,true]; + }; + + //--- Get allowed addons + _addonsType = _logic getvariable ["Addons",0]; + _addons = []; + switch _addonsType do { + + //--- All (including unofficial ones) + case 3: { + _cfgPatches = configfile >> "cfgpatches"; + for "_i" from 0 to (count _cfgPatches - 1) do { + _class = _cfgPatches select _i; + if (isclass _class) then {_addons set [count _addons,configname _class];}; + }; + _addons call bis_fnc_activateaddons; + removeallcuratoraddons _logic; + _logic addcuratoraddons _addons; + }; + + //--- All active + case 2: {}; + + //--- All mission + case 1: { + _addonsList = []; + { + _addonsList = _addonsList + (unitaddons typeof _x); + } foreach (entities "all"); + removeallcuratoraddons _logic; + _logic addcuratoraddons _addonsList; + }; + + //--- None + case 0: { + removeallcuratoraddons _logic; + }; + }; + + //--- Handle ownership + [_logic,_ownerVar,_ownerUID,_adminVar] spawn { + scriptname "BIS_fnc_moduleCurator: Owner"; + + _logic = _this select 0; + _ownerVar = _this select 1; + _ownerUID = _this select 2; + _adminVar = _this select 3; + + if (_adminVar != "") then {_ownerVar = _adminVar;}; + + _forced = _logic getvariable ["forced",0] > 0; + _name = _logic getvariable ["name",""]; + if (_name == "") then {_name = localize "STR_A3_curator";}; + + //--- Wait until mission starts + waituntil {time > 0}; // NOTE: DO NOT CHANGE TO ACE_TIME, IT BREAKS THE MODULE + + //--- Refresh addon list, so it's broadcasted to clients + _addons = curatoraddons _logic; + removeAllCuratorAddons _logic; + _logic addcuratoraddons _addons; + + while {true} do { + //--- Wait for player to become Zeus + switch true do { + case (_ownerUID > 0): { + waituntil { + sleep 0.01; + {getplayeruid _x == _ownerVar} count playableunits > 0 || isnull _logic + }; + }; + default { + waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull]) || isnull _logic}; + }; + }; + if (isnull _logic) exitwith {}; + + //--- Assign + _player = objnull; + switch true do { + case (_ownerUID > 0): { + { + if (getplayeruid _x == _ownerVar) exitwith {_player = _x;}; + } foreach playableunits; + }; + default { + _player = missionnamespace getvariable [_ownerVar,objnull]; + }; + }; + + waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; + waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; + if (isnull _logic) exitwith {}; + + //--- Add radio channels + { + _x radiochanneladd [_player]; + } foreach (_logic getvariable ["channels",[]]); + + // Added by ace_zeus to delay ascension message at mission start + [{ + _logic = _this select 0; + _player = _this select 1; + + //--- Sent notification to all assigned players + if ((_logic getvariable ["showNotification",true]) && GVAR(zeusAscension)) then { + { + if (isplayer _x) then { + [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; + }; + } foreach (curatoreditableobjects _logic); + }; + },[_logic,_player]] call EFUNC(common,execNextFrame); + + [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; + + // Added by ace_zeus + ["zeusUnitAssigned", [_logic,_player]] call EFUNC(common,globalEvent); + + //--- Forced interface + //if (_forced) then { + // [[true,true],"bis_fnc_forceCuratorInterface",_player] call bis_fnc_mp; + //}; + + //--- Wait for player to stop being Zeus + switch true do { + case (_ownerUID > 0): { + waituntil { + sleep 0.01; + {getplayeruid _x == _ownerVar} count playableunits == 0 || isnull _logic + }; + }; + default { + waituntil {_player != missionnamespace getvariable [_ownerVar,objnull] || isnull _logic}; + }; + }; + if (isnull _logic) exitwith {}; + + //--- Add radio channels + { + _x radiochannelremove [_player]; + } foreach (_logic getvariable ["channels",[]]); + + //--- Unassign + waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; + if (isnull _logic) exitwith {}; + }; + }; + + //--- Activated all future addons + _addons = []; + { + if (typeof _x == "ModuleCuratorAddAddons_F") then { + _paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]"); + { + if !(_x in _addons) then {_addons set [count _addons,_x];}; + { + if !(_x in _addons) then {_addons set [count _addons,_x];}; + } foreach (unitaddons _x); + } foreach _paramAddons; + }; + } foreach (synchronizedobjects _logic); + _addons call bis_fnc_activateaddons; + + // Added by ace_zeus to delay bird code + [{ + _logic = _this select 0; + + if (GVAR(zeusBird)) then { + //--- Create bird + _birdType = _logic getvariable ["birdType","eagle_f"]; + if (_birdType != "") then { + _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _logic setvariable ["bird",_bird,true]; + }; + + //--- Locality changed + _logic addeventhandler [ + "local", + { + _logic = _this select 0; + _bird = _logic getvariable ["bird",objnull]; + _bird setowner owner _logic; + } + ]; + }; + },[_logic]] call EFUNC(common,execNextFrame); + }; + + //--- Player + if (hasinterface) then { + waituntil {local player}; + _serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"}; + + //--- Black effect until the interface is open + _forced = _logic getvariable ["forced",0] > 0; + if (_forced) then { + _isCurator = switch true do { + case (_ownerUID > 0): { + getplayeruid player == _ownerVar + }; + case (_isAdmin): { + isserver || servercommandavailable _serverCommand + }; + default { + player == missionnamespace getvariable [_ownerVar,objnull] + }; + }; + if (_isCurator) then { + [true,true] spawn bis_fnc_forceCuratorInterface; + ("RscDisplayCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + }; + }; + + //--- Check if player is server admin + if (_isAdmin) then { + _adminVar = _logic getvariable ["adminVar",""]; + _logic setvariable ["adminVar",nil]; + if (isserver) then { + //--- Host + missionnamespace setvariable [_adminVar,player]; + } else { + //--- Client + [_logic,_adminVar,_serverCommand] spawn { + scriptname "BIS_fnc_moduleCurator: Admin check"; + + _logic = _this select 0; + _adminVar = _this select 1; + _serverCommand = _this select 2; + while {true} do { + waituntil {sleep 0.1; servercommandavailable _serverCommand}; + missionnamespace setvariable [_adminVar,player]; + publicvariable _adminVar; + _respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; + + waituntil {sleep 0.1; !servercommandavailable _serverCommand}; + missionnamespace setvariable [_adminVar,objnull]; + publicvariable _adminVar; + player removeeventhandler ["respawn",_respawn]; + }; + }; + }; + }; + + [_logic] spawn { + _logic = _this select 0; + sleep 1; + waituntil {alive player}; + + //--- Show warning when Zeus key is not assigned + if (count (actionkeys "curatorInterface") == 0) then { + [ + format [ + localize "str_a3_cfgvehicles_modulecurator_f_keyNotAssigned", + (["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBAtoHTML + ] + ] call bis_fnc_guiMessage; + }; + + //--- Show hint about pinging for players + if ( + isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} + && + {isTutHintsEnabled} + && + {isnull getassignedcuratorlogic player} + && + {player in curatoreditableobjects _logic} + ) then { + sleep 0.5; + [["Curator","Ping"]] call bis_fnc_advHint; + }; + }; + + //--- Add local event handlers + _logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; + _logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}]; + _logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; + _logic addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; + _logic addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; + + _logic addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + + player call bis_fnc_curatorRespawn; + }; +}; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf new file mode 100644 index 0000000000..8f60531b34 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -0,0 +1,50 @@ +/* + * Author: Bohemia Interactive + * Module function for spawning mines + * Edited to remove forced map markers and mines being revealed to players + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated) then { + _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); + if (_explosive != "") then { + _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; + _explosive attachto [_logic]; + + // Added by ace_zeus to control if mines are revealed + if (GVAR(revealMines) > 0) then { + //--- Reveal the mine to curator's side + { + _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; + _side revealmine _explosive; + } foreach (objectcurators _logic); + + if (GVAR(revealMines) > 1) then { + //--- Mark minefields in the map + [] spawn bis_fnc_drawMinefields; + }; + }; + + //--- Show hint to curator who placed the object + [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; + + waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; + if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; + deletevehicle _logic; + }; +}; diff --git a/addons/modules/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf similarity index 92% rename from addons/modules/functions/fnc_bi_moduleProjectile.sqf rename to addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 56e3eb9883..5980e56b3d 100644 --- a/addons/modules/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -2,9 +2,12 @@ * Author: Bohemia Interactive * Module function for spawning projectiles * Used by Curator artillery modules etc + * Edited to remove radio warning and add ballistics support * * Arguments: - * 0: The logic object + * 0: The module logic + * 1: units + * 2: activated * * Return Value: * nil @@ -12,6 +15,8 @@ * Public: No */ +#include "script_component.hpp" + _fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; private ['_fnc_scriptNameParent']; _fnc_scriptNameParent = _fnc_scriptNameParentTemp; @@ -99,9 +104,9 @@ if (_activated) then { _side = side group _x; if (_side in [east,west,resistance,civilian]) then { //--- Play radio (only if it wasn't played recently) - if (time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { + if (ACE_time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { [[_side,_radio,"side"],"bis_fnc_sayMessage",_x] call bis_fnc_mp; - _x setvariable ["BIS_fnc_moduleProjectile_radio",time + _delay]; + _x setvariable ["BIS_fnc_moduleProjectile_radio",ACE_time + _delay]; }; }; }; @@ -122,7 +127,7 @@ if (_activated) then { _projectile setvelocity _velocity; if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; - // This is our addition to this function + // Added by ace_zeus for ace_frag compatibility if (!isnil "ace_frag_fnc_addManualTrack") then { [_projectile] call ace_frag_fnc_addManualTrack }; @@ -133,8 +138,11 @@ if (_activated) then { //--- Create sound source _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; - //--- Play radio warning - [] call _fnc_playRadio; + // Added by ace_zeus to toggle ordnance radio message + if (GVAR(radioOrdnance)) then { + //--- Play radio warning + [] call _fnc_playRadio; + }; //--- Update if (_attach) then { diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf new file mode 100644 index 0000000000..a9e1f35080 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -0,0 +1,173 @@ +/* + * Author: Bohemia Interactive + * Module function for remote controlling units as zeus + * Edited to remove global wind sound + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated && local _logic && !isnull curatorcamera) then { + + //--- Terminate when remote control is already in progress + if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + + //--- Get unit under cursor + _unit = objnull; + _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; + _unit = effectivecommander _unit; + + //--- Check if the unit is suitable + _error = ""; + if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; + if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; + if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; + if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; + if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + + if (_error == "") then { + _unit spawn { + scriptname "bis_fnc_moduleRemoteControl: Loop"; + _unit = _this; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + + bis_fnc_moduleRemoteControl_unit = _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + + // Added by ace_zeus to toggle remote control wind sound + if (GVAR(remoteWind)) then { + //--- Play wind cue to all players + [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; + }; + + _blur = ppeffectcreate ["RadialBlur",144]; + _blur ppeffectenable true; + _blur ppeffectadjust [0,0,0.3,0.3]; + _blur ppeffectcommit 0; + _blur ppeffectadjust [0.03,0.03,0.1,0.1]; + _blur ppeffectcommit 1; + + _cam = "camera" camcreate getposatl curatorcamera; + _cam cameraeffect ["internal","back"]; + _cam campreparetarget (screentoworld [0.5,0.5]); + _cam camcommitprepared 0; + _cam campreparetarget _unit; + _cam campreparefov 0.1; + _cam camcommitprepared 1; + sleep 0.75; + + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; + sleep 0.25; + + //--- Wait for interface to close + (finddisplay 312) closedisplay 2; + waituntil {isnull curatorcamera}; + + //--- Switch + player remotecontrol _unit; + if (cameraon != _vehicle) then { + _vehicle switchcamera cameraview; + }; + + ppeffectdestroy _blur; + _cam cameraeffect ["terminate","back"]; + camdestroy _cam; + + _color = ppeffectcreate ["colorCorrections",1896]; + _color ppeffectenable true; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; + _color ppeffectcommit 0; + + _curator = getassignedcuratorlogic player; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; + [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; + + sleep 0.3; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; + _color ppeffectcommit 0.3; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; + + //--- Back to player + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + _rating = rating player; + waituntil { + //--- Refresh when vehicle or vehicle role changes + if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { + player remotecontrol _unit; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + }; + if (rating player < _rating) then { + player addrating (-rating player + _rating); + }; + sleep 0.01; + !isnull curatorcamera + || + {cameraon == vehicle player} + || + {!alive _unit} //--- Also isnull check, objNull is not alive + || + {isnull getassignedcuratorlogic player} + //|| + //{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit + }; + + player addrating (-rating player + _rating); + objnull remotecontrol _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + + //--- Death screen + if ( + isnull curatorcamera + && + {cameraon != vehicle player} + && + {!isnull _unit} + && + {!isnull getassignedcuratorlogic player} + //&& + //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} + ) then { + sleep 2; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; + sleep 1; + }; + _unitPos = getposatl _unit; + _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; + _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; + //[_camPos,_unit] call bis_fnc_setcuratorcamera; + (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + + sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + opencuratorinterface; + ppeffectdestroy _color; + + waituntil {!isnull curatorcamera}; + player switchcamera cameraview; + bis_fnc_moduleRemoteControl_unit = nil; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; + sleep 0.01; + }; + } else { + [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; + }; + deletevehicle _logic; +}; diff --git a/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf new file mode 100644 index 0000000000..e5433bad27 --- /dev/null +++ b/addons/zeus/functions/fnc_handleZeusUnitAssigned.sqf @@ -0,0 +1,50 @@ +/* + * Author: SilentSpike + * Contextually removes addons (given in ACE_Curator) from zeus based on their required addon(s) + * + * ACE_Curator format: + * ModuleAddon = "RequiredAddon"; + * OR + * ModuleAddon[] = {"RequiredAddon1","RequiredAddon2",...} + * + * Arguments: + * 0: The zeus logic + * 1: The zeus player + * + * Return Value: + * nil + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic","_removeAddons","_numCfgs","_cfg","_requiredAddon"]; + +if !(isClass (configFile >> "ACE_Curator")) exitWith { ERROR("The ACE_Curator class does not exist") }; + +_logic = _this select 0; +_removeAddons = []; + +_numCfgs = count (configFile >> "ACE_Curator"); +for "_n" from 0 to (_numCfgs - 1) do { + _cfg = (configFile >> "ACE_Curator") select _n; + + if (isArray _cfg) then { + _requiredAddon = getArray _cfg; + { + if !(isClass (configFile >> "CfgPatches" >> _x)) exitWith { + _removeAddons pushBack (configName _cfg); + }; + } forEach _requiredAddon; + }; + + if (isText _cfg) then { + _requiredAddon = getText _cfg; + if !(isClass (configFile >> "CfgPatches" >> _requiredAddon)) then { + _removeAddons pushBack (configName _cfg); + }; + }; +}; + +_logic removeCuratorAddons _removeAddons; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf new file mode 100644 index 0000000000..f77f9846a4 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -0,0 +1,45 @@ +/* + * Author: SilentSpike + * Flips the capture state of the unit the module is attached to. + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * ReturnValue: + * nil + * + * Public: no + */ + +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); +private ["_unit","_captive"]; + +if (!_activated) exitWith {}; + +if (isNil QEFUNC(captives,setHandcuffed)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _unit = attachedTo _logic; + + if (isNull _unit) then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + if !(_unit isKindOf "CAManBase") then { + [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + _captive = GETVAR(_unit,EGVAR(captives,isHandcuffed),false); + // Event initalized by ACE_Captives + ["SetHandcuffed", _unit, [_unit, !_captive]] call EFUNC(common,targetEvent); + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf new file mode 100644 index 0000000000..591b216ad7 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -0,0 +1,49 @@ +/* + * Author: SilentSpike + * Flips the surrender state of the unit the module is attached to. + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * ReturnValue: + * nil + * + * Public: no + */ + +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); +private ["_unit","_surrendering"]; + +if (!_activated) exitWith {}; + +if (isNil QEFUNC(captives,setSurrendered)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _unit = attachedTo _logic; + + if (isNull _unit) then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + 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 { + _surrendering = GETVAR(_unit,EGVAR(captives,isSurrendering),false); + // Event initalized by ACE_Captives + ["SetSurrendered", _unit, [_unit, !_surrendering]] call EFUNC(common,targetEvent); + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf new file mode 100644 index 0000000000..2d8bae85e8 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -0,0 +1,45 @@ +/* + * Author: SilentSpike + * Flips the unconscious state of the unit the module is attached to. + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * ReturnValue: + * nil + * + * Public: no + */ + +#include "script_component.hpp" + +PARAMS_3(_logic,_units,_activated); +private ["_unit","_conscious"]; + +if (!_activated) exitWith {}; + +if (isNil QEFUNC(medical,setUnconscious)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _unit = attachedTo _logic; + + if (isNull _unit) then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + if !(_unit isKindOf "CAManBase") then { + [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + _conscious = GETVAR(_unit,ACE_isUnconscious,false); + // Function handles locality for me + [_unit, !_conscious, round(random(10)+5), true] call EFUNC(medical,setUnconscious); + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf new file mode 100644 index 0000000000..3a582f7196 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -0,0 +1,29 @@ +/* + * Author: SilentSpike + * Module for adjusting various aspects of zeus + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(zeusAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(radioOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(revealMines), "revealMines"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule); diff --git a/addons/zeus/functions/script_component.hpp b/addons/zeus/functions/script_component.hpp new file mode 100644 index 0000000000..35453cc4e8 --- /dev/null +++ b/addons/zeus/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\zeus\script_component.hpp" \ No newline at end of file diff --git a/addons/zeus/script_component.hpp b/addons/zeus/script_component.hpp new file mode 100644 index 0000000000..7211b28f7d --- /dev/null +++ b/addons/zeus/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT zeus +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_ZEUS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_ZEUS + #define DEBUG_SETTINGS DEBUG_SETTINGS_ZEUS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml new file mode 100644 index 0000000000..80d08a3275 --- /dev/null +++ b/addons/zeus/stringtable.xml @@ -0,0 +1,174 @@ + + + + + Zeus Settings + Ustawienia Zeusa + Ajustes Zeus + Nastavení Zeuse + Ajustes do Zeus + + + Provides control over various aspects of Zeus. + Pozwala kontrolować różne aspekty Zeusa. + Proporciona control sobre diversos aspectos de Zeus. + Poskytuje kontrolu na různými aspekty Zeuse. + Proporciona controle sobre diversos aspectos do Zeus. + + + Ascension Messages + Wiad. o nowym Zeusie + Mensajes de ascensión + Zpráva o novém Zeusovi + Mensagens de ascensão + + + Display global popup messages when a player is assigned as Zeus. + Wyświetlaj globalną wiadomość kiedy gracz zostanie przydzielony jako Zeus + Mostrar mensajes emergentes globales cuando a un jugador se le asigna como Zeus. + Zobrazit globální zprávu když je hráč přiřazen jako Zeus. + Mostra uma mensagem popup quando um jogador é atribuido ao Zeus. + + + Zeus Eagle + Orzeł Zeusa + Águila Zeus + Orel Zeuse + Águia do Zeus + + + Spawn an eagle that follows the Zeus camera. + Spawnuj orła, który podąrza za kamerą Zeusa. + Generar un águila que sigue la cámara Zeus. + Vytvoří orla, který následuje kameru Zeuse. + Cria uma águia que segue a câmera do Zeus + + + Wind Sounds + Dźwięki wiatru + Sonidos de viento + Zvuky větru + Sons de vento + + + Play wind sounds when Zeus remote controls a unit. + Odtwarzaj dźwięki wiatru kiedy Zeus zdalnie kontroluje jednostkę. + Reproduce sonidos de viento cuando Zeus controle remotamente una unidad. + Přehrát varování (vítr) když Zeus převezmě kontrolu nad jednotkou. + Reproduz sons de vento quando uma unidade é remotamente controlada pelo Zeus. + + + Ordnance Warning + Ostrz. o ostrzale arty. + Advertencia de artefactos explosivos + Varování před dělostřelectvem + Aviso de explosivos + + + Play a radio warning when Zeus uses ordnance. + Odtwarzaj wiadomość radiową kiedy Zeus używa artylerii. + Reproduce un aviso de radio cuando Zeus utiliza artefactos explosivos. + Přehrát varování (rádio) když Zeus použije dělostřelectvo. + Reproduz uma aviso via rádio quando o Zeus usa um explosivo. + + + Reveal Mines + Pokazuj miny + Revelar minas + Odhalit miny + Revelar minas + + + Reveal mines to allies and place map markers. + Pokazuj znaczniki min dla sojuszników i twórz markery na mapie w miejscu min. + Revelar minas a aliados y establecer marcadores de mapa. + Odhalí miny pro spojence a umístnit jejich značku na mapu. + Revelar minas para aliados e colocar marcadores no mapa. + + + Reveal to Allies + Pokaż dla sojuszników + Revelar a aliados + Odhalit pro spojence + Revelar para aliados + + + Allies + Map Markers + Sojusznicy + markery na mapie + Aliados + Marcas de mapa + Spojenci + Značky na mapě + Aliados + Marcadores no mapa + + + Toggle Captive + Przełącz więźnia + Alternar cautivo + Přepnout - Vězeň + Alternar prisioneiro + + + Toggle Surrender + Przełącz kapitulację + Alternar rendición + Přepnout - Vzdávání + Alternar rendição + + + Toggle Unconscious + Przełącz nieprzytomność + Alternar inconsciencia + Přepnout - Bezvědomí + Alternar inconsciência + + + Unit must be alive + Utiliser uniquement sur une unité vivante + Nur bei lebenden Einheiten verwendbar + Utilizar solo en unidades vivas + Použitelné jen na živé jednotky + Używaj tylko na żywych jednostkach + Применимо только к живым юнитам + Csak élő egységeken használni + Si può fare solo su persone vive + Usar somente em unidades vivas + + + Unit must be infantry + Utiliser uniquement sur du personnel à pied + Nur bei abgesessener Infanterie verwendbar + Utilizar solo en infanteria desmontada + Použitelné jen na pěsích jednotkách + Używaj tylko na piechocie poza wszelkimi pojazdami + Применимо только к пехоте вне техники + Csak járműben kívül lévő egységeken használni + Si può usare solo su fanteria a piedi + Usar somente em infantaria desmontada + + + Unit must not be captive + Jednostka nie może być więźniem + La unidad no debe estar cautiva + Jednotka nemí být vězeň + Unidade não pode ser prisioneira + + + Place on a unit + Rien sous le curseur + Es wurde nichts ausgewählt + Nada bajo el ratón + Coloque em uma unidade + Umístni na jednotku + Nie ma nic pod kursorem + Ничего не выделено + Semmi sincs az egér alatt + Nessuna selezione + + + Requires an addon that is not present + Wymaga addonu, który nie jest obecny + Requiere un addon que no está presente + Vyžaduje addon, který není přítomen + Requer um addon que não está presente + + + \ No newline at end of file diff --git a/addons/zeus/ui/Icon_Module_Zeus_Captive_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Captive_ca.paa new file mode 100644 index 0000000000..aa7eb0faf8 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Captive_ca.paa differ diff --git a/addons/zeus/ui/Icon_Module_Zeus_Settings_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Settings_ca.paa new file mode 100644 index 0000000000..58bbe312ce Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Settings_ca.paa differ diff --git a/addons/zeus/ui/Icon_Module_Zeus_Surrender_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Surrender_ca.paa new file mode 100644 index 0000000000..6ddabf4d56 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Surrender_ca.paa differ diff --git a/addons/zeus/ui/Icon_Module_Zeus_Unconscious_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Unconscious_ca.paa new file mode 100644 index 0000000000..fb179e40fc Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Unconscious_ca.paa differ diff --git a/documentation/README_PL.md b/documentation/README_PL.md index d156185908..4d4c36a619 100644 --- a/documentation/README_PL.md +++ b/documentation/README_PL.md @@ -4,29 +4,28 @@

- ACE version + ACE wersja - - ACE download + + ACE pobierz - ACE issues + ACE zagadnienia - - BIF thread + + Temat BIF - ACE license + ACE licencja

Wymaga najnowszej wersji CBA A3. Odwiedź nas na Facebook | YouTube | Twitter | Reddit

- **ACE3** to efekt wspólnego wysiłku grup moderów odpowiedzialnych za **ACE2**, **AGM** oraz **CSE** w celu zwiększenia realizmu i autentyczności Arma 3. Projekt ten jest całkowicie **otwarty źródłowo** i wszelki wkład w rozwój jest mile widziany. Możesz bez przeszkód prowadzić swoją własną dostosowaną wersję, o ile zmiany jakie wprowadzisz będą otwarte dla publiki zgodnie z GNU General Public License ([GPLv2](https://github.com/acemod/ACE3/blob/master/LICENSE)). @@ -81,4 +80,4 @@ Używaj naszego [Issue Tracker-a](https://github.com/acemod/ACE3/issues) aby zg #### Testowanie i budowanie Aby pomóc nam w testowaniu najnowszych zmian rozwojowych, pobierz nasz master branch ([bezpośrednio](https://github.com/acemod/ACE3/archive/master.zip), lub [korzystając z git](https://help.github.com/articles/fetching-a-remote/)), a następnie złóż testowego build-a: -* [Konfiguracja środowiska do testów](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – intrukcja krok-po-kroku jak poprawnie ustawić i zbudować wersję ACE do celów testowych. \ No newline at end of file +* [Konfiguracja środowiska do testów](http://ace3mod.com/wiki/development/setting-up-the-development-environment.html) – intrukcja krok-po-kroku jak poprawnie ustawić i zbudować wersję ACE do celów testowych. diff --git a/documentation/development/Documentation guidelines and tips.md b/documentation/development/Documentation guidelines and tips.md new file mode 100644 index 0000000000..adb3c48b9c --- /dev/null +++ b/documentation/development/Documentation guidelines and tips.md @@ -0,0 +1,65 @@ +--- +layout: wiki +title: Documentation guidelines and tips +group: development +parent: wiki +order: 19 +--- + +# Documentation guidelines + + + + + +## Example entry +``` +--- +layout: wiki +title: Mission Modules +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Sub-feature 1 +Short description of sub-feature 1. + +### 1.2 Sub-feature 2 +Short description of sub-feature 2. + +## 2. Usage + +### 2.1 thing n°1 +- Step 1. +- Step 2. +- Step 3. + +### 2.2 thing n°2 +- Step 1. +- Step 2. +- Step 3. + +## 3. Dependencies + +`ace_something` + +## 4. Guides +``` + +# Guidelines + +- A line between each entry like above. +- Use `ACE3` instead of `ACE 3`. +- Remove each entry that is not used. +- Don't forget to say what you're going to work on in #documentation in slack or [this topic] (https://github.com/acemod/ACE3/issues/1166) +- Keybinds in ``` thoses thingies ``` +- Keywords in ``` `thoses thingies` ``` +- Capitals at the start of a sentence and `.`at the end. +- VERIFY EVERYTHING IN GAME, ALL THE THINGS + +# Tips + +- Use http://dillinger.io/ to keep your sanity +- [Markdown cheat sheet] (https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) diff --git a/documentation/development/ace3-config-entries.md b/documentation/development/ace3-config-entries.md index 07782cf76c..1e28bec44d 100644 --- a/documentation/development/ace3-config-entries.md +++ b/documentation/development/ace3-config-entries.md @@ -1,13 +1,14 @@ --- layout: wiki title: ACE3 Config Entries +description: A list of all ACE3 config entries. group: development parent: wiki order: 2 --- ## 1. CfgVehicles -Entries from found in the `CfgVehicles.hpp` files +Entries found in the `CfgVehicles.hpp` files ```c++ @@ -26,7 +27,7 @@ ace_offset ## 2. CfgWeapons -Entries from found in the `CfgWeapons.hpp` files +Entries found in the `CfgWeapons.hpp` files ```c++ @@ -50,7 +51,8 @@ ace_gforcecoef ace_protection ace_scopeadjust_horizontal ace_scopeadjust_vertical -ace_scopeadjust_increment +ace_scopeadjust_verticalincrement +ace_scopeadjust_horizontalincrement ace_isusedlauncher ace_attachable ace_range @@ -61,11 +63,13 @@ ace_barrelLength ace_laserpointer ace_nextmodeclass ace_modedescription +ace_hearing_protection +ace_hearing_lowerVolume ``` ## 3. CfgAmmo -Entries from found in the `CfgAmmo.hpp` files +Entries found in the `CfgAmmo.hpp` files ```c++ ace_recoil_shakemultiplier @@ -94,7 +98,7 @@ ace_barrellengths ## 4. CfgGlasses -Entries from found in the `CfgGlasses.hpp` file +Entries found in the `CfgGlasses.hpp` file ```c++ ace_color @@ -109,7 +113,7 @@ ace_dustpath ## 5. CfgMagazines -Entries from found in the `CfgMagazines.hpp` files +Entries found in the `CfgMagazines.hpp` files ```c++ ace_isbelt diff --git a/documentation/development/ace3-events-system.md b/documentation/development/ace3-events-system.md index 393005bdf4..77281c9c7c 100644 --- a/documentation/development/ace3-events-system.md +++ b/documentation/development/ace3-events-system.md @@ -1,6 +1,7 @@ --- layout: wiki title: ACE3 Events System +description: Event handlers in ACE3 are implemented through our event system. They should be used to trigger or allow triggering of specific functionality. group: development parent: wiki order: 3 diff --git a/documentation/development/arma-3-issues.md b/documentation/development/arma-3-issues.md index 3b4a6f036b..4a3e9ea0fc 100644 --- a/documentation/development/arma-3-issues.md +++ b/documentation/development/arma-3-issues.md @@ -1,6 +1,7 @@ --- layout: wiki title: Arma 3 Issues +description: Keeping track of Arma 3 issues that need to be fixed. If you want to support us and help raise Bohemia's awareness of those issues, please upvote them. group: development parent: wiki order: 6 @@ -20,6 +21,7 @@ Keeping track of Arma 3 issues that need to be fixed. If you want to support us * [CorruptedHeart: 0022318: Can no longer use "MenuBack" shortcut in AddAction](http://feedback.arma3.com/view.php?id=22318) * [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) **Resolved:** diff --git a/documentation/development/arma-3-scheduler-and-our-practices.md b/documentation/development/arma-3-scheduler-and-our-practices.md index 95852792d8..3d9bf0525e 100644 --- a/documentation/development/arma-3-scheduler-and-our-practices.md +++ b/documentation/development/arma-3-scheduler-and-our-practices.md @@ -1,6 +1,7 @@ --- layout: wiki title: Arma 3 Scheduler And Our Practices +description: group: development parent: wiki order: 8 diff --git a/documentation/development/branching-and-release.md b/documentation/development/branching-and-release.md new file mode 100644 index 0000000000..ae7b67b1e9 --- /dev/null +++ b/documentation/development/branching-and-release.md @@ -0,0 +1,37 @@ +--- +layout: wiki +title: Branching and Release +description: +group: development +parent: wiki +order: 5 +--- + + +## 1 Versioning + +For ACE3 we use an versioning strategy based on Semver. This means our version numbering is structured `MAJOR.MINOR.PATCH.BUILD`. + +Because this modification is for Arma and backwards compatability is not always possible, our `MAJOR.MINOR.PATCH.BUILD` rules are slightly different. We increment the: + + MAJOR version when we switch to a new arma version (ie Arma 4 or standalone expansion), + MINOR version when we add new features or large amount of bug fixes. + PATCH version when a release only contains bug fixes. + +## 2 Branching and releases + +We have a release scheduled every 2 weeks on a Tuesday. On the Friday before release, the project management will decide whether or not this scheduled release will continue. When continuing with the release, the current `master branch` will be merged into the `release branch`. The release branch will not contain any direct commits and no other branches will be merged into this branch. The exception being `hotfixes`, which are branched off `Release` and merged back into `Release` and `Master`. + +`Hotfixes` are fixes for critical bugs that prevent stable gameplay with the currently available version of ACE3. + +During this release process between the Friday and Tuesday, the day of release, work can continue on as normal on the `Master branch`. This includes new features, bug fixes that won't make it for release or other work. These will not be merged into the `Release branch` until the next release cycle, normally 2 weeks later. + +### 2.1 Branching + +* New features, bug fixes that are not a hotfix or other work will always be branched off `master` or another branch but never a `hotfix` or the `Release branch`. +* Hotfixes are always branched off the `Release branch` +* The release branch is never merged or deleted. Only master or hotfixes are allowed to merge into the `Release branch`. + +### 2.2 Diagram + +Release and branching flowchart diff --git a/documentation/development/coding-guidelines.md b/documentation/development/coding-guidelines.md index 04d6adba80..1ab53046ec 100644 --- a/documentation/development/coding-guidelines.md +++ b/documentation/development/coding-guidelines.md @@ -1,6 +1,7 @@ --- layout: wiki title: Coding Guidelines +description: group: development parent: wiki order: 1 @@ -106,12 +107,12 @@ Every function should have a header of the following format: * Arguments: * 0: The first argument * 1: The second argument - * + * * Return Value: * The return value * * Example: - * _bool = ["something", player] call ace_common_fnc_imanexample + * ["something", player] call ace_common_fnc_imanexample * * Public: [Yes/No] */ @@ -121,34 +122,41 @@ Every function should have a header of the following format: ## 4. Macro Usage ### 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' +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': -* `GVAR(face)` is `ace_balls_face` -* `QGVAR(face)` is `"ace_balls_face"` -* `EGVAR(balls,face)` is `ace_balls_face` -* `EGVAR(leg,face)` is `ace_leg_face` -* `QEGVAR(leg,face)` is `"ace_leg_face"` + +| Macros | is the same as | +| -------|---------| +| `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 | +There also exists the FUNC family of Macros: -There also exists the FUNC family of Macros -* `FUNC(face)` is `ace_balls_fnc_face` or the call trace wrapper for that function. -* `EFUNC(balls,face)` is `ace_balls_fnc_face` or the call trace wrapper for that function. -* `EFUNC(leg,face)` is `ace_leg_fnc_face` or the call trace wrapper for that function. -* `DFUNC(face)` is `ace_balls_fnc_face` and will ALWAYS be the function global variable. -* `DEFUNC(leg,face)` is `ace_leg_fnc_face` and will ALWAYS be the function global variable. -* `QFUNC(face)` is `"ace_balls_fnc_face"` -* `QEFUNC(leg,face)` is `"ace_leg_fnc_face"` +| Macros | is the same as | +| -------|---------| +|`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| 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`. Using `FUNC` or `EFUNC` inside a `QUOTE` macro is fine if the intention is for it to be executed as a function. -#### 4.1.1 FUNC Macros, Call Tracing, and Non-ACE/Anonymous Functions +#### 4.1.1 FUNC Macros, Call Tracing, and Non-ACE3 /Anonymous Functions -ACE 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: +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: -* `CALLSTACK(functionName)` example: `[] call CALLSTACK(cba_fnc_someFunction)` -* `CALLSTACK_NAMED(function,functionName)` example: `[] call CALLSTACK_NAMED(_anonymousFunction,'My anonymous function!')` +| Macro | example | +| -------|---------| +|`CALLSTACK(functionName)` | `[] call CALLSTACK(cba_fnc_someFunction)` | +|`CALLSTACK_NAMED(function,functionName)` | `[] call CALLSTACK_NAMED(_anonymousFunction,'My anonymous function!')`| These macros will call these functions with the appropriate wrappers and enable call logging into them (but to no further calls inside obviously). @@ -160,44 +168,64 @@ These macros will call these functions with the appropriate wrappers and enable #### 4.2.1 setVariable, getVariable family macros -* `GETVAR(player,MyVarName,false)` - `player getVariable ["MyVarName", false]` -* `GETMVAR(MyVarName,objNull)` - `missionNamespace getVariable ["MyVarName", objNull]` -* `GETUVAR(MyVarName,displayNull)` - `uiNamespace getVariable ["MyVarName", displayNull]` -* `SETVAR(player,MyVarName,127)` - `player setVariable ["MyVarName", 127]` -* `SETPVAR(player,MyVarName,127)` - `player setVariable ["MyVarName", 127, true]` -* `SETMVAR(MyVarName,player)` - `missionNamespace setVariable ["MyVarName", player]` -* `SETUVAR(MyVarName,_control)` - `uiNamespace setVariable ["MyVarName", _control]` +| Macro | is the same as | +| -------|---------| +|`GETVAR(player,MyVarName,false)` | player getVariable ["MyVarName", false]| +|`GETMVAR(MyVarName,objNull)` | missionNamespace getVariable ["MyVarName", objNull]| +|`GETUVAR(MyVarName,displayNull)` | uiNamespace getVariable ["MyVarName", displayNull]| +|`SETVAR(player,MyVarName,127)` | player setVariable ["MyVarName", 127] SETPVAR(player,MyVarName,127) player setVariable ["MyVarName", 127, true] | +|`SETMVAR(MyVarName,player)` | missionNamespace setVariable ["MyVarName", player] | +|`SETUVAR(MyVarName,_control)` | uiNamespace setVariable ["MyVarName", _control] | + +#### 4.2.2 STRING family macros + +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 | +| -------|---------| +| `LSTRING(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" | ## 5. Event Handlers -Event handlers in ACE are implemented through our event system. They should be used to trigger or allow triggering of specific functionality. +Event handlers in ACE3 are implemented through our event system. They should be used to trigger or allow triggering of specific functionality. The commands are listed below. -* `[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). -* `[eventName, targetObject(s), args] call ace_common_fnc_targetEvent` calls an event just on the targeted object or list of objects. -* `[eventName, args] call ace_common_fnc_localEvent` calls an event just on the local machine, useful for inter-module events. +| 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).| +| `[eventName, targetObject(s), args] call ace_common_fnc_targetEvent` | calls an event just on the targeted object or list of objects.| +|`[eventName, args] call ace_common_fnc_localEvent` | calls an event just on the local machine, useful for inter-module events.| Events can be removed or cleared with the following commands. -* `[eventName, eventHandlerId] call ace_common_fnc_removeEventHandler` will remove a specific event handler of the event name, using the ID returned from `ace_common_fnc_addEventHandler`. -* `[eventName] call ace_common_fnc_removeAllEventHandlers` will remove all event handlers for that type of event. +| 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.| -More information on the [ACE Events System](https://github.com/KoffeinFlummi/ACE3/wiki/ACE-Events-System) page. +More information on the [ACE3 Events System](https://github.com/KoffeinFlummi/ACE3/wiki/ACE-Events-System) page. ## 6. Hashes -Hashes are a variable type that store key value pairs. They are not implemented natively in SQF, so there are a number of macros and functions for their usage in ACE. If you are unfamiliar with the idea, they are similar in function to `setVariable`/`getVariable` but do not require an object to use. +Hashes are a variable type that store key value pairs. They are not implemented natively in SQF, so there are a number of macros and functions for their usage in ACE3. If you are unfamiliar with the idea, they are similar in function to `setVariable`/`getVariable` but do not require an object to use. The following example is a simple usage using our macros which will be explained further below. @@ -215,11 +243,13 @@ if(HASH_HASKEY(_hash, "key")) then { A description of the above macros is below. -* `HASHCREATE` is 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). -* `HASH_HASKEY(hash, key)` will return true/false if that key exists in the hash. -* `HASH_REM(hash, key)` will remove that hash key. +| 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). | +| `HASH_HASKEY(hash, key)` | will return true/false if that key exists in the hash. | +| `HASH_REM(hash, key)` | will remove that hash key.| ### 6.1 Hashlists @@ -254,11 +284,14 @@ 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. -* `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. -* `HASHLIST_SELECT(hashlist, index)` returns the hash at that index in the list. -* `HASHLIST_SET(hashlist, index, hash)` sets a specific index to that hash. + +| 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.| +|`HASHLIST_SELECT(hashlist, index)` | returns the hash at that index in the list. | +|`HASHLIST_SET(hashlist, index, hash)` | sets a specific index to that hash.| #### 6.1.1 A note on pass by reference and hashes diff --git a/documentation/development/extension-guidelines.md b/documentation/development/extension-guidelines.md index 45aa8c5994..d8da6a3974 100644 --- a/documentation/development/extension-guidelines.md +++ b/documentation/development/extension-guidelines.md @@ -1,6 +1,7 @@ --- layout: wiki title: Extension Guidelines +description: group: development parent: wiki order: 9 diff --git a/documentation/development/how-to-translate-ace3.md b/documentation/development/how-to-translate-ace3.md index 576cd3a98b..edb88263b1 100644 --- a/documentation/development/how-to-translate-ace3.md +++ b/documentation/development/how-to-translate-ace3.md @@ -1,6 +1,7 @@ --- layout: wiki title: How to translate ACE3 +description: This page describes in short how you can help translating ACE3 into your language. group: development parent: wiki order: 20 diff --git a/documentation/development/merging-pull-requests.md b/documentation/development/merging-pull-requests.md index 6bc34464f0..208c9c786d 100644 --- a/documentation/development/merging-pull-requests.md +++ b/documentation/development/merging-pull-requests.md @@ -1,6 +1,7 @@ --- layout: wiki title: Merging Pull Requests +description: group: development parent: wiki order: 5 diff --git a/documentation/development/modularity-and-pbo-structure.md b/documentation/development/modularity-and-pbo-structure.md index 036ebb35d4..7e4a926de8 100644 --- a/documentation/development/modularity-and-pbo-structure.md +++ b/documentation/development/modularity-and-pbo-structure.md @@ -1,18 +1,19 @@ --- layout: wiki title: Modularity And PBO Structure +description: group: development parent: wiki order: 4 --- -### Modularity +## 1. Modularity Main principles: - As much stuff as possible should be modular - Strive to make as much stuff as possible run-time togglable. Adding/removing PBOS would still be requiring to toggle any feature relying on config changes. -### PBO Structure +## 2. PBO Structure Main principles: @@ -28,3 +29,14 @@ Main -> Common -> Config things Main -> Common -> 3D Models | Interaction | -> Feature ``` + +## 3. Optional .PBOs for 3rd Party Mods + +- ACE3 policy is to NOT take care of compatibility with third party addons single handely. The current compatible .PBOs were kickstarted by the ACE3 team as an example to mod creators so it's clear which entries are needed for compatibility. The authors of those addons have been contacted and many of those pbos are due to be included in their respective mods eventually. + +
+
Notice for 3rd party mod creators:
+

Most of the config entries are inert if ACE3 is not present, so addons can be made ACE3 compatible without explicitly requiring ACE3. However, for addons that are not inert (for example, scope configs), it is best to create and distribute compatibility .PBOs along with the original mod content; feel free to consult with ACE3 devs about how to correctly implement this. All existing compatibility .PBOs are examples and thus no further compatibility .PBOs will be provided by the ACE3 team.

+
+ + diff --git a/documentation/development/setting-up-the-development-environment.md b/documentation/development/setting-up-the-development-environment.md index 14d5e067c9..e02760f96d 100644 --- a/documentation/development/setting-up-the-development-environment.md +++ b/documentation/development/setting-up-the-development-environment.md @@ -1,6 +1,7 @@ --- layout: wiki title: Setting Up The Development Environment +description: This page describes how you can setup your development environment for ACE3, allowing you to properly build ACE and utilize file patching. group: development parent: wiki order: 0 @@ -14,14 +15,15 @@ This page describes how you can setup your development environment for ACE3, all - Arma 3 (duh) - A proper installation of the Arma 3 Tools (available on Steam) - A properly setup P-drive +- Run ArmA 3 and Arma 3 Tools directly from steam once to install registry entries (and again after every update) - Python 3.x, available [here](http://www.python.org) -- The following Mikero Tools (available [here](https://dev.withsix.com/projects/mikero-pbodll/files)): DePBO, Rapify, MakePBO, PBOProject -- A properly setup PATH variable (containing Python and the Mikero tools) +- The following Mikero Tools (available [here](https://dev.withsix.com/projects/mikero-pbodll/files)): DePBO, DeOgg, Rapify, MakePBO, PBOProject +- A properly setup PATH variable (containing Python ,the Mikero tools and git) ## 2. Why so complicated? -If you have contributed to AGM you might be used to an easier build process, where there was even an .exe you could use for building. ACE3, however, makes use of CBA macros to simplify things and give the developer access to a better debug process, which requires a stricter build environment. Additionally, Mikero's tools are stricter and report more errors than AddonBuilder does. The structure of this development environment also allows for [file patching](#file-patching), which is very useful for debugging. +If you have contributed to AGM you might be used to an easier build process, where there was even an .exe you could use for building. ACE3, however, makes use of CBA macros to simplify things and give the developer access to a better debug process, which requires a stricter build environment. Additionally, Mikero's tools are stricter and report more errors than AddonBuilder does. The structure of this development environment also allows for [file patching](#7-file-patching), which is very useful for debugging. Not offering .exes for the Python scripts we use allows us to make easy changes without the hassle of compiling self-extracting exes all the time. @@ -85,6 +87,7 @@ File Patching allows you to change the files in an addon while the game is runni ### 7.1 Enabling File Patching There are two ways to enable file patching: + - Load cba_cache_disable.pbo (included in CBA's optional folder) - Add the following to your test missions description.ext: @@ -106,4 +109,4 @@ Files must exist in the built PBOs for filepatching to work. If you create a new Configs are not patched during run time, only at load time. You do not have have to rebuild a PBO to make config changes, just restart Arma. You can get around this though if you are on the dev branch of Arma 3 and running the diagnostic exe. That includes `diag_mergeConfig` which takes a full system path (as in `p:\z\ace\addons\my_module\config.cpp`) and allows you selectivly reload config files. -If you need to add/remove files* Then you'll need to run build.bat again without the game running, and restart. That is all that is required to add new files to then further use in testing. +If you need to add/remove files, then you'll need to run build.py again without the game running, and restart. That is all that is required to add new files to then further use in testing. diff --git a/documentation/feature/advanced_ballistics.md b/documentation/feature/advanced_ballistics.md new file mode 100644 index 0000000000..1f38a9d18e --- /dev/null +++ b/documentation/feature/advanced_ballistics.md @@ -0,0 +1,31 @@ +--- +layout: wiki +title: Advanced Ballistics +description: The advanced ballistics module improves internal and external ballistics. +group: feature +parent: wiki +--- + +## 1. Overview +The Advanced Ballistics module improves internal and external ballistics. + +## 1.1 Features +- Drag modelling based on real-world ballistic coefficients. +- Ambient air density (air pressure, temperature, humidity) affects drag. +- Wind affects drag and deflects the trajectory. +- Wind speed varies with altitude. +- Terrain features, buildings and other objects disrupt the wind. +- [Magnus effect](https://en.wikipedia.org/wiki/Magnus_effect) (spin drift) +- [Coriolis effect](https://en.wikipedia.org/wiki/Coriolis_effect) and [Eötvös effect](https://en.wikipedia.org/wiki/Eotvos_effect) (Earth rotation) +- Loss of stability during transonic flight. +- Variable muzzle velocity based on powder burn rate and barrel length. +- Bullet trace effect for supersonic bullets (light refraction due to air pressure waves). +- A protractor for quickly measuring the inclination angle. + +## 2. Usage + +### 2.1 Protractor +Press Ctrl+⇧ Shift+K while using a compatible weapon to toggle the protractor. The red line indicates the current inclination angle in degrees. The protractor will disappear if you lower or holster your weapon. + +## 3. Dependencies +`ace_ballistics`, `ace_weather`, `ace_modules` diff --git a/documentation/feature/ai.md b/documentation/feature/ai.md new file mode 100644 index 0000000000..afc6194644 --- /dev/null +++ b/documentation/feature/ai.md @@ -0,0 +1,31 @@ +--- +layout: wiki +title: AI (Artificial Intelligence) +description: Config based changes to AI to ensure compatibility with advanced AI modifications +group: feature +order: 5 +parent: wiki +--- + +## 1. Overview + +### 1.1 Adjusted AI skill values +The idea here is to reduce the AI's godlike aiming capabilities while retaining its high intelligence. The AI should be smart enough to move through a town, but also be 'human' in their reaction time and aim. + +*Note: All these values can still be adjusted via scripts, these arrays just change what 0 & 1 are for `setSkill`.* + +### 1.2 Firing in burst mode +AI will now use the automatic mode of their weapons at short distances, instead of always relying on firing single shots in quick succession. + +### 1.3 Longer engagement ranges +The maximum engagement ranges are increased: AI will fire in bursts with variable lengths on high ranges of 500 - 700 meters, depending on their weapon and optic. + +### 1.4 No dead zones in CQB +Some weapons had minimum engagement ranges. If you were as close as 2 meters to an AAF soldier, he wouldn't open fire, because the AI couldn't find any valid fire mode for their weapon. ACE3 removes this behaviour mostly notable in CQB by adding a valid firing mode. + +### 1.5 No scripting +All changes of ACE3 AI are config based to ensure full compatibility with advanced AI modifications like e.g. "ASR AI 3". + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/aircraft.md b/documentation/feature/aircraft.md new file mode 100644 index 0000000000..ead653641d --- /dev/null +++ b/documentation/feature/aircraft.md @@ -0,0 +1,42 @@ +--- +layout: wiki +title: Aircraft +description: Aircraft overhaul +group: feature +order: 5 +parent: wiki +--- + +## 1. Overview + +### 1.1 Adjusted flight behaviour +Changes the flight behaviour of various aircraft. + +### 1.2 Various adjustments to aircraft and gunships munitions +- Higher capacity magazines for the Comanche. +- Gatling rate of fire (ROF) increased. +- AP rockets have less splash damage. + +### 1.3 Missile lock warnings +Adds missile-lock warning systems to helicopters and planes based on the equivalent real life capabilities. + +### 1.4 Semi-automatic flare mode +Adds the semi-automatic flare mode known from Arma 2. The key to switch modes existed in Arma 3's key settings, but wasn't operational until now. + +### 1.5 Ejecting from pilot and copilot seats +Pilots and copilots of all helicopters can now eject. + +### 1.6 Laser marker for Wildcat +Adds a laser marker to the copilot seat of the Wildcat. + +### 1.7 HUD for AH-9 +Adds a HUD to the AH-9 based on the Comanche's HUD. + +## 2. Usage + +### 2.1 Switching flare modes +Press Ctrl+C to switch between flare firing modes (Arma 3 default key bind `countermeasure mode`) + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/apl.md b/documentation/feature/apl.md new file mode 100644 index 0000000000..c526935143 --- /dev/null +++ b/documentation/feature/apl.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: APL +description: assets under APL license +group: feature +parent: wiki +--- + +## 1. Overview + +This folder regroups all assets released under the APL license. + +## 2. Dependencies + +`ace_main` diff --git a/documentation/feature/atragmx.md b/documentation/feature/atragmx.md new file mode 100644 index 0000000000..c7113f7cd2 --- /dev/null +++ b/documentation/feature/atragmx.md @@ -0,0 +1,26 @@ +--- +layout: wiki +title: ATragMX +description: +group: feature +parent: wiki +--- + +## Overview + +### Sub-feature 1 +Short description of sub-feature 1. + +### Sub-feature 2 +Short description of sub-feature 2. + + +## Usage + +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + + +## Dependencies + +`ace_common`, `ace_weather` diff --git a/documentation/feature/attach.md b/documentation/feature/attach.md new file mode 100644 index 0000000000..fcf7f2ef77 --- /dev/null +++ b/documentation/feature/attach.md @@ -0,0 +1,34 @@ +--- +layout: wiki +title: Attach +description: Allow players to attach items to vehicles or themselves +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Attach items to uniform +Allows players to attach IR grenades and chemlights to themselves. + +### 1.2 IR Strobe +Adds an attachable IR strobe, which is only visible using night vision devices and offers better visibility than IR grenades. + +## 2. Usage + +### 2.1 Attaching to yourself +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select `Equipment`. +- Select `Attach item`. +- Select which item you want to attach. +- Repeat the process to detach. + +### 2.2 Attaching to a vehicle +- Interact with the vehicle ⊞ Win (ACE3 default). +- Select `Attach item`. +- Select your item and follow the instructions on the screen. +- Repeat the process to detach. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/backpacks.md b/documentation/feature/backpacks.md new file mode 100644 index 0000000000..426f39d18a --- /dev/null +++ b/documentation/feature/backpacks.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Backpacks +description: Notifies a player when his backpack is opened +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Zipping sounds +A zipper sound is played when someone opens your backpack. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/ballistics.md b/documentation/feature/ballistics.md new file mode 100644 index 0000000000..1e453271fb --- /dev/null +++ b/documentation/feature/ballistics.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Ballistics +description: Realistic ballistic improvements +group: feature +order: 5 +parent: wiki +--- + +## 1. Overview + +### 1.1 Realistic ballistics +Changes include adjusted muzzle velocity, air friction and dispersion based on real life values. + +### 1.2 Realistic silencers and subsonic ammunition +Silencers no longer decrease the muzzle velocity and are generally less effective when used with normal ammunition. They now only remove the muzzle blast and flash. To prevent the crack caused by supersonic projectiles, ACE3 introduces subsonic ammunition for the 7.62mm caliber. This is also fully compatible with AI. + +### 1.3 Armor piercing ammunition +Armor piercing rounds have higher penetration values against light armored targets and other obstacles on the battlefield. Their drawback is a slightly decreased man-stopping power. AP rounds are available in multiple calibers including 5.56mm and 7.62mm. + +### 1.4 IR-Dim tracer ammunition +IR-Dim ammunition is similar to tracer rounds, but these tracers are only visible using night vision devices. + +### 1.5 M118 long range ammunition +The M14 EBR now uses ammunition with decreased muzzle velocity and air friction to improve precision and energy retention at long ranges. + +### 1.6 Fully config-based +This module applies configuration changes only and does not decrease game performance. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/captives.md b/documentation/feature/captives.md new file mode 100644 index 0000000000..6ff4623016 --- /dev/null +++ b/documentation/feature/captives.md @@ -0,0 +1,47 @@ +--- +layout: wiki +title: Captives +description: System for taking and handling captives +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Take captives +Introduces a captivity system. + +### 1.2 Load and unload captives into / from vehicles +You can load and unload captives from vehicles using ACE3 interactions. + +### 1.3 Frisk captives +You can frisk a restrained captive. + +### 1.4 Surrendering +Allows players to surrender. It renders the unit unable to move and with the hands behind its head. When surrendered AI won't fire. + +## 2. Usage + +### 2.1 Taking a unit into captivity +- You need `Cable Tie`. +- Approach the unit and Interact ⊞ win (ACE3 default). +- The interaction is located around the hands in the form of a handcuffs icon. +- Repeat to release. + +### 2.2 Escorting a captive +- Interact with the captive ⊞ win. +- Select the `Escort prisoner` option. +- To stop escorting, use the mousewheel and select `Release` or use Self Interaction Ctrl+⊞ win and select `Release`. + +### 2.3 Loading and unloading a captive into/from a vehicle +- Escort the captive. +- Approach the vehicle you wish to load the captive unit into. +- Interact with the vehicle ⊞ win and select `Load captive`. +- To unload the captive interact with the vehicle ⊞ win +- Select `Passengers`. +- Select the captive. +- Select `Unload captive`. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/common.md b/documentation/feature/common.md new file mode 100644 index 0000000000..2929f6b335 --- /dev/null +++ b/documentation/feature/common.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Common +description: Common functions and systems used by most other components. +group: feature +parent: wiki +--- + +## 1. Overview + +Common functions and systems used by most other components. + +## 2. Dependencies + +`ace_main` + +*Note: The Common module is required by nearly all other modules. Do NOT remove it!* diff --git a/documentation/feature/concertina_wire.md b/documentation/feature/concertina_wire.md new file mode 100644 index 0000000000..8fd8a58eb6 --- /dev/null +++ b/documentation/feature/concertina_wire.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: concertina wire +description: +group: feature +parent: wiki +--- + +## 1. Overview + +A concertina wire is a type of barbed wire formed in large coils that can be expanded to form obstacles, in ACE3 any vehicle making contact with it get it's tires destroyed. + +## 2. Usage + +### 2.1 Deploying the concertina wire +- Approach the concertina coil and select ⊞ Win (ACE3 default) +- Select `Deploy concertina wire`. +- Follow the instructions on screen. + +## 3. Dependencies + +`ace_apl` , `ace_interaction` diff --git a/documentation/feature/dagr.md b/documentation/feature/dagr.md new file mode 100644 index 0000000000..e4b350295c --- /dev/null +++ b/documentation/feature/dagr.md @@ -0,0 +1,14 @@ +--- +layout: wiki +title: Dagr +group: feature +parent: wiki +--- + +## 1. Overview + +Adds the Defense Advanced GPS Receiver. + +## 3. Dependencies + +`ace_weather` \ No newline at end of file diff --git a/documentation/feature/difficulties.md b/documentation/feature/difficulties.md new file mode 100644 index 0000000000..bc48994e81 --- /dev/null +++ b/documentation/feature/difficulties.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Difficulties +description: Tweak to Vanilla hardest difficulty +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Elite mode adjustments +Adjusts the default settings of the hardest difficulty to better resemble Arma 2 settings (no crosshair, stat screen, death messages). + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/disarming.md b/documentation/feature/disarming.md new file mode 100644 index 0000000000..f635b94901 --- /dev/null +++ b/documentation/feature/disarming.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Disarming +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Searching through a unit's inventory +You can search the inventory and disarm captured or unconscious units. + +## 2. Usage + +### 2.1 Searching and disarming +- Interact with the captured or unconscious unit ⊞ Win (ACE3 default key bind `Interaction Key`). +- Select `Open inventory`. +- Drag & Drop the items you wish to remove from the unit. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/disposable.md b/documentation/feature/disposable.md new file mode 100644 index 0000000000..c60ae729cf --- /dev/null +++ b/documentation/feature/disposable.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Disposable +description: Makes NLAW disposable and allows addons to do the same +group: feature +parent: wiki +--- + +## 1. Overview + +The NLAW is shoulder fired and disposable, firing just once before being needed to be disposed of. This feature makes the NLAW disposable and provides the tools for other addons to do the same. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/dragging.md b/documentation/feature/dragging.md new file mode 100644 index 0000000000..d23935034d --- /dev/null +++ b/documentation/feature/dragging.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Dragging +description: Adds the option to drag and carry units and objects +group: feature +parent: wiki +--- + +## 1. Overview + +This adds the option to drag or carry units or objects. + +## 2. Usage + +### 2.1 Dragging / Carrying units and objects +- You can only drag or carry an unconscious unit. +- Interact with the unit or object ⊞ Win (ACE3 default key bind `Interact Key`). +- Select `Drag` or `Carry`. +- To release, use the mouse wheel and select `Release` or use Self Interaction Ctrl+⊞ Win and select `Release`. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/explosives.md b/documentation/feature/explosives.md new file mode 100644 index 0000000000..071252ffc0 --- /dev/null +++ b/documentation/feature/explosives.md @@ -0,0 +1,40 @@ +--- +layout: wiki +title: Explosives +description: Adds numerous improvements to using and handling explosives +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Advanced explosives placement +Enables more precise placement of explosives. + +### 1.2 Numerous trigger types +Offers different trigger types, like clackers and dead man switches. + +### 1.3 Attach explosives to vehicles +Enables attaching explosives to vehicles. + +## 2. Usage + +### 2.1 Placing explosives +- Use self interaction Ctrl+⊞ Win (ACE3 default key bind `Self Interaction Key`). +- Select `Explosives`. +- Choose your explosive type and follow the instructions on the screen. + +### 2.2 Arming and detonating explosives +- Interact with the explosive ⊞ Win (ACE3 default key bind `Interact Key`). +- Choose the arming method. +- For clackers use Self Interaction `Explosives` → `Detonate` and choose the corresponding Firing Device. + +### 2.3 Defusing explosives +- A `Defusal Kit` is required. +- Interact with the explosive ⊞ Win. +- Select `Disarm`. +- You are safe to pick it up after the action has completed. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/fcs.md b/documentation/feature/fcs.md new file mode 100644 index 0000000000..713fba4dcf --- /dev/null +++ b/documentation/feature/fcs.md @@ -0,0 +1,37 @@ +--- +layout: wiki +title: FCS (Fire Control System) +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Fire control system +Offers a custom fire control system for tanks and helicopters. It enables engaging stationary and moving targets. + +### 1.2 Manual lasing targets +Changes the default rangefinders, including those in vehicles, to require manual lasing. + +### 1.3 Air burst ammunition +Anti air cannons can now use airburst ammunition. It will explode on the FCS' zeroed in range. + +## 2. Usage + +### 2.1 Engaging moving targets +- Place the crosshair on the enemy vehicle. +- Press and hold Tab ↹ (ACE 3 default key bind `Lock Target [Hold]`) and follow the target for about 2 seconds. +- Release Tab ↹. +- The optic is now adjusted sideways to ensure a hit. + +### 2.2 Ranging stationary targets +- Place the crosshair on the object to range. +- 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/flashsuppressors.md b/documentation/feature/flashsuppressors.md new file mode 100644 index 0000000000..82696fcc91 --- /dev/null +++ b/documentation/feature/flashsuppressors.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Flash Suppressors +description: +group: feature +parent: wiki +--- + +## 1. Overview + +This adds the ability to use the flash suppressors that are already in game but not accessible. + +Flash suppressors are devices that reduce the muzzle flash while firing by cooling or dispersing the burning gases that exit the muzzle. Its intent is to reduce the chances that the shooter will be blinded in low-light shooting conditions as well as reducing the intensity of the flash visible to the enemy. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/fonts.md b/documentation/feature/fonts.md new file mode 100644 index 0000000000..bf40e5ed2d --- /dev/null +++ b/documentation/feature/fonts.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Fonts +group: feature +parent: wiki +--- + +## 1. Overview + +This module adds a font that will be used in the future, characters with equal widths to make it easy to structure correctly. This is **NOT** present in 3.1.1 because of a bug even if it's present in the sources. + + +## 3. Dependencies + +`ace_main` \ No newline at end of file diff --git a/documentation/feature/frag.md b/documentation/feature/frag.md new file mode 100644 index 0000000000..949597aad2 --- /dev/null +++ b/documentation/feature/frag.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Frag +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Adds a shrapnel system for explosives. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/gforces.md b/documentation/feature/gforces.md new file mode 100644 index 0000000000..fcc4758ee5 --- /dev/null +++ b/documentation/feature/gforces.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: G-Forces +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Adds G-force induced tunnel vision and unconsciousness. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/goggles.md b/documentation/feature/goggles.md new file mode 100644 index 0000000000..2e4dfce54d --- /dev/null +++ b/documentation/feature/goggles.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Goggles +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Visual Effects for eyewear +Adds color tint to sunglasses and other eyewear. Causes raindrops to appear on the screen in rain. Causes dirt to appear on the screen when dirt is kicked up nearby (e.g. explosions, rotor wash, bullet impacts, muzzle blast). + + +## 2. Usage + +### 2.1 Cleaning your goggles +- To clean your goggles press SHIFT + ALT + T(ACE3 deault key bind `Wipe goggles`) + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/grenades.md b/documentation/feature/grenades.md new file mode 100644 index 0000000000..fc6a8641f3 --- /dev/null +++ b/documentation/feature/grenades.md @@ -0,0 +1,31 @@ +--- +layout: wiki +title: Grenades +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Throw modes +Provides different modes for throwing grenades (high throw, precision throw and drop mode). + +### 1.2 Hand flares +Adds throwable hand flares in the colors white, red, green and yellow. Additionally buffs existing flares by making them brighter and last longer. + +### 1.3 M84 stun grenade +Adds the M84 stun grenade. The stun effect will also affect AI. + +## 2. Usage + +### 2.1 Switching between throw modes +- Press 8 (ACE3 default key bind `Switch Grenade Mode`) + +### 2.2 Switching between grenades +- Press 6 (ACE3 default key bind `Select frag`) to switch between `LETHAL` grenades +- Press 7 (ACE3 default key bind `Select non-frag`) to switch between `NON LETHAL` grenades + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/hearing.md b/documentation/feature/hearing.md new file mode 100644 index 0000000000..c596f12d19 --- /dev/null +++ b/documentation/feature/hearing.md @@ -0,0 +1,33 @@ +--- +layout: wiki +title: Hearing +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Hearing damage simulation +Introduces hearing damage caused by nearby explosions and large-caliber weapons. + +### 1.2 Earplugs +Adds earplugs to mitigate that effect. Soldiers with high caliber weapons or +missile launchers will be equipped with those, but remember to put them in. + +### 1.3 Helmets +Some types of helmets can mitigate hearing damage also (ie. crewman helmet, pilot helmet etc.). + +## 2. Usage + +### 2.1 Equipping earplugs +- For this you need the `Earplugs` item. +- Press the self interaction key Ctrl + ⊞ Win (ACE3 default key bind `Self Interaction Key`). +- Select `Equipment`. +- Select `Earplugs in`. +- Same method to remove them but the option is `Earplugs out`. +- Note: you're able to re-use earplugs. + +## 3. Dependencies + +`ace_interaction` \ No newline at end of file diff --git a/documentation/feature/hitreactions.md b/documentation/feature/hitreactions.md new file mode 100644 index 0000000000..919c09e9f6 --- /dev/null +++ b/documentation/feature/hitreactions.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Hit Reactions +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Falling under fire +If a unit is shot while running it falls to the ground in a prone position, the area where the shot lands does not matters. +Note that the shot needs to inflict a certain amount of damage to make the unit fall, a small cut won't make the unit stumble. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/huntIR.md b/documentation/feature/huntIR.md new file mode 100644 index 0000000000..205b812e33 --- /dev/null +++ b/documentation/feature/huntIR.md @@ -0,0 +1,42 @@ +--- +layout: wiki +title: HuntIR +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 The HuntIR +The **H**igh altitude **U**nit **N**avigated **T**actical **I**maging **R**ound (HuntIR) is designed to be fired from a grenade launcher. After being fired in the air the in built parachute will be deployed and the IR CMOS camera will activate, providing a video stream until it touches the ground or get shot down. + +## 2. Usage +NOTE: the HuntIR round doesn't work with modded weapons without a compatibility fix made either by the ACE3 team or the mod team. + +### 2.1 Using the HuntIR +- To be able to connect to the IR CMOS camera you'll need a `HuntIR monitor`. +- Fire the HuntIR round as high as possible over the area you want to observe. +- Open the `HuntIR monitor`. + - To open the `HuntIR monitor` self interact Ctrl + ⊞ Win (ACE3 default) + - Select `Equipment`. + - Select `Activate HuntIR monitor`. +- You now have control of the IR CMOS camera to close the monitor press ESC or ⊞ Win + +### 2.2 IR CMOS camera controls + +Shortcut | Action +------------ | ------------- +A | Lower zoom level +D | Increase zoom level +N | Toggle NV and TI modes +S | Next camera +W | Previous camera + | Rotate camera anticlockwise +| Rotate camera clockwise + | Raise camera + | Lower camera +R | Reset camera + +## 3. Dependencies + +`ace_common` \ No newline at end of file diff --git a/documentation/feature/interact_menu.md b/documentation/feature/interact_menu.md new file mode 100644 index 0000000000..d0635ae7ef --- /dev/null +++ b/documentation/feature/interact_menu.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Interact Menu +description: +group: feature +parent: wiki +--- + +## 1. Overview + +This handles the interaction layer of ACE3. + +## 2. Dependencies + +`ace_common` + +*Note: The Interact Menu module is required by most of the other modules. Do NOT remove it!* diff --git a/documentation/feature/interaction.md b/documentation/feature/interaction.md new file mode 100644 index 0000000000..e4e28f23c9 --- /dev/null +++ b/documentation/feature/interaction.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Interaction +description: +group: feature +parent: wiki +--- + +## 1. Overview + +This provides interaction options between units. + +## 2. Dependencies + +`ace_interact_menu` + +*Note: The Interaction module is required by most of the other modules. Do NOT remove it!* diff --git a/documentation/feature/inventory.md b/documentation/feature/inventory.md new file mode 100644 index 0000000000..53f126dc2a --- /dev/null +++ b/documentation/feature/inventory.md @@ -0,0 +1,25 @@ +--- +layout: wiki +title: Inventory +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Resized inventory UI +Makes the inventory dialog bigger and increases the number of items that can be seen in the list at once. + +## 2. Usage + +### 2.1 Changing the size of the UI +- Press Escape. +- Click on `ACE OPTIONS` on the top left corner of the screen. +- Click on `Make Inventory Display Bigger`. +- Choose the size desired on the right drop down menu. +- Press the `Close` button, your changes are automatically saved. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/javelin.md b/documentation/feature/javelin.md index b253a25fc9..a4187a0b82 100644 --- a/documentation/feature/javelin.md +++ b/documentation/feature/javelin.md @@ -1,21 +1,33 @@ --- layout: wiki -title: Javelin/Titan Locking and Firing +title: Javelin +description: group: feature -order: 5 parent: wiki --- ## 1. Overview -Blah blah blah -Steps to lock titan/Javelin: +### 1.1 Improved locking +The locking capabilities of the Titan and Javelin got improved, you can now lock on anything that has a thermal signature, including houses. -1. You must be zoomed ALL THE WAY IN -2. You must be in thermal view -3. You must have a missile loaded -4. Hold TAB over a target, it will start beeping and the constraint boxes will appear -5. Once the beeping changes to LOCK tone, and the lock crosshairs appear, click fire without releasing tab +### 1.2 Fire mode switching +The Titan / Javelin now posses the ability to be used in top down attack or direct. +## 2. Usage -CTRL+TAB is default key to change firemode (configurable as a key) +### 2.1 Locking with the Titan / Javelin +- For this feature you need to have a compatible launcher. +- Fully zoom in with the launcher. +- Switch to thermals N (Arma 3 default key bind `Night vision`). +- While keeping your aim steadily on target press and hold Tab ↹ (ACE3 default key bind `Lock Target [Hold]`). +- When the sound changes and a cross appears on the screen the target is locked and you're able to fire. + +### 2.2 Switching fire mode +- For this feature you need to have a compatible launcher. +- When aiming with your launcher press Ctrl + Tab ↹. +- On the right side of the screen (for most launchers) you should see that `TOP`is now illumiated in green which means that your missile will be fired in top down mode. + +## 3. Dependencies + +`ace_main`, `ace_common`, `ace_missileguidance` diff --git a/documentation/feature/kestrel4500.md b/documentation/feature/kestrel4500.md new file mode 100644 index 0000000000..f859ed4cd8 --- /dev/null +++ b/documentation/feature/kestrel4500.md @@ -0,0 +1,26 @@ +--- +layout: wiki +title: Kestrel 4500 +description: +group: feature +parent: wiki +--- + +## Overview + +### Sub-feature 1 +Short description of sub-feature 1. + +### Sub-feature 2 +Short description of sub-feature 2. + + +## Usage + +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + + +## Dependencies + +`ace_common`, `ace_weather` diff --git a/documentation/feature/laser.md b/documentation/feature/laser.md new file mode 100644 index 0000000000..78ab448e8c --- /dev/null +++ b/documentation/feature/laser.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Laser +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Contains various functions necessary for the realistic portrayal of laser mechanics in other components. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/laser_selfdesignate.md b/documentation/feature/laser_selfdesignate.md new file mode 100644 index 0000000000..dd3b25bc36 --- /dev/null +++ b/documentation/feature/laser_selfdesignate.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Laser Self-Designate +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Allows gunners to lase their own targets. See [Feature: "FCS"]({{ site.productionUrl }}/wiki/feature/fcs.html) for more information. + +## 2. Dependencies + +`ace_laser` diff --git a/documentation/feature/laserpointer.md b/documentation/feature/laserpointer.md new file mode 100644 index 0000000000..d6f38df99f --- /dev/null +++ b/documentation/feature/laserpointer.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Laser Pointer +description: Switching laser modes, daylight lasers +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Visible light laser +ACE3 adds a visible laser attachment for weapons. This feature is compatible with BI's lasers as well as supported modded ones. + +## 2. Usage + +### 2.1 Switching laser mode +- For this feature you need to have a compatible side attachment. +- Press Ctrl + L (ACE3 default key bind `Switch Laser / IR Laser`). +- A hint indicating the mode switch will appear in the top right corner. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/logistics_uavbattery.md b/documentation/feature/logistics_uavbattery.md new file mode 100644 index 0000000000..367d161340 --- /dev/null +++ b/documentation/feature/logistics_uavbattery.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Logistics - UAV Battery +description: UAV recharging +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Rechargeable darters. +Adds an item `ACE_UAVBattery` that allows refuelling / recharging of the "Darter" quad-copter UAVs. + +## 2. Usage + +### 2.1 Recharging the darter +- For this you need a `UAV battery` and the UAV needs to be a quad-copter. +- Interact with the UAV ⊞ Win (ACE3 default key bind `Interact Key`) +- Select `Recharge` + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/logistics_wirecutter.md b/documentation/feature/logistics_wirecutter.md new file mode 100644 index 0000000000..71eb6ac62f --- /dev/null +++ b/documentation/feature/logistics_wirecutter.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Logistics - Wirecutter +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Wirecutter +Adds an item `ACE_wirecutter` that allows cutting of fences in Arma 3 and AllInArma maps. + +## 2. Usage + +### 2.1 Using the wirecutter +- For this you need a `Wirecutter`. +- Approach the fence you want to cut. +- Press the interaction key ⊞ Win (ACE3 default key bind `Interaction Key`). +- Find the interaction point and select `Cut Fence` (the only option). + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/magazinerepack.md b/documentation/feature/magazinerepack.md new file mode 100644 index 0000000000..304f3e7f96 --- /dev/null +++ b/documentation/feature/magazinerepack.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Magazine Repack +description: Repacking magazines, and maybe your bananas. +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Repacking magazines +Adds the ability to repack magazines of the same type. + +## 2. Usage + +### 2.1 Repacking +- For this you need multiple half empty mags of the same type. +- Press the self interaction button Ctrl + ⊞ Win (ACE3 default key bind `Self Interaction Key`). +- Select `Repack magazines`. +- Select the type of magazines you want to repack. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/main.md b/documentation/feature/main.md new file mode 100644 index 0000000000..a745f01e3b --- /dev/null +++ b/documentation/feature/main.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Main +description: main module +group: feature +parent: wiki +--- + +## 1. Overview + +Main module which acts as the ACE3 core module. + +## 2. Dependencies + +`Arma 3` and `CBA_A3` + +*Note: The Main module is required by all other modules. Do not remove it!* diff --git a/documentation/feature/map.md b/documentation/feature/map.md new file mode 100644 index 0000000000..2feafa9350 --- /dev/null +++ b/documentation/feature/map.md @@ -0,0 +1,33 @@ +--- +layout: wiki +title: Map +description: Map improvements +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Map styling +Better map styling (contours, legend, hiding bushes and trees, etc). + +### 1.2 Map zoom level (optional) +The mission maker / server owner can restrict the maximum zoom level of the map. + +### 1.3 Map shake (optional) +While walking your map will move slightly. + +### 1.4 Map illumination (optional) +The map illumination will be the same as your surroundings meaning that in a dark night you'll either need a light source or NVGs to see your map. + +### 1.5 Blufor tracker (optional) +The Blufor tracker marks the position of your faction's group leaders on the map. + + +## 2. Usage + +- IMPORTANT NOTICE: The (optional) features above CAN be restricted by the mission maker / server owner. User experience may vary. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/maptools.md b/documentation/feature/maptools.md new file mode 100644 index 0000000000..1618721c82 --- /dev/null +++ b/documentation/feature/maptools.md @@ -0,0 +1,38 @@ +--- +layout: wiki +title: Map Tools +description: Map tools, a roamer and pens +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Line drawing +This adds the possibility to draw accurate lines on the map screen. + +### 1.2 Map tools +This adds map tools that can be used to measure distances between two points or bearings on the map. + +### 1.3 GPS on map +If you are equipped with a vanilla GPS it will be shown on the map. (You don't need the map tools in your inventory for this.) + +## 2. Usage + +### 2.1 Using map tools +- For this you need to have `Map Tools`. +- Open the map M (Arma 3 default key bind `Map`). +- Press the self interaction key Ctrl + ⊞ Win (ACE3 default key bind `Self Interaction Key`). +- Select `Map tools`. +- Select the type of tools you want to use. +- Note that you can drag the Roamer (map tool) around with LMB and rotate it with Ctrl + LMB. + +### 2.2 Drawing lines +- To draw lines `Map Tools` are not required. +- Press ALT + LMB to start the line, left click again to end it. +- To delete a line press Del around the center of the line. +- Note that you can change the color of the lines by clicking on one of the coloured column on top of the screen (While the map is opened) + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/markers.md b/documentation/feature/markers.md new file mode 100644 index 0000000000..84f133760c --- /dev/null +++ b/documentation/feature/markers.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Markers +description: improved markers +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Improved marker placement +Expands the "Insert Marker" menu and allows to rotate map markers. Shows the currently selected channel to prevent misplacement. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/medical-system.md b/documentation/feature/medical-system.md index 443fb4b182..b77c1c8bba 100644 --- a/documentation/feature/medical-system.md +++ b/documentation/feature/medical-system.md @@ -1,6 +1,7 @@ --- 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 parent: wiki @@ -31,6 +32,16 @@ To stop the bleeding, the combat life saver needs to bandage every wounded limb. 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. @@ -56,15 +67,177 @@ In order to stop the bleeding, all injuries on every bodypart requires treatment 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 stabalize the vitals and to counter for example pain, a player/medic can use medication. Advanced medical has 3 different medications available: +To stabilize the vitals and to counter for example pain, a player/medic can use medication. Advanced medical has 3 different medications available: + * Atropine * Morphine * Epinephrine 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). -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. +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. 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. _Epinephrine must never be given to a casualty with a high heart rate or blood pressure._ + +#### 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: + +* 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 + +* 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). + +* 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. + +* 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ę. + +* 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). + +* 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). + +* Puncture wounds + * Deep, narrow wounds produced by sharp objects such as nails, knives, and broken glass. + * Sources: stabs, grenades. + * Effects: pain - light, bleeding - slowly. + +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. + +#### 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. + +* 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 + +* 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 + +* 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 + +* 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 + +#### 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! + ++#### 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. + +### 3.2 Advanced medical system - recommended gear + +* 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 + +* 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* + +* 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 + +## Dependencies +`ace_interaction`, `ace_modules`, `ace_apl` diff --git a/documentation/feature/microdagr.md b/documentation/feature/microdagr.md new file mode 100644 index 0000000000..2ed13875f2 --- /dev/null +++ b/documentation/feature/microdagr.md @@ -0,0 +1,148 @@ +--- +layout: wiki +title: MicroDAGR +description: A GPS device and much more ! +group: feature +parent: wiki +--- + +For an easier time reading don't forget that you can view all chapters on the right side of the page by clicking on Show/hide under table of content. + +## 1. Overview + +"Military operations rely on the position, +navigation and timing (PNT) data that GPS +can provide. In combat, the accuracy of +PNT data can mean the difference between +life and death. Non-military GPS receivers +simply aren’t good enough when lives are +on the line" (Extracted from the real life manual) + +that's where the MicroDAGR comes in, here's a list of it's features (in arma 3) : + +- Compass and headings. +- Date and hour synced to the mission. +- Elevation (above or below sea level) +- Current speed. +- GPS with topographic and satellite view. +- Creating, naming, deleting waypoints. +- Friendly identification (BLUFOR tracker need to be on) +- The MicroDAGR is also able to connect to your vector to retrieve data from it. + +## 2. Usage + +Please note that the numbers in 2.1 are going to be referred to as `1` `2` etc when explaining how to use the MicroDAGR + +### 2.1 Bringing the MicroDAGR + +- Self interact Ctrl+⊞ Win. +- Select `Equipment`. +- Select `configure MicroDAGR`. + +### 2.2 The MicroDAGR interface + + + +number | function | +------ | ----------------------------------------------------- | +`1` | Options menu and hour display. +`2` | Grid position `e` is west to east `n` is south to north. +`3` | Elevation above sea level in meters. +`4` & `11` | Compass heading. +`5` & `10` | Current speed. +`6` | Date (mission). +`7` | Main menu button. +`8` | Compass menu button. +`9` | Map menu button. +`12` | Compass +`13` | Player heading (your eyes). +`14` | Center the map on your position. +`15` | Map zoom. +`16` | Map dezoom +`17` | Your position. +`18` | Waypoint creation menu +`19` | Waypoint editing menu. +`20` | Connection menu. +`21` | Settings menu. + +### 2.3 Waypoints +#### 2.3.1 Adding waypoints +- There's three ways of adding a waypoint. + +- First way: Using the waypoint creation menu. + - Find the position you want to mark on the map. + - Get it's map grid. + - The grid is composed of 6 digits. + - The first three digits are read west to east. (Top of the map screen). + - The last three are read south to north. (Left side of the map screen). + - Go to the options menu (Click in `1` area, above the bar). + - Click on `Mark`(`18`). + - Enter the grid number. + - Press OK. + - Enter the desired name of the waypoint. + - Press OK. + +- Second way: Using the waypoint menu + - Find the position you want to mark on the map. + - Get it's map grid. + - The grid is composed of 6 digits. + - The first three digits are read west to east. (Top of the map screen). + - The last three are read south to north. (Left side of the map screen). + - Go to the options menu (Click in `1` area, above the bar). + - CLick on `Waypoints` (`19`). + - Click on `Add`. + - Enter the grid number. + - Press OK. + - Enter the name of the waypoint. + - Press OK. + +- Third way: Using the Map menu. + - Go to the map menu (click on `9`) + - double left click on the position where you want your waypoint. + - Enter the name of the waypoint. + - Press OK. + +#### 2.3.2 Setting a waypoint +- Go to the options menu (Click in `1` area, above the bar). +- CLick on `Waypoints` (`19`). +- Select the waypoint. +- Click on `SetWp`. + + +- Once a waypoint is set: + - It's heading, elevation and distance are marked on the main menu. (`7`) + - It's heading, direction, grid position and name are marked in the compass menu (`8`) + - A marker appear at the waypoint grid location in the map menu (`9`) + +#### 2.3.3 Deleting a waypoint +- Go to the options menu (Click in `1` area, above the bar). +- CLick on `Waypoints` (`19`). +- Select the waypoint. +- Click on `Delete`. + +### 2.4 Switching between mils and degrees +- Go to the options menu (Click in `1` area, above the bar). +- Click on `Settings` (`21`) +- Double left click on the unit next to `Angular unit:` + +### 2.5 Switching between topographical and satellite view + +- Go to the map menu (`9`) +- Click on the map menu button again (`9`) + +### 2.6 Retrieving data from the vector +- For this you obviously need a `vector 21`. +- Go to the options menu (Click in `1` area, above the bar). +- Click on `Connect to` (`20`). +- Pull out your `vector 21`. + - Press and hold both R and Tab ↹ until the red pointing circle appears. + - Sight the circle on the object and release both keys. +- The data on the main menu now have changed, you can now see the azimuth the range and the elevation of the point you sighted. +- Note that the compass menu also changed and now features the azimuth, compass bearing, distance and grid position of the point you sighted. + +Note that the results of the measure you took won't change until you do an other measure. + + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/missileguidance.md b/documentation/feature/missileguidance.md new file mode 100644 index 0000000000..7231741d1a --- /dev/null +++ b/documentation/feature/missileguidance.md @@ -0,0 +1,28 @@ +--- +layout: wiki +title: Missile Guidance +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Adds the AMG framework, for more information about it refer to the [AMG framework documentation] ({{site.productionUrl}}/wiki/framework/advanced-missile-guidance.html) + +## 2. Usage + +### 2.1 Switching fire mode +- Press Ctrl + Tab ↹ the LED's on the right of the UI will change. +- `TOP` for top down mode. +- `DIR` for direct mode. + +### 2.2 Locking +- Fully zoom in by using NUMPAD + +- Switch to thermals by pressing N the `FLTR` LED should light up. +- Aim at the target and hold Tab ↹ a crosshair will appear and the `SEEK` LED will light up. +- Fire! + +## 3. Dependencies + +`ace_laser` diff --git a/documentation/feature/missionmodules.md b/documentation/feature/missionmodules.md new file mode 100644 index 0000000000..c434016fc2 --- /dev/null +++ b/documentation/feature/missionmodules.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Mission Modules +description: modules that can be used by mission makers. +group: feature +parent: wiki +--- + +## 1. Overview + +Add modules that can be used by mission makers. + +### 1.1 Ambient sounds + +That module can be used to add ambient sounds around players, it let you choose the sounds and some parameters (distance, volume interval). + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/mk6mortar.md b/documentation/feature/mk6mortar.md new file mode 100644 index 0000000000..90b6512ed5 --- /dev/null +++ b/documentation/feature/mk6mortar.md @@ -0,0 +1,65 @@ +--- +layout: wiki +title: Mk6 Mortar +description: Improve the existing mk6 mortar. +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 mk6 mortar overhaul +ACE3 adds wind deflection for shells as well as a rangetable to accurately take out your target without the artillery computer. + +## 2. Usage + +### 2.1 Switching charge +- Press F (Arma 3 default key bind `Fire Mode Switch`) to switch between charges + +### 2.2 Working with the rangetable +- To open the table: + - Self interact Ctrl + ⊞ Win + - Select `equipment`. + - Select `Open 82mm Rangetable`. + +- Using the table: + - Get the distance and elevation difference between you and the target for this you can use map tools. For this example we'll say we're 2 000m away and 50m below (we're at 20m they are at 70m, 70-20=50). + + - Select the charge you want to use (0 = close / 1 = medium / 2 = far). For this case we're using charge 2. + + - Check the range column on the table, we're at 2 000 then look at the corresponding entry in the column on the right (ELEV = elevation) For this example it's 1339. + + - After that's done move by one column on the right that's the elevation for 100m heigh so in our case we're subtracting 2 (4:2 = 2) if our target was 300m above us we would have to subtract 12 from our elevation (3x4 = 12). + + - Once you finished your maths, it's time to aim, get the cross of the mortar on target, if you don't see it use a waypoint if possible. In our case ELEV is 1339-2 = 1337. + + - On the right side of the screen, while looking through the mk6 scope you should see ELV, we need to match this number with the one we found. + - To adjust the ELV use Page Up and page Down. + - Once the number you found and ELV are the same FIRE ! + - On top of that you can calculate the time the shell will take to land by using the third row from the left, in our case the shell need to travel 2000m that's 20xthe number indicated. so 20x0,5 = 10s. + +### 2.3 Working with the rangetable (Crosswinds enabled) +- Same as above there's just an extra step, I'll provide an other example in case you forgot. + + - Get the distance and elevation difference between you and the target for this you can use map tools. For this example we'll say we're 2 400m away and 223m below (we're at 2m they are at 225, 225-2=223) + - Select the charge you want to use (0 = close / 1 = medium / 2 = far). For this case we're using charge 2. + + - Check the range column on the table, we're 2 400m a then look at the corresponding entry in the column on the right (ELEV = elevation) For this example it's 1145. + - After that's done move by one column on the right that's the elevation for 100m heigh so in our case we're subtracting 22 (2,2 x 10 (2,2 because we're around 220m below)). + - Extra step needed here, a kestrel 4500 IS NEEDED. + - Pick the crosswind on your kestrel (for this refer to the kestrel documentation). + + - For this example the crosswind is of 2 MPS on my table I can see under Azimuth correction that for each 1MPS I need to correct by 2.5 mill. + - So in this case i'm subtracting 5 mill from the ELV. + + - It's MATH TIME the ELV given by the table is 1 145, we subtract 22 because of the heigh, we also subtract 5 for the crosswind ( 1 145-22-5 = 1 118 ). + - After you finished your maths, it's time to aim, get the cross of the mortar on target, if you don't see it use a waypoint if possible. In our case ELEV is 1 118. + + - On the right side of the screen, while looking through the mk6 scope you should see ELV, we need to match this number with the one we found. + + - FIREEEE !!!! + - Little advantage of having crosswind enabled is that you don't have to calculate the flight time, it's marked on the table in this case it's 33,8s. + +## 3. Dependencies + +`ace_interaction` \ No newline at end of file diff --git a/documentation/feature/modules.md b/documentation/feature/modules.md new file mode 100644 index 0000000000..3d8f27136b --- /dev/null +++ b/documentation/feature/modules.md @@ -0,0 +1,14 @@ +--- +layout: wiki +title: modules +group: feature +parent: wiki +--- + +## 1. Overview + +This is taking care of module initialization **DO NOT REMOVE**. + +## 2. Dependencies + +`ace_main` reminder: **DO NOT REMOVE**. diff --git a/documentation/feature/movement.md b/documentation/feature/movement.md new file mode 100644 index 0000000000..bb857644b0 --- /dev/null +++ b/documentation/feature/movement.md @@ -0,0 +1,40 @@ +--- +layout: wiki +title: Movement +description: Movement improvements +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Jumping +Adds the ability to jump when pressing the vault key while moving. (V) + +### 1.2 Minor animation tweaks +Walking slowly with the weapon lowered now has a less silly looking animation. + +### 1.3 Fatigue adjustments +Soldiers get fatigued slower, but regain their stamina slower aswell. Fatigued soldiers have a faster walking speed and no longer turn into snails. + +### 1.4 Weight display +Adds a weight of the current loadout display in the inventory to estimate the fatigue gain while moving in combat. Can be adjusted to display lb. instead of kg in the ACE Options Menu. + +### 1.5 Optics view in all stances +The player can now use the sights of rifles and pistols in all prone stances. + + +## 2. Usage + +### 2.1 Jumping +- For this you need your weapon up +- While jogging or running press V + +### 2.2 Climbing +- Approach what you want to climb. +- Press ctrl + V (ACE3 default key bind `Climb`). +- Note that when climbing your character will put his weapon on his back. + +## Dependencies + +`ace_common` diff --git a/documentation/feature/mx2a.md b/documentation/feature/mx2a.md new file mode 100644 index 0000000000..892991d3b7 --- /dev/null +++ b/documentation/feature/mx2a.md @@ -0,0 +1,14 @@ +--- +layout: wiki +title: MX-2A +group: feature +parent: wiki +--- + +## 1. Overview + +Adds the MX-2A thermal imaging device. + +## 3. Dependencies + +`ace_apl` \ No newline at end of file diff --git a/documentation/feature/nametags.md b/documentation/feature/nametags.md new file mode 100644 index 0000000000..6130be167f --- /dev/null +++ b/documentation/feature/nametags.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Nametags +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Nametag and rank display +Adds nametags and soldier ranks to friendly players in multiplayer. This can be adjusted in the ACE Options Menu to not display the rank, display all nametags of nearby soldiers instead of those who are looked directly at, to require a button press to show the nametags or to disable them altogether. + +### 1.2 Arma 3 VON, ACRE and TFAR soundwaves +A soundwave effect is shown when someone is speaking using either the vanilla VON, ACRE 1 or 2 and TFAR. + +## 2. Dependencies + +`ace_interaction` diff --git a/documentation/feature/nightvision.md b/documentation/feature/nightvision.md new file mode 100644 index 0000000000..46bae6a905 --- /dev/null +++ b/documentation/feature/nightvision.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: Nightvision +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Multiple Generation NVGs +Adds different night vision devices with varying image quality and field of view. New Classnames for Generations 1, 2, and 4 NVG's (default Arma 3 NVG's represents Generation 3) and a wide view NVG. + +### 1.2 Blending effects +Adds a blending effect depending on ammunition type when firing while using a night vision device. Especially tracer rounds are bright, but you can use the IR-dim tracers from the Ballistics module to reduce tis effect. + +### 1.3 Brightness adjustment +Enables the user to manually adjust NVG brightness. + +## 2. Usage + +### 2.1 Adjusting brightness +- Use ALT + PageUP and ALT + PageDOWN to adjust NVG brightness (ACE3 default key bind `Increase/Decrease NVG Brightness`). + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/noidle.md b/documentation/feature/noidle.md new file mode 100644 index 0000000000..f63daa4eb8 --- /dev/null +++ b/documentation/feature/noidle.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: No Idle +description: Disable idle animations +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Idle animations removed + +This removes idle animations. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/noradio.md b/documentation/feature/noradio.md new file mode 100644 index 0000000000..e7452ed840 --- /dev/null +++ b/documentation/feature/noradio.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: No Radio +description: Disable callouts +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Silent avatar +Mutes the player's automatic callouts ("Enemy man, 100 meters, front!"). +Does not mute AI callouts. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/norearm.md b/documentation/feature/norearm.md new file mode 100644 index 0000000000..73ed1c35cc --- /dev/null +++ b/documentation/feature/norearm.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: No Rearm +description: Remove rearm from +group: feature +parent: wiki +--- + +## 1. Overview + +Hides the rearm action for players (on cars / boxes / corpses / ground) + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/optics.md b/documentation/feature/optics.md new file mode 100644 index 0000000000..fe1d04ee76 --- /dev/null +++ b/documentation/feature/optics.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Optics +description: 2D and PIP optics +group: feature +parent: wiki +--- + +## 1. Overview + +Adds animated 2D and PIP variants of some optics (RCO / MRCO / ARCO / LRPS / MOS) + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/optionsmenu.md b/documentation/feature/optionsmenu.md new file mode 100644 index 0000000000..e4da9f033a --- /dev/null +++ b/documentation/feature/optionsmenu.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: Options Menu +description: ACE3 options menu +group: feature +parent: wiki +--- + +## 1. Overview + +Adds the options menu used by other components. + +## 2. Usage + +### 2.1 Opening the user menu +- Press Escape +- In the top left corner of the screen you should see `ACE Options`. +- Click it. + +### 2.2 Options menu informations +- You don't have to press a save button. When a setting is changed it's saved automatically. + +## 3. Dependencies + +`ace_common` + +*Note: The Options Menu module is utilized by many other modules. Disabling it is not recommended.* diff --git a/documentation/feature/overheating.md b/documentation/feature/overheating.md new file mode 100644 index 0000000000..b97df663ce --- /dev/null +++ b/documentation/feature/overheating.md @@ -0,0 +1,42 @@ +--- +layout: wiki +title: Overheating +description: Weapon temperature and jamming, barrel swapping. +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Weapon Jamming +Adds a probability to jam a weapon when firing. Jams can be cleared by reloading or by using the clear jam-key. + +### 1.2 Temperature simulation +Introduces weapon temperature simulation depending on weapon and bullet mass. Hot weapons are more prone to jamming. Depending on weapon type the accuracy and in extreme cases the muzzle velocity might be reduced on high temperatures. Adds smoke puff and heat refraction effects to indicate this. + +### 1.3 Spare barrels +Adds the ability to changes barrels on machine guns to compensate for those effects. + + +## 2. Usage + +### 2.1 Clearing a jammed weapon +- To clear a jammed weapon, press SHIFT + R (ACE3 default key bind `Clear jam`). + +### 2.2 Swapping barrels +- For this you need a `Spare barrel` and a compatible weapon. +- Press self interaction Ctrl + ⊞ Win (ACE3 default key bind `Self Interaction Key`). +- Select `Equipment`. +- Select `Swap barrel`. + +### 2.3 Checking your barrel temperature +- Press self interaction Ctrl + ⊞ Win. +- Select `Equipment`. +- Select `Check weapon temperature`. + +**NOTE** When the bar is half full (yellow) it means the barrel is around 500°c. +Your weapon will be even more prone to jams, and it'll get worse if you don't let the barrel cool down or swap it. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/overpressure.md b/documentation/feature/overpressure.md new file mode 100644 index 0000000000..85ed13e8ca --- /dev/null +++ b/documentation/feature/overpressure.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Overpressure +description: backblast and overpressure +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Overpressure +Adds backblast to AT launchers and overpressure zones to tank cannons, don't stay behind a firing RPG or it'll hurt. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/parachute.md b/documentation/feature/parachute.md new file mode 100644 index 0000000000..a3f9791fb7 --- /dev/null +++ b/documentation/feature/parachute.md @@ -0,0 +1,28 @@ +--- +layout: wiki +title: Parachute +description: Add an altimeter and a non-steerable parachute +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Altimeter +Removes the altitude and descend speed UI elements when free-falling and parachuting on higher difficulties. Adds an altimeter watch type item. + +### 1.2 Non-steerable parachute +Adds a non-steerable parachute variant for jet pilots. + +### 1.3 Landing animation +Smoothens the parachute landing animation. + +## 2. Usage + +### 2.1 bringing up the altimeter +- 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. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/protection.md b/documentation/feature/protection.md new file mode 100644 index 0000000000..628d05d972 --- /dev/null +++ b/documentation/feature/protection.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Protection +description: Tweaks armor values +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Tweaked protection values +Fixes and tweaks the protection values of body armour, helmets and uniforms. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/ragdolls.md b/documentation/feature/ragdolls.md new file mode 100644 index 0000000000..235e8e97be --- /dev/null +++ b/documentation/feature/ragdolls.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Ragdolls +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Adjusted Ragdolls +Changes the ragdolls to react more to the force of shots and explosions. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/rangecard.md b/documentation/feature/rangecard.md new file mode 100644 index 0000000000..6c588de45a --- /dev/null +++ b/documentation/feature/rangecard.md @@ -0,0 +1,31 @@ +--- +layout: wiki +title: Rangecard +description: Add a range card for your weapons +group: feature +parent: wiki +--- + +## 1. Overview + +Add a range card that updates itself for your weapon and the type of ammo you're using. + +## 2. Usage + +### 2.1 Opening the range card +- Open the self interaction menu Ctrl + ⊞ Win +- Select `Equipment` +- Select `Open Range Card` + +### 2.2 Using the range card +- To use this to it's full potential the use of a `Vector 21` is strongly recommended, a `Kestrel 4500` will also help. + +- Pull out your rangefinder (`Vector 21` preferred) and get the distance between you and your target. + +- Open your rangetable and look under the `Target range` column. + +- Move to the `Bullet Drop` column, the drop is in MRADs, you need to compensate for it by adjusting your sight. Example, you want to adjust for a bullet drop of -7.9 MRADs simply adjust your scope 7.9 MRADs vertically. (check [feature scopes](http://ace3mod.com/wiki/feature/scopes.html) ) for this. + +## 3. Dependencies + +`ACE_Advanced_Ballistics` \ No newline at end of file diff --git a/documentation/feature/realisticnames.md b/documentation/feature/realisticnames.md new file mode 100644 index 0000000000..72f5766664 --- /dev/null +++ b/documentation/feature/realisticnames.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Realistic Names +description: More realistic weapon names +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Real names +Changes the names of vehicles, magazines, weapons, grenades, explosive charges and mines to their respective real-world counterparts whenever possible. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/recoil.md b/documentation/feature/recoil.md new file mode 100644 index 0000000000..b684a1c8ce --- /dev/null +++ b/documentation/feature/recoil.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Recoil +description: Recoil overhaul +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Recoil adjustment +Overhauls the recoil system reducing upwards recoil. + +### 1.2 Advanced cam shake +Introducing camshake when firing on foot or as vehicle gunner depending on stance and weapon type. + +### 1.3 Burst dispersion +Firing in longer burst (> 3 rounds per burst) slightly reduces the accuracy. Firing machine guns in bursts is now useful. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/reload.md b/documentation/feature/reload.md new file mode 100644 index 0000000000..1d8637c290 --- /dev/null +++ b/documentation/feature/reload.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Reload +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Ammo count +Hides the actual round count of magazines and removes the icon when the current magazine is emptied. The player can instead check the magazine weight, but that gives only estimated values for magazines with more than 10 rounds. + +## 2. Usage + +### 2.1 Checking your ammo +- Press Ctrl + R (ACE3 default key bind `Check Ammo`). + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/reloadlaunchers.md b/documentation/feature/reloadlaunchers.md new file mode 100644 index 0000000000..3bfa739360 --- /dev/null +++ b/documentation/feature/reloadlaunchers.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Reload Launchers +description: +group: feature +parent: wiki +--- + +## 1. Overview + +Add the ability to reload someone else's launcher. + +### 2. Usage + +### 2.1 Reloading someone else's launcher +- Press the interaction key ⊞ Win and aim at your buddy's launcher. +- Select `reload launcher`. +- Select the type of ammo. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/respawn.md b/documentation/feature/respawn.md new file mode 100644 index 0000000000..08d3bf7feb --- /dev/null +++ b/documentation/feature/respawn.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Respawn +description: Same gear on respawn, FF message, rallypoints +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Respawn with same gear +Requires the Respawn Gear module to be placed. Respawned soldiers now have their loadout when killed. + +### 1.2 Friendly Fire messages +Shows friendly fire warnings in system chat if the module is placed. Works even in higher difficulties where kill messages are normally disabled. + +### 1.3 Rallypoints +Adds rallypoints to all 3 sides to enable teleportation from base spawn to FOB's. Requires some setup from the mission maker. + + +## 2. Usage + +### 2.1 Using rallypoints +- For this to work pre-emptive preparations need to be made by the mission maker. +- Approach the rallypoint flagpole +- Use the interaction key ⊞ Win (ACE3 default key bind `Interaction key`). +- Select teleport to (base / rallypoint). + + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/safemode.md b/documentation/feature/safemode.md new file mode 100644 index 0000000000..0bcf4435de --- /dev/null +++ b/documentation/feature/safemode.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Safe Mode +description: Introduce safe mode +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Safety +You can now use the safety mode of any weapon. Switching weapon modes takes the safety off. + +## 2. Usage + +### 2.1 Switching safety on / off +- To turn it on press Ctrl + ` (QWERTY layout) (ACE3 default key bind `Safe Mode`). +- To turn it off press Ctrl + ` (QWERTY layout) again or switch firing mode. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/sandbags.md b/documentation/feature/sandbags.md new file mode 100644 index 0000000000..9c0c90b7e0 --- /dev/null +++ b/documentation/feature/sandbags.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Sandbags +group: feature +parent: wiki +--- + +## 1. Overview + +Adds stackable sandbags able to block bullets, shrapnel and small explosions. +Note that those sandbags are affected by physics, a rocket will send them flying. + +## 2. Usage + +### 2.1 Placing the sandbags +- You'll need at least one `sandbag (empty)`. +- You need to be over a grass area / sand area to be able to fill the sandbag. +- Self interact Ctrl+⊞ Win (ACE3 default). +- Select `Deploy sandbag`. +- Follow the instruction on screen. + +## 3. Dependencies + +`ace_interaction` \ No newline at end of file diff --git a/documentation/feature/scopes.md b/documentation/feature/scopes.md new file mode 100644 index 0000000000..cfcee4a687 --- /dev/null +++ b/documentation/feature/scopes.md @@ -0,0 +1,31 @@ +--- +layout: wiki +title: Scopes +description: Scope adjustment +group: feature +parent: wiki +--- + +## 1. Overview + +### Sniper Scope Adjustment +Allows snipers to adjust their scopes horizontally and vertically in mils. + +## 2. Usage + +### 2.1 Adjusting your scope vertically +Please not that the following key combinations are ACE3 default key binds. +- Minor adjustment up Page Up. +- Minor adjustment down page Down. +- Major adjustment up ⇧ Shift + Page Up. +- Major adjustment down ⇧ Shift + page Down. + +### 2.2 Adjusting your scope horizontally +- Minor adjustment right Ctrl + Page Up. +- Minor adjustment left Ctrl + page Down. +- Major adjustment right Ctrl + ⇧ Shift + Page Up. +- Major adjustment left Ctrl + ⇧ Shift + page Down. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/smallarms.md b/documentation/feature/smallarms.md new file mode 100644 index 0000000000..51fc7c0440 --- /dev/null +++ b/documentation/feature/smallarms.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Small Arms +description: Various improvements to small arms +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Magazine Names +Unifies the name formatting of magazines similar to Arma 2 standards. + +### 1.2 No tracers in non-tracer mags +Assault rifles no longer have tracer rounds in their non-tracer magazines. This doesn't effect the additional tracers in the last rounds of machine gun magazines. + +### 1.3 Real magazine round counts +All pistol and sub machine gun magazines now have adjusted capacities to match their real life counterparts. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/spotting_scope.md b/documentation/feature/spotting_scope.md new file mode 100644 index 0000000000..a2b9bdf19d --- /dev/null +++ b/documentation/feature/spotting_scope.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Spotting scope +group: feature +parent: wiki +--- + +## 1. Overview + +Adds a deployable spotting scope. + +## 2. Usage + +### 2.1 Deploying the spotting scope +- Self interact Ctrl+⊞ Win (ACE3 default). +- Select `Equipment`. +- Select `Place spotting scope` (note that the scope will be at your feet). + +## 3. Dependencies + +`ace_apl` , `ace_interaction` \ No newline at end of file diff --git a/documentation/feature/switchunits.md b/documentation/feature/switchunits.md new file mode 100644 index 0000000000..cc1a0ba381 --- /dev/null +++ b/documentation/feature/switchunits.md @@ -0,0 +1,29 @@ +--- +layout: wiki +title: Switch Units +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Switch units + +"ACE SwitchUnits" is a tool for mission makers to quickly add PvP (Player vs. Player) elements to a mission. In short it enables a player to control AI units. Allowing players to perform as enemies even during a COOP mission increases the authenticity of the enemy and thus the immersion for everyone. + +The most prominent feature of ACE SwitchUnits is that you can add it to nearly every existing mission and get AI control out of the box. Dynamic mission like "Enemy Assault", "Patrol Ops", "Invade & Annex", etc. don't need to be touched to make all random spawned AI's controllable. + +In its current form you're able to switch to infantry (vehicles, etc. are planned) from all four sides (West, East, Independent, Civilian). + +## 2. Usage + +### 2.1 Switching to a unit +- Open your map +- Find a unit you can access (they are showed with special icons and names on the map). +- Press LMB on the desired unit. +- You'll control that unit until it dies or until you switch to an other one. If the unit dies you'll be brought back to your original unit.. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/tacticallader.md b/documentation/feature/tacticallader.md new file mode 100644 index 0000000000..9ed4b9459d --- /dev/null +++ b/documentation/feature/tacticallader.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Tactical ladder +group: feature +parent: wiki +--- + +## 1. Overview + +Adds a deployable ladder with adjustable height that you can transport on your back. + +## 2. Usage + +### 2.1 Deploying the ladder +- Self interact Ctrl+⊞ Win (ACE3 default). +- Select `Deploy ladder`. +- You can adjust it's position and height by interacting with it ⊞ Win (ACE3 default) and following the instructions on screen. + +## 3. Dependencies + +`ace_apl` , `ace_interaction` \ No newline at end of file diff --git a/documentation/feature/testmissions.md b/documentation/feature/testmissions.md new file mode 100644 index 0000000000..8b61c47327 --- /dev/null +++ b/documentation/feature/testmissions.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: Test Missions +description: +group: feature +parent: wiki +--- + +## 1. Overview + +adds ACE3 test missions + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/thermals.md b/documentation/feature/thermals.md new file mode 100644 index 0000000000..495ba30eaf --- /dev/null +++ b/documentation/feature/thermals.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Thermals +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Body Warmth +Adjusts the thermal properties of humans making them less like torches. + +## 2. Dependencies + +`ace_common` diff --git a/documentation/feature/tripod.md b/documentation/feature/tripod.md new file mode 100644 index 0000000000..f6f49ba3d1 --- /dev/null +++ b/documentation/feature/tripod.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Tripod +group: feature +parent: wiki +--- + +## 1. Overview + +Adds a packable tripod deployable on the field. It features a flat part to deploy your weapon on and adjustable legs. + +## 2. Usage + +### 2.1 deploying the tripod +- Note that you need a `SSWT kit` in your inventory. +- Self interact Ctrl+⊞ Win. +- Select `Equipment` +- Select `Place SSWT kit`. + +To adjust or pick up the tripod just interact with it ⊞ Win and select the desired action. + +## 3. Dependencies + +`ace_interaction` diff --git a/documentation/feature/ui.md b/documentation/feature/ui.md new file mode 100644 index 0000000000..eb7cf3ff58 --- /dev/null +++ b/documentation/feature/ui.md @@ -0,0 +1,15 @@ +--- +layout: wiki +title: UI +group: feature +parent: wiki +--- + +## 1. Overview + +Changes the chat contrast on the map to allow easier reading. + + +## 3. Dependencies + +`ace_common` \ No newline at end of file diff --git a/documentation/feature/vector.md b/documentation/feature/vector.md new file mode 100644 index 0000000000..4dbf4440a1 --- /dev/null +++ b/documentation/feature/vector.md @@ -0,0 +1,84 @@ +--- +layout: wiki +title: Vector +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Vector 21 Rangefinder +ACE3 adds a realistic depiction of the Vector 21 rangefinder to the game. Unlike other rangefinders, it doesn't just magically show you the range to your target, but in exchange allows you to do alot of things with it that the other choices in Arma do not offer. The Vector's functions include, but are not limited to: + +- Distance to a target +- Azimuth to a target +- Horizontal and vertical distance to a target +- Distance between 2 targets +- Angle between 2 targets +- Switching between feet and meters +- Switching between degrees and mils +... + +## 2. Usage + +The Vector is controlled with 2 keys: the azimuth key and the range key; Tab and R and is brought up like any other binoculars. + +#### 2.1 Slope distance +Measuring Slope distance + +- Press and hold R until the red pointing circle appears. Sight the circle on the object and release the key. + +#### 2.2 Azimuth +Measuring Azimuth + +- Press and hold the Tab ↹ until the azimuth is displayed. + +#### 2.3 Slope distance and Azimuth +Measuring Slope distance and Azimuth + +- Press and hold both R and Tab ↹ until the red pointing circle appears. +- Sight the circle on the object and release both keys. + +#### 2.4 Horizontal distance and height difference +Measuring Horizontal distance and height difference + +- Tap R once then press and hold it until the red pointing circle appears. +- Sight the circle on the object and release the key. + +#### 2.5 Azimuth and Inclination +Measuring Azimuth and Inclination + +- Tap Tab ↹ once then press and hold it until the azimuth and inclination is displayed. + +#### 2.6 Distance between two points +Measuring Distance between two points + +- Press and hold R until the red pointing circle appears. +- Sight the circle on the first object and tap Tab ↹ while further holding R. The first measurement is confirmed ("1-P" = first point). +- Sight the second object and release R. + +#### 2.7 Horizontal and vertical distance between two points +Measuring Horizontal and vertical distance between two points + +- Tap R once then press and hold it until the red pointing circle appears. +- Sight the circle on the object and tap Tab ↹ once. The first measurement is confirmed ("1-P" = first point). +- Sight the second object and release R. + +#### 2.8 Horizontal distance and azimuth between two points +Measuring Horizontal distance and azimuth between two points + +- Press and hold Tab ↹ until the azimuth appears. +- Sight the circle on the first object and tap R while further holding Tab ↹. The first measurement is confirmed ("1-P" = first point). +- Sight the second object and release Tab ↹. + +### 2.9 Fall of shot +Measuring Fall of shot + +- Tap Tab ↹ once then press and hold it until the azimuth appears. +- Sight the circle on the object and tap R while further holding Tab ↹. The first measurement is confirmed ("1-P" = first point). +- Sight the Fall of shot and release Tab ↹. The left digits display the left (`L`)/right (`r`) correction value in meter and the right digits display the longer (`A` = add)/shorter (`d` = drop) correction value in meter. If R is tapped the height correction values will be displayed (`UP` and `dn`). + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/vehiclelock.md b/documentation/feature/vehiclelock.md new file mode 100644 index 0000000000..a97ec96149 --- /dev/null +++ b/documentation/feature/vehiclelock.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: Vehicle Lock +description: The Vehiclelock module enables locking vehicles and their inventory +group: feature +parent: wiki +--- + +## 1. Overview +This feature adds the ability to lock and unlock vehicles and their inventory using a key, as well as picking locks of locked vehicles. It's disabled by default. + +## 2. Usage +Locking, unlocking and picking vehicle locks is possible via the ACE Interact menu. + +
+
Note:
+

Different locking modes can be set, consult with your mission maker for more information.

+
+ +## 3. Dependencies +`ace_interaction` diff --git a/documentation/feature/vehicles.md b/documentation/feature/vehicles.md new file mode 100644 index 0000000000..a58d314194 --- /dev/null +++ b/documentation/feature/vehicles.md @@ -0,0 +1,50 @@ +--- +layout: wiki +title: Vehicles +description: +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Speed limiter +Adds ability to limit the max. speed of any vehicle. + +### 1.2 Engine start delay +The engine has to be started before the vehicle can move. Starting the engine takes aprox. 1 to 2 seconds. + +### 1.3 Fuel capacity +The range of all vehicle gets significantly reduced to reflect ranges of their real life counterparts. Scaled down to match the relative short distances in Arma 3. A full vehicle on mission start should still most likely never need a refueling during a mission. + +### 1.4 Main gun muzzles +APC's and tanks now share a muzzle for all ammunition types of their main guns. This prevents an exploit that skips the reloading time of a round or clip while changing the ammunition type. Also makes it possible to switch between ammunition types using the scroll wheel like in Arma 2. + +### 1.5 Boat machine gun tracers +NATO and AAF armed boats now use their respective tracer colours like any vehicle when they fire their rear gun. (Red for Blufor, yellow for Indep) + +### 1.6 Improved smoke launcher of Fennek (Strider) +Reduced smoke shell count and launch angle of the AAF Fennek to match the models smoke launcher. + +### 1.7 Stabilized optic of Fennek (Strider) +Stabilizes the commander's view in the Fennek (Strider). + +### 1.8 Vehicle mounted machine guns ROF +The rate of fire of vehicle mounted miniguns and machine guns is adjusted to match real life values. + +### 1.9 120mm gun and mortar behaviour +MBT main guns and mortars can no longer lock on enemies. The AT rounds of both now have raised cost values to encourage the AI to not use those rounds against foot soldiers over their machine guns or HE rounds. + +## 2. Usage + +### 2.1 Turning the engine on / off +- To turn the engine on press 2. +- To turn the engine off press 1. + +### 2.2 Turning the speed limiter on / off +- To turn the speed limiter on press Del. +- To turn it off press Del again. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/viewdistance.md b/documentation/feature/viewdistance.md new file mode 100644 index 0000000000..38e4fc4c53 --- /dev/null +++ b/documentation/feature/viewdistance.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: View Distance +description: The view distance module adds extra view distance settings +group: feature +parent: wiki +--- + +## 1. Overview +ACE3 View Distance adds the ability to have different view distance settings when on foot, in a vehicle or in the air. It is enabled by default. + +## 2. Usage +- When in-game, press ESC. +- Click `ACE Options` in the top-left corner. +- Scroll down to the `Client View Distance` settings. + +## 3. Dependencies +`ace_common` diff --git a/documentation/feature/weaponselect.md b/documentation/feature/weaponselect.md new file mode 100644 index 0000000000..232e643416 --- /dev/null +++ b/documentation/feature/weaponselect.md @@ -0,0 +1,35 @@ +--- +layout: wiki +title: Weapon Select +group: feature +parent: wiki +--- + +## 1. Overview + +### 1.1 Holster weapon +Adds the ability to holster a weapon on the back. + +### 1.2 Quick weapon select +Adds key bindings to quickly switch weapons while on foot or in a vehicle. (Unbound by default). + +### 1.3 Quick vehicle engine on/off +Adds key bindings to quickly turn a vehicle engine on or off. + +### 1.4 Grenade select +Changes the grenade selection key bindings to help prevent accidents. + +## 2. Usage + +### 2.1 Weapons + +- Press 0 to holster and unholster a weapon. +- When a weapon is holstered, the weapon fire button will not pull the weapon out. This can be used as an additional level of safety or as a role-playing feature. + +Quick weapon selection is not bound by default, but can be bound in the controls menu under `ACE3 Weapons`. + +Quick vehicle weapon selection is not bound by default, but can be bound in the controls menu under `ACE3 Vehicles`. + +## 3. Dependencies + +`ace_common` diff --git a/documentation/feature/weather.md b/documentation/feature/weather.md new file mode 100644 index 0000000000..4dee0da86f --- /dev/null +++ b/documentation/feature/weather.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Weather +description: The Weather module overrides the mission/editor weather setting with a synchronized realistic weather simulation +group: feature +parent: wiki +--- + +## 1. Overview +ACE3 Weather 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. + +## 2. Usage + +### 2.1 Wind info +- Wind info is toggled on/off using SHIFT + K. +- The arrow representing wind info is based on [Beaufort scale](http://en.wikipedia.org/wiki/Beaufort_scale#Modern_scale) + +## 3. Dependencies +`ace_common`, `ace_modules` diff --git a/documentation/feature/windeflection.md b/documentation/feature/windeflection.md new file mode 100644 index 0000000000..82019eca7c --- /dev/null +++ b/documentation/feature/windeflection.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Wind Deflection +description: The Windeflection module simulates wind deflection of projectiles +group: feature +parent: wiki +--- + +## 1. Overview +ACE3 Wind Deflection is enabled by default. This feature simulates the wind deflection of projectiles fired by players and is designed to work independently or in conjunction with the Advanced Ballistic feature. + +
+
Note:
+

The only affected projectiles are bullets and grenades. Mortar shells, tank shells, missiles and rockets are not affected.

+
+ +## 2. Usage +ACE3 Wind Deflection can be disabled or modified via a module in the 2D editor. + + +## 3. Dependencies +`ace_weather` diff --git a/documentation/feature/yardage450.md b/documentation/feature/yardage450.md new file mode 100644 index 0000000000..66c4a2d4e3 --- /dev/null +++ b/documentation/feature/yardage450.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Yardage 450 +group: feature +parent: wiki +--- + +## 1. Overview + +Adds the Bushnell Yardage Pro Sport 450 Laser Rangefinder. + +## 2. Usage + +### 2.1 How to use the Yardage 450 +- Bring it up like any other binocular +- Tap R once to activate the device. +- Sight the target and Hold R until `TARGET AQCUIRED` appears on top of the screen. +- The range in meters should now appear at the bottom of the screen. + +## 3. Dependencies + +`ace_apl` , `ace_laser` \ No newline at end of file diff --git a/documentation/feature/zeus.md b/documentation/feature/zeus.md new file mode 100644 index 0000000000..12a016d584 --- /dev/null +++ b/documentation/feature/zeus.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Zeus +description: The Zeus module improves the Vanilla functionality +group: feature +parent: wiki +--- + +## 1. Overview +ACE3 Zeus is enabled by default. This feature provides control over vanilla aspects of Zeus. + +## 2. Usage +ACE3 Zeus can be disabled or modified via a module in the 2D editor. + +## 3. Dependencies +`ace_common`, `ace_modules` diff --git a/documentation/framework/advanced-missile-guidance.md b/documentation/framework/advanced-missile-guidance.md index 8beee862b7..14f1d1feae 100644 --- a/documentation/framework/advanced-missile-guidance.md +++ b/documentation/framework/advanced-missile-guidance.md @@ -1,6 +1,7 @@ --- layout: wiki title: Advanced Missile Guidance +description: The ACE3 Advanced Missile Guidance Framework provides a setup of configuration settings, functions and a execution framework for addon makers to integrate with the missile guidance and targeting mechanisms of ACE3. group: framework order: 5 parent: wiki @@ -8,7 +9,7 @@ parent: wiki ## 1. Overview -The ACE Advanced Missile Guidance Framework provides a setup of configuration settings, functions and a execution framework for addon makers to integrate with the missile guidance and targeting mechanisms of ACE. It also provides for mod makers to create their own custom guidance methods within the framework. +The ACE3 Advanced Missile Guidance Framework provides a setup of configuration settings, functions and a execution framework for addon makers to integrate with the missile guidance and targeting mechanisms of ACE3. It also provides for mod makers to create their own custom guidance methods within the framework. The framework provides all the functionality needed for guidance; from laser locking, target specification and selection, to handling the fired events and tracking and steering the vehicle based on provided parameters. This way, all that needs to be defined in addons is the appropriate CfgAmmo entries for the missile. diff --git a/documentation/framework/carry-drag.md b/documentation/framework/carry-drag.md index d117bcbc4a..cfa4eb13af 100644 --- a/documentation/framework/carry-drag.md +++ b/documentation/framework/carry-drag.md @@ -1,6 +1,7 @@ --- layout: wiki title: Carry and Drag System +description: group: framework order: 5 parent: wiki @@ -25,3 +26,71 @@ class CfgVehicles { }; ``` +## 2. Functions + +**NOTE THAT THE FOLLOWING FUNCTIONS ARE NOT PUBLIC AND THUS MAY CHANGE IN THE FUTURE.**
+ + +Also note that if the item is too heavy you won't be able to carry / drag it, the mass is also affected by what's inside it.
+To bypass this empty the object and / or use setMass.
+ +### 2.1 Enabling / disabling dragging + +`ace_dragging_fnc_setDraggable.`
+Enable the object to be dragged.
+ +| Arguments | | +--------------| -------- | +0 | Any object (Object) +1: | true to enable dragging, false to disable (Bool) +2:| Position offset for attachTo command (Array, optional; default: [0,0,0]) +3: | Direction in degree to rotate the object after attachTo (Number, optional; default: 0) +Return value: NONE
+ +#### 2.1.1 example 1: +``` +[foo,true,[0,2,0],45] call ace_dragging_fnc_setDraggable +``` +| Arguments | | +--------------| -------- | +0:| foo (my object) +1:| true (dragging is enabled) +2:| `[0,2,0]` (0 meters sideways, 2 meters forward, 0 meters upwards) +3:| 45 (the object is rotated by 45°) + +#### 2.1.2 example 2 +``` +[bar,false,[3,-2,2],20] call ace_dragging_fnc_setDraggable +``` + +| Arguments | | +--------------| -------- | +0:| bar (object) +1:| false (dragging is disabled) +2:| 3 meters sideways, -2 meters backwards, 2 meters upwards +3:| the object is rotated by 20° + +### 2.2 Enabling / disabling carrying +`ace_dragging_fnc_setCarryable.`
+Enable the object to be carried.
+ +| Arguments | | +--------------| -------- | +0 | Any object (Object) +1:| true to enable carrying, false to disable (Bool) +2:| Position offset for attachTo command (Array, optional; default: [0,1,1]) +3:| Direction in degree to rotate the object after attachTo (Number, optional; default: 0) +Return value: NONE
+ + +#### 2.1.1 example 1: +``` +[foo,true,[0,3,1],10] call ace_dragging_fnc_setCarryable +``` +| Arguments | | +--------------| -------- | +0:| foo (my object) +1:| true (carrying is enabled) +2:| `[0,2,0]` (0 meters sideways, 3 meters forward, 1 meters upwards) +3:| 10 (the object is rotated by 10°) + diff --git a/documentation/framework/fragmentation-configuration.md b/documentation/framework/fragmentation-configuration.md index c8a64b2db4..876074e6f4 100644 --- a/documentation/framework/fragmentation-configuration.md +++ b/documentation/framework/fragmentation-configuration.md @@ -1,12 +1,13 @@ --- layout: wiki title: Fragmentation Configuration +description: The fragmentation system (ace_frag) in ACE3 is a significant improvement over the fragmentation system in ACE2. group: framework parent: wiki order: 7 --- -The fragmentation system (sys_frag) in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in CfgAmmo to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where casualty production was lower than desired. +The fragmentation system (ace_frag) in ACE3 is a significant improvement over the fragmentation system in ACE2. Previously the system relied on fuzzy math from the values of `indirectHit` and `indirectHitRange` in CfgAmmo to calculate roughly the velocity and range of fragmentation. This had some serious drawbacks, especially in the case of smaller explosives such as hand grenades and 40mm grenades where casualty production was lower than desired. In ACE3 the system has moved away from what "feels" right to actual explosive engineering equations, primarily the [Gurney equations](http://en.wikipedia.org/wiki/Gurney_equations). This allows us to get close to the actual fragmentation velocities that would be produced by an explosive configuration similar to type of ammo we are simulating. diff --git a/documentation/framework/settings.md b/documentation/framework/settings.md new file mode 100644 index 0000000000..58208a873d --- /dev/null +++ b/documentation/framework/settings.md @@ -0,0 +1,95 @@ +--- +layout: wiki +title: Settings Framework +description: ACE3 contains an extensive settings framework that allows you to tweak the modification without having to mess around with deleting pbos. +group: framework +order: 5 +parent: wiki +--- + +ACE3 contains an extensive settings framework that allows you to tweak the modification without having to mess around with deleting pbos. These settings are all handled server side and broadcasted to the clients connecting to that server. This ensures that everyone playing on the server will have a uniform experience. + +Part of this settings framework are global settings and client settings. Both use the same underlaying framework, with the difference that client settings can be adjusted by clients, where global settings can not. + + +## 1. How do they work + +Settings are entries in the config that get translated to `missionnamespace` global variables. An example settings entry looks like this: + +```c++ +class ACE_module_sampleSetting { + // Value + value = 1; + + // Type (SCALAR, BOOL, STRING, ARRAY, COLOR) + typeName = "SCALAR"; + + // Force the setting? + force = 0; + + // Does it appear on the options menu? + isClientSettable = 1; + + // The following settings only apply when isClientSettable == 1 + // Stringtable entry with the setting name + displayName = "$STR_ACE_Common_SettingName"; + + // Stringtable entry with the setting description + description = "$STR_ACE_Common_SettingDescription"; + + // Stringtable entries that describe the options + // Only applies if typeName == "SCALAR"; and is optional + values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; +}; +``` + +Settings are defined from the mods config but can be adjusted through the following methods: + +* Optional config entries +* Mission side modules + +## 2. Load order + +The load order for the settings are: + +* 1. Mod config +* 2. Server config +* 3. Mission config +* 4. Placed down mission modules + +What this means is that at any the 3 points after the mod config it is possible to insert your adjusted settings and force those (optionally). This is a powerful tool for server admins, whom can ensure that everyone is using uniform settings across the board on their server. And it provides mission makers the ability to easily set settings for their mission, without creating a large dependency on ACE3; you do not have to place down mission modules. + +## 3. How do I use them? + +In the 'how do they work' chapter an example of settings was shown. This is the same for any settings config. The only difference is the location. For ACE3 modules, the settings are placed in the class `ACE_settings`. The same goes for the mission config. + +The server config setting entries are done through our optional ACE_server.pbo, which can be found in the optionals folder of @ace. It also contains a `userconfig` folder, which inside contains the file `ace\serverconfig.hpp`. This is the location ACE3 settings are placed. There is no need for a sub class. + +### 3.1 Getting all the settings! + +ACE3 contains a lot of settings; for that reason tweaking everything to your liking manually can be quite a task. We have provided the option to export all settings in the editor (single-player). For this, follow these simple steps: + +* Open the editor (single-player). +* Under modules (F7), find ACE, `Config Export [ACE]`. +* Place down the module, ensure that the allow parameter is set to yes. +* Press preview, once in game, press Esc and open the ACE3 Options dialog (top left) +* This is the dialog where you can modify client side settings. On the bottom left of it, you will now see a button called `Config Export`. Press it and a new dialog opens. +* You are now in the dialog that allows you to adjust all settings from ACE3. Tweak this to your liking. +* Once you are done tweaking, press the `Export` button and all settings will be copied to your clipboard. +* Paste the settings in your `serverconfig.hpp` file and you're done. + +Note that the format copied to your clipboard by this can also be used in the mission config (`description.ext`), as long as they are in the class `ACE_Settings`. + +```c++ +class ACE_Settings { + // add exported settings here +}; +``` + + +### 3.2 Loading up the server config + +As stated before, the server config gets loaded through the optional `ACE_server.pbo`. This PBO is only required (and should only be used) on the server - clients do not need to have this! It is for this reason we have not signed this PBO. + +Load the `ACE_server.pbo` like any other addon on your server. It is advised to create an `@aceServer` mod folder with an `addons` sub folder where you would paste the `ACE_server.pbo` and load that through `-serverMod=@aceServer`. + diff --git a/documentation/missionmaker/classnames.md b/documentation/missionmaker/classnames.md new file mode 100644 index 0000000000..9ea0d5b556 --- /dev/null +++ b/documentation/missionmaker/classnames.md @@ -0,0 +1,327 @@ +--- +layout: wiki +title: Classnames +description: A list of all the classnames in ACE3, your wet dream came true. +group: missionmaker +order: 11 +parent: wiki +--- + +Everything is ordered alphabetically. + +You know an in-game name but want the classname? CTRL + F + +### Atragmx +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- | +ACE_ATragMX | ATragMX | ACE_ItemCore | + +### Attachable +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- | +ACE_IR_Strobe_Item | IR strobe | ACE_ItemCore | + +### Ballistics +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- | +ACE_100Rnd_65x39_caseless_mag_Tracer_Dim | 6.5mm IR-DIM | Magazine | +ACE_200Rnd_65x39_cased_Box_Tracer_Dim | 6.5mm IR-DIM | Magazine | +ACE_30Rnd_65x39_caseless_mag_Tracer_Dim | 6.5mm IR-DIM | Magazine | +ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim | 6.5mm IR-DIM | Magazine | +ACE_30Rnd_556x45_Stanag_M995_AP_mag | 5.56mm AP | Magazine | +ACE_30Rnd_556x45_Stanag_Mk262_mag | 5.56mm Mk262 | Magazine | +ACE_30Rnd_556x45_Stanag_Mk318_mag | 5.56mm Mk318 | Magazine | +ACE_30Rnd_556x45_Stanag_Tracer_Dim | 5.56mm IR-DIM | Magazine | +ACE_20Rnd_762x51_Mag_Tracer | 7.62mm Tracer | Magazine | +ACE_20Rnd_762x51_Mag_Tracer_Dim | 7.62mm IR-DIM | Magazine | +ACE_20Rnd_762x51_Mag_SD | 7.62mm SD | Magazine | +ACE_10Rnd_762x51_M118LR_Mag | 7.62mm M118LR | Magazine | +ACE_10Rnd_762x51_Mk316_Mod_0_Mag | 7.62mm Mk316 | Magazine| +ACE_10Rnd_762x51_Mk319_Mod_0_Mag | 7.62mm Mk319 | Magazine | +ACE_10Rnd_762x51_M993_AP_Mag | 7.62mm AP | Magazine | +ACE_20Rnd_762x51_M118LR_Mag | 7.62mm M118LR | Magazine | +ACE_20Rnd_762x51_Mk316_Mod_0_Mag | 7.62mm Mk316 | Magazine | +ACE_20Rnd_762x51_Mk319_Mod_0_Mag | 7.62mm Mk319 | Magazine | +ACE_20Rnd_762x51_M993_AP_Mag | 7.62mm AP | Magazine | +ACE_20Rnd_762x67_Mk248_Mod_0_Mag | 7.62mm Mk248 | Magazine | +ACE_20Rnd_762x67_Mk248_Mod_1_Mag | 7.62mm Mk248 | Magazine | +ACE_20Rnd_762x67_Berger_Hybrid_OTM_Mag | 7.62mm OTM | Magazine | +ACE_30Rnd_65x47_Scenar_mag | 6.5mm Lapua | Magazine | +ACE_30Rnd_65_Creedmor_mag | 6.5mm CM | Magazine | +ACE_10Rnd_338_300gr_HPBT_Mag |.338 HPBT | Magazine | +ACE_10Rnd_338_API526_Mag |.338 AP | Magazine | +ACE_5Rnd_127x99_Mag | 12.7mm | Magazine | +ACE_5Rnd_127x99_API_Mag | 12.7mm API | Magazine | +ACE_5Rnd_127x99_AMAX_Mag | 12.7mm | Magazine | +ACE_30Rnd_9x19_mag | 9x19mm | Magazine | +ACE_16Rnd_9x19_mag | 9x19mm | Magazine | +ACE_10Rnd_762x54_Tracer_mag | 7.62mm | Magazine | + +### Captive +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_CableTie | cable tie | ACE_ItemCore | + +### Common +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Banana | banana | ACE_ItemCore | + +### Concertina_wire +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_ConcertinaWireCoil | Concertina Wire Coil | ThingX | +ACE_ConcertinaWire | Concertina Wire | deployed concertina wire | + +### Dagr +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_DAGR | DAGR | ACE_ItemCore | + +### Disposable +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_launch_NLAW_Used_F | used NLAW | Weapon | + +### Explosives +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Clacker| M57 Firing Device | ACE_ItemCore | +ACE_M26_Clacker| M26 Firing Device | ACE_ItemCore | +ACE_DefusalKit | Defusal Kit | ACE_ItemCore | +ACE_DeadManSwitch | Dead Man's Switch | ACE_ItemCore | +ACE_Cellphone | Cellphone | ACE_ItemCore | + +### Grenades +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_HandFlare_White | M127A1 Hand Held Signal (White) | Grenade | +ACE_HandFlare_Red | M127A1 Hand Held Signal (Red | Grenade | +ACE_HandFlare_Green | M127A1 Hand Held Signal (Green) | Grenade | +ACE_HandFlare_Yellow | M127A1 Hand Held Signal (Yellow) | Grenade | +ACE_M84 | M84 Stun Grenade | Grenade | + +### Hearing +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_EarPlugs | Earplugs | ACE_ItemCore | + +### HuntIR +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_HuntIR_monitor | HuntIR monitor | ACE_ItemCore | +ACE_HuntIR_M203 | HuntIR Round | Grenade shell | +ACE_HuntIR_Box | HuntIR Transport Box | ammo box | + +### Kestrel +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Kestrel4500 | Kestrel 4500NV | ACE_ItemCore | + +### Laser pointers +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +acc_pointer_IR | Laser Pointer (red) | Weapon accessory | +ACE_acc_pointer_red | Laser Pointer (green) | Weapon accessory | +ACE_acc_pointer_green_IR | Laser Pointer (green) | Weapon accessory | +ACE_acc_pointer_green | Laser Pointer (green) | Weapon accessory | + +### logistics +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_UAVBattery | UAV Battery | ACE_ItemCore | +ACE_wirecutter | Wirecutter | ACE_ItemCore | + +### Map tools +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_MapTools | Map Tools | ACE_ItemCore | + +# Medical +`added in 3.0.0.3` + + +classname | in game name | type | +--------- | --------- | --------- +ACE_atropine | Atropin autoinjector | ACE_ItemCore | +ACE_fieldDressing | Bandage (Basic) | ACE_ItemCore | +ACE_elasticBandage | Bandage (Elastic) | ACE_ItemCore | +ACE_quikclot | Basic Field Dressing (QuikClot) | ACE_ItemCore | +ACE_bloodIV | Blood IV (1000ml) | ACE_ItemCore | +ACE_bloodIV_500 | Blood IV (500ml) | ACE_ItemCore | +ACE_bloodIV_250 | Blood IV (250ml) | ACE_ItemCore | +ACE_bodyBag | Bodybag | ACE_ItemCore | +ACE_bodyBagObject | Bodybag (packed) | | +ACE_epinephrine | Epinephrine autoinjector | ACE_ItemCore | +ACE_morphine | Morphine autoinjector | ACE_ItemCore | +ACE_packingBandage | Packing Bandage | ACE_ItemCore | +ACE_personalAidKit | Personal Aid Kit | ACE_ItemCore | +ACE_plasmaIV | Plasma IV (1000ml) | ACE_ItemCore | +ACE_plasmaIV_500 | Plasma IV (500ml) | ACE_ItemCore | +ACE_plasmaIV_250 | Plasma IV (250ml) | ACE_ItemCore | +ACE_salineIV | Saline IV (1000ml) | ACE_ItemCore | +ACE_salineIV_500 | Saline IV (500ml) | ACE_ItemCore | +ACE_salineIV_250 | Saline IV (250ml) | ACE_ItemCore | +ACE_surgicalKit | Surgical Kit | ACE_ItemCore | +ACE_tourniquet | Tourniquet (CAT) | ACE_ItemCore | + +### Microdagr +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_microDAGR | MicroDAGR GPS | ACE_ItemCore | + +### mk6 mortar +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_RangeTable_82mm | 82mm Rangetable | ACE_ItemCore | + +### M2XA +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_MX2A | MX-2A | Binocular | + + +### Nightvision +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_NVG_Gen1 | NV Goggles (Gen1) | Nvgs | +ACE_NVG_Gen2 | NV Goggles (Gen2) | Nvgs | +ACE_NVG_Gen3 | NV Goggles (Gen3) | Nvgs | +ACE_NVG_Gen4 | NV Goggles (Gen4) | Nvgs | +ACE_NVG_Wide | NV Goggles (Wide) | Nvgs | + + +### Optics +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_optic_Arco_2D | ARCO (2D) | Weapon accessory | +ACE_optic_Arco_PIP | ARCO (PIP) | Weapon accessory | +ACE_optic_LRPS_2D | LRPS (2D) | Weapon accessory | +ACE_optic_LRPS_PIP | LRPS (PIP) | Weapon accessory | +ACE_optic_SOS_2D| MOS (2D) | Weapon accessory | +ACE_optic_SOS_PIP | MOS (PIP) | Weapon accessory | +ACE_optic_MRCO_2D | MRCO (2D) | Weapon accessory | +ACE_optic_MRCO_PIP | MRCO (PIP) | Weapon accessory | +ACE_optic_Hamr_2D | RCO (2D) | Weapon accessory | +ACE_optic_Hamr_PIP | RCO (PIP) | Weapon accessory | + +### Overheating +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_SpareBarrel | Spare barrel | ACE_ItemCore | + +### Parachute +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Altimeter | Altimeter Watch | ACE_ItemCore | +ACE_NonSteerableParachute | Non-Steerable Parachute | Backpack | + +### Rangecard + +classname | in game name | type | +--------- | --------- | --------- +ACE_RangeCard | rangecard | ACE_ItemCore | + +### Vector +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Vector | Vector 21 | Binoculars | + +### Vehicle lock +`added in 3.0.0.3` + +classname | in game name | type | +--------- | --------- | --------- +ACE_key_master | Vehicle Key: Master | ACE_ItemCore | +ACE_key_lockpick | Lockpick | ACE_ItemCore | +ACE_key_west | Vehicle Key: West | ACE_ItemCore | +ACE_key_east | Vehicle Key: East | ACE_ItemCore | +ACE_key_indp | Vehicle Key: Independent | ACE_ItemCore | +ACE_key_civ | Vehicle Key: Civilian | ACE_ItemCore | + +### Sandbag +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Sandbag_empty | Sandbag (empty) | ACE_ItemCore | +ACE_SandbagObject | Sandbag | ThingX | + +### Spotting scope +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_SpottingScope | Spotting Scope | ACE_ItemCore | +ACE_SpottingScopeObject | Spotting Scope (placed) | StaticATWeapon | + +### Tactical ladder +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_TacticalLadder_Pack | Telescopic Ladder | Backpack | +ACE_Tactical_Ladder | Telescopic Ladder (placed) | house | + +### Tripod +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Tripod | SSWT Kit | ACE_ItemCore | +ACE_TripodObject | SSWT Kit (placed) | ThingX | + +### Yardage 450 +`added in 3.1.1` + +classname | in game name | type | +--------- | --------- | --------- +ACE_Yardage450 | Yardage 450 | Binocular | \ No newline at end of file diff --git a/documentation/missionmaker/mission-tools.md b/documentation/missionmaker/mission-tools.md new file mode 100644 index 0000000000..ead87303a6 --- /dev/null +++ b/documentation/missionmaker/mission-tools.md @@ -0,0 +1,60 @@ +--- +layout: wiki +title: Mission tools +description: A short description of ACE3's mission tools that help mission makers to provide awesome missions +group: missionmaker +order: 10 +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. + +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` + +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'; +``` + +*Note: You can't place more than one rallypoint of the same type.* + +All units synced to the ["Rallypoint System" module](./modules.html#1.14-rallypoint-system) are able to move the rallypoint. + +
+
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.

+
+ +To enable other units to move them add this to the unit's initialization code: + +```c++ +_unit setVariable ["ACE_canMoveRallypoint", true, true]; +``` + +## 2. ACE SwitchUnits +*Part of: ace_switchunits* + +"ACE SwitchUnits" is a tool for misson makers to quickly add PvP (Player vs. Player) elements to a mission. In short it enables a player to control AI units. Allowing players to perform as enemies even during a COOP mission increases the authenticity of the enemy and thus the immersion for everyone. + +The most prominent feature of ACE SwitchUnits is that you can add it to nearly every existing mission and get AI control out of the box. Dynamic mission like "Enemy Assault", "Patrol Ops", "Invade & Annex", etc. don't need to be touched to make all random spawned AI's controllable. + +In its current form you're able to switch to infantry (vehicles, etc. are planned) from all four sides (West, East, Independent, Civilian). + +To enable a player to control AI add the following to its init line: + +```c++ +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 diff --git a/documentation/missionmaker/modules.md b/documentation/missionmaker/modules.md index 9cb17e001f..5708a16379 100644 --- a/documentation/missionmaker/modules.md +++ b/documentation/missionmaker/modules.md @@ -1,53 +1,67 @@ --- layout: wiki title: Modules +description: A list of all modules in ACE3 and all the settings that can be tweaked by them group: missionmaker order: 5 parent: wiki --- -## 1. ACE +## 1. ACE3 ### 1.1 Advanced Ballistics *Part of: ace_advanced_ballistics* -This module allows to enable advanced external- and internal ballistics. +This module allows enabling and configuring advanced ballistic simulations. **Settings:** 1. **Advanced Ballistics (Boolean)**
Enables advanced ballistics.
`Default value: No` -2. **Always Enabled For Snipers (Boolean)**
-Always enables advanced ballistics when high power optics are used.
+ +2. **Enabled For Snipers (Boolean)**
+Enables advanced ballistics for non local snipers (when using high power optics).
`Default value: Yes` -3. **Disabled In FullAuto Mode (Boolean)**
+ +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` -4. **Disabled For Non Local Players (Boolean)**
-Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer).
-`Default value: Yes` -5. **Enable Ammo Temperature Simulation (Boolean)**
+ +6. **Enable Ammo Temperature Simulation (Boolean)**
Muzzle velocity varies with ammo temperature.
`Default value: Yes` -6. **Enable Barrel Length Simulation (Boolean)**
+ +7. **Enable Barrel Length Simulation (Boolean)**
Muzzle velocity varies with barrel length.
`Default value: Yes` -7. **Enable Bullet Trace Effect (Boolean)**
+ +8. **Enable Bullet Trace Effect (Boolean)**
Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics).
-8. **Simulation Interval (Number)**
+`default value: Yes ` + +9. **Simulation Interval (Number)**
Defines the interval between every calculation step.
-`Default value: 0.05` -9. **Simulation Radius (Number)**
+`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` ### 1.2 Allow Config Export *Part of: ace_Optionmenu* -This modules allows to export all current ACE settings from the ACE Option menu to the clipboard and RPT file. +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 ACE Option menu
+Enables the "export" button in the ACE3 Option menu
`Default value: Yes` ### 1.3 BlueForceTracking @@ -64,10 +78,26 @@ How often the markers should be refreshed (in seconds).
Hide markers for "AI only" groups.
`Default value: No` -### 1.4 Check PBOs +### 1.4 Captives settings +*Part of: ace_captives* + +Controls the settings for cable ties and surrendering. +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` + +### 1.5 Check PBOs *Part of: ace_common* -If you are worried that players haven't updated ACE or other mods to the version you're using on the server, you can place the "Check PBOs" module on your map. You can choose one of three posible actions that are being executed when a player joins that has a wrong version of ACE or an other mod: +If you are worried that players haven't updated ACE3 or other mods to the version you're using on the server, you can place the "Check PBOs" module on your map. You can choose one of three posible actions that are being executed when a player joins that has a wrong version of ACE3 or an other mod: * Warn once * Warn permanent @@ -80,7 +110,7 @@ What to do with people who do not have the right PBOs.
`Default value: "Warn once"` 2. **Check all addons (Boolean)**
-Check all addons instead of only those of ACE?
+Check all addons instead of only those of ACE3?
`Default value: "No"` 3. **Whitelist**
@@ -103,28 +133,29 @@ Example 3: @JSRS + @Blastcore-A3:
``` -### 1.5 Explosive System +### 1.6 Explosive System *Part of: ace_explosive* -The "Explosive System" module lets you tweak the settings for the new explosive system that ACE introduces. +The "Explosive System" module lets you tweak the settings for the new explosive system that ACE3 introduces. **Settings:** 1. **Require specialists? (Boolean)**
Require explosive specialists to disable explosives.
`Default value: No` + 2. **Punish non-specialists? (Boolean)**
Increase the time it takes to complete actions for non-specialists.
`Default value: Yes` -### 1.6 Friendly Fire Messages +### 1.7 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.7 Hearing +### 1.8 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. @@ -136,7 +167,7 @@ Enable combat deafness?
`Default value: Yes` -### 1.8 Interaction System +### 1.9 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"). @@ -147,13 +178,13 @@ This module allows you to tweak if players should be able to use team management Should players be allowed to use the Team Management Menu?.
`Default value: Yes` -### 1.9 Make Unit Surrender +### 1.10 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. -### 1.10 Map +### 1.11 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. @@ -163,18 +194,21 @@ ACE3 introdcues a bit more realism for the vanilla Arma 3 map and how it behaves 1. **Map illumination? (Boolean)**
Calculate dynamic map illumination based on light conditions?.
`Default value: Yes` + 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.11 MicroDAGR Map Fill +### 1.12 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. @@ -186,7 +220,7 @@ How much map data is filled on MicroDAGR's.
`Default value: "Full Satellite + Buildings"` -### 1.12 MK6 Settings +### 1.13 MK6 Settings *Part of: ace_mk6mortar* ACE3 now includes the first iteration of getting a less arcady point and click mortar experience. @@ -197,35 +231,44 @@ Placing this modules allows you to enable the increased realism in game. 1. **Air Resistance (Boolean)**
For Player Shots, Model Air Resistance and Wind Effects.
`Default value: 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.13 Name Tags +### 1.14 Name Tags *Part of: ace_nametags* This module allows you to tweak the settings for player names tags. **Settings:** -1. **Player Names View Distance (Number)**
+1. **Show player names (Option)**
+Let you choose when nametags appears.
+`Default value: "Do Not Force"` + +2. **Player Names View Distance (Number)**
Distance (in meters) at which player names are shown.
`Default value: 5` -2. **Show name tags for AI? (Option)**
+ +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"` -3. **Show crew info? (Option)**
+ +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"` -4. **Show for Vehicles? (Boolean)**
+ +5. **Show for Vehicles? (Boolean)**
Show cursor NameTag for vehicle commander (only if client has name tags enabled).
`Default value: No` -### 1.14 Rallypoint System +### 1.15 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. @@ -235,10 +278,10 @@ This module enables Mission Makers to specificly enable units to move a rallypoi

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.

-To enable JIP players to move rally points have a look at [ACE Rallypoints (to be done)](#). +To enable JIP players to move rally points have a look at [ACE3 Rallypoints](./mission-tools.html#1.-ace-rallypoints). -### 1.15 Respawn System +### 1.16 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). @@ -249,40 +292,49 @@ The "Respawn System" module enables players to respawn with the gear they had be Respawn with the gear a player had just before his death.
`Default value: No` -### 1.16 SwitchUnits System + +### 1.17 SwitchUnits System *Part of: ace_switchunits* -The [SwitchUnits System (to be done)](#) enables players to control certain AI units on the map. +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` + 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.17 Vehicle Lock +### 1.18 Vehicle Lock *Part of: ace_vehiclelock* -#### 1.17.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. +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.17.2 Vehicle Lock Setup +#### 1.18.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.18.2.1 Vehicle Lock Setup Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states. **Settings:** @@ -290,48 +342,94 @@ Settings for lockpick strength and initial vehicle lock state. Removes ambiguous 1. **Lock Vehicle Inventory? (Boolean)**
Locks the inventory of locked vehicles
`Default value: No` + 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.18.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.18 Weather + +### 1.19 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` + +2. **View Distance Limit (Number)**
+Sets the limit for how high clients can raise their view distance (<= 10000) +`Default value: 10000` + + +### 1.20 Weather *Part of: ace_weather* This module allows you to customize the weather settings. +
+
Note:
+

ACE3 Weather overrides weather settings (editor, mission settings) and automatically calculates wind, temperature and pressure according to map location, date, time of day and cloud coverage and allows the weather to evolve realistically as the simulation progresses. Weather synchronization occurs between all clients.
Adjustment of the weather is possible by modifying the overcast value (for example: 0.7 may result in intermittent rain).

+
+ **Settings:** 1. **Weather propagation (Boolean)**
Enables sever side weather propagation.
`Default value: Yes` -2. **ACE Weather (Boolean)**
-Overrides the default weather (editor, mission settings) with ACE weather (map based).
+
+
Note:
+

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

+
+ +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` -3. **Sync Wind (Boolean)**
+ +4. **Sync Wind (Boolean)**
Synchronizes wind.
`Default value: Yes` -3. **Sync Misc (Boolean)**
+ +5. **Sync Misc (Boolean)**
Synchronizes lightnings, rainbow, fog, ...
`Default value: Yes` -4. **Update Interval (Number)**
+ +6. **Update Interval (Number)**
Defines the interval (seconds) between weather updates.
`Default value: 60` -### 1.19 Wind Deflection + +### 1.21 Wind Deflection *Part of: ace_winddeflection* This module allows you to define when wind deflection is active.
Note:
-

Wind Deflection doesn't work in combination with Advanced Ballistics. If the Advanced Ballistics module is placed Wind deflection will exit and won't trigger.

+

Wind Deflection is compatible with Advanced Ballistics and allows the following combinations: +

    +
  • Only wind deflection
  • +
  • Only advanced ballistics
  • +
  • Combined wind deflection + advanced ballistics
  • +

**Settings:** @@ -339,18 +437,47 @@ This module allows you to define when wind deflection is active. 1. **Wind Deflection (Boolean)**
Enables wind deflection.
`Default value: Yes` + 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.22 Zeus Settings +*part of: ace_zeus* -### 1.20 LSD Vehicles +This module provides control over vanilla aspects of Zeus. + +**Settings:** + +1. **Ascension Messages (Option)**
+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 (Scalar)**
+Reveal mines to allies and/or 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. @@ -358,7 +485,7 @@ And then there's the "LSD Vehicles" module … it does 'something' to all v -## 2. ACE Medical +## 2. ACE3 Medical *Part of: ace_medical* ### 2.1 Medical Settings @@ -370,37 +497,52 @@ This module allows to tweak all the medical settings used in ACE3 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: "Normal"` +`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. **Prevent instant death (Boolean)**
+ +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` -10. **Bleeding coefficient (Number)**
+ +11. **Bleeding coefficient (Number)**
Coefficient to modify the bleeding speed.
`Default value: 1` -11. **Pain coefficient (Number)**
+ +12. **Pain coefficient (Number)**
Coefficient to modify the pain intensity.
`Default value: 1` -12. **Pain coefficient (Boolean)**
+ +13. **Sync status (Boolean)**
Keep unit status synced. Recommended on.
`Default value: Yes` @@ -414,31 +556,46 @@ This module allows you to change the default Advanced Medical Settings, when [2. 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` ### 2.3 Revive Settings @@ -449,9 +606,11 @@ This modules allows a mission maker to limit the amount of revives for units in 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` @@ -466,6 +625,7 @@ Using this module you can define which unit class is defined as a medic / doctor 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"` @@ -491,35 +651,49 @@ Defines an object as a medical facility. This allows for more advanced treatment 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` -## 3. ACE Mission Modules +## 3. ACE3 Mission Modules *Part of: ace_missionmodules* ### 3.1 Ambiance Sounds -Used for ambiance sounds loop (synced across MP) +Used for ambiance sounds loop (synced across MP). + +This module randomizes the time when the sound file is played and the position where the sound file is played (If "Follow Players" is set to No). +`Minimal Distance` and `Maximal Distance` influence the position from where the sound file is played. Setting both values to 0 forces the module to play the sound from where it was placed in the editor. +`Minimal Delay` and `Maximal Delay` work in a similar fashion but are used to randomize when the sound file is played. Setting both values to 0 plays the sound from mission start. **Settings:** 1. **Sounds (String)**
-Class names of the ambiance sounds played. Separated by ','.
+Class names of the ambiance sounds played. Separated by ','. (Example: `radio_track_01, electricity_loop`).
`Default value: ""` + 2. **Minimal Distance (Number)**
-Minimal Distance (in meters)
+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. **Minimal Delay (Number)**
-Minimal Delay (in seconds) between sounds played
+ +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` + +4. **Minimal Delay (Number)**
+Minimal delay (in seconds) between sounds played
`Default value: 10` -4. **Maximal Delay (Number)**
-Maximal Delay (in seconds) between sounds played
+ +5. **Maximum Delay (Number)**
+Maximum delay (in seconds) between sounds played
`Default value: 10` -5. **Follow Players (Boolean)**
+ +6. **Follow Players (Boolean)**
Follow players. If set to false, loop will play sounds only nearby logic position.
`Default value: No` -6. **Volume (Number)**
+ +7. **Volume (Number)**
The volume of the sounds played
-`Default value: 1` +`Default value: 1` \ No newline at end of file diff --git a/documentation/user/getting-started.md b/documentation/user/getting-started.md index baed16588b..6e18cdb278 100644 --- a/documentation/user/getting-started.md +++ b/documentation/user/getting-started.md @@ -1,88 +1,16 @@ --- 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 --- -
-
Note:
-

This page is currently under construction.

-
+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. -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. +- 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/) -### 1. Vector 21 -*Part of: ace_vector* - -ACE3 adds a realistic depiction of the Vector 21 rangefinder to the game. Unlike other rangefinders, it doesn't just magically show you the range to your target, but in exchange allows you to do alot of things with it that the other choices in Arma do not offer. The Vector's functions include, but are not limited to: - -- Distance to a target -- Azimuth to a target -- Horizontal and vertical distance to a target -- Distance between 2 targets -- Angle between 2 targets -- Switching between feet and meters -- Switching between degrees and mils -... - -The Vector is controlled with 2 keys: the azimuth key and the range key; Tab and R by default. First you bring it up like every other binocular in the game and then, while looking through it you can access all the different functions. - -The Vector 21 rangefinder has the following usage modes: - -1. Slope distance -2. Azimuth -3. Slope distance & Azimuth -4. Horizontal distance and height difference -5. Azimuth & Inclination -6. Distance between two points -7. Horizontal & vertical distance between two points -8. Horizontal distance & azimuth between two points -9. Fall of shot - -#### 1. Slope distance -Measuring Slope distance - -Press and hold the "Distance" key until the red pointing circle appears. Sight the circle on the object and release the key. - -#### 2. Azimuth -Measuring Azimuth - -Press and hold the "Azimuth" key until the red pointing circle appears. Sight the circle on the object and release the key. - -#### 3. Slope distance and Azimuth -Measuring Slope distance and Azimuth - -Press and hold both the "Distance" and "Azimuth" key until the red pointing circle appears. Sight the circle on the object and release both keys. - -#### 4. Horizontal distance and height difference -Measuring Horizontal distance and height difference - -Tap the "Distance" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and release the key. - -#### 5. Azimuth and Inclination -Measuring Azimuth and Inclination - -Tap the "Azimuth" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and release the key. - -#### 6. Distance between two points -Measuring Distance between two points - -Press and hold the "Distance" key until the red pointing circle appears. Sight the circle on the first object and tap the "Azimuth" key while further holding the "Distance" key. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Distance" key. - -#### 7. Horizontal and vertical distance between two points -Measuring Horizontal and vertical distance between two points - -Tap the "Distance" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and tap the "Azimuth" key once. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Distance" key. - -#### 8. Horizontal distance and azimuth between two points -Measuring Horizontal distance and azimuth between two points - -Press and hold the "Azimuth" key until the red pointing circle appears. Sight the circle on the first object and tap the "Distance" key while further holding the "Azimuth" key. The first measurement is confirmed ("1-P" = first point). Sight the second object and release the "Azimuth" key. - -#### 9. Fall of shot -Measuring Fall of shot - -Tap the "Azimuth" key once then press and hold it until the red pointing circle appears. Sight the circle on the object and tap the "Distance" key while further holding the "Azimuth" key. The first measurement is confirmed ("1-P" = first point). Sight the Fall of shot and release the "Azimuth" key. The left digits display the left (`L`)/right (`r`) correction value in meter and the right digits display the longer (`A` = add)/shorter (`d` = drop) correction value in meter. If the "Distance" key is tapped the height correction values will be displayed (`UP` and `dn`). +- 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/how-to-make-a-feature-request.md b/documentation/user/how-to-make-a-feature-request.md index 7b0c52478d..96bec54fb8 100644 --- a/documentation/user/how-to-make-a-feature-request.md +++ b/documentation/user/how-to-make-a-feature-request.md @@ -1,6 +1,7 @@ --- layout: wiki title: How to make a feature request +description: ACE3 requires a special procedure to make feature requests. Because due to our current work load, in the period of weeks prior and posterior to the first release, new feature requests are under embargo. group: user order: 11 parent: wiki diff --git a/documentation/user/how-to-report-an-issue.md b/documentation/user/how-to-report-an-issue.md index acabc3a944..96f2dd76c3 100644 --- a/documentation/user/how-to-report-an-issue.md +++ b/documentation/user/how-to-report-an-issue.md @@ -1,6 +1,7 @@ --- layout: wiki title: How to report an issue +description: If you've found an issue with ACE3 please read this entry before reporting it. group: user order: 10 parent: wiki @@ -10,6 +11,8 @@ parent: wiki 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. +Indicate if the issue appears on stable or development version. In case it is the development version, please also include the commit SHA-1 hash. +
Please note:

It's not a valid to simply remove @ACE3 from the mod list to confirm that ACE3 is the culprit.

@@ -22,6 +25,7 @@ Head over to the ACE3 GitH ``` ACE3 Version: 3.x.x +(indicate if stable or dev, if dev indicate the commit the version is based on) **Mods:** * @cba_a3 diff --git a/documentation/user/installation-guide.md b/documentation/user/installation-guide.md new file mode 100644 index 0000000000..751b698cce --- /dev/null +++ b/documentation/user/installation-guide.md @@ -0,0 +1,63 @@ +--- +layout: wiki +title: Installation Guide +description: Step-by-step guide for installing ACE3 +group: user +order: 0 +parent: wiki +--- + +## 1. Overview +This guide will explain how to get ACE3 up and running faster than you can say banana. + +## 2. Prerequisites +- Download [CBA](http://www.armaholic.com/page.php?id=18767). +- Download [ACE3](https://github.com/acemod/ACE3/releases/latest). +- Know how to extract .zip files. Use [Google](https://www.google.com) if not sure. + +## 3. Install ACE3 +- Extract both CBA and ACE3 .zip files into your Arma 3 folder. By default this is located in:
+32-Bit - `C:/Program Files/Steam/Steamapps/Common/Arma 3/`
+64-Bit - `C:/Program Files (x86)/Steam/Steamapps/Common/Arma 3/` +- After extraction you should have the `@ace` and `@CBA_A3` folders inside your Arma 3 folder. + +## 4. Install ACE3 Optional components +
+
Note:
+

Skip this step if you're not using additional mods. If you are, consult with your mission maker before installing any of these components. If you are a Mod creator, please visit the [Modularity and PBO Structure](http://ace3mod.com/wiki/development/modularity-and-pbo-structure.html) page for more information.

+
+ +### 4.1 What do they do? +Optional components supplement 3rd party mods with ACE3 features, for example: +- Optional weapon components make Advanced Ballistics possible, as well as the ability to use ACE3 weapon attachments with 3rd party weapons like RHS, HLC, etc. +- Optional tracers component brings back ACE2 ball tracers. +- Optional server component is used to load the userconfig files. + +### 4.2 Which optionals should I use? +Only use the optional components that correspond with your mod-pack. + +### 4.3 How to install these components? +- Inside your `Arma 3/@ace/` folder, you'll find the `optionals` and `addons` folders. +- Copy and paste the relevant `.pbo` and `.bisign` files from the `optionals` folder into the `addons` folder. +- Copy and paste the `userconfig` folder from the `optionals` folder into root `Arma 3` folder. + +## 5. Launch Arma 3 with ACE3 +- Launch Arma 3 to start the official game Launcher. +- Click `Mods` and make sure the checkboxes next to `ace` and `CBA_A3` are ticked. +Arma 3 Vanilla Launcher +- Click `Play` + +## 6. Alternative launch methods + +### 6.1 Steam Launch Parameters +- Not supported with the new Arma 3 Launcher + +### 6.2 Arma 3Sync +- Inspect `Addon Options` and verify the `Addon Search Directories` are leading to your Arma 3 folder. +- Return to the `Addons` tab and click `Refresh`. +- Right-click inside `Addon Groups`, click `Create Group` and give it a name. +- Drag and drop `@ace` and `@CBA_A3` from `Available Addons` into the new Group you created inside `Addon Groups` and make sure the checkboxes are ticked. +Arma 3Sync Launcher +- Click `Start Game` + +### 5.3 Play withSIX diff --git a/documentation/user/promotional-material.md b/documentation/user/promotional-material.md index 4c928f1fb3..98a8ace6b5 100644 --- a/documentation/user/promotional-material.md +++ b/documentation/user/promotional-material.md @@ -1,6 +1,7 @@ --- layout: wiki title: Promotional Material +description: Promotional materials like logos and color values. group: user order: 20 parent: wiki diff --git a/documentation/user/shortcuts.md b/documentation/user/shortcuts.md index 66e12ae76f..59b7975340 100644 --- a/documentation/user/shortcuts.md +++ b/documentation/user/shortcuts.md @@ -1,6 +1,7 @@ --- layout: wiki title: Shortcuts +description: A list containing all default shortcuts in ACE3 group: user order: 5 parent: wiki diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 9f4a8a29fa..ed8dd066e4 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -1,11 +1,20 @@ cmake_minimum_required (VERSION 3.0) project (ACE) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +if(WIN32) +add_definitions(/DWINVER=0x0600 /D_WIN32_WINNT=0x0600) +endif() + if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) message(STATUS "No build type selected, default to Debug") set(CMAKE_BUILD_TYPE "Debug") endif() +option(DEVEL "DEVEL" OFF) +option(USE_BULLET "USE_BULLET" OFF) +option(USE_DIRECTX "USE_DIRECTX" OFF) option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF) option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) @@ -14,16 +23,69 @@ if(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_CXX_FLAGS "-std=c++11 -march=i686 -m32 -O2 -s -fPIC -fpermissive") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") -else() - set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") - set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") - set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + message(ERROR "SUPPORT NOT COMPLETE") +elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /arch:SSE2 /Qpar-report:2") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} /MT /O1 /Ob1 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT /O2 /Ob2 /D NDEBUG") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} /MT /Zi /O2 /Ob1 /D NDEBUG") +endif() + +include_directories("common") + +if(USE_BULLET) + # Dependencies + # + set(BACKUP_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) + set(BACKUP_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + set(BACKUP_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + + add_definitions(-DUSE_DIRECTX) + add_subdirectory(lib/bullet3) + + set_target_properties(App_BasicExample PROPERTIES FOLDER Bullet3) + set_target_properties(App_HelloWorld PROPERTIES FOLDER Bullet3) + set_target_properties(App_ExampleBrowser PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet2FileLoader PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Collision PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Dynamics PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Geometry PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Common PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3OpenCL_clew PROPERTIES FOLDER Bullet3) + set_target_properties(BulletCollision PROPERTIES FOLDER Bullet3) + set_target_properties(BulletDynamics PROPERTIES FOLDER Bullet3) + set_target_properties(BulletFileLoader PROPERTIES FOLDER Bullet3) + set_target_properties(BulletSoftBody PROPERTIES FOLDER Bullet3) + + set_target_properties(BulletWorldImporter PROPERTIES FOLDER Bullet3) + set_target_properties(BulletXmlWorldImporter PROPERTIES FOLDER Bullet3) + set_target_properties(ConvexDecomposition PROPERTIES FOLDER Bullet3) + set_target_properties(GIMPACTUtils PROPERTIES FOLDER Bullet3) + set_target_properties(gtest PROPERTIES FOLDER Bullet3) + set_target_properties(gwen PROPERTIES FOLDER Bullet3) + set_target_properties(HACD PROPERTIES FOLDER Bullet3) + set_target_properties(OpenGLWindow PROPERTIES FOLDER Bullet3) + set_target_properties(LinearMath PROPERTIES FOLDER Bullet3) + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BACKUP_ARCHIVE_OUTPUT_DIRECTORY}) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BACKUP_LIBRARY_OUTPUT_DIRECTORY}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BACKUP_RUNTIME_OUTPUT_DIRECTORY}) + + include_directories(BEFORE "lib/bullet3/src") +endif() +if(USE_DIRECTX) + add_definitions(-DUSE_DIRECTX) + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) + find_package (DirectX) + link_directories (BEFORE ${DirectX_D3DX11_LIBRARY}) + include_directories (BEFORE ${DirectX_D3DX11_INCLUDE_DIR} ) +endif() +if(DEVEL) + add_definitions(-DDEVEL) endif() -file(GLOB ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp) -add_library(ace_common STATIC ${ACE_COMMON_SOURCES}) -include_directories(AFTER "common") string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") set(ACE_VERSION_MAJOR 3) @@ -50,13 +112,31 @@ if(MSVC) set(GLOBAL_RC ${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc) endif() -include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/common) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/common) set(GLOBAL_SOURCES ${GLOBAL_RC}) + # Add extensions to build here +add_subdirectory(common) + +# Extensions + add_subdirectory(fcs) add_subdirectory(break_line) add_subdirectory(clipboard) add_subdirectory(advanced_ballistics) +add_subdirectory(medical) +add_subdirectory(parse_imagepath) + +# Test Extension for dynamically loading/unloading built extensions; does not build in release +if (DEVEL) + add_subdirectory(dynload) + add_subdirectory(tests) + if(USE_DIRECTX) + add_subdirectory(lib/directxtk) + endif() +endif() + + message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp index 6e964f8921..c5c0a6c7a3 100644 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ b/extensions/advanced_ballistics/AdvancedBallistics.cpp @@ -1,8 +1,8 @@ -#include "ace_common.h" +#include "shared.hpp" #include #include -#include +#include #include #define M_PI 3.14159265358979323846f @@ -57,7 +57,7 @@ struct Map { }; std::vector bulletDatabase; -std::map mapDatabase; +std::unordered_map mapDatabase; std::string worldName = ""; Map* map = &mapDatabase[""]; @@ -82,7 +82,7 @@ double calculateRoughnessLength(double posX, double posY) { return 1.6; } - return roughness_lengths[2 + min(nearBuildings, 6)]; + return roughness_lengths[2 + std::min(nearBuildings, 6)]; } return 0.0024; @@ -230,14 +230,16 @@ double calculateRetard(int DragFunction, double DragCoefficient, double Velocity extern "C" { - __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); + EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); } void __stdcall RVExtension(char *output, int outputSize, const char *function) { + ZERO_OUTPUT(); + std::stringstream outputStr; if (!strcmp(function, "version")) { - int n = sprintf_s(output, outputSize, "%s", ACE_FULL_VERSION_STR); - return; + strncpy(output, ACE_FULL_VERSION_STR, outputSize); + EXTENSION_RETURN(); } char* input = _strdup(function); @@ -256,8 +258,12 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) velocity = strtod(strtok_s(NULL, ":", &next_token), NULL); retard = calculateRetard(dragModel, ballisticCoefficient, velocity); - int n = sprintf_s(output, outputSize, "%f", retard); - return; + // int n = sprintf(output, "%f", retard); + + outputStr << retard; + strncpy(output, outputStr.str().c_str(), outputSize); + + EXTENSION_RETURN(); } else if (!strcmp(mode, "atmosphericCorrection")) { double ballisticCoefficient = 1.0; double temperature = 15.0; @@ -272,8 +278,10 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) atmosphereModel = strtok_s(NULL, ":", &next_token); ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, humidity, atmosphereModel); - int n = sprintf_s(output, outputSize, "%f", ballisticCoefficient); - return; + //int n = sprintf(output, "%f", ballisticCoefficient); + outputStr << ballisticCoefficient; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } else if (!strcmp(mode, "new")) { unsigned int index = 0; double airFriction = 0.0; @@ -367,8 +375,8 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) bulletDatabase[index].frames = 0.0; bulletDatabase[index].randSeed = 0; - int n = sprintf_s(output, outputSize, "%s", ""); - return; + strncpy(output, "", outputSize); + EXTENSION_RETURN(); } else if (!strcmp(mode, "simulate")) { // simulate:0:[-0.109985,542.529,-3.98301]:[3751.57,5332.23,214.252]:[0.598153,2.38829,0]:28.6:0:0.481542:0:215.16 unsigned int index = 0; @@ -499,7 +507,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) trueSpeed = sqrt(pow(trueVelocity[0], 2) + pow(trueVelocity[1], 2) + pow(trueVelocity[2], 2)); temperature = bulletDatabase[index].temperature - 0.0065 * position[2]; - pressure = 1013.25 * exp(-(bulletDatabase[index].altitude + position[2]) / 7990) - 10 * bulletDatabase[index].overcast; + pressure = (1013.25 - 10 * bulletDatabase[index].overcast) * pow(1 - (0.0065 * (bulletDatabase[index].altitude + position[2])) / (273.15 + temperature + 0.0065 * bulletDatabase[index].altitude), 5.255754495); if (bulletDatabase[index].ballisticCoefficients.size() == bulletDatabase[index].velocityBoundaries.size() + 1) { dragRef = deltaT * bulletDatabase[index].airFriction * bulletSpeed * bulletSpeed; @@ -575,7 +583,8 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) positionOffset[0] += sin(bulletDir + M_PI / 2) * spinDriftPartial; positionOffset[1] += cos(bulletDir + M_PI / 2) * spinDriftPartial; - if (bulletSpeed < 345 && bulletSpeedAvg > 340 && bulletSpeed > 335) { + double speedOfSound = 331.3 + (0.6 * temperature); + if (bulletSpeed < (speedOfSound + 5) && bulletSpeedAvg > speedOfSound && bulletSpeed > (speedOfSound - 5)) { std::uniform_real_distribution distribution(0.0, 1.0); double coef = 1.0f - bulletDatabase[index].transonicStabilityCoef; @@ -583,9 +592,10 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) velocityOffset[1] += (distribution(bulletDatabase[index].randGenerator) * 0.8 - 0.4) * coef; velocityOffset[2] += (distribution(bulletDatabase[index].randGenerator) * 0.8 - 0.4) * coef; }; - - int n = sprintf_s(output, outputSize, "_bullet setVelocity (_bulletVelocity vectorAdd [%f, %f, %f]); _bullet setPosASL (_bulletPosition vectorAdd [%f, %f, %f]);", velocityOffset[0], velocityOffset[1], velocityOffset[2], positionOffset[0], positionOffset[1], positionOffset[2]); - return; + + outputStr << "_bullet setVelocity (_bulletVelocity vectorAdd [" << velocityOffset[0] << "," << velocityOffset[1] << "," << velocityOffset[2] << "]); _bullet setPosASL (_bulletPosition vectorAdd [" << positionOffset[0] << "," << positionOffset[1] << "," << positionOffset[2] << "]);"; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } else if (!strcmp(mode, "set")) { int height = 0; int numObjects = 0; @@ -599,8 +609,8 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) map->gridBuildingNums.push_back(numObjects); map->gridSurfaceIsWater.push_back(surfaceIsWater); - int n = sprintf_s(output, outputSize, "%s", ""); - return; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } else if (!strcmp(mode, "init")) { int mapSize = 0; int mapGrids = 0; @@ -614,8 +624,9 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) map = &mapDatabase[worldName]; if (map->gridHeights.size() == gridCells) { - int n = sprintf_s(output, outputSize, "%s", "Terrain already initialized"); - return; + outputStr << "Terrain already initialized"; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } map->mapSize = mapSize; @@ -627,10 +638,9 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) map->gridBuildingNums.reserve(gridCells); map->gridSurfaceIsWater.reserve(gridCells); - int n = sprintf_s(output, outputSize, "%s", ""); - return; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } - - int n = sprintf_s(output, outputSize, "%s", ""); - return; + strncpy(output, outputStr.str().c_str(), outputSize); + EXTENSION_RETURN(); } diff --git a/extensions/advanced_ballistics/CMakeLists.txt b/extensions/advanced_ballistics/CMakeLists.txt index 19b9fc41d9..51e709f6d2 100644 --- a/extensions/advanced_ballistics/CMakeLists.txt +++ b/extensions/advanced_ballistics/CMakeLists.txt @@ -1,9 +1,10 @@ set(ACE_EXTENSION_NAME "ace_advanced_ballistics") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) -add_dependencies(${ACE_EXTENSION_NAME} ace_common) -SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) +target_link_libraries(${ACE_EXTENSION_NAME} ace_common) +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) if(CMAKE_COMPILER_IS_GNUCXX) set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) diff --git a/extensions/break_line/CMakeLists.txt b/extensions/break_line/CMakeLists.txt index 00a74d4c3a..5d29d295c8 100644 --- a/extensions/break_line/CMakeLists.txt +++ b/extensions/break_line/CMakeLists.txt @@ -1,9 +1,10 @@ set(ACE_EXTENSION_NAME "ace_break_line") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) -add_dependencies(${ACE_EXTENSION_NAME} ace_common) -SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) +target_link_libraries(${ACE_EXTENSION_NAME} ace_common) +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) if(CMAKE_COMPILER_IS_GNUCXX) set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) diff --git a/extensions/break_line/ace_break_line.cpp b/extensions/break_line/ace_break_line.cpp index 2b253c05bc..8bb5af9572 100644 --- a/extensions/break_line/ace_break_line.cpp +++ b/extensions/break_line/ace_break_line.cpp @@ -11,7 +11,7 @@ * String with line breaks */ -#include "ace_common.h" +#include "shared.hpp" #include #include @@ -20,7 +20,7 @@ #define MAXCHARACTERS 14 extern "C" { - __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); + EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); }; std::vector splitString(const std::string & input) { @@ -65,12 +65,14 @@ std::string addLineBreaks(const std::vector &words) { #pragma warning( disable : 4996 ) void __stdcall RVExtension(char *output, int outputSize, const char *function) { + ZERO_OUTPUT(); if (!strcmp(function, "version")) { strncpy(output, ACE_FULL_VERSION_STR, outputSize); } else { strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize); output[outputSize - 1] = '\0'; } + EXTENSION_RETURN(); } #pragma warning( pop ) diff --git a/extensions/clipboard/ace_clipboard.cpp b/extensions/clipboard/ace_clipboard.cpp index 4809a14acf..61960598ec 100644 --- a/extensions/clipboard/ace_clipboard.cpp +++ b/extensions/clipboard/ace_clipboard.cpp @@ -9,12 +9,12 @@ * Returns: * None */ -#include "ace_common.h" +#include "shared.hpp" #include #include extern "C" { - __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); + EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); }; std::string gClipboardData; @@ -23,12 +23,15 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { std::string cur_input(function); std::string result; - if (cur_input.length() < 1) - return; + ZERO_OUTPUT(); + + if (cur_input.length() < 1) { + EXTENSION_RETURN(); + } if (!strcmp(function, "version")) { strncpy(output, ACE_FULL_VERSION_STR, outputSize); - return; + EXTENSION_RETURN(); } #ifdef _WIN32 @@ -38,14 +41,14 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { if (!hClipboardData) { result = "GlobalAlloc() failed, GetLastError=" + GetLastError(); gClipboardData = ""; - return; + EXTENSION_RETURN(); } char *pClipboardData = (char *)GlobalLock(hClipboardData); if (!pClipboardData) { result = "GlobalLock() failed, GetLastError=" + GetLastError(); gClipboardData = ""; - return; + EXTENSION_RETURN(); } memcpy(pClipboardData, gClipboardData.c_str(), gClipboardData.length()); pClipboardData[gClipboardData.length() + 1] = 0x00; @@ -82,6 +85,6 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { #endif - + EXTENSION_RETURN(); } diff --git a/extensions/cmake/FindDirectX.cmake b/extensions/cmake/FindDirectX.cmake new file mode 100644 index 0000000000..69bf1d62e8 --- /dev/null +++ b/extensions/cmake/FindDirectX.cmake @@ -0,0 +1,215 @@ +# - try to find DirectX include directories and libraries +# +# Once done this will define: +# +# DirectX_XYZ_FOUND - system has the XYZ API +# DirectX_XYZ_INCLUDE_FOUND - system has the include for the XYZ API +# DirectX_XYZ_INCLUDE_DIR - include directory for the XYZ API +# DirectX_XYZ_LIBRARY - path/name for the XYZ library +# +# Where XYZ can be any of: +# +# DDRAW +# D3D +# D3DX +# D3D8 +# D3DX8 +# D3D9 +# D3DX9 +# D3D10 +# D3D10_1 +# D3DX10 +# D3D11 +# D3D11_1 +# D3D11_2 +# D3DX11 +# D2D1 +# + + +include (CheckIncludeFileCXX) +include (FindPackageMessage) + + +if (WIN32) + + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set (DirectX_ARCHITECTURE x64) + else () + set (DirectX_ARCHITECTURE x86) + endif () + + # Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053. See + # http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html + set (ProgramFiles_x86 "ProgramFiles(x86)") + if ("$ENV{${ProgramFiles_x86}}") + set (ProgramFiles "$ENV{${ProgramFiles_x86}}") + else () + set (ProgramFiles "$ENV{ProgramFiles}") + endif () + + find_path (DirectX_ROOT_DIR + Include/d3d9.h + PATHS + "$ENV{DXSDK_DIR}" + "${ProgramFiles}/Microsoft DirectX SDK (June 2010)" + "${ProgramFiles}/Microsoft DirectX SDK (February 2010)" + "${ProgramFiles}/Microsoft DirectX SDK (March 2009)" + "${ProgramFiles}/Microsoft DirectX SDK (August 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (June 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (March 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (November 2007)" + "${ProgramFiles}/Microsoft DirectX SDK (August 2007)" + "${ProgramFiles}/Microsoft DirectX SDK" + DOC "DirectX SDK root directory" + ) + if (DirectX_ROOT_DIR) + set (DirectX_INC_SEARCH_PATH "${DirectX_ROOT_DIR}/Include") + set (DirectX_LIB_SEARCH_PATH "${DirectX_ROOT_DIR}/Lib/${DirectX_ARCHITECTURE}") + set (DirectX_BIN_SEARCH_PATH "${DirectX_ROOT_DIR}/Utilities/bin/x86") + endif () + + # With VS 2011 and Windows 8 SDK, the DirectX SDK is included as part of + # the Windows SDK. + # + # See also: + # - http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx + if (DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) + set (USE_WINSDK_HEADERS TRUE) + endif () + + # Find a header in the DirectX SDK + macro (find_dxsdk_header var_name header) + set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") + set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") + find_path (${include_dir_var} ${header} + HINTS ${DirectX_INC_SEARCH_PATH} + DOC "The directory where ${header} resides" + CMAKE_FIND_ROOT_PATH_BOTH + ) + if (${include_dir_var}) + set (${include_found_var} TRUE) + find_package_message (${var_name}_INC "Found ${header} header: ${${include_dir_var}}/${header}" "[${${include_dir_var}}]") + endif () + mark_as_advanced (${include_found_var}) + endmacro () + + # Find a library in the DirectX SDK + macro (find_dxsdk_library var_name library) + # DirectX SDK + set (library_var "DirectX_${var_name}_LIBRARY") + find_library (${library_var} ${library} + HINTS ${DirectX_LIB_SEARCH_PATH} + DOC "The directory where ${library} resides" + CMAKE_FIND_ROOT_PATH_BOTH + ) + if (${library_var}) + find_package_message (${var_name}_LIB "Found ${library} library: ${${library_var}}" "[${${library_var}}]") + endif () + mark_as_advanced (${library_var}) + endmacro () + + # Find a header in the Windows SDK + macro (find_winsdk_header var_name header) + if (USE_WINSDK_HEADERS) + # Windows SDK + set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") + set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") + check_include_file_cxx (${header} ${include_found_var}) + set (${include_dir_var}) + mark_as_advanced (${include_found_var}) + else () + find_dxsdk_header (${var_name} ${header}) + endif () + endmacro () + + # Find a library in the Windows SDK + macro (find_winsdk_library var_name library) + if (USE_WINSDK_HEADERS) + # XXX: We currently just assume the library exists + set (library_var "DirectX_${var_name}_LIBRARY") + set (${library_var} ${library}) + mark_as_advanced (${library_var}) + else () + find_dxsdk_library (${var_name} ${library}) + endif () + endmacro () + + # Combine header and library variables into an API found variable + macro (find_combined var_name inc_var_name lib_var_name) + if (DirectX_${inc_var_name}_INCLUDE_FOUND AND DirectX_${lib_var_name}_LIBRARY) + set (DirectX_${var_name}_FOUND 1) + find_package_message (${var_name} "Found ${var_name} API" "[${DirectX_${lib_var_name}_LIBRARY}][${DirectX_${inc_var_name}_INCLUDE_DIR}]") + endif () + endmacro () + + find_winsdk_header (DDRAW ddraw.h) + find_winsdk_library (DDRAW ddraw) + find_combined (DDRAW DDRAW DDRAW) + + if (CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") + # Windows 7 SDKs, used by XP toolset, do not include d3d.h + find_dxsdk_header (D3D d3d.h) + else () + find_winsdk_header (D3D d3d.h) + endif () + find_combined (D3D D3D DDRAW) + + find_dxsdk_header (D3DX d3dx.h) + find_combined (D3DX D3DX D3DX) + + find_dxsdk_header (D3D8 d3d8.h) + find_dxsdk_library (D3D8 d3d8) + find_combined (D3D8 D3D8 D3D8) + + find_dxsdk_header (D3DX8 d3dx8.h) + find_dxsdk_library (D3DX8 d3dx8) + find_combined (D3DX8 D3DX8 D3DX8) + + find_winsdk_header (D3D9 d3d9.h) + find_winsdk_library (D3D9 d3d9) + find_combined (D3D9 D3D9 D3D9) + + find_dxsdk_header (D3DX9 d3dx9.h) + find_dxsdk_library (D3DX9 d3dx9) + find_combined (D3DX9 D3DX9 D3DX9) + + find_winsdk_header (DXGI dxgi.h) + find_winsdk_header (DXGI1_2 dxgi1_2.h) + find_winsdk_header (DXGI1_3 dxgi1_3.h) + find_winsdk_library (DXGI dxgi) + + find_winsdk_header (D3D10 d3d10.h) + find_winsdk_library (D3D10 d3d10) + find_combined (D3D10 D3D10 D3D10) + + find_winsdk_header (D3D10_1 d3d10_1.h) + find_winsdk_library (D3D10_1 d3d10_1) + find_combined (D3D10_1 D3D10_1 D3D10_1) + + find_dxsdk_header (D3DX10 d3dx10.h) + find_dxsdk_library (D3DX10 d3dx10) + find_combined (D3DX10 D3DX10 D3DX10) + + find_winsdk_header (D3D11 d3d11.h) + find_winsdk_library (D3D11 d3d11) + find_combined (D3D11 D3D11 D3D11) + find_winsdk_header (D3D11_1 d3d11_1.h) + find_combined (D3D11_1 D3D11_1 D3D11) + find_winsdk_header (D3D11_2 d3d11_2.h) + find_combined (D3D11_2 D3D11_2 D3D11) + + find_dxsdk_header (D3DX11 d3dx11.h) + find_dxsdk_library (D3DX11 d3dx11) + find_combined (D3DX11 D3DX11 D3DX11) + + find_winsdk_header (D2D1 d2d1.h) + find_winsdk_library (D2D1 d2d1) + find_combined (D2D1 D2D1 D2D1) + + find_program (DirectX_FXC_EXECUTABLE fxc + HINTS ${DirectX_BIN_SEARCH_PATH} + DOC "Path to fxc.exe executable." + ) + +endif () \ No newline at end of file diff --git a/extensions/common/CMakeLists.txt b/extensions/common/CMakeLists.txt new file mode 100644 index 0000000000..620023ceb1 --- /dev/null +++ b/extensions/common/CMakeLists.txt @@ -0,0 +1,18 @@ +file(GLOB_RECURSE ACE_COMMON_SOURCES *.h *.hpp *.c *.cpp) + + +file(GLOB ACE_BASE_COMMON_SOURCES *.h *.hpp *.c *.cpp) +file(GLOB ACE_P3D_SOURCES p3d/*.h p3d/*.hpp p3d/*.c p3d/*.cpp) +file(GLOB ACE_PBO_SOURCES pbo/*.h pbo/*.hpp pbo/*.c pbo/*.cpp) +file(GLOB ACE_SIMULATION_SOURCES simulation/*.h simulation/*.hpp simulation/*.c simulation/*.cpp) +file(GLOB ACE_DIRECTX_SOURCES directx/*.h directx/*.hpp directx/*.c directx/*.cpp) +file(GLOB ACE_GLM_SOURCES glm/*.h glm/*.hpp glm/*.c glm/*.cpp) + +SOURCE_GROUP("common" FILES ${ACE_BASE_COMMON_SOURCES}) +SOURCE_GROUP("p3d" FILES ${ACE_P3D_SOURCES}) +SOURCE_GROUP("pbo" FILES ${ACE_PBO_SOURCES}) +SOURCE_GROUP("simulation" FILES ${ACE_SIMULATION_SOURCES}) +SOURCE_GROUP("directx" FILES ${ACE_DIRECTX_SOURCES}) +SOURCE_GROUP("glm" FILES ${ACE_GLM_SOURCES}) + +add_library(ace_common STATIC ${ACE_GLM_SOURCES} ${ACE_BASE_COMMON_SOURCES} ${ACE_P3D_SOURCES} ${ACE_PBO_SOURCES} ${ACE_SIMULATION_SOURCES} ${ACE_DIRECTX_SOURCES}) diff --git a/extensions/common/arguments.hpp b/extensions/common/arguments.hpp new file mode 100644 index 0000000000..70e942a241 --- /dev/null +++ b/extensions/common/arguments.hpp @@ -0,0 +1,90 @@ +#pragma once + +#include "shared.hpp" +#include "vector.hpp" + +#include +#include + +namespace ace { + class argument_accessor { + public: + argument_accessor(const uint32_t index, const std::vector & ar) : _index(index), _args(ar) { } + + const std::string & as_string() const { return _args[_index]; } + operator const std::string &() const { return as_string(); } + + float as_float() const { return atof(_args[_index].c_str()); } + operator float() const { return as_float(); } + + int as_int() const { return atoi(_args[_index].c_str()); } + operator int() const { return as_int(); } + + int as_uint32() const { return (uint32_t)atoi(_args[_index].c_str()); } + operator uint32_t() const { return as_uint32(); } + + ace::vector3 as_vector() const { + std::vector t = ace::split(_args[_index], ';'); + return ace::vector3(atof(t[0].c_str()), + atof(t[1].c_str()), + atof(t[2].c_str())); + } + operator ace::vector3() const { return as_vector(); } + + protected: + const uint32_t _index; + const std::vector & _args; + }; + + class arguments { + public: + arguments(const std::string & str) : _original(str) { + _args = ace::split(str, ','); + for (int i = 0; i < _args.size(); i++) { + _args[i] = trim(_args[i]); + } + } + + size_t size() const { return _args.size(); } + + const argument_accessor operator[] (int index) const { return argument_accessor(index, _args); } + + const std::string & as_string(uint32_t _index) const { return _args[_index]; } + float as_float(uint32_t _index) const { return atof(_args[_index].c_str()); } + int as_int(uint32_t _index) const { return atoi(_args[_index].c_str()); } + int as_uint32(uint32_t _index) const { return (uint32_t)atoi(_args[_index].c_str()); } + ace::vector3 as_vector(uint32_t _index) const { + std::vector t = ace::split(_args[_index], ';'); + return ace::vector3(atof(t[0].c_str()), + atof(t[1].c_str()), + atof(t[2].c_str())); + } + + const std::string & get() const { + return _original; + } + + std::string create(const std::string & command) const { + std::stringstream ss; + ss << command << ":"; + + for (auto & v : _args) { + ss << v << ","; + } + + // Remove the trailing , + std::string result = ss.str(); + result.erase(result.length()); + + return result; + } + static std::string create(const std::string & command, const arguments & args) { + return args.create(command); + } + + + protected: + std::vector _args; + const std::string _original; + }; +} \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.cpp b/extensions/common/directx/d3d_display.cpp new file mode 100644 index 0000000000..bfc7a0e013 --- /dev/null +++ b/extensions/common/directx/d3d_display.cpp @@ -0,0 +1,439 @@ +#ifdef USE_DIRECTX + +#include "shared.hpp" +#include "d3d_display.hpp" + +#include + +#include + +using namespace DirectX; + +namespace ace { + namespace debug { + + DWORD GetMainThreadId() { + const std::shared_ptr hThreadSnapshot( + CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0), CloseHandle); + if (hThreadSnapshot.get() == INVALID_HANDLE_VALUE) { + throw std::runtime_error("GetMainThreadId failed"); + } + THREADENTRY32 tEntry; + tEntry.dwSize = sizeof(THREADENTRY32); + DWORD result = 0; + DWORD currentPID = GetCurrentProcessId(); + for (BOOL success = Thread32First(hThreadSnapshot.get(), &tEntry); + !result && success && GetLastError() != ERROR_NO_MORE_FILES; + success = Thread32Next(hThreadSnapshot.get(), &tEntry)) + { + if (tEntry.th32OwnerProcessID == currentPID) { + result = tEntry.th32ThreadID; + } + } + return result; + } + + d3d_display::d3d_display() : _fullscreen(false) {} + d3d_display::~d3d_display() {} + + bool d3d_display::render_thread(uint32_t w, uint32_t h, bool f) { + _render_thread = std::make_unique(this, d3d_display_worker_args(w, h, f) ); + return true; + } + + void d3d_display::render_worker(d3d_display_worker_args args) { + { + create(args.width, args.height, args.fullscreen); + init(); + } + run(); + } + + bool d3d_display::run() { + MSG msg = { 0 }; + + while (WM_QUIT != msg.message) { + if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } else { + render(); + } + } + + return true; + } + + bool d3d_display::init() { + + std::lock_guard _lock(_render_lock); + + HRESULT hr = S_OK; + RECT rc; + + GetClientRect(_hWnd, &rc); + UINT width = rc.right - rc.left; + UINT height = rc.bottom - rc.top; + UINT createDeviceFlags = 0; +#ifdef _DEBUG + createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; +#endif + + D3D_DRIVER_TYPE driverTypes[] = + { + D3D_DRIVER_TYPE_HARDWARE, + D3D_DRIVER_TYPE_WARP, + D3D_DRIVER_TYPE_REFERENCE, + }; + UINT numDriverTypes = ARRAYSIZE(driverTypes); + + D3D_FEATURE_LEVEL featureLevels[] = + { + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + }; + UINT numFeatureLevels = ARRAYSIZE(featureLevels); + + DXGI_SWAP_CHAIN_DESC sd; + ZeroMemory(&sd, sizeof(sd)); + sd.BufferCount = 1; + sd.BufferDesc.Width = width; + sd.BufferDesc.Height = height; + sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + sd.BufferDesc.RefreshRate.Numerator = 60; + sd.BufferDesc.RefreshRate.Denominator = 1; + sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + sd.OutputWindow = _hWnd; + sd.SampleDesc.Count = 1; + sd.SampleDesc.Quality = 0; + sd.Windowed = _fullscreen ? FALSE : TRUE; + + for (UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++) + { + _driverType = driverTypes[driverTypeIndex]; + hr = D3D11CreateDeviceAndSwapChain(nullptr, _driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels, + D3D11_SDK_VERSION, &sd, &_pSwapChain, &_pd3dDevice, &_featureLevel, &_pImmediateContext); + if (SUCCEEDED(hr)) + break; + } + if (FAILED(hr)) + return false; + + // Create a render target view + ID3D11Texture2D* pBackBuffer = nullptr; + hr = _pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBackBuffer); + if (FAILED(hr)) + return false; + + hr = _pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr, &_pRenderTargetView); + pBackBuffer->Release(); + if (FAILED(hr)) + return false; + + // Create depth stencil texture + D3D11_TEXTURE2D_DESC descDepth; + ZeroMemory(&descDepth, sizeof(descDepth)); + descDepth.Width = width; + descDepth.Height = height; + descDepth.MipLevels = 1; + descDepth.ArraySize = 1; + descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + descDepth.SampleDesc.Count = 1; + descDepth.SampleDesc.Quality = 0; + descDepth.Usage = D3D11_USAGE_DEFAULT; + descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL; + descDepth.CPUAccessFlags = 0; + descDepth.MiscFlags = 0; + hr = _pd3dDevice->CreateTexture2D(&descDepth, nullptr, &_pDepthStencil); + if (FAILED(hr)) + return false; + + // Create the depth stencil view + D3D11_DEPTH_STENCIL_VIEW_DESC descDSV; + ZeroMemory(&descDSV, sizeof(descDSV)); + descDSV.Format = descDepth.Format; + descDSV.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + descDSV.Texture2D.MipSlice = 0; + hr = _pd3dDevice->CreateDepthStencilView(_pDepthStencil, &descDSV, &_pDepthStencilView); + if (FAILED(hr)) + return false; + + _pImmediateContext->OMSetRenderTargets(1, &_pRenderTargetView, _pDepthStencilView); + + // Setup the viewport + D3D11_VIEWPORT vp; + vp.Width = (FLOAT)width; + vp.Height = (FLOAT)height; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + vp.TopLeftX = 0; + vp.TopLeftY = 0; + _pImmediateContext->RSSetViewports(1, &vp); + + XMStoreFloat4x4(&_World, XMMatrixIdentity()); + XMStoreFloat4x4(&_View, XMMatrixLookAtLH(XMLoadFloat4(&_camera.camPosition), XMLoadFloat4(&_camera.camTarget), XMLoadFloat4(&_camera.camUp))); + XMStoreFloat4x4(&_Projection, XMMatrixPerspectiveFovLH(XM_PIDIV4, width / (FLOAT)height, 0.01f, 100.0f)); + + init_input(); + + return true; + } + + bool d3d_display::init_input() { + RAWINPUTDEVICE Rid[2]; + + Rid[0].usUsagePage = 0x01; // magic numbers + Rid[0].usUsage = 0x02; // magically means mouse + Rid[0].dwFlags = 0; // (use this if you DO NOT WANT to capture mouse) + //Rid[0].dwFlags = RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY ; // (use this to CAPTURE MOUSE) + Rid[0].hwndTarget = _hWnd; + + Rid[1].usUsagePage = 0x01; // magic numbers + Rid[1].usUsage = 0x06; // magically means keyboard + Rid[1].dwFlags = 0; // use RIDEV_NOHOTKEYS for no winkey + Rid[1].hwndTarget = _hWnd; + + if (!RegisterRawInputDevices(Rid, 2, sizeof(Rid[0]))) { + LOG(ERROR) << "Could not register raw input devices. "; + exit(1); + } + } + + bool d3d_display::create(uint32_t width = 1024, uint32_t height = 768, bool fullscreen = false) { + std::lock_guard _lock(_render_lock); + + _fullscreen = fullscreen; + + WNDCLASSEXW wcex; + wcex.cbSize = sizeof(WNDCLASSEXW); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = (WNDPROC)&ace::debug::d3d_display::wndproc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = (HINSTANCE)GetCurrentProcess(); + //wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SAMPLE1); + //wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + wcex.lpszMenuName = nullptr; + wcex.lpszClassName = L"ACE3BaseDisplayClass"; + //wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SAMPLE1); + if (!RegisterClassExW(&wcex)) { + return false; + } + + // Create window + _hInst = (HINSTANCE)GetCurrentProcess(); + RECT rc = { 0, 0, width, height }; + AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); + _hWnd = CreateWindowW(L"ACE3BaseDisplayClass", L"ACE3 D3D Render", WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, _hInst, + nullptr); + + if (!_hWnd) { + return false; + } + + // Attach our input to the master input + //AttachThreadInput(GetCurrentThreadId(), GetMainThraedId()); + + SetWindowLongPtr(_hWnd, GWLP_USERDATA, (LONG)this); + + ShowWindow(_hWnd, 5); + + return true; + } + + bool d3d_display::destroy() { + if (_pImmediateContext) _pImmediateContext->ClearState(); + + if (_pBatchInputLayout) _pBatchInputLayout->Release(); + + if (_pTextureRV1) _pTextureRV1->Release(); + if (_pTextureRV2) _pTextureRV2->Release(); + + if (_pDepthStencilView) _pDepthStencilView->Release(); + if (_pDepthStencil) _pDepthStencil->Release(); + if (_pRenderTargetView) _pRenderTargetView->Release(); + if (_pSwapChain) _pSwapChain->Release(); + if (_pImmediateContext) _pImmediateContext->Release(); + if (_pd3dDevice) _pd3dDevice->Release(); + + return true; + } + + bool d3d_display::render() { + // Update our time + static float t = 0.0f; + static float dt = 0.f; + if (_driverType == D3D_DRIVER_TYPE_REFERENCE) { + t += (float)XM_PI * 0.0125f; + } else { + static uint64_t dwTimeStart = 0; + static uint64_t dwTimeLast = 0; + uint64_t dwTimeCur = GetTickCount64(); + if (dwTimeStart == 0) + dwTimeStart = dwTimeCur; + t = (dwTimeCur - dwTimeStart) / 1000.0f; + dt = (dwTimeCur - dwTimeLast) / 1000.0f; + dwTimeLast = dwTimeCur; + } + + { + std::lock_guard _lock(_render_lock); + + _pImmediateContext->ClearRenderTargetView(_pRenderTargetView, Colors::MidnightBlue); + _pImmediateContext->ClearDepthStencilView(_pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); + + update_camera(); + step(); + + _pSwapChain->Present(0, 0); + } + + return true; + } + + bool d3d_display::step() { + return true; + } + + void d3d_display::_move_camera(ace::vector3 direction) { + + } + void d3d_display::_rotate_camera(ace::vector3 direction) { + + } + void d3d_display::update_camera() { + XMVECTOR DefaultForward, DefaultRight, camPosition; + + DefaultForward = XMLoadFloat4(&_camera.DefaultForward); + DefaultRight = XMLoadFloat4(&_camera.DefaultRight); + camPosition = XMLoadFloat4(&_camera.camPosition); + + XMMATRIX camRotationMatrix = XMMatrixRotationRollPitchYaw(_camera.camPitch, _camera.camYaw, 0); + XMVECTOR camTarget = XMVector3TransformCoord(DefaultForward, camRotationMatrix); + camTarget = XMVector3Normalize(camTarget); + + XMVECTOR camRight = XMVector3TransformCoord(DefaultRight, camRotationMatrix); + XMVECTOR camForward = XMVector3TransformCoord(DefaultForward, camRotationMatrix); + XMVECTOR camUp = XMVector3Cross(camForward, camRight); + + camPosition += _camera.moveLeftRight * camRight; + camPosition += _camera.moveBackForward * camForward; + XMStoreFloat4(&_camera.camPosition, camPosition); + + _camera.moveLeftRight = 0.0f; + _camera.moveBackForward = 0.0f; + + camTarget = camPosition + camTarget; + + XMStoreFloat4x4(&_View, XMMatrixLookAtLH(camPosition, camTarget, camUp)); + } + + LRESULT CALLBACK d3d_display::_wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + PAINTSTRUCT ps; + HDC hdc; + + switch (message) { + case WM_INPUT: { + UINT dwSize; + if (GetActiveWindow() != _hWnd) { + return DefWindowProc(hWnd, message, wParam, lParam); + } + GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, + sizeof(RAWINPUTHEADER)); + LPBYTE lpb = new BYTE[dwSize]; + if (lpb == NULL) { + return 0; + } + + int readSize = GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)); + + if (readSize != dwSize) + break; + + RAWINPUT* raw = (RAWINPUT*)lpb; + + float speed = 0.5f; + + if (raw->header.dwType == RIM_TYPEKEYBOARD) { + switch (raw->data.keyboard.VKey) { + case VK_SPACE: { + XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); + break; + } + // Camera Movement + case 0x57: case VK_NUMPAD8: + case VK_UP: { + _camera.moveBackForward += speed; + break; + } + case 0x53: case VK_NUMPAD2: + case VK_DOWN: { + _camera.moveBackForward -= speed; + break; + } + case 0x41: case VK_NUMPAD4: + case VK_LEFT: { + _camera.moveLeftRight -= speed; + break; + } + case 0x44: case VK_NUMPAD6: + case VK_RIGHT: { + _camera.moveLeftRight += speed; + break; + } + // Numpad Movement + case VK_NUMPAD5: { + XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); + break; + } + } + } + else if (raw->header.dwType == RIM_TYPEMOUSE) { + RAWMOUSE mouseCurrState = raw->data.mouse; + + if ((mouseCurrState.lLastX != _last_mouse_state.lLastY) || (mouseCurrState.lLastX != _last_mouse_state.lLastY)) + { + _camera.camYaw += mouseCurrState.lLastX * 0.005f; + _camera.camPitch += mouseCurrState.lLastY * 0.005f; + _last_mouse_state = mouseCurrState; + } + + } + + delete[] lpb; + return 0; + } + + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + EndPaint(hWnd, &ps); + break; + + case WM_DESTROY: + PostQuitMessage(0); + + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + + return 0; + } + LRESULT CALLBACK d3d_display::wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + LONG data; + data = GetWindowLongPtr(hWnd, GWLP_USERDATA); + if (data) { + return ((d3d_display*)data)->_wndproc(hWnd, message, wParam, lParam); + } else { + return DefWindowProc(hWnd, message, wParam, lParam); + } + } + }; + + +}; + +#endif \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.hpp b/extensions/common/directx/d3d_display.hpp new file mode 100644 index 0000000000..b10e8ef070 --- /dev/null +++ b/extensions/common/directx/d3d_display.hpp @@ -0,0 +1,130 @@ +#pragma once + +#ifdef USE_DIRECTX + +#include +#include +#include +#include + +#include +#include +#include + +#include "singleton.hpp" +#include "vector.hpp" + +#define IDI_ACE_DEBUG 666 + +namespace ace { + namespace debug { + + __declspec(align(16)) + struct camera_movement { + camera_movement() { + XMStoreFloat4(&DefaultForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); + XMStoreFloat4(&DefaultRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); + XMStoreFloat4(&camForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); + XMStoreFloat4(&camRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); + + camYaw = 0.0f; + camPitch = 0.0f; + + moveLeftRight = 0.0f; + moveBackForward = 0.0f; + + XMStoreFloat4(&camPosition, DirectX::XMVectorSet(0.0f, 12.0f, 6.0f, 0.0f)); + XMStoreFloat4(&camTarget, DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f)); + XMStoreFloat4(&camUp, DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f)); + } + + DirectX::XMFLOAT4 DefaultForward; + DirectX::XMFLOAT4 DefaultRight; + DirectX::XMFLOAT4 camForward; + DirectX::XMFLOAT4 camRight; + + DirectX::XMFLOAT4X4 camRotationMatrix; + DirectX::XMFLOAT4X4 groundWorld; + + float moveLeftRight; + float moveBackForward; + + float camYaw; + float camPitch; + + DirectX::XMFLOAT4 camPosition; + DirectX::XMFLOAT4 camTarget; + DirectX::XMFLOAT4 camUp; + }; + + struct d3d_display_worker; + struct d3d_display_worker_args; + __declspec(align(16)) + class d3d_display { + public: + d3d_display(); + ~d3d_display(); + + virtual bool run(); + virtual bool render(); + virtual bool render_thread(uint32_t, uint32_t, bool); + + virtual void update_camera(); + virtual bool step(); + + virtual bool create(uint32_t, uint32_t, bool); + virtual bool init(); + virtual bool init_input(); + + virtual bool destroy(); + + void render_worker(d3d_display_worker_args); + + static LRESULT CALLBACK wndproc(HWND, UINT, WPARAM, LPARAM); + LRESULT CALLBACK _wndproc(HWND, UINT, WPARAM, LPARAM); + protected: + void _move_camera(ace::vector3); + void _rotate_camera(ace::vector3); + + std::unique_ptr _render_thread; + std::mutex _render_lock; + + bool _fullscreen; + HINSTANCE _hInst = nullptr; + HWND _hWnd = nullptr; + D3D_DRIVER_TYPE _driverType = D3D_DRIVER_TYPE_NULL; + D3D_FEATURE_LEVEL _featureLevel = D3D_FEATURE_LEVEL_11_0; + ID3D11Device* _pd3dDevice = nullptr; + ID3D11DeviceContext* _pImmediateContext = nullptr; + IDXGISwapChain* _pSwapChain = nullptr; + ID3D11RenderTargetView* _pRenderTargetView = nullptr; + ID3D11Texture2D* _pDepthStencil = nullptr; + ID3D11DepthStencilView* _pDepthStencilView = nullptr; + + ID3D11ShaderResourceView* _pTextureRV1 = nullptr; + ID3D11ShaderResourceView* _pTextureRV2 = nullptr; + ID3D11InputLayout* _pBatchInputLayout = nullptr; + + DirectX::XMFLOAT4X4 _World; + DirectX::XMFLOAT4X4 _View; + DirectX::XMFLOAT4X4 _Projection; + + RAWMOUSE _last_mouse_state; + camera_movement _camera; + + }; + struct d3d_display_worker_args { + d3d_display_worker_args(uint32_t w, uint32_t h, bool f) : width(w), height(h), fullscreen(f) {} + uint32_t width; + uint32_t height; + bool fullscreen; + }; + struct d3d_display_worker { + d3d_display_worker(d3d_display * obj, d3d_display_worker_args args) : thread(&ace::debug::d3d_display::render_worker, obj, args) {} + ~d3d_display_worker() { thread.join(); } + std::thread thread; + }; + }; +}; + +#endif \ No newline at end of file diff --git a/extensions/common/dispatch.hpp b/extensions/common/dispatch.hpp new file mode 100644 index 0000000000..0a37824b83 --- /dev/null +++ b/extensions/common/dispatch.hpp @@ -0,0 +1,153 @@ +#pragma once + +#include +#include +#include +#include + +#include "shared.hpp" +#include "arguments.hpp" +#include "singleton.hpp" + +namespace ace { + class dispatcher { + public: + dispatcher() : _ready(true) {} + + virtual bool call(const std::string & name_, const arguments & args_, std::string & result_) { + if (_methods.find(name_) == _methods.end()) { + // @TODO: Exceptions + return false; + } + return _methods[name_](args_, result_); + } + + bool add(const std::string & name_, std::function func_) { + if (_methods.find(name_) != _methods.end()) { + // @TODO: Exceptions + return false; + } + _methods[name_] = func_; + + return true; + } + + bool ready() const { return _ready; } + void ready(bool r) { _ready.exchange(r); } + protected: + std::unordered_map < std::string, std::function > _methods; + std::atomic_bool _ready; + }; + class dispatch : public dispatcher, public singleton { }; + + struct dispatch_message { + dispatch_message(const std::string & command_, const arguments & args_, const uint64_t id_) : command(command_), args(args_), id(id_) {} + std::string command; + arguments args; + uint64_t id; + }; + struct dispatch_result { + dispatch_result() {} + dispatch_result(const std::string &res, const uint64_t id_) : message(res), id(id_) {} + std::string message; + uint64_t id; + }; + + class threaded_dispatcher : public dispatcher { + public: + threaded_dispatcher() : _stop(false), _worker(&ace::threaded_dispatcher::monitor, this) { + + } + ~threaded_dispatcher() {} + + bool call(const std::string & name_, const arguments & args_, std::string & result_, bool threaded) { + if (_methods.find(name_) == _methods.end()) { + // @TODO: Exceptions + return false; + } + if (threaded) { + std::lock_guard lock(_messages_lock); + _messages.push(dispatch_message(name_, args_, _message_id)); + + // @TODO: We should provide an interface for this serialization. + std::stringstream ss; + ss << "[\"result_id\", \"" << _message_id << "\" ]"; + result_ = ss.str(); + + _message_id = _message_id + 1; + } else { +#ifdef _DEBUG + if (name_ != "fetch_result") { + LOG(TRACE) << "dispatch[immediate]:\t[" << name_ << "] { " << args_.get() << " }"; + } +#endif + return dispatcher::call(name_, args_, result_); + } + + return true; + } + bool call(const std::string & name_, const arguments & args_, std::string & result_) override { + return call(name_, args_, result_, false); + } + + void push_result(const dispatch_result & result) { + { + std::lock_guard lock(_results_lock); + _results.push(result); + } + } + void push_result(const std::string & result) { + push_result(dispatch_result(result, -1)); + } + void stop() { + std::lock_guard lock(_messages_lock); + _stop = true; + } + protected: + void monitor() { + _ready = false; + while (!_stop) { + { + std::lock_guard lock(_messages_lock); + while (!_messages.empty()) { + if (_ready) { + dispatch_result result; + dispatch_message _message = std::move(_messages.front()); + _messages.pop(); + + result.id = _message.id; + result.message.resize(4096); +#ifdef _DEBUG + if (_message.command != "fetch_result") { + LOG(TRACE) << "dispatch[threaded]:\t[" << _message.command << "]"; + if (_message.args.size() > 0) { + // LOG(TRACE) << "\t{ " << _messages.front().args.get() << " }"; + } + } +#endif + dispatcher::call(_message.command, _message.args, result.message); + { + std::lock_guard lock(_results_lock); + _results.push(result); + } + + + } + } + } + sleep(5); + } + } + std::atomic_bool _stop; + std::queue _results; + std::mutex _results_lock; + + std::queue _messages; + std::mutex _messages_lock; + + std::thread _worker; + + uint64_t _message_id; + }; + class threaded_dispatch : public threaded_dispatcher, public singleton { }; +}; \ No newline at end of file diff --git a/extensions/common/easyloggingc++.hpp b/extensions/common/easyloggingc++.hpp new file mode 100644 index 0000000000..3a5455c4d0 --- /dev/null +++ b/extensions/common/easyloggingc++.hpp @@ -0,0 +1,6718 @@ +// +// Easylogging++ v9.80 +// Single-header only, cross-platform logging library for C++ applications +// +// Copyright (c) 2015 muflihun.com +// +// This library is released under the MIT Licence. +// http://easylogging.muflihun.com/licence.php +// +// easylogging@muflihun.com +// +// https://github.com/easylogging/easyloggingpp +// http://easylogging.muflihun.com +// http://muflihun.com +// +#ifndef EASYLOGGINGPP_H +#define EASYLOGGINGPP_H +// Compilers and C++0x/C++11 Evaluation +#if defined(__GNUC__) +# define ELPP_COMPILER_GCC 1 +# define ELPP_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ELPP_CXX0X 1 +# elif(ELPP_GCC_VERSION >= 40801) +# define ELPP_CXX11 1 +# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) +#endif // defined(__GNUC__) +// Visual C++ +#if defined(_MSC_VER) +# define ELPP_COMPILER_MSVC 1 +# define ELPP_CRT_DBG_WARNINGS 1 +# if (_MSC_VER == 1600) +# define ELPP_CXX0X 1 +# elif(_MSC_VER >= 1700) +# define ELPP_CXX11 1 +# endif // (_MSC_VER == 1600) +#endif // defined(_MSC_VER) +// Clang++ +#if defined(__clang__) && (__clang__ == 1) +# define ELPP_COMPILER_CLANG 1 +# define ELPP_CLANG_VERSION (__clang_major__ * 10000 \ + + __clang_minor__ * 100 \ + + __clang_patchlevel__) +# if (ELPP_CLANG_VERSION >= 30300) +# define ELPP_CXX11 1 +# endif // (ELPP_CLANG_VERSION >= 30300) +#endif // defined(__clang__) && (__clang__ == 1) +// MinGW +#if defined(__MINGW32__) || defined(__MINGW64__) +# define ELPP_MINGW 1 +#endif // defined(__MINGW32__) || defined(__MINGW64__) +// Cygwin +#if defined(__CYGWIN__) && (__CYGWIN__ == 1) +# define ELPP_CYGWIN 1 +#endif // defined(__CYGWIN__) && (__CYGWIN__ == 1) +// Intel C++ +#if defined(__INTEL_COMPILER) +# define ELPP_COMPILER_INTEL 1 +#endif +// Operating System Evaluation +// Windows +#if defined(_WIN32) || defined(_WIN64) +# define ELPP_OS_WINDOWS 1 +#endif // defined(_WIN32) || defined(_WIN64) +// Linux +#if (defined(__linux) || defined(__linux__)) +# define ELPP_OS_LINUX 1 +#endif // (defined(__linux) || defined(__linux__)) +// Mac +#if defined(__APPLE__) +# define ELPP_OS_MAC 1 +#endif // defined(__APPLE__) +// FreeBSD +#if defined(__FreeBSD__) +# define ELPP_OS_FREEBSD 1 +#endif +// Solaris +#if defined(__sun) +# define ELPP_OS_SOLARIS 1 +#endif +// Unix +#if ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS) && (!ELPP_OS_WINDOWS)) +# define ELPP_OS_UNIX 1 +#endif // ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS) && (!ELPP_OS_WINDOWS)) +// Android +#if defined(__ANDROID__) +# define ELPP_OS_ANDROID 1 +#endif // defined(__ANDROID__) +// Evaluating Cygwin as *nix OS +#if !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN +# undef ELPP_OS_UNIX +# undef ELPP_OS_LINUX +# define ELPP_OS_UNIX 1 +# define ELPP_OS_LINUX 1 +#endif // !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN +#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_INFO) +# define ELPP_INTERNAL_DEBUGGING_OUT_INFO std::cout +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_ERROR) +# define ELPP_INTERNAL_DEBUGGING_OUT_ERROR std::cerr +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_ENDL) +# define ELPP_INTERNAL_DEBUGGING_ENDL std::endl +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_MSG) +# define ELPP_INTERNAL_DEBUGGING_MSG(msg) msg +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +// Internal Assertions and errors +#if !defined(ELPP_DISABLE_ASSERT) +# if (defined(ELPP_DEBUG_ASSERT_FAILURE)) +# define ELPP_ASSERT(expr, msg) if (!(expr)) { \ + std::stringstream internalInfoStream; internalInfoStream << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ + << "EASYLOGGING++ ASSERTION FAILED (LINE: " << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" \ + << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" << ELPP_INTERNAL_DEBUGGING_ENDL; base::utils::abort(1, \ + "ELPP Assertion failure, please define ELPP_DEBUG_ASSERT_FAILURE"); } +# else +# define ELPP_ASSERT(expr, msg) if (!(expr)) { \ + std::stringstream internalInfoStream; internalInfoStream << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR\ + << "ASSERTION FAILURE FROM EASYLOGGING++ (LINE: " \ + << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" \ + << ELPP_INTERNAL_DEBUGGING_ENDL; } +# endif // (defined(ELPP_DEBUG_ASSERT_FAILURE)) +#else +# define ELPP_ASSERT(x, y) +#endif //(!defined(ELPP_DISABLE_ASSERT) +#if ELPP_COMPILER_MSVC +# define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ + { char buff[256]; strerror_s(buff, 256, errno); \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << buff << " [" << errno << "]";} (void)0 +#else +# define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << strerror(errno) << " [" << errno << "]"; (void)0 +#endif // ELPP_COMPILER_MSVC +#if defined(ELPP_DEBUG_ERRORS) +# if !defined(ELPP_INTERNAL_ERROR) +# define ELPP_INTERNAL_ERROR(msg, pe) { \ + std::stringstream internalInfoStream; internalInfoStream << " " << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ + << "ERROR FROM EASYLOGGING++ (LINE: " << __LINE__ << ") " \ + << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << ELPP_INTERNAL_DEBUGGING_ENDL; \ + if (pe) { ELPP_INTERNAL_DEBUGGING_OUT_ERROR << " "; ELPP_INTERNAL_DEBUGGING_WRITE_PERROR; }} (void)0 +# endif +#else +# undef ELPP_INTERNAL_INFO +# define ELPP_INTERNAL_ERROR(msg, pe) +#endif // defined(ELPP_DEBUG_ERRORS) +#if (defined(ELPP_DEBUG_INFO)) +# if !(defined(ELPP_INTERNAL_INFO_LEVEL)) +# define ELPP_INTERNAL_INFO_LEVEL 9 +# endif // !(defined(ELPP_INTERNAL_INFO_LEVEL)) +# if !defined(ELPP_INTERNAL_INFO) +# define ELPP_INTERNAL_INFO(lvl, msg) { if (lvl <= ELPP_INTERNAL_INFO_LEVEL) { \ + std::stringstream internalInfoStream; internalInfoStream << " " << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) \ + << ELPP_INTERNAL_DEBUGGING_ENDL; }} +# endif +#else +# undef ELPP_INTERNAL_INFO +# define ELPP_INTERNAL_INFO(lvl, msg) +#endif // (defined(ELPP_DEBUG_INFO)) +#if defined(ELPP_STACKTRACE_ON_CRASH) +# if (ELPP_COMPILER_GCC && !ELPP_MINGW) +# define ELPP_STACKTRACE 1 +# else +# if ELPP_COMPILER_MSVC +# pragma message("Stack trace not available for this compiler") +# else +# warning "Stack trace not available for this compiler"; +# endif // ELPP_COMPILER_MSVC +# endif // ELPP_COMPILER_GCC +#endif // (defined(ELPP_STACKTRACE_ON_CRASH)) +// Miscellaneous macros +#define ELPP_UNUSED(x) (void)x +#if ELPP_OS_UNIX +// Log file permissions for unix-based systems +# define ELPP_LOG_PERMS S_IRUSR | S_IWUSR | S_IXUSR | S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IXOTH +#endif // ELPP_OS_UNIX +#if defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC +# if defined(ELPP_EXPORT_SYMBOLS) +# define ELPP_EXPORT __declspec(dllexport) +# else +# define ELPP_EXPORT __declspec(dllimport) +# endif // defined(ELPP_EXPORT_SYMBOLS) +#else +# define ELPP_EXPORT +#endif // defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC +// Some special functions that are VC++ specific +#undef STRTOK +#undef STRERROR +#undef STRCAT +#undef STRCPY +#if ELPP_CRT_DBG_WARNINGS +# define STRTOK(a, b, c) strtok_s(a, b, c) +# define STRERROR(a, b, c) strerror_s(a, b, c) +# define STRCAT(a, b, len) strcat_s(a, len, b) +# define STRCPY(a, b, len) strcpy_s(a, len, b) +#else +# define STRTOK(a, b, c) strtok(a, b) +# define STRERROR(a, b, c) strerror(c) +# define STRCAT(a, b, len) strcat(a, b) +# define STRCPY(a, b, len) strcpy(a, b) +#endif +// Compiler specific support evaluations +#if (!ELPP_MINGW && !ELPP_COMPILER_CLANG) || defined(ELPP_FORCE_USE_STD_THREAD) +# define ELPP_USE_STD_THREADING 1 +#endif // (!ELPP_MINGW && !ELPP_COMPILER_CLANG) || defined(ELPP_FORCE_USE_STD_THREAD) +#undef ELPP_FINAL +#if ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) +# define ELPP_FINAL +#else +# define ELPP_FINAL final +#endif // ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) +#if defined(ELPP_EXPERIMENTAL_ASYNC) +# define ELPP_ASYNC_LOGGING 1 +#else +# define ELPP_ASYNC_LOGGING 0 +#endif // defined(ELPP_EXPERIMENTAL_ASYNC) +#if defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING +# define ELPP_THREADING_ENABLED 1 +#endif // defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING +// Function macro ELPP_FUNC +#undef ELPP_FUNC +#if ELPP_COMPILER_MSVC // Visual C++ +# define ELPP_FUNC __FUNCSIG__ +#elif ELPP_COMPILER_GCC // GCC +# define ELPP_FUNC __PRETTY_FUNCTION__ +#elif ELPP_COMPILER_INTEL // Intel C++ +# define ELPP_FUNC __PRETTY_FUNCTION__ +#elif ELPP_COMPILER_CLANG // Clang++ +# define ELPP_FUNC __PRETTY_FUNCTION__ +#else +# if defined(__func__) +# define ELPP_FUNC __func__ +# else +# define ELPP_FUNC "" +# endif // defined(__func__) +#endif // defined(_MSC_VER) +#undef ELPP_VARIADIC_TEMPLATES_SUPPORTED +// Keep following line commented until features are fixed +#if ELPP_COMPILER_GCC || ELPP_COMPILER_CLANG || ELPP_COMPILER_INTEL || (ELPP_COMPILER_MSVC && _MSC_VER >= 1800) +# define ELPP_VARIADIC_TEMPLATES_SUPPORTED 1 +#endif // ELPP_COMPILER_GCC || ELPP_COMPILER_CLANG || ELPP_COMPILER_INTEL || (ELPP_COMPILER_MSVC && _MSC_VER >= 1800) +// Logging Enable/Disable macros +#if (!defined(ELPP_DISABLE_LOGS)) +# define ELPP_LOGGING_ENABLED 1 +#endif // (!defined(ELPP_DISABLE_LOGS)) +#if (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED) && ((defined(_DEBUG)) || (!defined(NDEBUG)))) +# define ELPP_DEBUG_LOG 1 +#else +# define ELPP_DEBUG_LOG 0 +#endif // (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED) && ((defined(_DEBUG)) || (!defined(NDEBUG)))) +#if (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_INFO_LOG 1 +#else +# define ELPP_INFO_LOG 0 +#endif // (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_WARNING_LOG 1 +#else +# define ELPP_WARNING_LOG 0 +#endif // (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_ERROR_LOG 1 +#else +# define ELPP_ERROR_LOG 0 +#endif // (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_FATAL_LOG 1 +#else +# define ELPP_FATAL_LOG 0 +#endif // (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_TRACE_LOG 1 +#else +# define ELPP_TRACE_LOG 0 +#endif // (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_VERBOSE_LOG 1 +#else +# define ELPP_VERBOSE_LOG 0 +#endif // (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!(ELPP_CXX0X || ELPP_CXX11)) +# error "Easylogging++ 9.0+ is only compatible with C++0x (or higher) compliant compiler" +#endif // (!(ELPP_CXX0X || ELPP_CXX11)) +// Headers +#if defined(ELPP_SYSLOG) +# include +#endif // defined(ELPP_SYSLOG) +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(ELPP_UNICODE) +# include +# if ELPP_OS_WINDOWS +# include +# endif // ELPP_OS_WINDOWS +#endif // defined(ELPP_UNICODE) +#if ELPP_STACKTRACE +# include +# include +#endif // ELPP_STACKTRACE +#if ELPP_OS_ANDROID +# include +#endif // ELPP_OS_ANDROID +#if ELPP_OS_UNIX +# include +# include +#elif ELPP_OS_WINDOWS +# include +# include +# if defined(WIN32_LEAN_AND_MEAN) +# if defined(ELPP_WINSOCK2) +# include +# else +# include +# endif // defined(ELPP_WINSOCK2) +# endif // defined(WIN32_LEAN_AND_MEAN) +#endif // ELPP_OS_UNIX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if ELPP_THREADING_ENABLED +# if ELPP_USE_STD_THREADING +# include +# include +# else +# if ELPP_OS_UNIX +# include +# endif // ELPP_OS_UNIX +# endif // ELPP_USE_STD_THREADING +#endif // ELPP_THREADING_ENABLED +#if ELPP_ASYNC_LOGGING +# include +# include +# include +#endif // ELPP_ASYNC_LOGGING +#if defined(ELPP_STL_LOGGING) +// For logging STL based templates +# include +# include +# include +# include +# include +# include +# if defined(ELPP_LOG_STD_ARRAY) +# include +# endif // defined(ELPP_LOG_STD_ARRAY) +# if defined(ELPP_LOG_UNORDERED_MAP) +# include +# endif // defined(ELPP_LOG_UNORDERED_MAP) +# if defined(ELPP_LOG_UNORDERED_SET) +# include +# endif // defined(ELPP_UNORDERED_SET) +#endif // defined(ELPP_STL_LOGGING) +#if defined(ELPP_QT_LOGGING) +// For logging Qt based classes & templates +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // defined(ELPP_QT_LOGGING) +#if defined(ELPP_BOOST_LOGGING) +// For logging boost based classes & templates +# include +# include +# include +# include +# include +# include +# include +# include +#endif // defined(ELPP_BOOST_LOGGING) +#if defined(ELPP_WXWIDGETS_LOGGING) +// For logging wxWidgets based classes & templates +# include +#endif // defined(ELPP_WXWIDGETS_LOGGING) +// Forward declarations +namespace el { + class Logger; + class LogMessage; + class PerformanceTrackingData; + class Loggers; + class Helpers; + template class Callback; + class LogDispatchCallback; + class PerformanceTrackingCallback; + class LogDispatchData; + namespace base { + class Storage; + class RegisteredLoggers; + class PerformanceTracker; + class MessageBuilder; + class Writer; + class PErrorWriter; + class LogDispatcher; + class DefaultLogBuilder; + class DefaultLogDispatchCallback; +#if ELPP_ASYNC_LOGGING + class AsyncLogDispatchCallback; + class AsyncDispatchWorker; +#endif // ELPP_ASYNC_LOGGING + class DefaultPerformanceTrackingCallback; + } // namespace base +} // namespace el + /// @brief Easylogging++ entry namespace +namespace el { + /// @brief Namespace containing base/internal functionality used by Easylogging++ + namespace base { + /// @brief Data types used by Easylogging++ + namespace type { +#undef ELPP_LITERAL +#undef ELPP_STRLEN +#undef ELPP_COUT +#if defined(ELPP_UNICODE) +# define ELPP_LITERAL(txt) L##txt +# define ELPP_STRLEN wcslen +# if defined ELPP_CUSTOM_COUT +# define ELPP_COUT ELPP_CUSTOM_COUT +# else +# define ELPP_COUT std::wcout +# endif // defined ELPP_CUSTOM_COUT + typedef wchar_t char_t; + typedef std::wstring string_t; + typedef std::wstringstream stringstream_t; + typedef std::wfstream fstream_t; + typedef std::wostream ostream_t; +#else +# define ELPP_LITERAL(txt) txt +# define ELPP_STRLEN strlen +# if defined ELPP_CUSTOM_COUT +# define ELPP_COUT ELPP_CUSTOM_COUT +# else +# define ELPP_COUT std::cout +# endif // defined ELPP_CUSTOM_COUT + typedef char char_t; + typedef std::string string_t; + typedef std::stringstream stringstream_t; + typedef std::fstream fstream_t; + typedef std::ostream ostream_t; +#endif // defined(ELPP_UNICODE) +#if defined(ELPP_CUSTOM_COUT_LINE) +# define ELPP_COUT_LINE(logLine) ELPP_CUSTOM_COUT_LINE(logLine) +#else +# define ELPP_COUT_LINE(logLine) logLine << std::flush +#endif // defined(ELPP_CUSTOM_COUT_LINE) + typedef unsigned short EnumType; + typedef std::shared_ptr StoragePointer; + typedef int VerboseLevel; + typedef std::shared_ptr LogDispatchCallbackPtr; + typedef std::shared_ptr PerformanceTrackingCallbackPtr; + } // namespace type + /// @brief Internal helper class that prevent copy constructor for class + /// + /// @detail When using this class simply inherit it privately + class NoCopy { + protected: + NoCopy(void) {} + private: + NoCopy(const NoCopy&); + NoCopy& operator=(const NoCopy&); + }; + /// @brief Internal helper class that makes all default constructors private. + /// + /// @detail This prevents initializing class making it static unless an explicit constructor is declared. + /// When using this class simply inherit it privately + class StaticClass { + private: + StaticClass(void); + StaticClass(const StaticClass&); + StaticClass& operator=(const StaticClass&); + }; + } // namespace base + /// @brief Represents enumeration for severity level used to determine level of logging + /// + /// @detail With Easylogging++, developers may disable or enable any level regardless of + /// what the severity is. Or they can choose to log using hierarchical logging flag + enum class Level : base::type::EnumType { + /// @brief Generic level that represents all the levels. Useful when setting global configuration for all levels + Global = 1, + /// @brief Information that can be useful to back-trace certain events - mostly useful than debug logs. + Trace = 2, + /// @brief Informational events most useful for developers to debug application + Debug = 4, + /// @brief Severe error information that will presumably abort application + Fatal = 8, + /// @brief Information representing errors in application but application will keep running + Error = 16, + /// @brief Useful when application has potentially harmful situtaions + Warning = 32, + /// @brief Information that can be highly useful and vary with verbose logging level. + Verbose = 64, + /// @brief Mainly useful to represent current progress of application + Info = 128, + /// @brief Represents unknown level + Unknown = 1010 + }; + /// @brief Static class that contains helper functions for el::Level + class LevelHelper : base::StaticClass { + public: + /// @brief Represents minimum valid level. Useful when iterating through enum. + static const base::type::EnumType kMinValid = static_cast(Level::Trace); + /// @brief Represents maximum valid level. This is used internally and you should not need it. + static const base::type::EnumType kMaxValid = static_cast(Level::Info); + /// @brief Casts level to int, useful for iterating through enum. + static base::type::EnumType castToInt(Level level) { + return static_cast(level); + } + /// @brief Casts int(ushort) to level, useful for iterating through enum. + static Level castFromInt(base::type::EnumType l) { + return static_cast(l); + } + /// @brief Converts level to associated const char* + /// @return Upper case string based level. + static const char* convertToString(Level level) { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (level == Level::Global) return "GLOBAL"; + if (level == Level::Debug) return "DEBUG"; + if (level == Level::Info) return "INFO"; + if (level == Level::Warning) return "WARNING"; + if (level == Level::Error) return "ERROR"; + if (level == Level::Fatal) return "FATAL"; + if (level == Level::Verbose) return "VERBOSE"; + if (level == Level::Trace) return "TRACE"; + return "UNKNOWN"; + } + /// @brief Converts from levelStr to Level + /// @param levelStr Upper case string based level. + /// Lower case is also valid but providing upper case is recommended. + static Level convertFromString(const char* levelStr) { + if ((strcmp(levelStr, "GLOBAL") == 0) || (strcmp(levelStr, "global") == 0)) + return Level::Global; + if ((strcmp(levelStr, "DEBUG") == 0) || (strcmp(levelStr, "debug") == 0)) + return Level::Debug; + if ((strcmp(levelStr, "INFO") == 0) || (strcmp(levelStr, "info") == 0)) + return Level::Info; + if ((strcmp(levelStr, "WARNING") == 0) || (strcmp(levelStr, "warning") == 0)) + return Level::Warning; + if ((strcmp(levelStr, "ERROR") == 0) || (strcmp(levelStr, "error") == 0)) + return Level::Error; + if ((strcmp(levelStr, "FATAL") == 0) || (strcmp(levelStr, "fatal") == 0)) + return Level::Fatal; + if ((strcmp(levelStr, "VERBOSE") == 0) || (strcmp(levelStr, "verbose") == 0)) + return Level::Verbose; + if ((strcmp(levelStr, "TRACE") == 0) || (strcmp(levelStr, "trace") == 0)) + return Level::Trace; + return Level::Unknown; + } + /// @brief Applies specified function to each level starting from startIndex + /// @param startIndex initial value to start the iteration from. This is passed as pointer and + /// is left-shifted so this can be used inside function (fn) to represent current level. + /// @param fn function to apply with each level. This bool represent whether or not to stop iterating through levels. + static inline void forEachLevel(base::type::EnumType* startIndex, const std::function& fn) { + base::type::EnumType lIndexMax = LevelHelper::kMaxValid; + do { + if (fn()) { + break; + } + *startIndex = static_cast(*startIndex << 1); + } while (*startIndex <= lIndexMax); + } + }; + /// @brief Represents enumeration of ConfigurationType used to configure or access certain aspect + /// of logging + enum class ConfigurationType : base::type::EnumType { + /// @brief Determines whether or not corresponding level and logger of logging is enabled + /// You may disable all logs by using el::Level::Global + Enabled = 1, + /// @brief Whether or not to write corresponding log to log file + ToFile = 2, + /// @brief Whether or not to write corresponding level and logger log to standard output. + /// By standard output meaning termnal, command prompt etc + ToStandardOutput = 4, + /// @brief Determines format of logging corresponding level and logger. + Format = 8, + /// @brief Determines log file (full path) to write logs to for correponding level and logger + Filename = 16, + /// @brief Specifies milliseconds width. Width can be within range (1-6) + MillisecondsWidth = 32, + /// @brief Determines whether or not performance tracking is enabled. + /// + /// @detail This does not depend on logger or level. Performance tracking always uses 'performance' logger + PerformanceTracking = 64, + /// @brief Specifies log file max size. + /// + /// @detail If file size of corresponding log file (for corresponding level) is >= specified size, log file will + /// be truncated and re-initiated. + MaxLogFileSize = 128, + /// @brief Specifies number of log entries to hold until we flush pending log data + LogFlushThreshold = 256, + /// @brief Represents unknown configuration + Unknown = 1010 + }; + /// @brief Static class that contains helper functions for el::ConfigurationType + class ConfigurationTypeHelper : base::StaticClass { + public: + /// @brief Represents minimum valid configuration type. Useful when iterating through enum. + static const base::type::EnumType kMinValid = static_cast(ConfigurationType::Enabled); + /// @brief Represents maximum valid configuration type. This is used internally and you should not need it. + static const base::type::EnumType kMaxValid = static_cast(ConfigurationType::MaxLogFileSize); + /// @brief Casts configuration type to int, useful for iterating through enum. + static base::type::EnumType castToInt(ConfigurationType configurationType) { + return static_cast(configurationType); + } + /// @brief Casts int(ushort) to configurationt type, useful for iterating through enum. + static ConfigurationType castFromInt(base::type::EnumType c) { + return static_cast(c); + } + /// @brief Converts configuration type to associated const char* + /// @returns Upper case string based configuration type. + static const char* convertToString(ConfigurationType configurationType) { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (configurationType == ConfigurationType::Enabled) return "ENABLED"; + if (configurationType == ConfigurationType::Filename) return "FILENAME"; + if (configurationType == ConfigurationType::Format) return "FORMAT"; + if (configurationType == ConfigurationType::ToFile) return "TO_FILE"; + if (configurationType == ConfigurationType::ToStandardOutput) return "TO_STANDARD_OUTPUT"; + if (configurationType == ConfigurationType::MillisecondsWidth) return "MILLISECONDS_WIDTH"; + if (configurationType == ConfigurationType::PerformanceTracking) return "PERFORMANCE_TRACKING"; + if (configurationType == ConfigurationType::MaxLogFileSize) return "MAX_LOG_FILE_SIZE"; + if (configurationType == ConfigurationType::LogFlushThreshold) return "LOG_FLUSH_THRESHOLD"; + return "UNKNOWN"; + } + /// @brief Converts from configStr to ConfigurationType + /// @param configStr Upper case string based configuration type. + /// Lower case is also valid but providing upper case is recommended. + static ConfigurationType convertFromString(const char* configStr) { + if ((strcmp(configStr, "ENABLED") == 0) || (strcmp(configStr, "enabled") == 0)) + return ConfigurationType::Enabled; + if ((strcmp(configStr, "TO_FILE") == 0) || (strcmp(configStr, "to_file") == 0)) + return ConfigurationType::ToFile; + if ((strcmp(configStr, "TO_STANDARD_OUTPUT") == 0) || (strcmp(configStr, "to_standard_output") == 0)) + return ConfigurationType::ToStandardOutput; + if ((strcmp(configStr, "FORMAT") == 0) || (strcmp(configStr, "format") == 0)) + return ConfigurationType::Format; + if ((strcmp(configStr, "FILENAME") == 0) || (strcmp(configStr, "filename") == 0)) + return ConfigurationType::Filename; + if ((strcmp(configStr, "MILLISECONDS_WIDTH") == 0) || (strcmp(configStr, "milliseconds_width") == 0)) + return ConfigurationType::MillisecondsWidth; + if ((strcmp(configStr, "PERFORMANCE_TRACKING") == 0) || (strcmp(configStr, "performance_tracking") == 0)) + return ConfigurationType::PerformanceTracking; + if ((strcmp(configStr, "MAX_LOG_FILE_SIZE") == 0) || (strcmp(configStr, "max_log_file_size") == 0)) + return ConfigurationType::MaxLogFileSize; + if ((strcmp(configStr, "LOG_FLUSH_THRESHOLD") == 0) || (strcmp(configStr, "log_flush_threshold") == 0)) + return ConfigurationType::LogFlushThreshold; + return ConfigurationType::Unknown; + } + /// @brief Applies specified function to each configuration type starting from startIndex + /// @param startIndex initial value to start the iteration from. This is passed by pointer and is left-shifted + /// so this can be used inside function (fn) to represent current configuration type. + /// @param fn function to apply with each configuration type. + /// This bool represent whether or not to stop iterating through configurations. + static inline void forEachConfigType(base::type::EnumType* startIndex, const std::function& fn) { + base::type::EnumType cIndexMax = ConfigurationTypeHelper::kMaxValid; + do { + if (fn()) { + break; + } + *startIndex = static_cast(*startIndex << 1); + } while (*startIndex <= cIndexMax); + } + }; + /// @brief Flags used while writing logs. This flags are set by user + enum class LoggingFlag : base::type::EnumType { + /// @brief Makes sure we have new line for each container log entry + NewLineForContainer = 1, + /// @brief Makes sure if -vmodule is used and does not specifies a module, then verbose + /// logging is allowed via that module. + AllowVerboseIfModuleNotSpecified = 2, + /// @brief When handling crashes by default, detailed crash reason will be logged as well + LogDetailedCrashReason = 4, + /// @brief Allows to disable application abortion when logged using FATAL level + DisableApplicationAbortOnFatalLog = 8, + /// @brief Flushes log with every log-entry (performance sensative) - Disabled by default + ImmediateFlush = 16, + /// @brief Enables strict file rolling + StrictLogFileSizeCheck = 32, + /// @brief Make terminal output colorful for supported terminals + ColoredTerminalOutput = 64, + /// @brief Supports use of multiple logging in same macro, e.g, CLOG(INFO, "default", "network") + MultiLoggerSupport = 128, + /// @brief Disables comparing performance tracker's checkpoints + DisablePerformanceTrackingCheckpointComparison = 256, + /// @brief Disable VModules + DisableVModules = 512, + /// @brief Disable VModules extensions + DisableVModulesExtensions = 1024, + /// @brief Enables hierarchical logging + HierarchicalLogging = 2048, + /// @brief Creates logger automatically when not available + CreateLoggerAutomatically = 4096, + /// @brief Adds spaces b/w logs that separated by left-shift operator + AutoSpacing = 8192, + /// @brief Preserves time format and does not convert it to sec, hour etc (performance tracking only) + FixedTimeFormat = 16384 + }; + namespace base { + /// @brief Namespace containing constants used internally. + namespace consts { + // Level log values - These are values that are replaced in place of %level format specifier + static const base::type::char_t* kInfoLevelLogValue = ELPP_LITERAL("INFO "); + static const base::type::char_t* kDebugLevelLogValue = ELPP_LITERAL("DEBUG"); + static const base::type::char_t* kWarningLevelLogValue = ELPP_LITERAL("WARN "); + static const base::type::char_t* kErrorLevelLogValue = ELPP_LITERAL("ERROR"); + static const base::type::char_t* kFatalLevelLogValue = ELPP_LITERAL("FATAL"); + static const base::type::char_t* kVerboseLevelLogValue = ELPP_LITERAL("VER"); + static const base::type::char_t* kTraceLevelLogValue = ELPP_LITERAL("TRACE"); + static const base::type::char_t* kInfoLevelShortLogValue = ELPP_LITERAL("I"); + static const base::type::char_t* kDebugLevelShortLogValue = ELPP_LITERAL("D"); + static const base::type::char_t* kWarningLevelShortLogValue = ELPP_LITERAL("W"); + static const base::type::char_t* kErrorLevelShortLogValue = ELPP_LITERAL("E"); + static const base::type::char_t* kFatalLevelShortLogValue = ELPP_LITERAL("F"); + static const base::type::char_t* kVerboseLevelShortLogValue = ELPP_LITERAL("V"); + static const base::type::char_t* kTraceLevelShortLogValue = ELPP_LITERAL("T"); + // Format specifiers - These are used to define log format + static const base::type::char_t* kAppNameFormatSpecifier = ELPP_LITERAL("%app"); + static const base::type::char_t* kLoggerIdFormatSpecifier = ELPP_LITERAL("%logger"); + static const base::type::char_t* kThreadIdFormatSpecifier = ELPP_LITERAL("%thread"); + static const base::type::char_t* kSeverityLevelFormatSpecifier = ELPP_LITERAL("%level"); + static const base::type::char_t* kSeverityLevelShortFormatSpecifier = ELPP_LITERAL("%levshort"); + static const base::type::char_t* kDateTimeFormatSpecifier = ELPP_LITERAL("%datetime"); + static const base::type::char_t* kLogFileFormatSpecifier = ELPP_LITERAL("%file"); + static const base::type::char_t* kLogFileBaseFormatSpecifier = ELPP_LITERAL("%fbase"); + static const base::type::char_t* kLogLineFormatSpecifier = ELPP_LITERAL("%line"); + static const base::type::char_t* kLogLocationFormatSpecifier = ELPP_LITERAL("%loc"); + static const base::type::char_t* kLogFunctionFormatSpecifier = ELPP_LITERAL("%func"); + static const base::type::char_t* kCurrentUserFormatSpecifier = ELPP_LITERAL("%user"); + static const base::type::char_t* kCurrentHostFormatSpecifier = ELPP_LITERAL("%host"); + static const base::type::char_t* kMessageFormatSpecifier = ELPP_LITERAL("%msg"); + static const base::type::char_t* kVerboseLevelFormatSpecifier = ELPP_LITERAL("%vlevel"); + static const char* kDateTimeFormatSpecifierForFilename = "%datetime"; + // Date/time + static const char* kDays[7] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; + static const char* kDaysAbbrev[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + static const char* kMonths[12] = { "January", "February", "March", "Apri", "May", "June", "July", "August", + "September", "October", "November", "December" }; + static const char* kMonthsAbbrev[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char* kDefaultDateTimeFormat = "%Y-%M-%d %H:%m:%s,%g"; + static const char* kDefaultDateTimeFormatInFilename = "%Y-%M-%d_%H-%m"; + static const int kYearBase = 1900; + static const char* kAm = "AM"; + static const char* kPm = "PM"; + // Miscellaneous constants + static const char* kDefaultLoggerId = "default"; + static const char* kPerformanceLoggerId = "performance"; + static const char* kSysLogLoggerId = "syslog"; + static const char* kNullPointer = "nullptr"; + static const char kFormatSpecifierChar = '%'; +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + static const char kFormatSpecifierCharValue = 'v'; +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + static const unsigned int kMaxLogPerContainer = 100; + static const unsigned int kMaxLogPerCounter = 100000; + static const unsigned int kDefaultMillisecondsWidth = 3; + static const base::type::VerboseLevel kMaxVerboseLevel = 9; + static const char* kUnknownUser = "user"; + static const char* kUnknownHost = "unknown-host"; +#if defined(ELPP_DEFAULT_LOG_FILE) + static const char* kDefaultLogFile = ELPP_DEFAULT_LOG_FILE; +#else +# if ELPP_OS_UNIX +# if ELPP_OS_ANDROID + static const char* kDefaultLogFile = "logs/ace.log"; +# else + static const char* kDefaultLogFile = "logs/ace.log"; +# endif // ELPP_OS_ANDROID +# elif ELPP_OS_WINDOWS + static const char* kDefaultLogFile = "logs\\ace.log"; +# endif // ELPP_OS_UNIX +#endif // defined(ELPP_DEFAULT_LOG_FILE) +#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) + static const char* kDefaultLogFileParam = "--default-log-file"; +#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) +#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) + static const char* kLoggingFlagsParam = "--logging-flags"; +#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) +#if ELPP_OS_WINDOWS + static const char* kFilePathSeperator = "\\"; +#else + static const char* kFilePathSeperator = "/"; +#endif // ELPP_OS_WINDOWS + static const char* kValidLoggerIdSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._"; + static const char* kConfigurationComment = "##"; + static const char* kConfigurationLevel = "*"; + static const char* kConfigurationLoggerId = "--"; + static const std::size_t kSourceFilenameMaxLength = 100; + static const std::size_t kSourceLineMaxLength = 10; + static const Level kPerformanceTrackerDefaultLevel = Level::Info; + const struct { + double value; + const base::type::char_t* unit; + } kTimeFormats[] = { + { 1000.0f, ELPP_LITERAL("mis") }, + { 1000.0f, ELPP_LITERAL("ms") }, + { 60.0f, ELPP_LITERAL("seconds") }, + { 60.0f, ELPP_LITERAL("minutes") }, + { 24.0f, ELPP_LITERAL("hours") }, + { 7.0f, ELPP_LITERAL("days") } + }; + static const int kTimeFormatsCount = sizeof(kTimeFormats) / sizeof(kTimeFormats[0]); + const struct { + int numb; + const char* name; + const char* brief; + const char* detail; + } kCrashSignals[] = { + // NOTE: Do not re-order, if you do please check CrashHandler(bool) constructor and CrashHandler::setHandler(..) + { SIGABRT, "SIGABRT", "Abnormal termination", + "Program was abnormally terminated." }, + { SIGFPE, "SIGFPE", "Erroneous arithmetic operation", + "Arithemetic operation issue such as division by zero or operation resulting in overflow." }, + { SIGILL, "SIGILL", "Illegal instruction", + "Generally due to a corruption in the code or to an attempt to execute data." }, + { SIGSEGV, "SIGSEGV", "Invalid access to memory", + "Program is trying to read an invalid (unallocated, deleted or corrupted) or inaccessible memory." }, + { SIGINT, "SIGINT", "Interactive attention signal", + "Interruption generated (generally) by user or operating system." }, + }; + static const int kCrashSignalsCount = sizeof(kCrashSignals) / sizeof(kCrashSignals[0]); + } // namespace consts + } // namespace base + typedef std::function PreRollOutCallback; + namespace base { + static inline void defaultPreRollOutCallback(const char*, std::size_t) {} + /// @brief Enum to represent timestamp unit + enum class TimestampUnit : base::type::EnumType { + Microsecond = 0, Millisecond = 1, Second = 2, Minute = 3, Hour = 4, Day = 5 + }; + /// @brief Format flags used to determine specifiers that are active for performance improvements. + enum class FormatFlags : base::type::EnumType { + DateTime = 1 << 1, LoggerId = 1 << 2, File = 1 << 3, Line = 1 << 4, Location = 1 << 5, Function = 1 << 6, + User = 1 << 7, Host = 1 << 8, LogMessage = 1 << 9, VerboseLevel = 1 << 10, AppName = 1 << 11, ThreadId = 1 << 12, + Level = 1 << 13, FileBase = 1 << 14, LevelShort = 1 << 15 + }; + /// @brief A milliseconds width class containing actual width and offset for date/time + class MillisecondsWidth { + public: + MillisecondsWidth(void) { init(base::consts::kDefaultMillisecondsWidth); } + explicit MillisecondsWidth(int width) { init(width); } + bool operator==(const MillisecondsWidth& msWidth) { return m_width == msWidth.m_width && m_offset == msWidth.m_offset; } + int m_width; unsigned int m_offset; + private: + void init(int width) { + if (width < 1 || width > 6) { + width = base::consts::kDefaultMillisecondsWidth; + } + m_width = width; + switch (m_width) { + case 3: m_offset = 1000; break; + case 4: m_offset = 100; break; + case 5: m_offset = 10; break; + case 6: m_offset = 1; break; + default: m_offset = 1000; break; + } + } + }; + /// @brief Namespace containing utility functions/static classes used internally + namespace utils { + /// @brief Deletes memory safely and points to null + template + static inline + typename std::enable_if::value, void>::type + safeDelete(T*& pointer) { + if (pointer == nullptr) + return; + delete pointer; + pointer = nullptr; + } + /// @brief Gets value of const char* but if it is nullptr, a string nullptr is returned + static inline const char* charPtrVal(const char* pointer) { + return pointer == nullptr ? base::consts::kNullPointer : pointer; + } + /// @brief Aborts application due with user-defined status + static inline void abort(int status, const std::string& reason = std::string()) { + // Both status and reason params are there for debugging with tools like gdb etc + ELPP_UNUSED(status); + ELPP_UNUSED(reason); +#if defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) + // Ignore msvc critical error dialog - break instead (on debug mode) + _asm int 3 +#else + ::abort(); +#endif // defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) + } + /// @brief Bitwise operations for C++11 strong enum class. This casts e into Flag_T and returns value after bitwise operation + /// Use these function as
flag = bitwise::Or(MyEnum::val1, flag);
+ namespace bitwise { + template + static inline base::type::EnumType And(Enum e, base::type::EnumType flag) { + return static_cast(flag) & static_cast(e); + } + template + static inline base::type::EnumType Not(Enum e, base::type::EnumType flag) { + return static_cast(flag) & ~(static_cast(e)); + } + template + static inline base::type::EnumType Or(Enum e, base::type::EnumType flag) { + return static_cast(flag) | static_cast(e); + } + } // namespace bitwise + template + static inline void addFlag(Enum e, base::type::EnumType* flag) { + *flag = base::utils::bitwise::Or(e, *flag); + } + template + static inline void removeFlag(Enum e, base::type::EnumType* flag) { + *flag = base::utils::bitwise::Not(e, *flag); + } + template + static inline bool hasFlag(Enum e, base::type::EnumType flag) { + return base::utils::bitwise::And(e, flag) > 0x0; + } + } // namespace utils + namespace threading { +#if ELPP_THREADING_ENABLED +# if !ELPP_USE_STD_THREADING + namespace internal { + /// @brief A mutex wrapper for compiler that dont yet support std::mutex + class Mutex : base::NoCopy { + public: + Mutex(void) { +# if ELPP_OS_UNIX + pthread_mutex_init(&m_underlyingMutex, nullptr); +# elif ELPP_OS_WINDOWS + InitializeCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + virtual ~Mutex(void) { +# if ELPP_OS_UNIX + pthread_mutex_destroy(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + DeleteCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline void lock(void) { +# if ELPP_OS_UNIX + pthread_mutex_lock(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + EnterCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline bool try_lock(void) { +# if ELPP_OS_UNIX + return (pthread_mutex_trylock(&m_underlyingMutex) == 0); +# elif ELPP_OS_WINDOWS + return TryEnterCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline void unlock(void) { +# if ELPP_OS_UNIX + pthread_mutex_unlock(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + LeaveCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + private: +# if ELPP_OS_UNIX + pthread_mutex_t m_underlyingMutex; +# elif ELPP_OS_WINDOWS + CRITICAL_SECTION m_underlyingMutex; +# endif // ELPP_OS_UNIX + }; + /// @brief Scoped lock for compiler that dont yet support std::lock_guard + template + class ScopedLock : base::NoCopy { + public: + explicit ScopedLock(M& mutex) { + m_mutex = &mutex; + m_mutex->lock(); + } + + virtual ~ScopedLock(void) { + m_mutex->unlock(); + } + private: + M* m_mutex; + ScopedLock(void); + }; + } // namespace internal + /// @brief Gets ID of currently running threading in windows systems. On unix, nothing is returned. + static inline std::string getCurrentThreadId(void) { + std::stringstream ss; +# if (ELPP_OS_WINDOWS) + ss << GetCurrentThreadId(); +# endif // (ELPP_OS_WINDOWS) + return ss.str(); + } + static inline void msleep(int) { + // No implementation for non std::thread version + } + typedef base::threading::internal::Mutex Mutex; + typedef base::threading::internal::ScopedLock ScopedLock; +# else + /// @brief Gets ID of currently running threading using std::this_thread::get_id() + static inline std::string getCurrentThreadId(void) { + std::stringstream ss; + ss << std::this_thread::get_id(); + return ss.str(); + } + static inline void msleep(int ms) { + // Only when async logging enabled - this is because async is strict on compiler +#if ELPP_ASYNC_LOGGING + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); +#endif // ELPP_ASYNC_LOGGING + } + typedef std::mutex Mutex; + typedef std::lock_guard ScopedLock; +# endif // !ELPP_USE_STD_THREADING +#else + namespace internal { + /// @brief Mutex wrapper used when multi-threading is disabled. + class NoMutex : base::NoCopy { + public: + NoMutex(void) {} + inline void lock(void) {} + inline bool try_lock(void) { return true; } + inline void unlock(void) {} + }; + /// @brief Lock guard wrapper used when multi-threading is disabled. + template + class NoScopedLock : base::NoCopy { + public: + explicit NoScopedLock(Mutex&) { + } + virtual ~NoScopedLock(void) { + } + private: + NoScopedLock(void); + }; + } // namespace internal + static inline std::string getCurrentThreadId(void) { + return std::string(); + } + static inline void msleep(int) { + // No custom implementation + } + typedef base::threading::internal::NoMutex Mutex; + typedef base::threading::internal::NoScopedLock ScopedLock; +#endif // ELPP_THREADING_ENABLED + /// @brief Base of thread safe class, this class is inheritable-only + class ThreadSafe { + public: + virtual inline void acquireLock(void) ELPP_FINAL { m_mutex.lock(); } + virtual inline void releaseLock(void) ELPP_FINAL { m_mutex.unlock(); } + virtual inline base::threading::Mutex& lock(void) ELPP_FINAL { return m_mutex; } + protected: + ThreadSafe(void) {} + virtual ~ThreadSafe(void) {} + private: + base::threading::Mutex m_mutex; + }; + } // namespace threading + namespace utils { + class File : base::StaticClass { + public: + /// @brief Creates new out file stream for specified filename. + /// @return Pointer to newly created fstream or nullptr + static base::type::fstream_t* newFileStream(const std::string& filename) { + base::type::fstream_t *fs = new base::type::fstream_t(filename.c_str(), + base::type::fstream_t::out | base::type::fstream_t::app); +#if defined(ELPP_UNICODE) + std::locale elppUnicodeLocale(""); +#if ELPP_OS_WINDOWS + std::locale elppUnicodeLocaleWindows(elppUnicodeLocale, new std::codecvt_utf8_utf16); + elppUnicodeLocale = elppUnicodeLocaleWindows; +#endif + fs->imbue(elppUnicodeLocale); +#endif // defined(ELPP_UNICODE) + if (fs->is_open()) { + fs->flush(); + } + else { + base::utils::safeDelete(fs); + ELPP_INTERNAL_ERROR("Bad file [" << filename << "]", true); + } + return fs; + } + + /// @brief Gets size of file provided in stream + static std::size_t getSizeOfFile(base::type::fstream_t* fs) { + if (fs == nullptr) { + return 0; + } + std::streampos currPos = fs->tellg(); + fs->seekg(0, fs->end); + std::size_t size = static_cast(fs->tellg()); + fs->seekg(currPos); + return size; + } + + /// @brief Determines whether or not provided path exist in current file system + static inline bool pathExists(const char* path, bool considerFile = false) { + if (path == nullptr) { + return false; + } +#if ELPP_OS_UNIX + ELPP_UNUSED(considerFile); + struct stat st; + return (stat(path, &st) == 0); +#elif ELPP_OS_WINDOWS + DWORD fileType = GetFileAttributesA(path); + if (fileType == INVALID_FILE_ATTRIBUTES) { + return false; + } + return considerFile ? true : ((fileType & FILE_ATTRIBUTE_DIRECTORY) == 0 ? false : true); +#endif // ELPP_OS_UNIX + } + + /// @brief Creates specified path on file system + /// @param path Path to create. + static bool createPath(const std::string& path) { + if (path.empty()) { + return false; + } + if (base::utils::File::pathExists(path.c_str())) { + return true; + } + int status = -1; + + char* currPath = const_cast(path.c_str()); + std::string builtPath = std::string(); +#if ELPP_OS_UNIX + if (path[0] == '/') { + builtPath = "/"; + } + currPath = STRTOK(currPath, base::consts::kFilePathSeperator, 0); +#elif ELPP_OS_WINDOWS + // Use secure functions API + char* nextTok_ = nullptr; + currPath = STRTOK(currPath, base::consts::kFilePathSeperator, &nextTok_); + ELPP_UNUSED(nextTok_); +#endif // ELPP_OS_UNIX + while (currPath != nullptr) { + builtPath.append(currPath); + builtPath.append(base::consts::kFilePathSeperator); +#if ELPP_OS_UNIX + status = mkdir(builtPath.c_str(), ELPP_LOG_PERMS); + currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, 0); +#elif ELPP_OS_WINDOWS + status = _mkdir(builtPath.c_str()); + currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, &nextTok_); +#endif // ELPP_OS_UNIX + } + if (status == -1) { + ELPP_INTERNAL_ERROR("Error while creating path [" << path << "]", true); + return false; + } + return true; + } + /// @brief Extracts path of filename with leading slash + static std::string extractPathFromFilename(const std::string& fullPath, + const char* seperator = base::consts::kFilePathSeperator) { + if ((fullPath == "") || (fullPath.find(seperator) == std::string::npos)) { + return fullPath; + } + std::size_t lastSlashAt = fullPath.find_last_of(seperator); + if (lastSlashAt == 0) { + return std::string(seperator); + } + return fullPath.substr(0, lastSlashAt + 1); + } + /// @brief builds stripped filename and puts it in buff + static void buildStrippedFilename(const char* filename, char buff[], + std::size_t limit = base::consts::kSourceFilenameMaxLength) { + std::size_t sizeOfFilename = strlen(filename); + if (sizeOfFilename >= limit) { + filename += (sizeOfFilename - limit); + if (filename[0] != '.' && filename[1] != '.') { // prepend if not already + filename += 3; // 3 = '..' + STRCAT(buff, "..", limit); + } + } + STRCAT(buff, filename, limit); + } + /// @brief builds base filename and puts it in buff + static void buildBaseFilename(const std::string& fullPath, char buff[], + std::size_t limit = base::consts::kSourceFilenameMaxLength, + const char* seperator = base::consts::kFilePathSeperator) { + const char *filename = fullPath.c_str(); + std::size_t lastSlashAt = fullPath.find_last_of(seperator); + filename += lastSlashAt ? lastSlashAt + 1 : 0; + std::size_t sizeOfFilename = strlen(filename); + if (sizeOfFilename >= limit) { + filename += (sizeOfFilename - limit); + if (filename[0] != '.' && filename[1] != '.') { // prepend if not already + filename += 3; // 3 = '..' + STRCAT(buff, "..", limit); + } + } + STRCAT(buff, filename, limit); + } + }; + /// @brief String utilities helper class used internally. You should not use it. + class Str : base::StaticClass { + public: + /// @brief Checks if character is digit. Dont use libc implementation of it to prevent locale issues. + static inline bool isDigit(char c) { + return c >= '0' && c <= '9'; + } + + /// @brief Matches wildcards, '*' and '?' only supported. + static bool wildCardMatch(const char* str, const char* pattern) { + while (*pattern) { + switch (*pattern) { + case '?': + if (!*str) + return false; + ++str; + ++pattern; + break; + case '*': + if (wildCardMatch(str, pattern + 1)) + return true; + if (*str && wildCardMatch(str + 1, pattern)) + return true; + return false; + break; + default: + if (*str++ != *pattern++) + return false; + break; + } + } + return !*str && !*pattern; + } + + /// @brief Trims string from start + /// @param [in,out] str String to trim + static inline std::string& ltrim(std::string& str) { + str.erase(str.begin(), std::find_if(str.begin(), str.end(), std::not1(std::ptr_fun(&std::isspace)))); + return str; + } + + /// @brief Trim string from end + /// @param [in,out] str String to trim + static inline std::string& rtrim(std::string& str) { + str.erase(std::find_if(str.rbegin(), str.rend(), std::not1(std::ptr_fun(&std::isspace))).base(), str.end()); + return str; + } + + /// @brief Trims string from left and right + /// @param [in,out] str String to trim + static inline std::string& trim(std::string& str) { + return ltrim(rtrim(str)); + } + + /// @brief Determines whether or not str starts with specified string + /// @param str String to check + /// @param start String to check against + /// @return Returns true if starts with specified string, false otherwise + static inline bool startsWith(const std::string& str, const std::string& start) { + return (str.length() >= start.length()) && (str.compare(0, start.length(), start) == 0); + } + + /// @brief Determines whether or not str ends with specified string + /// @param str String to check + /// @param end String to check against + /// @return Returns true if ends with specified string, false otherwise + static inline bool endsWith(const std::string& str, const std::string& end) { + return (str.length() >= end.length()) && (str.compare(str.length() - end.length(), end.length(), end) == 0); + } + + /// @brief Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. + /// @param [in,out] str String to replace from + /// @param replaceWhat Character to replace + /// @param replaceWith Character to replace with + /// @return Modified version of str + static inline std::string& replaceAll(std::string& str, char replaceWhat, char replaceWith) { + std::replace(str.begin(), str.end(), replaceWhat, replaceWith); + return str; + } + + /// @brief Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place + /// @param str String to replace from + /// @param replaceWhat Character to replace + /// @param replaceWith Character to replace with + /// @return Modified (original) str + static inline std::string& replaceAll(std::string& str, const std::string& replaceWhat, // NOLINT + const std::string& replaceWith) { + if (replaceWhat == replaceWith) + return str; + std::size_t foundAt = std::string::npos; + while ((foundAt = str.find(replaceWhat, foundAt + 1)) != std::string::npos) { + str.replace(foundAt, replaceWhat.length(), replaceWith); + } + return str; + } + + static void replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, // NOLINT + const base::type::string_t& replaceWith) { + std::size_t foundAt = base::type::string_t::npos; + while ((foundAt = str.find(replaceWhat, foundAt + 1)) != base::type::string_t::npos) { + if (foundAt > 0 && str[foundAt - 1] == base::consts::kFormatSpecifierChar) { + str.erase(foundAt > 0 ? foundAt - 1 : 0, 1); + ++foundAt; + } + else { + str.replace(foundAt, replaceWhat.length(), replaceWith); + return; + } + } + } +#if defined(ELPP_UNICODE) + static void replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, // NOLINT + const std::string& replaceWith) { + replaceFirstWithEscape(str, replaceWhat, base::type::string_t(replaceWith.begin(), replaceWith.end())); + } +#endif // defined(ELPP_UNICODE) + /// @brief Converts string to uppercase + /// @param str String to convert + /// @return Uppercase string + static inline std::string& toUpper(std::string& str) { + std::transform(str.begin(), str.end(), str.begin(), ::toupper); + return str; + } + + /// @brief Compares cstring equality - uses strcmp + static inline bool cStringEq(const char* s1, const char* s2) { + if (s1 == nullptr && s2 == nullptr) return true; + if (s1 == nullptr || s2 == nullptr) return false; + return strcmp(s1, s2) == 0; + } + + /// @brief Compares cstring equality (case-insensitive) - uses toupper(char) + /// Dont use strcasecmp because of CRT (VC++) + static bool cStringCaseEq(const char* s1, const char* s2) { + if (s1 == nullptr && s2 == nullptr) return true; + if (s1 == nullptr || s2 == nullptr) return false; + if (strlen(s1) != strlen(s2)) return false; + while (*s1 != '\0' && *s2 != '\0') { + if (::toupper(*s1) != ::toupper(*s2)) return false; + ++s1; + ++s2; + } + return true; + } + + /// @brief Returns true if c exist in str + static inline bool contains(const char* str, char c) { + for (; *str; ++str) { + if (*str == c) + return true; + } + return false; + } + + static inline char* convertAndAddToBuff(std::size_t n, int len, char* buf, const char* bufLim, bool zeroPadded = true) { + char localBuff[10] = ""; + char* p = localBuff + sizeof(localBuff) - 2; + if (n > 0) { + for (; n > 0 && p > localBuff && len > 0; n /= 10, --len) + *--p = static_cast(n % 10 + '0'); + } + else { + *--p = '0'; + --len; + } + if (zeroPadded) + while (p > localBuff && len-- > 0) *--p = static_cast('0'); + return addToBuff(p, buf, bufLim); + } + + static inline char* addToBuff(const char* str, char* buf, const char* bufLim) { + while ((buf < bufLim) && ((*buf = *str++) != '\0')) + ++buf; + return buf; + } + + static inline char* clearBuff(char buff[], std::size_t lim) { + STRCPY(buff, "", lim); + ELPP_UNUSED(lim); // For *nix we dont have anything using lim in above STRCPY macro + return buff; + } + + /// @brief Converst wchar* to char* + /// NOTE: Need to free return value after use! + static char* wcharPtrToCharPtr(const wchar_t* line) { + std::size_t len_ = wcslen(line) + 1; + char* buff_ = static_cast(malloc(len_ + 1)); +# if ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) + std::wcstombs(buff_, line, len_); +# elif ELPP_OS_WINDOWS + std::size_t convCount_ = 0; + mbstate_t mbState_; + ::memset(static_cast(&mbState_), 0, sizeof(mbState_)); + wcsrtombs_s(&convCount_, buff_, len_, &line, len_, &mbState_); +# endif // ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) + return buff_; + } + }; + /// @brief Operating System helper static class used internally. You should not use it. + class OS : base::StaticClass { + public: +#if ELPP_OS_WINDOWS + /// @brief Gets environment variables for Windows based OS. + /// We are not using getenv(const char*) because of CRT deprecation + /// @param varname Variable name to get environment variable value for + /// @return If variable exist the value of it otherwise nullptr + static const char* getWindowsEnvironmentVariable(const char* varname) { + const DWORD bufferLen = 50; + static char buffer[bufferLen]; + if (GetEnvironmentVariableA(varname, buffer, bufferLen)) { + return buffer; + } + return nullptr; + } +#endif // ELPP_OS_WINDOWS +#if ELPP_OS_ANDROID + /// @brief Reads android property value + static inline std::string getProperty(const char* prop) { + char propVal[PROP_VALUE_MAX + 1]; + int ret = __system_property_get(prop, propVal); + return ret == 0 ? std::string() : std::string(propVal); + } + + /// @brief Reads android device name + static std::string getDeviceName(void) { + std::stringstream ss; + std::string manufacturer = getProperty("ro.product.manufacturer"); + std::string model = getProperty("ro.product.model"); + if (manufacturer.empty() || model.empty()) { + return std::string(); + } + ss << manufacturer << "-" << model; + return ss.str(); + } +#endif // ELPP_OS_ANDROID + + /// @brief Runs command on terminal and returns the output. + /// + /// @detail This is applicable only on unix based systems, for all other OS, an empty string is returned. + /// @param command Bash command + /// @return Result of bash output or empty string if no result found. + static const std::string getBashOutput(const char* command) { +#if (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) + if (command == nullptr) { + return std::string(); + } + FILE* proc = nullptr; + if ((proc = popen(command, "r")) == nullptr) { + ELPP_INTERNAL_ERROR("\nUnable to run command [" << command << "]", true); + return std::string(); + } + char hBuff[4096]; + if (fgets(hBuff, sizeof(hBuff), proc) != nullptr) { + pclose(proc); + if (hBuff[strlen(hBuff) - 1] == '\n') { + hBuff[strlen(hBuff) - 1] = '\0'; + } + return std::string(hBuff); + } + return std::string(); +#else + ELPP_UNUSED(command); + return std::string(); +#endif // (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) + } + + /// @brief Gets environment variable. This is cross-platform and CRT safe (for VC++) + /// @param variableName Environment variable name + /// @param defaultVal If no environment variable or value found the value to return by default + /// @param alternativeBashCommand If environment variable not found what would be alternative bash command + /// in order to look for value user is looking for. E.g, for 'user' alternative command will 'whoami' + static std::string getEnvironmentVariable(const char* variableName, const char* defaultVal, const char* alternativeBashCommand = nullptr) { +#if ELPP_OS_UNIX + const char* val = getenv(variableName); +#elif ELPP_OS_WINDOWS + const char* val = getWindowsEnvironmentVariable(variableName); +#endif // ELPP_OS_UNIX + if ((val == nullptr) || ((strcmp(val, "") == 0))) { +#if ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) + // Try harder on unix-based systems + std::string valBash = base::utils::OS::getBashOutput(alternativeBashCommand); + if (valBash.empty()) { + return std::string(defaultVal); + } + else { + return valBash; + } +#elif ELPP_OS_WINDOWS || ELPP_OS_UNIX + ELPP_UNUSED(alternativeBashCommand); + return std::string(defaultVal); +#endif // ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) + } + return std::string(val); + } + /// @brief Gets current username. + static inline std::string currentUser(void) { +#if ELPP_OS_UNIX && !ELPP_OS_ANDROID + return getEnvironmentVariable("USER", base::consts::kUnknownUser, "whoami"); +#elif ELPP_OS_WINDOWS + return getEnvironmentVariable("USERNAME", base::consts::kUnknownUser); +#elif ELPP_OS_ANDROID + ELPP_UNUSED(base::consts::kUnknownUser); + return std::string("android"); +#else + return std::string(); +#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID + } + + /// @brief Gets current host name or computer name. + /// + /// @detail For android systems this is device name with its manufacturer and model seperated by hyphen + static inline std::string currentHost(void) { +#if ELPP_OS_UNIX && !ELPP_OS_ANDROID + return getEnvironmentVariable("HOSTNAME", base::consts::kUnknownHost, "hostname"); +#elif ELPP_OS_WINDOWS + return getEnvironmentVariable("COMPUTERNAME", base::consts::kUnknownHost); +#elif ELPP_OS_ANDROID + ELPP_UNUSED(base::consts::kUnknownHost); + return getDeviceName(); +#else + return std::string(); +#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID + } + /// @brief Whether or not terminal supports colors + static inline bool termSupportsColor(void) { + std::string term = getEnvironmentVariable("TERM", ""); + return term == "xterm" || term == "xterm-color" || term == "xterm-256color" || + term == "screen" || term == "linux" || term == "cygwin"; + } + }; + extern std::string s_currentUser; + extern std::string s_currentHost; + extern bool s_termSupportsColor; +#define ELPP_INITI_BASIC_DECLR \ + namespace el {\ + namespace base {\ + namespace utils {\ + std::string s_currentUser = el::base::utils::OS::currentUser(); \ + std::string s_currentHost = el::base::utils::OS::currentHost(); \ + bool s_termSupportsColor = el::base::utils::OS::termSupportsColor(); \ + }\ + }\ + } + /// @brief Contains utilities for cross-platform date/time. This class make use of el::base::utils::Str + class DateTime : base::StaticClass { + public: + /// @brief Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond. + /// + /// @detail For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is provided + /// @param [in,out] tv Pointer that gets updated + static void gettimeofday(struct timeval* tv) { +#if ELPP_OS_WINDOWS + if (tv != nullptr) { +# if ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) + const unsigned __int64 delta_ = 11644473600000000Ui64; +# else + const unsigned __int64 delta_ = 11644473600000000ULL; +# endif // ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) + const double secOffSet = 0.000001; + const unsigned long usecOffSet = 1000000; + FILETIME fileTime; + GetSystemTimeAsFileTime(&fileTime); + unsigned __int64 present = 0; + present |= fileTime.dwHighDateTime; + present = present << 32; + present |= fileTime.dwLowDateTime; + present /= 10; // mic-sec + // Subtract the difference + present -= delta_; + tv->tv_sec = static_cast(present * secOffSet); + tv->tv_usec = static_cast(present % usecOffSet); + } +#else + ::gettimeofday(tv, nullptr); +#endif // ELPP_OS_WINDOWS + } + + /// @brief Gets current date and time with milliseconds. + /// @param format User provided date/time format + /// @param msWidth A pointer to base::MillisecondsWidth from configuration (non-null) + /// @returns string based date time in specified format. + static inline std::string getDateTime(const char* format, const base::MillisecondsWidth* msWidth) { + struct timeval currTime; + gettimeofday(&currTime); + struct ::tm timeInfo; + buildTimeInfo(&currTime, &timeInfo); + const int kBuffSize = 30; + char buff_[kBuffSize] = ""; + parseFormat(buff_, kBuffSize, format, &timeInfo, static_cast(currTime.tv_usec / msWidth->m_offset), msWidth); + return std::string(buff_); + } + + /// @brief Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc + static base::type::string_t formatTime(unsigned long long time, base::TimestampUnit timestampUnit) { + double result = static_cast(time); + base::type::EnumType start = static_cast(timestampUnit); + const base::type::char_t* unit = base::consts::kTimeFormats[start].unit; + for (base::type::EnumType i = start; i < base::consts::kTimeFormatsCount - 1; ++i) { + if (result <= base::consts::kTimeFormats[i].value) { + break; + } + result /= base::consts::kTimeFormats[i].value; + unit = base::consts::kTimeFormats[i + 1].unit; + } + base::type::stringstream_t ss; + ss << result << " " << unit; + return ss.str(); + } + + /// @brief Gets time difference in milli/micro second depending on timestampUnit + static inline unsigned long long getTimeDifference(const struct timeval& endTime, const struct timeval& startTime, base::TimestampUnit timestampUnit) { + if (timestampUnit == base::TimestampUnit::Microsecond) { + return static_cast(static_cast(1000000 * endTime.tv_sec + endTime.tv_usec) - + static_cast(1000000 * startTime.tv_sec + startTime.tv_usec)); + } + else { + return static_cast((((endTime.tv_sec - startTime.tv_sec) * 1000000) + (endTime.tv_usec - startTime.tv_usec)) / 1000); + } + } + + private: + static inline struct ::tm* buildTimeInfo(struct timeval* currTime, struct ::tm* timeInfo) { +#if ELPP_OS_UNIX + time_t rawTime = currTime->tv_sec; + ::localtime_r(&rawTime, timeInfo); + return timeInfo; +#else +# if ELPP_COMPILER_MSVC + ELPP_UNUSED(currTime); + time_t t; + _time64(&t); + localtime_s(timeInfo, &t); + return timeInfo; +# else + // For any other compilers that don't have CRT warnings issue e.g, MinGW or TDM GCC- we use different method + time_t rawTime = currTime->tv_sec; + struct tm* tmInf = localtime(&rawTime); + *timeInfo = *tmInf; + return timeInfo; +# endif // ELPP_COMPILER_MSVC +#endif // ELPP_OS_UNIX + } + static char* parseFormat(char* buf, std::size_t bufSz, const char* format, const struct tm* tInfo, + std::size_t msec, const base::MillisecondsWidth* msWidth) { + const char* bufLim = buf + bufSz; + for (; *format; ++format) { + if (*format == base::consts::kFormatSpecifierChar) { + switch (*++format) { + case base::consts::kFormatSpecifierChar: // Escape + break; + case '\0': // End + --format; + break; + case 'd': // Day + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mday, 2, buf, bufLim); + continue; + case 'a': // Day of week (short) + buf = base::utils::Str::addToBuff(base::consts::kDaysAbbrev[tInfo->tm_wday], buf, bufLim); + continue; + case 'A': // Day of week (long) + buf = base::utils::Str::addToBuff(base::consts::kDays[tInfo->tm_wday], buf, bufLim); + continue; + case 'M': // month + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mon + 1, 2, buf, bufLim); + continue; + case 'b': // month (short) + buf = base::utils::Str::addToBuff(base::consts::kMonthsAbbrev[tInfo->tm_mon], buf, bufLim); + continue; + case 'B': // month (long) + buf = base::utils::Str::addToBuff(base::consts::kMonths[tInfo->tm_mon], buf, bufLim); + continue; + case 'y': // year (two digits) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 2, buf, bufLim); + continue; + case 'Y': // year (four digits) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 4, buf, bufLim); + continue; + case 'h': // hour (12-hour) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour % 12, 2, buf, bufLim); + continue; + case 'H': // hour (24-hour) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour, 2, buf, bufLim); + continue; + case 'm': // minute + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_min, 2, buf, bufLim); + continue; + case 's': // second + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_sec, 2, buf, bufLim); + continue; + case 'z': // milliseconds + case 'g': + buf = base::utils::Str::convertAndAddToBuff(msec, msWidth->m_width, buf, bufLim); + continue; + case 'F': // AM/PM + buf = base::utils::Str::addToBuff((tInfo->tm_hour >= 12) ? base::consts::kPm : base::consts::kAm, buf, bufLim); + continue; + default: + continue; + } + } + if (buf == bufLim) break; + *buf++ = *format; + } + return buf; + } + }; + /// @brief Command line arguments for application if specified using el::Helpers::setArgs(..) or START_EASYLOGGINGPP(..) + class CommandLineArgs { + public: + CommandLineArgs(void) { + setArgs(0, static_cast(nullptr)); + } + CommandLineArgs(int argc, const char** argv) { + setArgs(argc, argv); + } + CommandLineArgs(int argc, char** argv) { + setArgs(argc, argv); + } + virtual ~CommandLineArgs(void) {} + /// @brief Sets arguments and parses them + inline void setArgs(int argc, const char** argv) { + setArgs(argc, const_cast(argv)); + } + /// @brief Sets arguments and parses them + inline void setArgs(int argc, char** argv) { + m_params.clear(); + m_paramsWithValue.clear(); + if (argc == 0 || argv == nullptr) { + return; + } + m_argc = argc; + m_argv = argv; + for (int i = 1; i < m_argc; ++i) { + const char* v = (strstr(m_argv[i], "=")); + if (v != nullptr && strlen(v) > 0) { + std::string key = std::string(m_argv[i]); + key = key.substr(0, key.find_first_of('=')); + if (hasParamWithValue(key.c_str())) { + ELPP_INTERNAL_INFO(1, "Skipping [" << key << "] arg since it already has value [" + << getParamValue(key.c_str()) << "]"); + } + else { + m_paramsWithValue.insert(std::make_pair(key, std::string(v + 1))); + } + } + if (v == nullptr) { + if (hasParam(m_argv[i])) { + ELPP_INTERNAL_INFO(1, "Skipping [" << m_argv[i] << "] arg since it already exists"); + } + else { + m_params.push_back(std::string(m_argv[i])); + } + } + } + } + /// @brief Returns true if arguments contain paramKey with a value (seperated by '=') + inline bool hasParamWithValue(const char* paramKey) const { + return m_paramsWithValue.find(std::string(paramKey)) != m_paramsWithValue.end(); + } + /// @brief Returns value of arguments + /// @see hasParamWithValue(const char*) + inline const char* getParamValue(const char* paramKey) const { + return m_paramsWithValue.find(std::string(paramKey))->second.c_str(); + } + /// @brief Return true if arguments has a param (not having a value) i,e without '=' + inline bool hasParam(const char* paramKey) const { + return std::find(m_params.begin(), m_params.end(), std::string(paramKey)) != m_params.end(); + } + /// @brief Returns true if no params available. This exclude argv[0] + inline bool empty(void) const { + return m_params.empty() && m_paramsWithValue.empty(); + } + /// @brief Returns total number of arguments. This exclude argv[0] + inline std::size_t size(void) const { + return m_params.size() + m_paramsWithValue.size(); + } + inline friend base::type::ostream_t& operator<<(base::type::ostream_t& os, const CommandLineArgs& c) { + for (int i = 1; i < c.m_argc; ++i) { + os << ELPP_LITERAL("[") << c.m_argv[i] << ELPP_LITERAL("]"); + if (i < c.m_argc - 1) { + os << ELPP_LITERAL(" "); + } + } + return os; + } + + private: + int m_argc; + char** m_argv; + std::map m_paramsWithValue; + std::vector m_params; + }; + /// @brief Abstract registry (aka repository) that provides basic interface for pointer repository specified by T_Ptr type. + /// + /// @detail Most of the functions are virtual final methods but anything implementing this abstract class should implement + /// unregisterAll() and deepCopy(const AbstractRegistry&) and write registerNew() method according to container + /// and few more methods; get() to find element, unregister() to unregister single entry. + /// Please note that this is thread-unsafe and should also implement thread-safety mechanisms in implementation. + template + class AbstractRegistry : public base::threading::ThreadSafe { + public: + typedef typename Container::iterator iterator; + typedef typename Container::const_iterator const_iterator; + + /// @brief Default constructor + AbstractRegistry(void) {} + + /// @brief Move constructor that is useful for base classes + AbstractRegistry(AbstractRegistry&& sr) { + if (this == &sr) { + return; + } + unregisterAll(); + m_list = std::move(sr.m_list); + } + + bool operator==(const AbstractRegistry& other) { + if (size() != other.size()) { + return false; + } + for (std::size_t i = 0; i < m_list.size(); ++i) { + if (m_list.at(i) != other.m_list.at(i)) { + return false; + } + } + return true; + } + + bool operator!=(const AbstractRegistry& other) { + if (size() != other.size()) { + return true; + } + for (std::size_t i = 0; i < m_list.size(); ++i) { + if (m_list.at(i) != other.m_list.at(i)) { + return true; + } + } + return false; + } + + /// @brief Assignment move operator + AbstractRegistry& operator=(AbstractRegistry&& sr) { + if (this == &sr) { + return *this; + } + unregisterAll(); + m_list = std::move(sr.m_list); + return *this; + } + + virtual ~AbstractRegistry(void) { + } + + /// @return Iterator pointer from start of repository + virtual inline iterator begin(void) ELPP_FINAL { + return m_list.begin(); + } + + /// @return Iterator pointer from end of repository + virtual inline iterator end(void) ELPP_FINAL { + return m_list.end(); + } + + + /// @return Constant iterator pointer from start of repository + virtual inline const_iterator cbegin(void) const ELPP_FINAL { + return m_list.cbegin(); + } + + /// @return End of repository + virtual inline const_iterator cend(void) const ELPP_FINAL { + return m_list.cend(); + } + + /// @return Whether or not repository is empty + virtual inline bool empty(void) const ELPP_FINAL { + return m_list.empty(); + } + + /// @return Size of repository + virtual inline std::size_t size(void) const ELPP_FINAL { + return m_list.size(); + } + + /// @brief Returns underlying container by reference + virtual inline Container& list(void) ELPP_FINAL { + return m_list; + } + + /// @brief Returns underlying container by constant reference. + virtual inline const Container& list(void) const ELPP_FINAL { + return m_list; + } + + /// @brief Unregisters all the pointers from current repository. + virtual void unregisterAll(void) = 0; + + protected: + virtual void deepCopy(const AbstractRegistry&) = 0; + void reinitDeepCopy(const AbstractRegistry& sr) { + unregisterAll(); + deepCopy(sr); + } + + private: + Container m_list; + }; + + /// @brief A pointer registry mechanism to manage memory and provide search functionalities. (non-predicate version) + /// + /// @detail NOTE: This is thread-unsafe implementation (although it contains lock function, it does not use these functions) + /// of AbstractRegistry. Any implementation of this class should be + /// explicitly (by using lock functions) + template + class Registry : public AbstractRegistry> { + public: + typedef typename Registry::iterator iterator; + typedef typename Registry::const_iterator const_iterator; + + Registry(void) {} + + /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. + Registry(const Registry& sr) : AbstractRegistry>() { + if (this == &sr) { + return; + } + this->reinitDeepCopy(sr); + } + + /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element + /// @see unregisterAll() + /// @see deepCopy(const AbstractRegistry&) + Registry& operator=(const Registry& sr) { + if (this == &sr) { + return *this; + } + this->reinitDeepCopy(sr); + return *this; + } + + virtual ~Registry(void) { + unregisterAll(); + } + + protected: + virtual inline void unregisterAll(void) ELPP_FINAL { + if (!this->empty()) { + for (auto&& curr : this->list()) { + base::utils::safeDelete(curr.second); + } + this->list().clear(); + } + } + + /// @brief Registers new registry to repository. + virtual inline void registerNew(const T_Key& uniqKey, T_Ptr* ptr) ELPP_FINAL { + unregister(uniqKey); + this->list().insert(std::make_pair(uniqKey, ptr)); + } + + /// @brief Unregisters single entry mapped to specified unique key + inline void unregister(const T_Key& uniqKey) { + T_Ptr* existing = get(uniqKey); + if (existing != nullptr) { + base::utils::safeDelete(existing); + this->list().erase(uniqKey); + } + } + + /// @brief Gets pointer from repository. If none found, nullptr is returned. + inline T_Ptr* get(const T_Key& uniqKey) { + iterator it = this->list().find(uniqKey); + return it == this->list().end() + ? nullptr + : it->second; + } + + private: + virtual inline void deepCopy(const AbstractRegistry>& sr) ELPP_FINAL { + for (const_iterator it = sr.cbegin(); it != sr.cend(); ++it) { + registerNew(it->first, new T_Ptr(*it->second)); + } + } + }; + + /// @brief A pointer registry mechanism to manage memory and provide search functionalities. (predicate version) + /// + /// @detail NOTE: This is thread-unsafe implementation of AbstractRegistry. Any implementation of this class + /// should be made thread-safe explicitly + template + class RegistryWithPred : public AbstractRegistry> { + public: + typedef typename RegistryWithPred::iterator iterator; + typedef typename RegistryWithPred::const_iterator const_iterator; + + RegistryWithPred(void) { + } + + virtual ~RegistryWithPred(void) { + unregisterAll(); + } + + /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. + RegistryWithPred(const RegistryWithPred& sr) : AbstractRegistry>() { + if (this == &sr) { + return; + } + this->reinitDeepCopy(sr); + } + + /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element + /// @see unregisterAll() + /// @see deepCopy(const AbstractRegistry&) + RegistryWithPred& operator=(const RegistryWithPred& sr) { + if (this == &sr) { + return *this; + } + this->reinitDeepCopy(sr); + return *this; + } + + friend inline base::type::ostream_t& operator<<(base::type::ostream_t& os, const RegistryWithPred& sr) { + for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { + os << ELPP_LITERAL(" ") << **it << ELPP_LITERAL("\n"); + } + return os; + } + + protected: + virtual inline void unregisterAll(void) ELPP_FINAL { + if (!this->empty()) { + for (auto&& curr : this->list()) { + base::utils::safeDelete(curr); + } + this->list().clear(); + } + } + + virtual void unregister(T_Ptr*& ptr) ELPP_FINAL { + if (ptr) { + iterator iter = this->begin(); + for (; iter != this->end(); ++iter) { + if (ptr == *iter) { + break; + } + } + if (iter != this->end() && *iter != nullptr) { + this->list().erase(iter); + base::utils::safeDelete(*iter); + } + } + } + + virtual inline void registerNew(T_Ptr* ptr) ELPP_FINAL { + this->list().push_back(ptr); + } + + /// @brief Gets pointer from repository with speicifed arguments. Arguments are passed to predicate + /// in order to validate pointer. + template + inline T_Ptr* get(const T& arg1, const T2 arg2) { + iterator iter = std::find_if(this->list().begin(), this->list().end(), Pred(arg1, arg2)); + if (iter != this->list().end() && *iter != nullptr) { + return *iter; + } + return nullptr; + } + + private: + virtual inline void deepCopy(const AbstractRegistry>& sr) { + for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { + registerNew(new T_Ptr(**it)); + } + } + }; + + } // namespace utils + } // namespace base + /// @brief Base of Easylogging++ friendly class + /// + /// @detail After inheriting this class publicly, implement pure-virtual function `void log(std::ostream&) const` + class Loggable { + public: + virtual ~Loggable(void) {} + virtual void log(el::base::type::ostream_t&) const = 0; + private: + friend inline el::base::type::ostream_t& operator<<(el::base::type::ostream_t& os, const Loggable& loggable) { + loggable.log(os); + return os; + } + }; + namespace base { + /// @brief Represents log format containing flags and date format. This is used internally to start initial log + class LogFormat : public Loggable { + public: + LogFormat(void) : + m_level(Level::Unknown), + m_userFormat(base::type::string_t()), + m_format(base::type::string_t()), + m_dateTimeFormat(std::string()), + m_flags(0x0) { + } + + LogFormat(Level level, const base::type::string_t& format) + : m_level(level), m_userFormat(format) { + parseFromFormat(m_userFormat); + } + + LogFormat(const LogFormat& logFormat) { + m_level = logFormat.m_level; + m_userFormat = logFormat.m_userFormat; + m_format = logFormat.m_format; + m_dateTimeFormat = logFormat.m_dateTimeFormat; + m_flags = logFormat.m_flags; + } + + LogFormat(LogFormat&& logFormat) { + m_level = std::move(logFormat.m_level); + m_userFormat = std::move(logFormat.m_userFormat); + m_format = std::move(logFormat.m_format); + m_dateTimeFormat = std::move(logFormat.m_dateTimeFormat); + m_flags = std::move(logFormat.m_flags); + } + + LogFormat& operator=(const LogFormat& logFormat) { + m_level = logFormat.m_level; + m_userFormat = logFormat.m_userFormat; + m_dateTimeFormat = logFormat.m_dateTimeFormat; + m_flags = logFormat.m_flags; + return *this; + } + + virtual ~LogFormat(void) { + } + + inline bool operator==(const LogFormat& other) { + return m_level == other.m_level && m_userFormat == other.m_userFormat && m_format == other.m_format && + m_dateTimeFormat == other.m_dateTimeFormat && m_flags == other.m_flags; + } + + /// @brief Updates format to be used while logging. + /// @param userFormat User provided format + void parseFromFormat(const base::type::string_t& userFormat) { + // We make copy because we will be changing the format + // i.e, removing user provided date format from original format + // and then storing it. + base::type::string_t formatCopy = userFormat; + m_flags = 0x0; + auto conditionalAddFlag = [&](const base::type::char_t* specifier, base::FormatFlags flag) { + std::size_t foundAt = base::type::string_t::npos; + while ((foundAt = formatCopy.find(specifier, foundAt + 1)) != base::type::string_t::npos) { + if (foundAt > 0 && formatCopy[foundAt - 1] == base::consts::kFormatSpecifierChar) { + if (hasFlag(flag)) { + // If we already have flag we remove the escape chars so that '%%' is turned to '%' + // even after specifier resolution - this is because we only replaceFirst specifier + formatCopy.erase(foundAt > 0 ? foundAt - 1 : 0, 1); + ++foundAt; + } + } + else { + if (!hasFlag(flag)) addFlag(flag); + } + } + }; + conditionalAddFlag(base::consts::kAppNameFormatSpecifier, base::FormatFlags::AppName); + conditionalAddFlag(base::consts::kSeverityLevelFormatSpecifier, base::FormatFlags::Level); + conditionalAddFlag(base::consts::kSeverityLevelShortFormatSpecifier, base::FormatFlags::LevelShort); + conditionalAddFlag(base::consts::kLoggerIdFormatSpecifier, base::FormatFlags::LoggerId); + conditionalAddFlag(base::consts::kThreadIdFormatSpecifier, base::FormatFlags::ThreadId); + conditionalAddFlag(base::consts::kLogFileFormatSpecifier, base::FormatFlags::File); + conditionalAddFlag(base::consts::kLogFileBaseFormatSpecifier, base::FormatFlags::FileBase); + conditionalAddFlag(base::consts::kLogLineFormatSpecifier, base::FormatFlags::Line); + conditionalAddFlag(base::consts::kLogLocationFormatSpecifier, base::FormatFlags::Location); + conditionalAddFlag(base::consts::kLogFunctionFormatSpecifier, base::FormatFlags::Function); + conditionalAddFlag(base::consts::kCurrentUserFormatSpecifier, base::FormatFlags::User); + conditionalAddFlag(base::consts::kCurrentHostFormatSpecifier, base::FormatFlags::Host); + conditionalAddFlag(base::consts::kMessageFormatSpecifier, base::FormatFlags::LogMessage); + conditionalAddFlag(base::consts::kVerboseLevelFormatSpecifier, base::FormatFlags::VerboseLevel); + // For date/time we need to extract user's date format first + std::size_t dateIndex = std::string::npos; + if ((dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier)) != std::string::npos) { + while (dateIndex > 0 && formatCopy[dateIndex - 1] == base::consts::kFormatSpecifierChar) { + dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier, dateIndex + 1); + } + if (dateIndex != std::string::npos) { + addFlag(base::FormatFlags::DateTime); + updateDateFormat(dateIndex, formatCopy); + } + } + m_format = formatCopy; + updateFormatSpec(); + } + + inline Level level(void) const { + return m_level; + } + + inline const base::type::string_t& userFormat(void) const { + return m_userFormat; + } + + inline const base::type::string_t& format(void) const { + return m_format; + } + + inline const std::string& dateTimeFormat(void) const { + return m_dateTimeFormat; + } + + inline base::type::EnumType flags(void) const { + return m_flags; + } + + inline bool hasFlag(base::FormatFlags flag) const { + return base::utils::hasFlag(flag, m_flags); + } + + virtual void log(el::base::type::ostream_t& os) const { + os << m_format; + } + + protected: + /// @brief Updates date time format if available in currFormat. + /// @param index Index where %datetime, %date or %time was found + /// @param [in,out] currFormat current format that is being used to format + virtual void updateDateFormat(std::size_t index, base::type::string_t& currFormat) ELPP_FINAL { + if (hasFlag(base::FormatFlags::DateTime)) { + index += ELPP_STRLEN(base::consts::kDateTimeFormatSpecifier); + } + const base::type::char_t* ptr = currFormat.c_str() + index; + if ((currFormat.size() > index) && (ptr[0] == '{')) { + // User has provided format for date/time + ++ptr; + int count = 1; // Start by 1 in order to remove starting brace + std::stringstream ss; + for (; *ptr; ++ptr, ++count) { + if (*ptr == '}') { + ++count; // In order to remove ending brace + break; + } + ss << *ptr; + } + currFormat.erase(index, count); + m_dateTimeFormat = ss.str(); + } + else { + // No format provided, use default + if (hasFlag(base::FormatFlags::DateTime)) { + m_dateTimeFormat = std::string(base::consts::kDefaultDateTimeFormat); + } + } + } + + /// @brief Updates %level from format. This is so that we dont have to do it at log-writing-time. It uses m_format and m_level + virtual void updateFormatSpec(void) ELPP_FINAL { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (m_level == Level::Debug) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kDebugLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kDebugLevelShortLogValue); + } + else if (m_level == Level::Info) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kInfoLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kInfoLevelShortLogValue); + } + else if (m_level == Level::Warning) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kWarningLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kWarningLevelShortLogValue); + } + else if (m_level == Level::Error) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kErrorLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kErrorLevelShortLogValue); + } + else if (m_level == Level::Fatal) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kFatalLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kFatalLevelShortLogValue); + } + else if (m_level == Level::Verbose) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kVerboseLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kVerboseLevelShortLogValue); + } + else if (m_level == Level::Trace) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kTraceLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kTraceLevelShortLogValue); + } + if (hasFlag(base::FormatFlags::User)) { + std::string s = base::utils::s_currentUser; + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentUserFormatSpecifier, + base::utils::s_currentUser); + } + if (hasFlag(base::FormatFlags::Host)) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentHostFormatSpecifier, + base::utils::s_currentHost); + } + // Ignore Level::Global and Level::Unknown + } + + inline void addFlag(base::FormatFlags flag) { + base::utils::addFlag(flag, &m_flags); + } + + private: + Level m_level; + base::type::string_t m_userFormat; + base::type::string_t m_format; + std::string m_dateTimeFormat; + base::type::EnumType m_flags; + friend class el::Logger; // To resolve loggerId format specifier easily + }; + } // namespace base + /// @brief Resolving function for format specifier + typedef std::function FormatSpecifierValueResolver; + /// @brief User-provided custom format specifier + /// @see el::Helpers::installCustomFormatSpecifier + /// @see FormatSpecifierValueResolver + class CustomFormatSpecifier { + public: + CustomFormatSpecifier(const char* formatSpecifier, const FormatSpecifierValueResolver& resolver) : + m_formatSpecifier(formatSpecifier), m_resolver(resolver) {} + inline const char* formatSpecifier(void) const { return m_formatSpecifier; } + inline const FormatSpecifierValueResolver& resolver(void) const { return m_resolver; } + inline bool operator==(const char* formatSpecifier) { + return strcmp(m_formatSpecifier, formatSpecifier) == 0; + } + + private: + const char* m_formatSpecifier; + FormatSpecifierValueResolver m_resolver; + }; + /// @brief Represents single configuration that has representing level, configuration type and a string based value. + /// + /// @detail String based value means any value either its boolean, integer or string itself, it will be embedded inside quotes + /// and will be parsed later. + /// + /// Consider some examples below: + /// * el::Configuration confEnabledInfo(el::Level::Info, el::ConfigurationType::Enabled, "true"); + /// * el::Configuration confMaxLogFileSizeInfo(el::Level::Info, el::ConfigurationType::MaxLogFileSize, "2048"); + /// * el::Configuration confFilenameInfo(el::Level::Info, el::ConfigurationType::Filename, "/var/log/my.log"); + class Configuration : public Loggable { + public: + Configuration(const Configuration& c) : + m_level(c.m_level), + m_configurationType(c.m_configurationType), + m_value(c.m_value) { + } + + Configuration& operator=(const Configuration& c) { + m_level = c.m_level; + m_configurationType = c.m_configurationType; + m_value = c.m_value; + return *this; + } + + virtual ~Configuration(void) { + } + + /// @brief Full constructor used to sets value of configuration + Configuration(Level level, ConfigurationType configurationType, const std::string& value) : + m_level(level), + m_configurationType(configurationType), + m_value(value) { + } + + /// @brief Gets level of current configuration + inline Level level(void) const { + return m_level; + } + + /// @brief Gets configuration type of current configuration + inline ConfigurationType configurationType(void) const { + return m_configurationType; + } + + /// @brief Gets string based configuration value + inline const std::string& value(void) const { + return m_value; + } + + /// @brief Set string based configuration value + /// @param value Value to set. Values have to be std::string; For boolean values use "true", "false", for any integral values + /// use them in quotes. They will be parsed when configuring + inline void setValue(const std::string& value) { + m_value = value; + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << LevelHelper::convertToString(m_level) + << ELPP_LITERAL(" ") << ConfigurationTypeHelper::convertToString(m_configurationType) + << ELPP_LITERAL(" = ") << m_value.c_str(); + } + + /// @brief Used to find configuration from configuration (pointers) repository. Avoid using it. + class Predicate { + public: + Predicate(Level level, ConfigurationType configurationType) : + m_level(level), + m_configurationType(configurationType) { + } + + inline bool operator()(const Configuration* conf) const { + return ((conf != nullptr) && (conf->level() == m_level) && (conf->configurationType() == m_configurationType)); + } + + private: + Level m_level; + ConfigurationType m_configurationType; + }; + + private: + Level m_level; + ConfigurationType m_configurationType; + std::string m_value; + }; + + /// @brief Thread-safe Configuration repository + /// + /// @detail This repository represents configurations for all the levels and configuration type mapped to a value. + class Configurations : public base::utils::RegistryWithPred { + public: + /// @brief Default constructor with empty repository + Configurations(void) : + m_configurationFile(std::string()), + m_isFromFile(false) { + } + + /// @brief Constructor used to set configurations using configuration file. + /// @param configurationFile Full path to configuration file + /// @param useDefaultsForRemaining Lets you set the remaining configurations to default. + /// @param base If provided, this configuration will be based off existing repository that this argument is pointing to. + /// @see parseFromFile(const std::string&, Configurations* base) + /// @see setRemainingToDefault() + Configurations(const std::string& configurationFile, bool useDefaultsForRemaining = true, Configurations* base = nullptr) : + m_configurationFile(configurationFile), + m_isFromFile(false) { + parseFromFile(configurationFile, base); + if (useDefaultsForRemaining) { + setRemainingToDefault(); + } + } + + virtual ~Configurations(void) { + } + + /// @brief Parses configuration from file. + /// @param configurationFile Full path to configuration file + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration file. + /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure you + /// do not proceed without successful parse. + inline bool parseFromFile(const std::string& configurationFile, Configurations* base = nullptr) { + // We initial assertion with true because if we have assertion diabled, we want to pass this + // check and if assertion is enabled we will have values re-assigned any way. + bool assertionPassed = true; + ELPP_ASSERT((assertionPassed = base::utils::File::pathExists(configurationFile.c_str(), true)), + "Configuration file [" << configurationFile << "] does not exist!"); + if (!assertionPassed) { + return false; + } + bool success = Parser::parseFromFile(configurationFile, this, base); + m_isFromFile = success; + return success; + } + + /// @brief Parse configurations from configuration string. + /// + /// @detail This configuration string has same syntax as configuration file contents. Make sure all the necessary + /// new line characters are provided. + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration text. + /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure you + /// do not proceed without successful parse. + inline bool parseFromText(const std::string& configurationsString, Configurations* base = nullptr) { + bool success = Parser::parseFromText(configurationsString, this, base); + if (success) { + m_isFromFile = false; + } + return success; + } + + /// @brief Sets configuration based-off an existing configurations. + /// @param base Pointer to existing configurations. + inline void setFromBase(Configurations* base) { + if (base == nullptr || base == this) { + return; + } + base::threading::ScopedLock scopedLock(base->lock()); + for (Configuration*& conf : base->list()) { + set(conf); + } + } + + /// @brief Determines whether or not specified configuration type exists in the repository. + /// + /// @detail Returns as soon as first level is found. + /// @param configurationType Type of configuration to check existence for. + bool hasConfiguration(ConfigurationType configurationType) { + base::type::EnumType lIndex = LevelHelper::kMinValid; + bool result = false; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + if (hasConfiguration(LevelHelper::castFromInt(lIndex), configurationType)) { + result = true; + } + return result; + }); + return result; + } + + /// @brief Determines whether or not specified configuration type exists for specified level + /// @param level Level to check + /// @param configurationType Type of configuration to check existence for. + inline bool hasConfiguration(Level level, ConfigurationType configurationType) { + base::threading::ScopedLock scopedLock(lock()); +#if ELPP_COMPILER_INTEL + // We cant specify template types here, Intel C++ throws compilation error + // "error: type name is not allowed" + return RegistryWithPred::get(level, configurationType) != nullptr; +#else + return RegistryWithPred::get(level, configurationType) != nullptr; +#endif // ELPP_COMPILER_INTEL + } + + /// @brief Sets value of configuration for specified level. + /// + /// @detail Any existing configuration for specified level will be replaced. Also note that configuration types + /// ConfigurationType::MillisecondsWidth and ConfigurationType::PerformanceTracking will be ignored if not set for + /// Level::Global because these configurations are not dependant on level. + /// @param level Level to set configuration for (el::Level). + /// @param configurationType Type of configuration (el::ConfigurationType) + /// @param value A string based value. Regardless of what the data type of configuration is, it will always be string + /// from users' point of view. This is then parsed later to be used internally. + /// @see Configuration::setValue(const std::string& value) + /// @see el::Level + /// @see el::ConfigurationType + inline void set(Level level, ConfigurationType configurationType, const std::string& value) { + base::threading::ScopedLock scopedLock(lock()); + unsafeSet(level, configurationType, value); // This is not unsafe anymore as we have locked mutex + if (level == Level::Global) { + unsafeSetGlobally(configurationType, value, false); // Again this is not unsafe either + } + } + + /// @brief Sets single configuration based on other single configuration. + /// @see set(Level level, ConfigurationType configurationType, const std::string& value) + inline void set(Configuration* conf) { + if (conf == nullptr) { + return; + } + set(conf->level(), conf->configurationType(), conf->value()); + } + + inline Configuration* get(Level level, ConfigurationType configurationType) { + base::threading::ScopedLock scopedLock(lock()); + return RegistryWithPred::get(level, configurationType); + } + + /// @brief Sets configuration for all levels. + /// @param configurationType Type of configuration + /// @param value String based value + /// @see Configurations::set(Level level, ConfigurationType configurationType, const std::string& value) + inline void setGlobally(ConfigurationType configurationType, const std::string& value) { + setGlobally(configurationType, value, false); + } + + /// @brief Clears repository so that all the configurations are unset + inline void clear(void) { + base::threading::ScopedLock scopedLock(lock()); + unregisterAll(); + } + + /// @brief Gets configuration file used in parsing this configurations. + /// + /// @detail If this repository was set manually or by text this returns empty string. + inline const std::string& configurationFile(void) const { + return m_configurationFile; + } + + /// @brief Sets configurations to "factory based" configurations. + void setToDefault(void) { + setGlobally(ConfigurationType::Enabled, std::string("true"), true); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + setGlobally(ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile), true); +#else + ELPP_UNUSED(base::consts::kDefaultLogFile); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + setGlobally(ConfigurationType::ToFile, std::string("true"), true); + setGlobally(ConfigurationType::ToStandardOutput, std::string("true"), true); + setGlobally(ConfigurationType::MillisecondsWidth, std::string("3"), true); + setGlobally(ConfigurationType::PerformanceTracking, std::string("true"), true); + setGlobally(ConfigurationType::MaxLogFileSize, std::string("0"), true); + setGlobally(ConfigurationType::LogFlushThreshold, std::string("0"), true); + + setGlobally(ConfigurationType::Format, std::string("%datetime %level [%logger] %msg"), true); + set(Level::Debug, ConfigurationType::Format, std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); + // INFO and WARNING are set to default by Level::Global + set(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + set(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + set(Level::Verbose, ConfigurationType::Format, std::string("%datetime %level-%vlevel [%logger] %msg")); + set(Level::Trace, ConfigurationType::Format, std::string("%datetime %level [%logger] [%func] [%loc] %msg")); + } + + /// @brief Lets you set the remaining configurations to default. + /// + /// @detail By remaining, it means that the level/type a configuration does not exist for. + /// This function is useful when you want to minimize chances of failures, e.g, if you have a configuration file that sets + /// configuration for all the configurations except for Enabled or not, we use this so that ENABLED is set to default i.e, + /// true. If you dont do this explicitley (either by calling this function or by using second param in Constructor + /// and try to access a value, an error is thrown + void setRemainingToDefault(void) { + base::threading::ScopedLock scopedLock(lock()); + unsafeSetIfNotExist(Level::Global, ConfigurationType::Enabled, std::string("true")); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + unsafeSetIfNotExist(Level::Global, ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile)); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + unsafeSetIfNotExist(Level::Global, ConfigurationType::ToFile, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::ToStandardOutput, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::MillisecondsWidth, std::string("3")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::PerformanceTracking, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::MaxLogFileSize, std::string("0")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Debug, ConfigurationType::Format, + std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); + // INFO and WARNING are set to default by Level::Global + unsafeSetIfNotExist(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Verbose, ConfigurationType::Format, std::string("%datetime %level-%vlevel [%logger] %msg")); + unsafeSetIfNotExist(Level::Trace, ConfigurationType::Format, std::string("%datetime %level [%logger] [%func] [%loc] %msg")); + } + + /// @brief Parser used internally to parse configurations from file or text. + /// + /// @detail This class makes use of base::utils::Str. + /// You should not need this unless you are working on some tool for Easylogging++ + class Parser : base::StaticClass { + public: + /// @brief Parses configuration from file. + /// @param configurationFile Full path to configuration file + /// @param sender Sender configurations pointer. Usually 'this' is used from calling class + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration file. + /// @return True if successfully parsed, false otherwise. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make sure you + /// do not proceed without successful parse. + static bool parseFromFile(const std::string& configurationFile, Configurations* sender, Configurations* base = nullptr) { + sender->setFromBase(base); + std::ifstream fileStream_(configurationFile.c_str(), std::ifstream::in); + ELPP_ASSERT(fileStream_.is_open(), "Unable to open configuration file [" << configurationFile << "] for parsing."); + bool parsedSuccessfully = false; + std::string line = std::string(); + Level currLevel = Level::Unknown; + std::string currConfigStr = std::string(); + std::string currLevelStr = std::string(); + while (fileStream_.good()) { + std::getline(fileStream_, line); + parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); + ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); + } + return parsedSuccessfully; + } + + /// @brief Parse configurations from configuration string. + /// + /// @detail This configuration string has same syntax as configuration file contents. Make sure all the necessary + /// new line characters are provided. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make sure you + /// do not proceed without successful parse (This is recommended) + /// @param configurationsString + /// @param sender Sender configurations pointer. Usually 'this' is used from calling class + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration text. + /// @return True if successfully parsed, false otherwise. + static bool parseFromText(const std::string& configurationsString, Configurations* sender, Configurations* base = nullptr) { + sender->setFromBase(base); + bool parsedSuccessfully = false; + std::stringstream ss(configurationsString); + std::string line = std::string(); + Level currLevel = Level::Unknown; + std::string currConfigStr = std::string(); + std::string currLevelStr = std::string(); + while (std::getline(ss, line)) { + parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); + ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); + } + return parsedSuccessfully; + } + + private: + friend class el::Loggers; + static void ignoreComments(std::string* line) { + std::size_t foundAt = 0; + std::size_t quotesStart = line->find("\""); + std::size_t quotesEnd = std::string::npos; + if (quotesStart != std::string::npos) { + quotesEnd = line->find("\"", quotesStart + 1); + while (quotesEnd != std::string::npos && line->at(quotesEnd - 1) == '\\') { + // Do not erase slash yet - we will erase it in parseLine(..) while loop + quotesEnd = line->find("\"", quotesEnd + 2); + } + } + if ((foundAt = line->find(base::consts::kConfigurationComment)) != std::string::npos) { + if (foundAt < quotesEnd) { + foundAt = line->find(base::consts::kConfigurationComment, quotesEnd + 1); + } + *line = line->substr(0, foundAt); + } + } + static inline bool isLevel(const std::string& line) { + return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLevel)); + } + + static inline bool isComment(const std::string& line) { + return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationComment)); + } + + static inline bool isConfig(const std::string& line) { + std::size_t assignment = line.find('='); + return line != "" && + (line[0] >= 65 || line[0] <= 90 || line[0] >= 97 || line[0] <= 122) && + (assignment != std::string::npos) && + (line.size() > assignment); + } + + static bool parseLine(std::string* line, std::string* currConfigStr, std::string* currLevelStr, Level* currLevel, Configurations* conf) { + ConfigurationType currConfig = ConfigurationType::Unknown; + std::string currValue = std::string(); + *line = base::utils::Str::trim(*line); + if (isComment(*line)) return true; + ignoreComments(line); + *line = base::utils::Str::trim(*line); + if (line->empty()) { + // Comment ignored + return true; + } + if (isLevel(*line)) { + if (line->size() <= 2) { + return true; + } + *currLevelStr = line->substr(1, line->size() - 2); + *currLevelStr = base::utils::Str::toUpper(*currLevelStr); + *currLevelStr = base::utils::Str::trim(*currLevelStr); + *currLevel = LevelHelper::convertFromString(currLevelStr->c_str()); + return true; + } + if (isConfig(*line)) { + std::size_t assignment = line->find('='); + *currConfigStr = line->substr(0, assignment); + *currConfigStr = base::utils::Str::toUpper(*currConfigStr); + *currConfigStr = base::utils::Str::trim(*currConfigStr); + currConfig = ConfigurationTypeHelper::convertFromString(currConfigStr->c_str()); + currValue = line->substr(assignment + 1); + currValue = base::utils::Str::trim(currValue); + std::size_t quotesStart = currValue.find("\"", 0); + std::size_t quotesEnd = std::string::npos; + if (quotesStart != std::string::npos) { + quotesEnd = currValue.find("\"", quotesStart + 1); + while (quotesEnd != std::string::npos && currValue.at(quotesEnd - 1) == '\\') { + currValue = currValue.erase(quotesEnd - 1, 1); + quotesEnd = currValue.find("\"", quotesEnd + 2); + } + } + if (quotesStart != std::string::npos && quotesEnd != std::string::npos) { + // Quote provided - check and strip if valid + ELPP_ASSERT((quotesStart < quotesEnd), "Configuration error - No ending quote found in [" + << currConfigStr << "]"); + ELPP_ASSERT((quotesStart + 1 != quotesEnd), "Empty configuration value for [" << currConfigStr << "]"); + if ((quotesStart != quotesEnd) && (quotesStart + 1 != quotesEnd)) { + // Explicit check in case if assertion is disabled + currValue = currValue.substr(quotesStart + 1, quotesEnd - 1); + } + } + } + ELPP_ASSERT(*currLevel != Level::Unknown, "Unrecognized severity level [" << *currLevelStr << "]"); + ELPP_ASSERT(currConfig != ConfigurationType::Unknown, "Unrecognized configuration [" << *currConfigStr << "]"); + if (*currLevel == Level::Unknown || currConfig == ConfigurationType::Unknown) { + return false; // unrecognizable level or config + } + conf->set(*currLevel, currConfig, currValue); + return true; + } + }; + + private: + std::string m_configurationFile; + bool m_isFromFile; + friend class el::Loggers; + + /// @brief Unsafely sets configuration if does not already exist + void unsafeSetIfNotExist(Level level, ConfigurationType configurationType, const std::string& value) { + Configuration* conf = RegistryWithPred::get(level, configurationType); + if (conf == nullptr) { + unsafeSet(level, configurationType, value); + } + } + + /// @brief Thread unsafe set + void unsafeSet(Level level, ConfigurationType configurationType, const std::string& value) { + Configuration* conf = RegistryWithPred::get(level, configurationType); + if (conf == nullptr) { + registerNew(new Configuration(level, configurationType, value)); + } + else { + conf->setValue(value); + } + if (level == Level::Global) { + unsafeSetGlobally(configurationType, value, false); + } + } + + /// @brief Sets configurations for all levels including Level::Global if includeGlobalLevel is true + /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) + void setGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel) { + if (includeGlobalLevel) { + set(Level::Global, configurationType, value); + } + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + set(LevelHelper::castFromInt(lIndex), configurationType, value); + return false; // Do not break lambda function yet as we need to set all levels regardless + }); + } + + /// @brief Sets configurations (Unsafely) for all levels including Level::Global if includeGlobalLevel is true + /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) + void unsafeSetGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel) { + if (includeGlobalLevel) { + unsafeSet(Level::Global, configurationType, value); + } + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + unsafeSet(LevelHelper::castFromInt(lIndex), configurationType, value); + return false; // Do not break lambda function yet as we need to set all levels regardless + }); + } + }; + + namespace base { + typedef std::shared_ptr FileStreamPtr; + typedef std::map LogStreamsReferenceMap; + /// @brief Configurations with data types. + /// + /// @detail el::Configurations have string based values. This is whats used internally in order to read correct configurations. + /// This is to perform faster while writing logs using correct configurations. + /// + /// This is thread safe and final class containing non-virtual destructor (means nothing should inherit this class) + class TypedConfigurations : public base::threading::ThreadSafe { + public: + /// @brief Constructor to initialize (construct) the object off el::Configurations + /// @param configurations Configurations pointer/reference to base this typed configurations off. + /// @param logStreamsReference Use ELPP->registeredLoggers()->logStreamsReference() + TypedConfigurations(Configurations* configurations, base::LogStreamsReferenceMap* logStreamsReference) { + m_configurations = configurations; + m_logStreamsReference = logStreamsReference; + build(m_configurations); + } + + TypedConfigurations(const TypedConfigurations& other) { + this->m_configurations = other.m_configurations; + this->m_logStreamsReference = other.m_logStreamsReference; + build(m_configurations); + } + + virtual ~TypedConfigurations(void) { + } + + const Configurations* configurations(void) const { + return m_configurations; + } + + inline bool enabled(Level level) { + return getConfigByVal(level, &m_enabledMap, "enabled"); + } + + inline bool toFile(Level level) { + return getConfigByVal(level, &m_toFileMap, "toFile"); + } + + inline const std::string& filename(Level level) { + return getConfigByRef(level, &m_filenameMap, "filename"); + } + + inline bool toStandardOutput(Level level) { + return getConfigByVal(level, &m_toStandardOutputMap, "toStandardOutput"); + } + + inline const base::LogFormat& logFormat(Level level) { + return getConfigByRef(level, &m_logFormatMap, "logFormat"); + } + + inline const base::MillisecondsWidth& millisecondsWidth(Level level = Level::Global) { + return getConfigByRef(level, &m_millisecondsWidthMap, "millisecondsWidth"); + } + + inline bool performanceTracking(Level level = Level::Global) { + return getConfigByVal(level, &m_performanceTrackingMap, "performanceTracking"); + } + + inline base::type::fstream_t* fileStream(Level level) { + return getConfigByRef(level, &m_fileStreamMap, "fileStream").get(); + } + + inline std::size_t maxLogFileSize(Level level) { + return getConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); + } + + inline std::size_t logFlushThreshold(Level level) { + return getConfigByVal(level, &m_logFlushThresholdMap, "logFlushThreshold"); + } + + private: + Configurations* m_configurations; + std::map m_enabledMap; + std::map m_toFileMap; + std::map m_filenameMap; + std::map m_toStandardOutputMap; + std::map m_logFormatMap; + std::map m_millisecondsWidthMap; + std::map m_performanceTrackingMap; + std::map m_fileStreamMap; + std::map m_maxLogFileSizeMap; + std::map m_logFlushThresholdMap; + base::LogStreamsReferenceMap* m_logStreamsReference; + + friend class el::Helpers; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::DefaultLogDispatchCallback; + friend class el::base::LogDispatcher; + + template + inline Conf_T getConfigByVal(Level level, const std::map* confMap, const char* confName) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeGetConfigByVal(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope + } + + template + inline Conf_T& getConfigByRef(Level level, std::map* confMap, const char* confName) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeGetConfigByRef(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope + } + + template + inline Conf_T unsafeGetConfigByVal(Level level, const std::map* confMap, const char* confName) { + ELPP_UNUSED(confName); + typename std::map::const_iterator it = confMap->find(level); + if (it == confMap->end()) { + try { + return confMap->at(Level::Global); + } + catch (...) { + ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level [" + << LevelHelper::convertToString(level) << "]" + << std::endl << "Please ensure you have properly configured logger.", false); + return Conf_T(); + } + } + return it->second; + } + + template + inline Conf_T& unsafeGetConfigByRef(Level level, std::map* confMap, const char* confName) { + ELPP_UNUSED(confName); + typename std::map::iterator it = confMap->find(level); + if (it == confMap->end()) { + try { + return confMap->at(Level::Global); + } + catch (...) { + ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level [" + << LevelHelper::convertToString(level) << "]" + << std::endl << "Please ensure you have properly configured logger.", false); + } + } + return it->second; + } + + template + void setValue(Level level, const Conf_T& value, std::map* confMap, bool includeGlobalLevel = true) { + // If map is empty and we are allowed to add into generic level (Level::Global), do it! + if (confMap->empty() && includeGlobalLevel) { + confMap->insert(std::make_pair(Level::Global, value)); + return; + } + // If same value exist in generic level already, dont add it to explicit level + typename std::map::iterator it = confMap->find(Level::Global); + if (it != confMap->end() && it->second == value) { + return; + } + // Now make sure we dont double up values if we really need to add it to explicit level + it = confMap->find(level); + if (it == confMap->end()) { + // Value not found for level, add new + confMap->insert(std::make_pair(level, value)); + } + else { + // Value found, just update value + confMap->at(level) = value; + } + } + + void build(Configurations* configurations) { + base::threading::ScopedLock scopedLock(lock()); + auto getBool = [](std::string boolStr) -> bool { // Pass by value for trimming + base::utils::Str::trim(boolStr); + return (boolStr == "TRUE" || boolStr == "true" || boolStr == "1"); + }; + std::vector withFileSizeLimit; + for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { + Configuration* conf = *it; + // We cannot use switch on strong enums because Intel C++ dont support them yet + if (conf->configurationType() == ConfigurationType::Enabled) { + setValue(conf->level(), getBool(conf->value()), &m_enabledMap); + } + else if (conf->configurationType() == ConfigurationType::ToFile) { + setValue(conf->level(), getBool(conf->value()), &m_toFileMap); + } + else if (conf->configurationType() == ConfigurationType::ToStandardOutput) { + setValue(conf->level(), getBool(conf->value()), &m_toStandardOutputMap); + } + else if (conf->configurationType() == ConfigurationType::Filename) { + // We do not yet configure filename but we will configure in another + // loop. This is because if file cannot be created, we will force ToFile + // to be false. Because configuring logger is not necessarily performance + // sensative operation, we can live with another loop; (by the way this loop + // is not very heavy either) + } + else if (conf->configurationType() == ConfigurationType::Format) { + setValue(conf->level(), base::LogFormat(conf->level(), + base::type::string_t(conf->value().begin(), conf->value().end())), &m_logFormatMap); + } + else if (conf->configurationType() == ConfigurationType::MillisecondsWidth) { + setValue(Level::Global, + base::MillisecondsWidth(static_cast(getULong(conf->value()))), &m_millisecondsWidthMap); + } + else if (conf->configurationType() == ConfigurationType::PerformanceTracking) { + setValue(Level::Global, getBool(conf->value()), &m_performanceTrackingMap); + } + else if (conf->configurationType() == ConfigurationType::MaxLogFileSize) { + setValue(conf->level(), static_cast(getULong(conf->value())), &m_maxLogFileSizeMap); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + withFileSizeLimit.push_back(conf); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + } + else if (conf->configurationType() == ConfigurationType::LogFlushThreshold) { + setValue(conf->level(), static_cast(getULong(conf->value())), &m_logFlushThresholdMap); + } + } + // As mentioned early, we will now set filename configuration in separate loop to deal with non-existent files + for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { + Configuration* conf = *it; + if (conf->configurationType() == ConfigurationType::Filename) { + insertFile(conf->level(), conf->value()); + } + } + for (std::vector::iterator conf = withFileSizeLimit.begin(); + conf != withFileSizeLimit.end(); ++conf) { + // This is not unsafe as mutex is locked in currect scope + unsafeValidateFileRolling((*conf)->level(), base::defaultPreRollOutCallback); + } + } + + unsigned long getULong(std::string confVal) { + bool valid = true; + base::utils::Str::trim(confVal); + valid = !confVal.empty() && std::find_if(confVal.begin(), confVal.end(), + [](char c) { return !base::utils::Str::isDigit(c); }) == confVal.end(); + if (!valid) { + valid = false; + ELPP_ASSERT(valid, "Configuration value not a valid integer [" << confVal << "]"); + return 0; + } + return atol(confVal.c_str()); + } + + std::string resolveFilename(const std::string& filename) { + std::string resultingFilename = filename; + std::size_t dateIndex = std::string::npos; + std::string dateTimeFormatSpecifierStr = std::string(base::consts::kDateTimeFormatSpecifierForFilename); + if ((dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str())) != std::string::npos) { + while (dateIndex > 0 && resultingFilename[dateIndex - 1] == base::consts::kFormatSpecifierChar) { + dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str(), dateIndex + 1); + } + if (dateIndex != std::string::npos) { + const char* ptr = resultingFilename.c_str() + dateIndex; + // Goto end of specifier + ptr += dateTimeFormatSpecifierStr.size(); + std::string fmt; + if ((resultingFilename.size() > dateIndex) && (ptr[0] == '{')) { + // User has provided format for date/time + ++ptr; + int count = 1; // Start by 1 in order to remove starting brace + std::stringstream ss; + for (; *ptr; ++ptr, ++count) { + if (*ptr == '}') { + ++count; // In order to remove ending brace + break; + } + ss << *ptr; + } + resultingFilename.erase(dateIndex + dateTimeFormatSpecifierStr.size(), count); + fmt = ss.str(); + } + else { + fmt = std::string(base::consts::kDefaultDateTimeFormatInFilename); + } + base::MillisecondsWidth msWidth(3); + std::string now = base::utils::DateTime::getDateTime(fmt.c_str(), &msWidth); + base::utils::Str::replaceAll(now, '/', '-'); // Replace path element since we are dealing with filename + base::utils::Str::replaceAll(resultingFilename, dateTimeFormatSpecifierStr, now); + } + } + return resultingFilename; + } + + void insertFile(Level level, const std::string& fullFilename) { + std::string resolvedFilename = resolveFilename(fullFilename); + if (resolvedFilename.empty()) { + std::cerr << "Could not load empty file for logging, please re-check your configurations for level [" + << LevelHelper::convertToString(level) << "]"; + } + std::string filePath = base::utils::File::extractPathFromFilename(resolvedFilename, base::consts::kFilePathSeperator); + if (filePath.size() < resolvedFilename.size()) { + base::utils::File::createPath(filePath); + } + auto create = [&](Level level) { + base::LogStreamsReferenceMap::iterator filestreamIter = m_logStreamsReference->find(resolvedFilename); + base::type::fstream_t* fs = nullptr; + if (filestreamIter == m_logStreamsReference->end()) { + // We need a completely new stream, nothing to share with + fs = base::utils::File::newFileStream(resolvedFilename); + m_filenameMap.insert(std::make_pair(level, resolvedFilename)); + m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(fs))); + m_logStreamsReference->insert(std::make_pair(resolvedFilename, base::FileStreamPtr(m_fileStreamMap.at(level)))); + } + else { + // Woops! we have an existing one, share it! + m_filenameMap.insert(std::make_pair(level, filestreamIter->first)); + m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(filestreamIter->second))); + fs = filestreamIter->second.get(); + } + if (fs == nullptr) { + // We display bad file error from newFileStream() + ELPP_INTERNAL_ERROR("Setting [TO_FILE] of [" + << LevelHelper::convertToString(level) << "] to FALSE", false); + setValue(level, false, &m_toFileMap); + } + }; + // If we dont have file conf for any level, create it for Level::Global first + // otherwise create for specified level + create(m_filenameMap.empty() && m_fileStreamMap.empty() ? Level::Global : level); + } + + bool unsafeValidateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) { + base::type::fstream_t* fs = unsafeGetConfigByRef(level, &m_fileStreamMap, "fileStream").get(); + if (fs == nullptr) { + return true; + } + std::size_t maxLogFileSize = unsafeGetConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); + std::size_t currFileSize = base::utils::File::getSizeOfFile(fs); + if (maxLogFileSize != 0 && currFileSize >= maxLogFileSize) { + std::string fname = unsafeGetConfigByRef(level, &m_filenameMap, "filename"); + ELPP_INTERNAL_INFO(1, "Truncating log file [" << fname << "] as a result of configurations for level [" + << LevelHelper::convertToString(level) << "]"); + fs->close(); + PreRollOutCallback(fname.c_str(), currFileSize); + fs->open(fname, std::fstream::out | std::fstream::trunc); + return true; + } + return false; + } + + bool validateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeValidateFileRolling(level, PreRollOutCallback); + } + }; + /// @brief Class that keeps record of current line hit for occasional logging + class HitCounter { + public: + HitCounter(void) : + m_filename(""), + m_lineNumber(0), + m_hitCounts(0) { + } + + HitCounter(const char* filename, unsigned long int lineNumber) : + m_filename(filename), + m_lineNumber(lineNumber), + m_hitCounts(0) { + } + + HitCounter(const HitCounter& hitCounter) : + m_filename(hitCounter.m_filename), + m_lineNumber(hitCounter.m_lineNumber), + m_hitCounts(hitCounter.m_hitCounts) { + } + + HitCounter& operator=(const HitCounter& hitCounter) { + m_filename = hitCounter.m_filename; + m_lineNumber = hitCounter.m_lineNumber; + m_hitCounts = hitCounter.m_hitCounts; + return *this; + } + + virtual ~HitCounter(void) { + } + + /// @brief Resets location of current hit counter + inline void resetLocation(const char* filename, unsigned long int lineNumber) { + m_filename = filename; + m_lineNumber = lineNumber; + } + + /// @brief Validates hit counts and resets it if necessary + inline void validateHitCounts(std::size_t n) { + if (m_hitCounts >= base::consts::kMaxLogPerCounter) { + m_hitCounts = (n >= 1 ? base::consts::kMaxLogPerCounter % n : 0); + } + ++m_hitCounts; + } + + inline const char* filename(void) const { + return m_filename; + } + + inline unsigned long int lineNumber(void) const { + return m_lineNumber; + } + + inline std::size_t hitCounts(void) const { + return m_hitCounts; + } + + inline void increment(void) { + ++m_hitCounts; + } + + class Predicate { + public: + Predicate(const char* filename, unsigned long int lineNumber) + : m_filename(filename), + m_lineNumber(lineNumber) { + } + inline bool operator()(const HitCounter* counter) { + return ((counter != nullptr) && + (strcmp(counter->m_filename, m_filename) == 0) && + (counter->m_lineNumber == m_lineNumber)); + } + + private: + const char* m_filename; + unsigned long int m_lineNumber; + }; + + private: + const char* m_filename; + unsigned long int m_lineNumber; + std::size_t m_hitCounts; + }; + /// @brief Repository for hit counters used across the application + class RegisteredHitCounters : public base::utils::RegistryWithPred { + public: + /// @brief Validates counter for every N, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateEveryN(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + counter->validateHitCounts(n); + bool result = (n >= 1 && counter->hitCounts() != 0 && counter->hitCounts() % n == 0); + return result; + } + + /// @brief Validates counter for hits >= N, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateAfterN(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + // Do not use validateHitCounts here since we do not want to reset counter here + // Note the >= instead of > because we are incrementing + // after this check + if (counter->hitCounts() >= n) + return true; + counter->increment(); + return false; + } + + /// @brief Validates counter for hits are <= n, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateNTimes(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + counter->increment(); + // Do not use validateHitCounts here since we do not want to reset counter here + if (counter->hitCounts() <= n) + return true; + return false; + } + + /// @brief Gets hit counter registered at specified position + inline const base::HitCounter* getCounter(const char* filename, unsigned long int lineNumber) { + base::threading::ScopedLock scopedLock(lock()); + return get(filename, lineNumber); + } + }; + /// @brief Action to be taken for dispatching + enum class DispatchAction : base::type::EnumType { + None = 1, NormalLog = 2, SysLog = 4 + }; + } // namespace base + template + class Callback : protected base::threading::ThreadSafe { + public: + Callback(void) : m_enabled(true) {} + inline bool enabled(void) const { return m_enabled; } + inline void setEnabled(bool enabled) { + base::threading::ScopedLock scopedLock(lock()); + m_enabled = enabled; + } + protected: + virtual void handle(const T* handlePtr) = 0; + private: + bool m_enabled; + }; + class LogDispatchData { + public: + LogDispatchData() : m_logMessage(nullptr), m_dispatchAction(base::DispatchAction::None) {} + inline const LogMessage* logMessage(void) const { return m_logMessage; } + inline base::DispatchAction dispatchAction(void) const { return m_dispatchAction; } + private: + LogMessage* m_logMessage; + base::DispatchAction m_dispatchAction; + friend class base::LogDispatcher; + + inline void setLogMessage(LogMessage* logMessage) { m_logMessage = logMessage; } + inline void setDispatchAction(base::DispatchAction dispatchAction) { m_dispatchAction = dispatchAction; } + }; + class LogDispatchCallback : public Callback { + private: + friend class base::LogDispatcher; + }; + class PerformanceTrackingCallback : public Callback { + private: + friend class base::PerformanceTracker; + }; + class LogBuilder : base::NoCopy { + public: + virtual ~LogBuilder(void) { ELPP_INTERNAL_INFO(3, "Destroying log builder...") } + virtual base::type::string_t build(const LogMessage* logMessage, bool appendNewLine) const = 0; + void convertToColoredOutput(base::type::string_t* logLine, Level level) { + if (!base::utils::s_termSupportsColor) return; + const base::type::char_t* resetColor = ELPP_LITERAL("\x1b[0m"); + if (level == Level::Error || level == Level::Fatal) + *logLine = ELPP_LITERAL("\x1b[31m") + *logLine + resetColor; + else if (level == Level::Warning) + *logLine = ELPP_LITERAL("\x1b[33m") + *logLine + resetColor; + } + private: + friend class el::base::DefaultLogDispatchCallback; + }; + typedef std::shared_ptr LogBuilderPtr; + /// @brief Represents a logger holding ID and configurations we need to write logs + /// + /// @detail This class does not write logs itself instead its used by writer to read configuations from. + class Logger : public base::threading::ThreadSafe, public Loggable { + public: + Logger(const std::string& id, base::LogStreamsReferenceMap* logStreamsReference) : + m_id(id), + m_typedConfigurations(nullptr), + m_parentApplicationName(std::string()), + m_isConfigured(false), + m_logStreamsReference(logStreamsReference) { + initUnflushedCount(); + } + + Logger(const std::string& id, const Configurations& configurations, base::LogStreamsReferenceMap* logStreamsReference) : + m_id(id), + m_typedConfigurations(nullptr), + m_parentApplicationName(std::string()), + m_isConfigured(false), + m_logStreamsReference(logStreamsReference) { + initUnflushedCount(); + configure(configurations); + } + + Logger(const Logger& logger) { + base::utils::safeDelete(m_typedConfigurations); + m_id = logger.m_id; + m_typedConfigurations = logger.m_typedConfigurations; + m_parentApplicationName = logger.m_parentApplicationName; + m_isConfigured = logger.m_isConfigured; + m_configurations = logger.m_configurations; + m_unflushedCount = logger.m_unflushedCount; + m_logStreamsReference = logger.m_logStreamsReference; + } + + Logger& operator=(const Logger& logger) { + base::utils::safeDelete(m_typedConfigurations); + m_id = logger.m_id; + m_typedConfigurations = logger.m_typedConfigurations; + m_parentApplicationName = logger.m_parentApplicationName; + m_isConfigured = logger.m_isConfigured; + m_configurations = logger.m_configurations; + m_unflushedCount = logger.m_unflushedCount; + m_logStreamsReference = logger.m_logStreamsReference; + return *this; + } + + virtual ~Logger(void) { + base::utils::safeDelete(m_typedConfigurations); + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << m_id.c_str(); + } + + /// @brief Configures the logger using specified configurations. + void configure(const Configurations& configurations) { + m_isConfigured = false; // we set it to false in case if we fail + initUnflushedCount(); + if (m_typedConfigurations != nullptr) { + Configurations* c = const_cast(m_typedConfigurations->configurations()); + if (c->hasConfiguration(Level::Global, ConfigurationType::Filename)) { + // This check is definitely needed for cases like ELPP_NO_DEFAULT_LOG_FILE + flush(); + } + } + base::threading::ScopedLock scopedLock(lock()); + if (m_configurations != configurations) { + m_configurations.setFromBase(const_cast(&configurations)); + } + base::utils::safeDelete(m_typedConfigurations); + m_typedConfigurations = new base::TypedConfigurations(&m_configurations, m_logStreamsReference); + resolveLoggerFormatSpec(); + m_isConfigured = true; + } + + /// @brief Reconfigures logger using existing configurations + inline void reconfigure(void) { + ELPP_INTERNAL_INFO(1, "Reconfiguring logger [" << m_id << "]"); + configure(m_configurations); + } + + inline const std::string& id(void) const { + return m_id; + } + + inline const std::string& parentApplicationName(void) const { + return m_parentApplicationName; + } + + inline void setParentApplicationName(const std::string& parentApplicationName) { + m_parentApplicationName = parentApplicationName; + } + + inline Configurations* configurations(void) { + return &m_configurations; + } + + inline base::TypedConfigurations* typedConfigurations(void) { + return m_typedConfigurations; + } + + static inline bool isValidId(const std::string& id) { + for (std::string::const_iterator it = id.begin(); it != id.end(); ++it) { + if (!base::utils::Str::contains(base::consts::kValidLoggerIdSymbols, *it)) { + return false; + } + } + return true; + } + /// @brief Flushes logger to sync all log files for all levels + inline void flush(void) { + ELPP_INTERNAL_INFO(3, "Flushing logger [" << m_id << "] all levels"); + base::threading::ScopedLock scopedLock(lock()); + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + flush(LevelHelper::castFromInt(lIndex), nullptr); + return false; + }); + } + + inline void flush(Level level, base::type::fstream_t* fs) { + if (fs == nullptr && m_typedConfigurations->toFile(level)) { + fs = m_typedConfigurations->fileStream(level); + } + if (fs != nullptr) { + fs->flush(); + m_unflushedCount.find(level)->second = 0; + } + } + + inline bool isFlushNeeded(Level level) { + return ++m_unflushedCount.find(level)->second >= m_typedConfigurations->logFlushThreshold(level); + } + + inline LogBuilder* logBuilder(void) const { + return m_logBuilder.get(); + } + + inline void setLogBuilder(const LogBuilderPtr& logBuilder) { + m_logBuilder = logBuilder; + } + + inline bool enabled(Level level) const { + return m_typedConfigurations->enabled(level); + } + +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED +# define LOGGER_LEVEL_WRITERS_SIGNATURES(FUNCTION_NAME)\ + template \ + inline void FUNCTION_NAME(const char*, const T&, const Args&...);\ + template \ + inline void FUNCTION_NAME(const T&); + + template + inline void verbose(int, const char*, const T&, const Args&...); + + template + inline void verbose(int, const T&); + + LOGGER_LEVEL_WRITERS_SIGNATURES(info) + LOGGER_LEVEL_WRITERS_SIGNATURES(debug) + LOGGER_LEVEL_WRITERS_SIGNATURES(warn) + LOGGER_LEVEL_WRITERS_SIGNATURES(error) + LOGGER_LEVEL_WRITERS_SIGNATURES(fatal) + LOGGER_LEVEL_WRITERS_SIGNATURES(trace) +# undef LOGGER_LEVEL_WRITERS_SIGNATURES +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + private: + std::string m_id; + base::TypedConfigurations* m_typedConfigurations; + base::type::stringstream_t m_stream; + std::string m_parentApplicationName; + bool m_isConfigured; + Configurations m_configurations; + std::map m_unflushedCount; + base::LogStreamsReferenceMap* m_logStreamsReference; + LogBuilderPtr m_logBuilder; + + friend class el::LogMessage; + friend class el::Loggers; + friend class el::Helpers; + friend class el::base::RegisteredLoggers; + friend class el::base::DefaultLogDispatchCallback; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::PErrorWriter; + friend class el::base::Storage; + friend class el::base::PerformanceTracker; + friend class el::base::LogDispatcher; + + Logger(void); + +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + template + void log_(Level, int, const char*, const T&, const Args&...); + + template + inline void log_(Level, int, const T&); + + template + void log(Level, const char*, const T&, const Args&...); + + template + inline void log(Level, const T&); +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + + void initUnflushedCount(void) { + m_unflushedCount.clear(); + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + m_unflushedCount.insert(std::make_pair(LevelHelper::castFromInt(lIndex), 0)); + return false; + }); + } + + inline base::type::stringstream_t& stream(void) { + return m_stream; + } + + void resolveLoggerFormatSpec(void) const { + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + base::LogFormat* logFormat = + const_cast(&m_typedConfigurations->logFormat(LevelHelper::castFromInt(lIndex))); + base::utils::Str::replaceFirstWithEscape(logFormat->m_format, base::consts::kLoggerIdFormatSpecifier, m_id); + return false; + }); + } + }; + namespace base { + /// @brief Loggers repository + class RegisteredLoggers : public base::utils::Registry { + public: + explicit RegisteredLoggers(const LogBuilderPtr& defaultLogBuilder) : + m_defaultLogBuilder(defaultLogBuilder) { + m_defaultConfigurations.setToDefault(); + } + + virtual ~RegisteredLoggers(void) { + flushAll(); + } + + inline void setDefaultConfigurations(const Configurations& configurations) { + base::threading::ScopedLock scopedLock(lock()); + m_defaultConfigurations.setFromBase(const_cast(&configurations)); + } + + inline Configurations* defaultConfigurations(void) { + return &m_defaultConfigurations; + } + + Logger* get(const std::string& id, bool forceCreation = true) { + base::threading::ScopedLock scopedLock(lock()); + Logger* logger_ = base::utils::Registry::get(id); + if (logger_ == nullptr && forceCreation) { + bool validId = Logger::isValidId(id); + if (!validId) { + ELPP_ASSERT(validId, "Invalid logger ID [" << id << "]. Not registering this logger."); + return nullptr; + } + logger_ = new Logger(id, m_defaultConfigurations, &m_logStreamsReference); + logger_->m_logBuilder = m_defaultLogBuilder; + registerNew(id, logger_); + } + return logger_; + } + + bool remove(const std::string& id) { + if (id == "default") { + return false; + } + Logger* logger = base::utils::Registry::get(id); + if (logger != nullptr) { + unregister(logger); + } + return true; + } + + inline bool has(const std::string& id) { + return get(id, false) != nullptr; + } + + inline void unregister(Logger*& logger) { + base::threading::ScopedLock scopedLock(lock()); + base::utils::Registry::unregister(logger->id()); + } + + inline base::LogStreamsReferenceMap* logStreamsReference(void) { + return &m_logStreamsReference; + } + + inline void flushAll(void) { + ELPP_INTERNAL_INFO(1, "Flushing all log files"); + base::threading::ScopedLock scopedLock(lock()); + for (base::LogStreamsReferenceMap::iterator it = m_logStreamsReference.begin(); + it != m_logStreamsReference.end(); ++it) { + if (it->second.get() == nullptr) continue; + it->second->flush(); + } + } + + private: + LogBuilderPtr m_defaultLogBuilder; + Configurations m_defaultConfigurations; + base::LogStreamsReferenceMap m_logStreamsReference; + friend class el::base::Storage; + }; + /// @brief Represents registries for verbose logging + class VRegistry : base::NoCopy, public base::threading::ThreadSafe { + public: + explicit VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags) : m_level(level), m_pFlags(pFlags) { + } + + /// @brief Sets verbose level. Accepted range is 0-9 + inline void setLevel(base::type::VerboseLevel level) { + base::threading::ScopedLock scopedLock(lock()); + if (level < 0) + m_level = 0; + else if (level > 9) + m_level = base::consts::kMaxVerboseLevel; + else + m_level = level; + } + + inline base::type::VerboseLevel level(void) const { + return m_level; + } + + inline void clearModules(void) { + base::threading::ScopedLock scopedLock(lock()); + m_modules.clear(); + } + + void setModules(const char* modules) { + base::threading::ScopedLock scopedLock(lock()); + auto addSuffix = [](std::stringstream& ss, const char* sfx, const char* prev) { + if (prev != nullptr && base::utils::Str::endsWith(ss.str(), std::string(prev))) { + std::string chr(ss.str().substr(0, ss.str().size() - strlen(prev))); + ss.str(std::string("")); + ss << chr; + } + if (base::utils::Str::endsWith(ss.str(), std::string(sfx))) { + std::string chr(ss.str().substr(0, ss.str().size() - strlen(sfx))); + ss.str(std::string("")); + ss << chr; + } + ss << sfx; + }; + auto insert = [&](std::stringstream& ss, base::type::VerboseLevel level) { + if (!base::utils::hasFlag(LoggingFlag::DisableVModulesExtensions, *m_pFlags)) { + addSuffix(ss, ".h", nullptr); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".c", ".h"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cpp", ".c"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cc", ".cpp"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cxx", ".cc"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".-inl.h", ".cxx"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hxx", ".-inl.h"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hpp", ".hxx"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hh", ".hpp"); + } + m_modules.insert(std::make_pair(ss.str(), level)); + }; + bool isMod = true; + bool isLevel = false; + std::stringstream ss; + int level = -1; + for (; *modules; ++modules) { + switch (*modules) { + case '=': + isLevel = true; + isMod = false; + break; + case ',': + isLevel = false; + isMod = true; + if (!ss.str().empty() && level != -1) { + insert(ss, level); + ss.str(std::string("")); + level = -1; + } + break; + default: + if (isMod) { + ss << *modules; + } + else if (isLevel) { + if (isdigit(*modules)) { + level = static_cast(*modules) - 48; + } + } + break; + } + } + if (!ss.str().empty() && level != -1) { + insert(ss, level); + } + } + + bool allowed(base::type::VerboseLevel vlevel, const char* file) { + base::threading::ScopedLock scopedLock(lock()); + if (m_modules.empty() || file == nullptr) { + return vlevel <= m_level; + } + else { + std::map::iterator it = m_modules.begin(); + for (; it != m_modules.end(); ++it) { + if (base::utils::Str::wildCardMatch(file, it->first.c_str())) { + return vlevel <= it->second; + } + } + if (base::utils::hasFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified, *m_pFlags)) { + return true; + } + return false; + } + } + + inline const std::map& modules(void) const { + return m_modules; + } + + void setFromArgs(const base::utils::CommandLineArgs* commandLineArgs) { + if (commandLineArgs->hasParam("-v") || commandLineArgs->hasParam("--verbose") || + commandLineArgs->hasParam("-V") || commandLineArgs->hasParam("--VERBOSE")) { + setLevel(base::consts::kMaxVerboseLevel); + } + else if (commandLineArgs->hasParamWithValue("--v")) { + setLevel(atoi(commandLineArgs->getParamValue("--v"))); + } + else if (commandLineArgs->hasParamWithValue("--V")) { + setLevel(atoi(commandLineArgs->getParamValue("--V"))); + } + else if ((commandLineArgs->hasParamWithValue("-vmodule")) && vModulesEnabled()) { + setModules(commandLineArgs->getParamValue("-vmodule")); + } + else if (commandLineArgs->hasParamWithValue("-VMODULE") && vModulesEnabled()) { + setModules(commandLineArgs->getParamValue("-VMODULE")); + } + } + + /// @brief Whether or not vModules enabled + inline bool vModulesEnabled(void) { + return !base::utils::hasFlag(LoggingFlag::DisableVModules, *m_pFlags); + } + + private: + base::type::VerboseLevel m_level; + base::type::EnumType* m_pFlags; + std::map m_modules; + }; + } // namespace base + class LogMessage { + public: + LogMessage(Level level, const std::string& file, unsigned long int line, const std::string& func, + base::type::VerboseLevel verboseLevel, Logger* logger) : + m_level(level), m_file(file), m_line(line), m_func(func), + m_verboseLevel(verboseLevel), m_logger(logger), m_message(std::move(logger->stream().str())) { + } + inline Level level(void) const { return m_level; } + inline const std::string& file(void) const { return m_file; } + inline unsigned long int line(void) const { return m_line; } // NOLINT + inline const std::string& func(void) const { return m_func; } + inline base::type::VerboseLevel verboseLevel(void) const { return m_verboseLevel; } + inline Logger* logger(void) const { return m_logger; } + inline const base::type::string_t& message(void) const { return m_message; } + private: + Level m_level; + std::string m_file; + unsigned long int m_line; + std::string m_func; + base::type::VerboseLevel m_verboseLevel; + Logger* m_logger; + base::type::string_t m_message; + }; + namespace base { +#if ELPP_ASYNC_LOGGING + class AsyncLogItem { + public: + explicit AsyncLogItem(const LogMessage& logMessage, const LogDispatchData& data, const base::type::string_t& logLine) + : m_logMessage(logMessage), m_dispatchData(data), m_logLine(logLine) {} + virtual ~AsyncLogItem() {} + inline LogMessage* logMessage(void) { return &m_logMessage; } + inline LogDispatchData* data(void) { return &m_dispatchData; } + inline base::type::string_t logLine(void) { return m_logLine; } + private: + LogMessage m_logMessage; + LogDispatchData m_dispatchData; + base::type::string_t m_logLine; + }; + class AsyncLogQueue : public base::threading::ThreadSafe { + public: + virtual ~AsyncLogQueue() { + ELPP_INTERNAL_INFO(6, "~AsyncLogQueue"); + } + + inline AsyncLogItem next(void) { + base::threading::ScopedLock scopedLock(lock()); + AsyncLogItem result = m_queue.front(); + m_queue.pop(); + return result; + } + + inline void push(const AsyncLogItem& item) { + base::threading::ScopedLock scopedLock(lock()); + m_queue.push(item); + } + inline void pop(void) { + base::threading::ScopedLock scopedLock(lock()); + m_queue.pop(); + } + inline AsyncLogItem front(void) { + base::threading::ScopedLock scopedLock(lock()); + return m_queue.front(); + } + inline bool empty(void) { + base::threading::ScopedLock scopedLock(lock()); + return m_queue.empty(); + } + private: + std::queue m_queue; + }; + class IWorker { + public: + virtual ~IWorker() {} + virtual void start() = 0; + }; +#endif // ELPP_ASYNC_LOGGING + /// @brief Easylogging++ management storage + class Storage : base::NoCopy, public base::threading::ThreadSafe { + public: +#if ELPP_ASYNC_LOGGING + Storage(const LogBuilderPtr& defaultLogBuilder, base::IWorker* asyncDispatchWorker) : +#else + explicit Storage(const LogBuilderPtr& defaultLogBuilder) : +#endif // ELPP_ASYNC_LOGGING + m_registeredHitCounters(new base::RegisteredHitCounters()), + m_registeredLoggers(new base::RegisteredLoggers(defaultLogBuilder)), + m_flags(0x0), + m_vRegistry(new base::VRegistry(0, &m_flags)), +#if ELPP_ASYNC_LOGGING + m_asyncLogQueue(new base::AsyncLogQueue()), + m_asyncDispatchWorker(asyncDispatchWorker), +#endif // ELPP_ASYNC_LOGGING + m_preRollOutCallback(base::defaultPreRollOutCallback) { + // Register default logger + m_registeredLoggers->get(std::string(base::consts::kDefaultLoggerId)); + // Register performance logger and reconfigure format + Logger* performanceLogger = m_registeredLoggers->get(std::string(base::consts::kPerformanceLoggerId)); + performanceLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%datetime %level %msg")); + performanceLogger->reconfigure(); +#if defined(ELPP_SYSLOG) + // Register syslog logger and reconfigure format + Logger* sysLogLogger = m_registeredLoggers->get(std::string(base::consts::kSysLogLoggerId)); + sysLogLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%level: %msg")); + sysLogLogger->reconfigure(); +#else + ELPP_UNUSED(base::consts::kSysLogLoggerId); +#endif // defined(ELPP_SYSLOG) + addFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified); +#if ELPP_ASYNC_LOGGING + installLogDispatchCallback(std::string("AsyncLogDispatchCallback")); +#else + installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); +#endif // ELPP_ASYNC_LOGGING + installPerformanceTrackingCallback(std::string("DefaultPerformanceTrackingCallback")); + ELPP_INTERNAL_INFO(1, "Easylogging++ has been initialized"); +#if ELPP_ASYNC_LOGGING + m_asyncDispatchWorker->start(); +#endif // ELPP_ASYNC_LOGGING + } + + virtual ~Storage(void) { + ELPP_INTERNAL_INFO(4, "Destroying storage"); +#if ELPP_ASYNC_LOGGING + ELPP_INTERNAL_INFO(5, "Replacing log dispatch callback to synchronous"); + uninstallLogDispatchCallback(std::string("AsyncLogDispatchCallback")); + installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); + ELPP_INTERNAL_INFO(5, "Destroying asyncDispatchWorker"); + base::utils::safeDelete(m_asyncDispatchWorker); + ELPP_INTERNAL_INFO(5, "Destroying asyncLogQueue"); + base::utils::safeDelete(m_asyncLogQueue); +#endif // ELPP_ASYNC_LOGGING + ELPP_INTERNAL_INFO(5, "Destroying registeredHitCounters"); + base::utils::safeDelete(m_registeredHitCounters); + ELPP_INTERNAL_INFO(5, "Destroying registeredLoggers"); + base::utils::safeDelete(m_registeredLoggers); + ELPP_INTERNAL_INFO(5, "Destroying vRegistry"); + base::utils::safeDelete(m_vRegistry); + } + + inline bool validateEveryNCounter(const char* filename, unsigned long int lineNumber, std::size_t occasion) { + return hitCounters()->validateEveryN(filename, lineNumber, occasion); + } + + inline bool validateAfterNCounter(const char* filename, unsigned long int lineNumber, std::size_t n) { // NOLINT + return hitCounters()->validateAfterN(filename, lineNumber, n); + } + + inline bool validateNTimesCounter(const char* filename, unsigned long int lineNumber, std::size_t n) { // NOLINT + return hitCounters()->validateNTimes(filename, lineNumber, n); + } + + inline base::RegisteredHitCounters* hitCounters(void) const { + return m_registeredHitCounters; + } + + inline base::RegisteredLoggers* registeredLoggers(void) const { + return m_registeredLoggers; + } + + inline base::VRegistry* vRegistry(void) const { + return m_vRegistry; + } + +#if ELPP_ASYNC_LOGGING + inline base::AsyncLogQueue* asyncLogQueue(void) const { + return m_asyncLogQueue; + } +#endif // ELPP_ASYNC_LOGGING + + inline const base::utils::CommandLineArgs* commandLineArgs(void) const { + return &m_commandLineArgs; + } + + inline void addFlag(LoggingFlag flag) { + base::utils::addFlag(flag, &m_flags); + } + + inline void removeFlag(LoggingFlag flag) { + base::utils::removeFlag(flag, &m_flags); + } + + inline bool hasFlag(LoggingFlag flag) const { + return base::utils::hasFlag(flag, m_flags); + } + + inline base::type::EnumType flags(void) const { + return m_flags; + } + + inline void setFlags(base::type::EnumType flags) { + m_flags = flags; + } + + inline void setPreRollOutCallback(const PreRollOutCallback& callback) { + m_preRollOutCallback = callback; + } + + inline void unsetPreRollOutCallback(void) { + m_preRollOutCallback = base::defaultPreRollOutCallback; + } + + inline PreRollOutCallback& preRollOutCallback(void) { + return m_preRollOutCallback; + } + + inline bool hasCustomFormatSpecifier(const char* formatSpecifier) { + base::threading::ScopedLock scopedLock(lock()); + return std::find(m_customFormatSpecifiers.begin(), m_customFormatSpecifiers.end(), + formatSpecifier) != m_customFormatSpecifiers.end(); + } + + inline void installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { + if (hasCustomFormatSpecifier(customFormatSpecifier.formatSpecifier())) { + return; + } + base::threading::ScopedLock scopedLock(lock()); + m_customFormatSpecifiers.push_back(customFormatSpecifier); + } + + inline bool uninstallCustomFormatSpecifier(const char* formatSpecifier) { + base::threading::ScopedLock scopedLock(lock()); + std::vector::iterator it = std::find(m_customFormatSpecifiers.begin(), + m_customFormatSpecifiers.end(), formatSpecifier); + if (it != m_customFormatSpecifiers.end() && strcmp(formatSpecifier, it->formatSpecifier()) == 0) { + m_customFormatSpecifiers.erase(it); + return true; + } + return false; + } + + const std::vector* customFormatSpecifiers(void) const { + return &m_customFormatSpecifiers; + } + + inline void setLoggingLevel(Level level) { + m_loggingLevel = level; + } + + template + inline bool installLogDispatchCallback(const std::string& id) { + return installCallback(id, &m_logDispatchCallbacks); + } + + template + inline void uninstallLogDispatchCallback(const std::string& id) { + uninstallCallback(id, &m_logDispatchCallbacks); + } + template + inline T* logDispatchCallback(const std::string& id) { + return callback(id, &m_logDispatchCallbacks); + } + + template + inline bool installPerformanceTrackingCallback(const std::string& id) { + return installCallback(id, &m_performanceTrackingCallbacks); + } + + template + inline void uninstallPerformanceTrackingCallback(const std::string& id) { + uninstallCallback(id, &m_performanceTrackingCallbacks); + } + + template + inline T* performanceTrackingCallback(const std::string& id) { + return callback(id, &m_performanceTrackingCallbacks); + } + private: + base::RegisteredHitCounters* m_registeredHitCounters; + base::RegisteredLoggers* m_registeredLoggers; + base::type::EnumType m_flags; + base::VRegistry* m_vRegistry; +#if ELPP_ASYNC_LOGGING + base::AsyncLogQueue* m_asyncLogQueue; + base::IWorker* m_asyncDispatchWorker; +#endif // ELPP_ASYNC_LOGGING + base::utils::CommandLineArgs m_commandLineArgs; + PreRollOutCallback m_preRollOutCallback; + std::map m_logDispatchCallbacks; + std::map m_performanceTrackingCallbacks; + std::vector m_customFormatSpecifiers; + Level m_loggingLevel; + + friend class el::Helpers; + friend class el::base::DefaultLogDispatchCallback; + friend class el::LogBuilder; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::PerformanceTracker; + friend class el::base::LogDispatcher; + + void setApplicationArguments(int argc, char** argv) { + m_commandLineArgs.setArgs(argc, argv); + m_vRegistry->setFromArgs(commandLineArgs()); + // default log file +#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) + if (m_commandLineArgs.hasParamWithValue(base::consts::kDefaultLogFileParam)) { + Configurations c; + c.setGlobally(ConfigurationType::Filename, std::string(m_commandLineArgs.getParamValue(base::consts::kDefaultLogFileParam))); + registeredLoggers()->setDefaultConfigurations(c); + for (base::RegisteredLoggers::iterator it = registeredLoggers()->begin(); + it != registeredLoggers()->end(); ++it) { + it->second->configure(c); + } + } +#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) +#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) + if (m_commandLineArgs.hasParamWithValue(base::consts::kLoggingFlagsParam)) { + m_flags = atoi(m_commandLineArgs.getParamValue(base::consts::kLoggingFlagsParam)); + } +#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) + } + + inline void setApplicationArguments(int argc, const char** argv) { + setApplicationArguments(argc, const_cast(argv)); + } + + template + inline bool installCallback(const std::string& id, std::map* mapT) { + if (mapT->find(id) == mapT->end()) { + mapT->insert(std::make_pair(id, TPtr(new T()))); + return true; + } + return false; + } + + template + inline void uninstallCallback(const std::string& id, std::map* mapT) { + if (mapT->find(id) != mapT->end()) { + mapT->erase(id); + } + } + + template + inline T* callback(const std::string& id, std::map* mapT) { + typename std::map::iterator iter = mapT->find(id); + if (iter != mapT->end()) { + return static_cast(iter->second.get()); + } + return nullptr; + } + }; + extern ELPP_EXPORT base::type::StoragePointer elStorage; +#define ELPP el::base::elStorage + class DefaultLogDispatchCallback : public LogDispatchCallback { + protected: + void handle(const LogDispatchData* data) { + m_data = data; + dispatch(std::move(m_data->logMessage()->logger()->logBuilder()->build(m_data->logMessage(), + m_data->dispatchAction() == base::DispatchAction::NormalLog))); + } + private: + const LogDispatchData* m_data; + void dispatch(base::type::string_t&& logLine) { + if (m_data->dispatchAction() == base::DispatchAction::NormalLog) { + if (m_data->logMessage()->logger()->m_typedConfigurations->toFile(m_data->logMessage()->level())) { + base::type::fstream_t* fs = m_data->logMessage()->logger()->m_typedConfigurations->fileStream(m_data->logMessage()->level()); + if (fs != nullptr) { + fs->write(logLine.c_str(), logLine.size()); + if (fs->fail()) { + ELPP_INTERNAL_ERROR("Unable to write log to file [" + << m_data->logMessage()->logger()->m_typedConfigurations->filename(m_data->logMessage()->level()) << "].\n" + << "Few possible reasons (could be something else):\n" << " * Permission denied\n" + << " * Disk full\n" << " * Disk is not writable", true); + } + else { + if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || (m_data->logMessage()->logger()->isFlushNeeded(m_data->logMessage()->level()))) { + m_data->logMessage()->logger()->flush(m_data->logMessage()->level(), fs); + } + } + } + else { + ELPP_INTERNAL_ERROR("Log file for [" << LevelHelper::convertToString(m_data->logMessage()->level()) << "] " + << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " + << m_data->logMessage()->logger()->id() << "]", false); + } + } + if (m_data->logMessage()->logger()->m_typedConfigurations->toStandardOutput(m_data->logMessage()->level())) { + if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) + m_data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, m_data->logMessage()->level()); + ELPP_COUT << ELPP_COUT_LINE(logLine); + } + } +#if defined(ELPP_SYSLOG) + else if (m_data->dispatchAction() == base::DispatchAction::SysLog) { + // Determine syslog priority + int sysLogPriority = 0; + if (m_data->logMessage()->level() == Level::Fatal) + sysLogPriority = LOG_EMERG; + else if (m_data->logMessage()->level() == Level::Error) + sysLogPriority = LOG_ERR; + else if (m_data->logMessage()->level() == Level::Warning) + sysLogPriority = LOG_WARNING; + else if (m_data->logMessage()->level() == Level::Info) + sysLogPriority = LOG_INFO; + else if (m_data->logMessage()->level() == Level::Debug) + sysLogPriority = LOG_DEBUG; + else + sysLogPriority = LOG_NOTICE; +# if defined(ELPP_UNICODE) + char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); + syslog(sysLogPriority, "%s", line); + free(line); +# else + syslog(sysLogPriority, "%s", logLine.c_str()); +# endif + } +#endif // defined(ELPP_SYSLOG) + } + }; +#if ELPP_ASYNC_LOGGING + class AsyncLogDispatchCallback : public LogDispatchCallback { + protected: + void handle(const LogDispatchData* data) { + base::type::string_t logLine = data->logMessage()->logger()->logBuilder()->build(data->logMessage(), data->dispatchAction() == base::DispatchAction::NormalLog); + if (data->dispatchAction() == base::DispatchAction::NormalLog && data->logMessage()->logger()->typedConfigurations()->toStandardOutput(data->logMessage()->level())) { + if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) + data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, data->logMessage()->level()); + ELPP_COUT << ELPP_COUT_LINE(logLine); + } + // Save resources and only queue if we want to write to file otherwise just ignore handler + if (data->logMessage()->logger()->typedConfigurations()->toFile(data->logMessage()->level())) { + ELPP->asyncLogQueue()->push(AsyncLogItem(*(data->logMessage()), *data, logLine)); + } + } + }; + class AsyncDispatchWorker : public base::IWorker, public base::threading::ThreadSafe { + public: + AsyncDispatchWorker() { + setContinueRunning(false); + } + + virtual ~AsyncDispatchWorker() { + setContinueRunning(false); + ELPP_INTERNAL_INFO(6, "Stopping dispatch worker - Cleaning log queue"); + clean(); + ELPP_INTERNAL_INFO(6, "Log queue cleaned"); + } + + inline bool clean() { + std::mutex m; + std::unique_lock lk(m); + cv.wait(lk, [] { return !ELPP->asyncLogQueue()->empty(); }); + emptyQueue(); + lk.unlock(); + cv.notify_one(); + return ELPP->asyncLogQueue()->empty(); + } + + inline void emptyQueue() { + while (!ELPP->asyncLogQueue()->empty()) { + AsyncLogItem data = ELPP->asyncLogQueue()->next(); + handle(&data); + base::threading::msleep(100); + } + } + + virtual inline void start() { + base::threading::msleep(5000); // Wait extra few seconds + setContinueRunning(true); + std::thread t1(&AsyncDispatchWorker::runner, this); + t1.join(); + } + + void handle(AsyncLogItem* logItem) { + LogDispatchData* data = logItem->data(); + LogMessage* logMessage = logItem->logMessage(); + Logger* logger = logMessage->logger(); + base::TypedConfigurations* conf = logger->typedConfigurations(); + base::type::string_t logLine = logItem->logLine(); + if (data->dispatchAction() == base::DispatchAction::NormalLog) { + if (conf->toFile(logMessage->level())) { + base::type::fstream_t* fs = conf->fileStream(logMessage->level()); + if (fs != nullptr) { + fs->write(logLine.c_str(), logLine.size()); + if (fs->fail()) { + ELPP_INTERNAL_ERROR("Unable to write log to file [" + << conf->filename(logMessage->level()) << "].\n" + << "Few possible reasons (could be something else):\n" << " * Permission denied\n" + << " * Disk full\n" << " * Disk is not writable", true); + } + else { + if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || (logger->isFlushNeeded(logMessage->level()))) { + logger->flush(logMessage->level(), fs); + } + } + } + else { + ELPP_INTERNAL_ERROR("Log file for [" << LevelHelper::convertToString(logMessage->level()) << "] " + << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " << logger->id() << "]", false); + } + } + } +# if defined(ELPP_SYSLOG) + else if (data->dispatchAction() == base::DispatchAction::SysLog) { + // Determine syslog priority + int sysLogPriority = 0; + if (logMessage->level() == Level::Fatal) + sysLogPriority = LOG_EMERG; + else if (logMessage->level() == Level::Error) + sysLogPriority = LOG_ERR; + else if (logMessage->level() == Level::Warning) + sysLogPriority = LOG_WARNING; + else if (logMessage->level() == Level::Info) + sysLogPriority = LOG_INFO; + else if (logMessage->level() == Level::Debug) + sysLogPriority = LOG_DEBUG; + else + sysLogPriority = LOG_NOTICE; +# if defined(ELPP_UNICODE) + char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); + syslog(sysLogPriority, "%s", line); + free(line); +# else + syslog(sysLogPriority, "%s", logLine.c_str()); +# endif + } +# endif // defined(ELPP_SYSLOG) + } + + void run() { + while (continueRunning()) { + emptyQueue(); + base::threading::msleep(10); // 10ms + } + } + + static void* runner(void *context) { + static_cast(context)->run(); + return NULL; + } + + void setContinueRunning(bool value) { + base::threading::ScopedLock scopedLock(m_continueRunningMutex); + m_continueRunning = value; + } + bool continueRunning(void) { + return m_continueRunning; + } + private: + std::condition_variable cv; + bool m_continueRunning; + base::threading::Mutex m_continueRunningMutex; + }; +#endif // ELPP_ASYNC_LOGGING + } // namespace base + namespace base { + class DefaultLogBuilder : public LogBuilder { + public: + base::type::string_t build(const LogMessage* logMessage, bool appendNewLine) const { + base::TypedConfigurations* tc = logMessage->logger()->typedConfigurations(); + const base::LogFormat* logFormat = &tc->logFormat(logMessage->level()); + base::type::string_t logLine = logFormat->format(); + char buff[base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength] = ""; + const char* bufLim = buff + sizeof(buff); + if (logFormat->hasFlag(base::FormatFlags::AppName)) { + // App name + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kAppNameFormatSpecifier, + logMessage->logger()->parentApplicationName()); + } + if (logFormat->hasFlag(base::FormatFlags::ThreadId)) { + // Thread ID + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kThreadIdFormatSpecifier, + base::threading::getCurrentThreadId()); + } + if (logFormat->hasFlag(base::FormatFlags::DateTime)) { + // DateTime + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kDateTimeFormatSpecifier, + base::utils::DateTime::getDateTime(logFormat->dateTimeFormat().c_str(), + &tc->millisecondsWidth(logMessage->level()))); + } + if (logFormat->hasFlag(base::FormatFlags::Function)) { + // Function + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFunctionFormatSpecifier, logMessage->func()); + } + if (logFormat->hasFlag(base::FormatFlags::File)) { + // File + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); + base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::FileBase)) { + // FileBase + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); + base::utils::File::buildBaseFilename(logMessage->file(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileBaseFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::Line)) { + // Line + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceLineMaxLength); + buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), + base::consts::kSourceLineMaxLength, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLineFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::Location)) { + // Location + char* buf = base::utils::Str::clearBuff(buff, + base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength); + base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + buf = base::utils::Str::addToBuff(":", buf, bufLim); + buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), + base::consts::kSourceLineMaxLength, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLocationFormatSpecifier, std::string(buff)); + } + if (logMessage->level() == Level::Verbose && logFormat->hasFlag(base::FormatFlags::VerboseLevel)) { + // Verbose level + char* buf = base::utils::Str::clearBuff(buff, 1); + buf = base::utils::Str::convertAndAddToBuff(logMessage->verboseLevel(), 1, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kVerboseLevelFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::LogMessage)) { + // Log message + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kMessageFormatSpecifier, logMessage->message()); + } +#if !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) + for (std::vector::const_iterator it = ELPP->customFormatSpecifiers()->begin(); + it != ELPP->customFormatSpecifiers()->end(); ++it) { + std::string fs(it->formatSpecifier()); + base::type::string_t wcsFormatSpecifier(fs.begin(), fs.end()); + base::utils::Str::replaceFirstWithEscape(logLine, wcsFormatSpecifier, std::string(it->resolver()())); + } +#endif // !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) + if (appendNewLine) logLine += ELPP_LITERAL("\n"); + return logLine; + } + }; + /// @brief Dispatches log messages + class LogDispatcher : base::NoCopy { + public: + LogDispatcher(bool proceed, LogMessage&& logMessage, base::DispatchAction dispatchAction) : + m_proceed(proceed), + m_logMessage(std::move(logMessage)), + m_dispatchAction(std::move(dispatchAction)) { + } + + void dispatch(void) { + if (m_proceed && m_dispatchAction == base::DispatchAction::None) { + m_proceed = false; + } + if (!m_proceed) { + return; + } + // We minimize the time of ELPP's lock - this lock is released after log is written + base::threading::ScopedLock scopedLock(ELPP->lock()); + base::TypedConfigurations* tc = m_logMessage.logger()->m_typedConfigurations; + if (ELPP->hasFlag(LoggingFlag::StrictLogFileSizeCheck)) { + tc->validateFileRolling(m_logMessage.level(), ELPP->preRollOutCallback()); + } + LogDispatchCallback* callback = nullptr; + LogDispatchData data; + for (const std::pair& h + : ELPP->m_logDispatchCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + data.setLogMessage(&m_logMessage); + data.setDispatchAction(m_dispatchAction); + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + } + + private: + bool m_proceed; + LogMessage m_logMessage; + base::DispatchAction m_dispatchAction; + }; +#if defined(ELPP_STL_LOGGING) + /// @brief Workarounds to write some STL logs + /// + /// @detail There is workaround needed to loop through some stl containers. In order to do that, we need iterable containers + /// of same type and provide iterator interface and pass it on to writeIterator(). + /// Remember, this is passed by value in constructor so that we dont change original containers. + /// This operation is as expensive as Big-O(std::min(class_.size(), base::consts::kMaxLogPerContainer)) + namespace workarounds { + /// @brief Abstract IterableContainer template that provides interface for iterable classes of type T + template + class IterableContainer { + public: + typedef typename Container::iterator iterator; + typedef typename Container::const_iterator const_iterator; + IterableContainer(void) {} + virtual ~IterableContainer(void) {} + iterator begin(void) { return getContainer().begin(); } + iterator end(void) { return getContainer().end(); } + private: + virtual Container& getContainer(void) = 0; + }; + /// @brief Implements IterableContainer and provides iterable std::priority_queue class + template, typename Comparator = std::less> + class IterablePriorityQueue : public IterableContainer, public std::priority_queue { + public: + IterablePriorityQueue(std::priority_queue queue_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { + this->push(queue_.top()); + queue_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + /// @brief Implements IterableContainer and provides iterable std::queue class + template> + class IterableQueue : public IterableContainer, public std::queue { + public: + IterableQueue(std::queue queue_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { + this->push(queue_.front()); + queue_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + /// @brief Implements IterableContainer and provides iterable std::stack class + template> + class IterableStack : public IterableContainer, public std::stack { + public: + IterableStack(std::stack stack_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !stack_.empty()) { + this->push(stack_.top()); + stack_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + } // namespace workarounds +#endif // defined(ELPP_STL_LOGGING) + // Log message builder + class MessageBuilder { + public: + MessageBuilder(void) : m_logger(nullptr), m_containerLogSeperator(ELPP_LITERAL("")) {} + void initialize(Logger* logger) { + m_logger = logger; + m_containerLogSeperator = ELPP->hasFlag(LoggingFlag::NewLineForContainer) ? + ELPP_LITERAL("\n ") : ELPP_LITERAL(", "); + } + +# define ELPP_SIMPLE_LOG(LOG_TYPE)\ + inline MessageBuilder& operator<<(LOG_TYPE msg) {\ + m_logger->stream() << msg;\ + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) {\ + m_logger->stream() << " ";\ + }\ + return *this;\ + } + + inline MessageBuilder& operator<<(const std::string& msg) { + return operator<<(msg.c_str()); + } + ELPP_SIMPLE_LOG(char) + ELPP_SIMPLE_LOG(bool) + ELPP_SIMPLE_LOG(signed short) + ELPP_SIMPLE_LOG(unsigned short) + ELPP_SIMPLE_LOG(signed int) + ELPP_SIMPLE_LOG(unsigned int) + ELPP_SIMPLE_LOG(signed long) + ELPP_SIMPLE_LOG(unsigned long) + ELPP_SIMPLE_LOG(float) + ELPP_SIMPLE_LOG(double) + ELPP_SIMPLE_LOG(char*) + ELPP_SIMPLE_LOG(const char*) + ELPP_SIMPLE_LOG(const void*) + ELPP_SIMPLE_LOG(long double) + inline MessageBuilder& operator<<(const std::wstring& msg) { + return operator<<(msg.c_str()); + } + inline MessageBuilder& operator<<(const wchar_t* msg) { + if (msg == nullptr) { + m_logger->stream() << base::consts::kNullPointer; + return *this; + } +# if defined(ELPP_UNICODE) + m_logger->stream() << msg; +# else + char* buff_ = base::utils::Str::wcharPtrToCharPtr(msg); + m_logger->stream() << buff_; + free(buff_); +# endif + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { + m_logger->stream() << " "; + } + return *this; + } + // ostream manipulators + inline MessageBuilder& operator<<(std::ostream& (*OStreamMani)(std::ostream&)) { + m_logger->stream() << OStreamMani; + return *this; + } +#define ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } + +#if defined(ELPP_STL_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::list) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::deque) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::set) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::multiset) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::map) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::multimap) + template + inline MessageBuilder& operator<<(const std::queue& queue_) { + base::workarounds::IterableQueue iterableQueue_ = + static_cast >(queue_); + return writeIterator(iterableQueue_.begin(), iterableQueue_.end(), iterableQueue_.size()); + } + template + inline MessageBuilder& operator<<(const std::stack& stack_) { + base::workarounds::IterableStack iterableStack_ = + static_cast >(stack_); + return writeIterator(iterableStack_.begin(), iterableStack_.end(), iterableStack_.size()); + } + template + inline MessageBuilder& operator<<(const std::priority_queue& priorityQueue_) { + base::workarounds::IterablePriorityQueue iterablePriorityQueue_ = + static_cast >(priorityQueue_); + return writeIterator(iterablePriorityQueue_.begin(), iterablePriorityQueue_.end(), iterablePriorityQueue_.size()); + } + template + inline MessageBuilder& operator<<(const std::pair& pair_) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(pair_.first)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(pair_.second)); + m_logger->stream() << ELPP_LITERAL(")"); + return *this; + } + template + inline MessageBuilder& operator<<(const std::bitset& bitset_) { + m_logger->stream() << ELPP_LITERAL("["); + operator << (bitset_.to_string()); + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } +# if defined(ELPP_LOG_STD_ARRAY) + template + inline MessageBuilder& operator<<(const std::array& array) { + return writeIterator(array.begin(), array.end(), array.size()); + } +# endif // defined(ELPP_LOG_STD_ARRAY) +# if defined(ELPP_LOG_UNORDERED_MAP) + ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_map) + ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_multimap) +# endif // defined(ELPP_LOG_UNORDERED_MAP) +# if defined(ELPP_LOG_UNORDERED_SET) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_set) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_multiset) +# endif // defined(ELPP_LOG_UNORDERED_SET) +#endif // defined(ELPP_STL_LOGGING) +#if defined(ELPP_QT_LOGGING) + inline MessageBuilder& operator<<(const QString& msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << msg.toStdWString(); +# else + m_logger->stream() << msg.toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(const QByteArray& msg) { + return operator << (QString(msg)); + } + inline MessageBuilder& operator<<(const QStringRef& msg) { + return operator<<(msg.toString()); + } + inline MessageBuilder& operator<<(qint64 msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << QString::number(msg).toStdWString(); +# else + m_logger->stream() << QString::number(msg).toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(quint64 msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << QString::number(msg).toStdWString(); +# else + m_logger->stream() << QString::number(msg).toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(QChar msg) { + m_logger->stream() << msg.toLatin1(); + return *this; + } + inline MessageBuilder& operator<<(const QLatin1String& msg) { + m_logger->stream() << msg.latin1(); + return *this; + } + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QList) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QVector) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QQueue) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QSet) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QLinkedList) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QStack) + template + inline MessageBuilder& operator<<(const QPair& pair_) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(pair_.first)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(pair_.second)); + m_logger->stream() << ELPP_LITERAL(")"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMap& map_) { + m_logger->stream() << ELPP_LITERAL("["); + QList keys = map_.keys(); + typename QList::const_iterator begin = keys.begin(); + typename QList::const_iterator end = keys.end(); + int max_ = static_cast(base::consts::kMaxLogPerContainer); // to prevent warning + for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(*begin)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(map_.value(*begin))); + m_logger->stream() << ELPP_LITERAL(")"); + m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin != end) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMultiMap& map_) { + operator << (static_cast>(map_)); + return *this; + } + template + inline MessageBuilder& operator<<(const QHash& hash_) { + m_logger->stream() << ELPP_LITERAL("["); + QList keys = hash_.keys(); + typename QList::const_iterator begin = keys.begin(); + typename QList::const_iterator end = keys.end(); + int max_ = static_cast(base::consts::kMaxLogPerContainer); // prevent type warning + for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(*begin)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(hash_.value(*begin))); + m_logger->stream() << ELPP_LITERAL(")"); + m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin != end) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMultiHash& multiHash_) { + operator << (static_cast>(multiHash_)); + return *this; + } +#endif // defined(ELPP_QT_LOGGING) +#if defined(ELPP_BOOST_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::stable_vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::list) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::deque) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::map) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::flat_map) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::set) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::flat_set) +#endif // defined(ELPP_BOOST_LOGGING) + + /// @brief Macro used internally that can be used externally to make containers easylogging++ friendly + /// + /// @detail This macro expands to write an ostream& operator<< for container. This container is expected to + /// have begin() and end() methods that return respective iterators + /// @param ContainerType Type of container e.g, MyList from WX_DECLARE_LIST(int, MyList); in wxwidgets + /// @param SizeMethod Method used to get size of container. + /// @param ElementInstance Instance of element to be fed out. Insance name is "elem". See WXELPP_ENABLED macro + /// for an example usage +#define MAKE_CONTAINERELPP_FRIENDLY(ContainerType, SizeMethod, ElementInstance) \ + el::base::type::ostream_t& operator<<(el::base::type::ostream_t& ss, const ContainerType& container) {\ + const el::base::type::char_t* sep = ELPP->hasFlag(el::LoggingFlag::NewLineForContainer) ? \ + ELPP_LITERAL("\n ") : ELPP_LITERAL(", ");\ + ContainerType::const_iterator elem = container.begin();\ + ContainerType::const_iterator endElem = container.end();\ + std::size_t size_ = container.SizeMethod; \ + ss << ELPP_LITERAL("[");\ + for (std::size_t i = 0; elem != endElem && i < el::base::consts::kMaxLogPerContainer; ++i, ++elem) { \ + ss << ElementInstance;\ + ss << ((i < size_ - 1) ? sep : ELPP_LITERAL(""));\ + }\ + if (elem != endElem) {\ + ss << ELPP_LITERAL("...");\ + }\ + ss << ELPP_LITERAL("]");\ + return ss;\ + } +#if defined(ELPP_WXWIDGETS_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(wxVector) +# define ELPP_WX_PTR_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), *(*elem)) +# define ELPP_WX_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), (*elem)) +# define ELPP_WX_HASH_MAP_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), \ + ELPP_LITERAL("(") << elem->first << ELPP_LITERAL(", ") << elem->second << ELPP_LITERAL(")") +#else +# define ELPP_WX_PTR_ENABLED(ContainerType) +# define ELPP_WX_ENABLED(ContainerType) +# define ELPP_WX_HASH_MAP_ENABLED(ContainerType) +#endif // defined(ELPP_WXWIDGETS_LOGGING) + // Other classes + template + ELPP_SIMPLE_LOG(const Class&) +#undef ELPP_SIMPLE_LOG +#undef ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG + private: + Logger* m_logger; + const base::type::char_t* m_containerLogSeperator; + + template + inline MessageBuilder& writeIterator(Iterator begin_, Iterator end_, std::size_t size_) { + m_logger->stream() << ELPP_LITERAL("["); + for (std::size_t i = 0; begin_ != end_ && i < base::consts::kMaxLogPerContainer; ++i, ++begin_) { + operator << (*begin_); + m_logger->stream() << ((i < size_ - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin_ != end_) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { + m_logger->stream() << " "; + } + return *this; + } + }; + /// @brief Writes nothing - Used when certain log is disabled + class NullWriter : base::NoCopy { + public: + NullWriter(void) {} + + // Null manipulator + inline NullWriter& operator<<(std::ostream& (*)(std::ostream&)) { + return *this; + } + + template + inline NullWriter& operator<<(const T&) { + return *this; + } + }; + /// @brief Main entry point of each logging + class Writer : base::NoCopy { + public: + Writer(Level level, const char* file, unsigned long int line, + const char* func, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, + base::type::VerboseLevel verboseLevel = 0) : + m_level(level), m_file(file), m_line(line), m_func(func), m_verboseLevel(verboseLevel), + m_proceed(false), m_dispatchAction(dispatchAction) { + } + + virtual ~Writer(void) { + processDispatch(); + } + + template + inline Writer& operator<<(const T& log) { +#if ELPP_LOGGING_ENABLED + if (m_proceed) { + m_messageBuilder << log; + } +#endif // ELPP_LOGGING_ENABLED + return *this; + } + + inline Writer& operator<<(std::ostream& (*log)(std::ostream&)) { +#if ELPP_LOGGING_ENABLED + if (m_proceed) { + m_messageBuilder << log; + } +#endif // ELPP_LOGGING_ENABLED + return *this; + } + + Writer& construct(Logger* logger, bool needLock = true) { + m_logger = logger; + initializeLogger(logger->id(), false, needLock); + m_messageBuilder.initialize(m_logger); + return *this; + } + + Writer& construct(int count, const char* loggerIds, ...) { + if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { + va_list loggersList; + va_start(loggersList, loggerIds); + const char* id = loggerIds; + for (int i = 0; i < count; ++i) { + m_loggerIds.push_back(std::string(id)); + id = va_arg(loggersList, const char*); + } + va_end(loggersList); + initializeLogger(m_loggerIds.at(0)); + } + else { + initializeLogger(std::string(loggerIds)); + } + m_messageBuilder.initialize(m_logger); + return *this; + } + protected: + Level m_level; + const char* m_file; + const unsigned long int m_line; + const char* m_func; + base::type::VerboseLevel m_verboseLevel; + Logger* m_logger; + bool m_proceed; + base::MessageBuilder m_messageBuilder; + base::DispatchAction m_dispatchAction; + std::vector m_loggerIds; + friend class el::Helpers; + + void initializeLogger(const std::string& loggerId, bool lookup = true, bool needLock = true) { + if (lookup) { + m_logger = ELPP->registeredLoggers()->get(loggerId, ELPP->hasFlag(LoggingFlag::CreateLoggerAutomatically)); + } + if (m_logger == nullptr) { + ELPP->acquireLock(); + if (!ELPP->registeredLoggers()->has(std::string(base::consts::kDefaultLoggerId))) { + // Somehow default logger has been unregistered. Not good! Register again + ELPP->registeredLoggers()->get(std::string(base::consts::kDefaultLoggerId)); + } + ELPP->releaseLock(); // Need to unlock it for next writer + Writer(Level::Debug, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) + << "Logger [" << loggerId << "] is not registered yet!"; + m_proceed = false; + } + else { + if (needLock) { + m_logger->acquireLock(); // This should not be unlocked by checking m_proceed because + // m_proceed can be changed by lines below + } + if (ELPP->hasFlag(LoggingFlag::HierarchicalLogging)) { + m_proceed = m_level == Level::Verbose ? m_logger->enabled(m_level) : + LevelHelper::castToInt(m_level) >= LevelHelper::castToInt(ELPP->m_loggingLevel); + } + else { + m_proceed = m_logger->enabled(m_level); + } + } + } + + void processDispatch() { +#if ELPP_LOGGING_ENABLED + if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { + bool firstDispatched = false; + base::type::string_t logMessage; + std::size_t i = 0; + do { + if (m_proceed) { + if (firstDispatched) { + m_logger->stream() << logMessage; + } + else { + firstDispatched = true; + if (m_loggerIds.size() > 1) { + logMessage = m_logger->stream().str(); + } + } + triggerDispatch(); + } + else if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + if (i + 1 < m_loggerIds.size()) { + initializeLogger(m_loggerIds.at(i + 1)); + } + } while (++i < m_loggerIds.size()); + } + else { + if (m_proceed) { + triggerDispatch(); + } + else if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + } +#else + if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } +#endif // ELPP_LOGGING_ENABLED + } + + void triggerDispatch(void) { + if (m_proceed) { + base::LogDispatcher(m_proceed, LogMessage(m_level, m_file, m_line, m_func, m_verboseLevel, + m_logger), m_dispatchAction).dispatch(); + } + if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + if (m_proceed && m_level == Level::Fatal + && !ELPP->hasFlag(LoggingFlag::DisableApplicationAbortOnFatalLog)) { + base::Writer(Level::Warning, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) + << "Aborting application. Reason: Fatal log at [" << m_file << ":" << m_line << "]"; + std::stringstream reasonStream; + reasonStream << "Fatal log at [" << m_file << ":" << m_line << "]" + << " If you wish to disable 'abort on fatal log' please use " + << "el::Helpers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog)"; + base::utils::abort(1, reasonStream.str()); + } + m_proceed = false; + } + }; + class PErrorWriter : public base::Writer { + public: + PErrorWriter(Level level, const char* file, unsigned long int line, + const char* func, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, + base::type::VerboseLevel verboseLevel = 0) : + base::Writer(level, file, line, func, dispatchAction, verboseLevel) { + } + + virtual ~PErrorWriter(void) { + if (m_proceed) { +#if ELPP_COMPILER_MSVC + char buff[256]; + strerror_s(buff, 256, errno); + m_logger->stream() << ": " << buff << " [" << errno << "]"; +#else + m_logger->stream() << ": " << strerror(errno) << " [" << errno << "]"; +#endif + } + } + }; + } // namespace base + // Logging from Logger class. Why this is here? Because we have Storage and Writer class available +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + template + void Logger::log_(Level level, int vlevel, const char* s, const T& value, const Args&... args) { + base::MessageBuilder b; + b.initialize(this); + while (*s) { + if (*s == base::consts::kFormatSpecifierChar) { + if (*(s + 1) == base::consts::kFormatSpecifierChar) { + ++s; + } + else { + if (*(s + 1) == base::consts::kFormatSpecifierCharValue) { + ++s; + b << value; + log_(level, vlevel, ++s, args...); + return; + } + } + } + b << *s++; + } + ELPP_INTERNAL_ERROR("Too many arguments provided. Unable to handle. Please provide more format specifiers", false); + } + template + inline void Logger::log_(Level level, int vlevel, const T& log) { + if (level == Level::Verbose) { + if (ELPP->vRegistry()->allowed(vlevel, __FILE__)) { + base::Writer(Level::Verbose, "FILE", 0, "FUNCTION", + base::DispatchAction::NormalLog, vlevel).construct(this, false) << log; + } + else { + stream().str(ELPP_LITERAL("")); + } + } + else { + base::Writer(level, "FILE", 0, "FUNCTION").construct(this, false) << log; + } + } + template + void Logger::log(Level level, const char* s, const T& value, const Args&... args) { + base::threading::ScopedLock scopedLock(lock()); + log_(level, 0, s, value, args...); + } + template + inline void Logger::log(Level level, const T& log) { + base::threading::ScopedLock scopedLock(lock()); + log_(level, 0, log); + } +# if ELPP_VERBOSE_LOG + template + inline void Logger::verbose(int vlevel, const char* s, const T& value, const Args&... args) { + base::threading::ScopedLock scopedLock(lock()); + log_(el::Level::Verbose, vlevel, s, value, args...); + } + template + inline void Logger::verbose(int vlevel, const T& log) { + base::threading::ScopedLock scopedLock(lock()); + log_(el::Level::Verbose, vlevel, log); + } +# else + template + inline void Logger::verbose(int, const char*, const T&, const Args&...) { + return; + } + template + inline void Logger::verbose(int, const T&) { + return; + } +# endif // ELPP_VERBOSE_LOG +# define LOGGER_LEVEL_WRITERS(FUNCTION_NAME, LOG_LEVEL)\ + template \ + inline void Logger::FUNCTION_NAME(const char* s, const T& value, const Args&... args) {\ + log(LOG_LEVEL, s, value, args...);\ + }\ + template \ + inline void Logger::FUNCTION_NAME(const T& value) {\ + log(LOG_LEVEL, value);\ + } +# define LOGGER_LEVEL_WRITERS_DISABLED(FUNCTION_NAME, LOG_LEVEL)\ + template \ + inline void Logger::FUNCTION_NAME(const char*, const T&, const Args&...) {\ + return;\ + }\ + template \ + inline void Logger::FUNCTION_NAME(const T&) {\ + return;\ + } + +# if ELPP_INFO_LOG + LOGGER_LEVEL_WRITERS(info, Level::Info) +# else + LOGGER_LEVEL_WRITERS_DISABLED(info, Level::Info) +# endif // ELPP_INFO_LOG +# if ELPP_DEBUG_LOG + LOGGER_LEVEL_WRITERS(debug, Level::Debug) +# else + LOGGER_LEVEL_WRITERS_DISABLED(debug, Level::Debug) +# endif // ELPP_DEBUG_LOG +# if ELPP_WARNING_LOG + LOGGER_LEVEL_WRITERS(warn, Level::Warning) +# else + LOGGER_LEVEL_WRITERS_DISABLED(warn, Level::Warning) +# endif // ELPP_WARNING_LOG +# if ELPP_ERROR_LOG + LOGGER_LEVEL_WRITERS(error, Level::Error) +# else + LOGGER_LEVEL_WRITERS_DISABLED(error, Level::Error) +# endif // ELPP_ERROR_LOG +# if ELPP_FATAL_LOG + LOGGER_LEVEL_WRITERS(fatal, Level::Fatal) +# else + LOGGER_LEVEL_WRITERS_DISABLED(fatal, Level::Fatal) +# endif // ELPP_FATAL_LOG +# if ELPP_TRACE_LOG + LOGGER_LEVEL_WRITERS(trace, Level::Trace) +# else + LOGGER_LEVEL_WRITERS_DISABLED(trace, Level::Trace) +# endif // ELPP_TRACE_LOG +# undef LOGGER_LEVEL_WRITERS +# undef LOGGER_LEVEL_WRITERS_DISABLED +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED +#if ELPP_COMPILER_MSVC +# define ELPP_VARIADIC_FUNC_MSVC(variadicFunction, variadicArgs) variadicFunction variadicArgs +# define ELPP_VARIADIC_FUNC_MSVC_RUN(variadicFunction, ...) ELPP_VARIADIC_FUNC_MSVC(variadicFunction, (__VA_ARGS__)) +# define el_getVALength(...) ELPP_VARIADIC_FUNC_MSVC_RUN(el_resolveVALength, 0, ## __VA_ARGS__,\ + 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#else +# if ELPP_COMPILER_CLANG +# define el_getVALength(...) el_resolveVALength(0, __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +# else +# define el_getVALength(...) el_resolveVALength(0, ## __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +# endif // ELPP_COMPILER_CLANG +#endif // ELPP_COMPILER_MSVC +#define el_resolveVALength(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N +#define ELPP_WRITE_LOG(writer, level, dispatchAction, ...) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_IF(writer, condition, level, dispatchAction, ...) if (condition) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_EVERY_N(writer, occasion, level, dispatchAction, ...) \ + if (ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_AFTER_N(writer, n, level, dispatchAction, ...) \ + if (ELPP->validateAfterNCounter(__FILE__, __LINE__, n)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_N_TIMES(writer, n, level, dispatchAction, ...) \ + if (ELPP->validateNTimesCounter(__FILE__, __LINE__, n)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#undef ELPP_CURR_FILE_PERFORMANCE_LOGGER +#if defined(ELPP_PERFORMANCE_LOGGER) +# define ELPP_CURR_FILE_PERFORMANCE_LOGGER ELPP_PERFORMANCE_LOGGER +#else +# define ELPP_CURR_FILE_PERFORMANCE_LOGGER el::base::consts::kPerformanceLoggerId +#endif + class PerformanceTrackingData { + public: + enum class DataType : base::type::EnumType { + Checkpoint = 1, Complete = 2 + }; + // Do not use constructor, will run into multiple definition error, use init(PerformanceTracker*) + explicit PerformanceTrackingData(DataType dataType) : m_performanceTracker(nullptr), + m_dataType(dataType), m_file(""), m_line(0), m_func("") {} + inline const std::string* blockName(void) const; + inline const struct timeval* startTime(void) const; + inline const struct timeval* endTime(void) const; + inline const struct timeval* lastCheckpointTime(void) const; + inline const base::PerformanceTracker* performanceTracker(void) const { return m_performanceTracker; } + inline PerformanceTrackingData::DataType dataType(void) const { return m_dataType; } + inline bool firstCheckpoint(void) const { return m_firstCheckpoint; } + inline std::string checkpointId(void) const { return m_checkpointId; } + inline const char* file(void) const { return m_file; } + inline unsigned long int line(void) const { return m_line; } + inline const char* func(void) const { return m_func; } + inline const base::type::string_t* formattedTimeTaken() const { return &m_formattedTimeTaken; } + inline const std::string& loggerId(void) const; + private: + base::PerformanceTracker* m_performanceTracker; + base::type::string_t m_formattedTimeTaken; + PerformanceTrackingData::DataType m_dataType; + bool m_firstCheckpoint; + std::string m_checkpointId; + const char* m_file; + unsigned long int m_line; + const char* m_func; + inline void init(base::PerformanceTracker* performanceTracker, bool firstCheckpoint = false) { + m_performanceTracker = performanceTracker; + m_firstCheckpoint = firstCheckpoint; + } + + friend class el::base::PerformanceTracker; + }; + namespace base { + /// @brief Represents performanceTracker block of code that conditionally adds performance status to log + /// either when goes outside the scope of when checkpoint() is called + class PerformanceTracker : public base::threading::ThreadSafe, public Loggable { + public: + PerformanceTracker(const std::string& blockName, + base::TimestampUnit timestampUnit = base::TimestampUnit::Millisecond, + const std::string& loggerId = std::string(ELPP_CURR_FILE_PERFORMANCE_LOGGER), + bool scopedLog = true, Level level = base::consts::kPerformanceTrackerDefaultLevel) : + m_blockName(blockName), m_timestampUnit(timestampUnit), m_loggerId(loggerId), m_scopedLog(scopedLog), + m_level(level), m_hasChecked(false), m_lastCheckpointId(std::string()), m_enabled(false) { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + // We store it locally so that if user happen to change configuration by the end of scope + // or before calling checkpoint, we still depend on state of configuraton at time of construction + el::Logger* loggerPtr = ELPP->registeredLoggers()->get(loggerId, false); + m_enabled = loggerPtr != nullptr && loggerPtr->m_typedConfigurations->performanceTracking(m_level); + if (m_enabled) { + base::utils::DateTime::gettimeofday(&m_startTime); + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + } + /// @brief Copy constructor + PerformanceTracker(const PerformanceTracker& t) : + m_blockName(t.m_blockName), m_timestampUnit(t.m_timestampUnit), m_loggerId(t.m_loggerId), m_scopedLog(t.m_scopedLog), + m_level(t.m_level), m_hasChecked(t.m_hasChecked), m_lastCheckpointId(t.m_lastCheckpointId), m_enabled(t.m_enabled), + m_startTime(t.m_startTime), m_endTime(t.m_endTime), m_lastCheckpointTime(t.m_lastCheckpointTime) { + } + virtual ~PerformanceTracker(void) { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + if (m_enabled) { + base::threading::ScopedLock scopedLock(lock()); + if (m_scopedLog) { + base::utils::DateTime::gettimeofday(&m_endTime); + base::type::string_t formattedTime = getFormattedTimeTaken(); + PerformanceTrackingData data(PerformanceTrackingData::DataType::Complete); + data.init(this); + data.m_formattedTimeTaken = formattedTime; + PerformanceTrackingCallback* callback = nullptr; + for (const std::pair& h + : ELPP->m_performanceTrackingCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + } + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) + } + /// @brief A checkpoint for current performanceTracker block. + void checkpoint(const std::string& id = std::string(), const char* file = __FILE__, unsigned long int line = __LINE__, const char* func = "") { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + if (m_enabled) { + base::threading::ScopedLock scopedLock(lock()); + base::utils::DateTime::gettimeofday(&m_endTime); + base::type::string_t formattedTime = m_hasChecked ? getFormattedTimeTaken(m_lastCheckpointTime) : ELPP_LITERAL(""); + PerformanceTrackingData data(PerformanceTrackingData::DataType::Checkpoint); + data.init(this); + data.m_checkpointId = id; + data.m_file = file; + data.m_line = line; + data.m_func = func; + data.m_formattedTimeTaken = formattedTime; + PerformanceTrackingCallback* callback = nullptr; + for (const std::pair& h + : ELPP->m_performanceTrackingCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + base::utils::DateTime::gettimeofday(&m_lastCheckpointTime); + m_hasChecked = true; + m_lastCheckpointId = id; + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + ELPP_UNUSED(id); + ELPP_UNUSED(file); + ELPP_UNUSED(line); + ELPP_UNUSED(func); + } + inline Level level(void) const { return m_level; } + private: + std::string m_blockName; + base::TimestampUnit m_timestampUnit; + std::string m_loggerId; + bool m_scopedLog; + Level m_level; + bool m_hasChecked; + std::string m_lastCheckpointId; + bool m_enabled; + struct timeval m_startTime, m_endTime, m_lastCheckpointTime; + + PerformanceTracker(void); + + friend class el::PerformanceTrackingData; + friend class base::DefaultPerformanceTrackingCallback; + + const inline base::type::string_t getFormattedTimeTaken() const { + return getFormattedTimeTaken(m_startTime); + } + + const base::type::string_t getFormattedTimeTaken(struct timeval startTime) const { + if (ELPP->hasFlag(LoggingFlag::FixedTimeFormat)) { + base::type::stringstream_t ss; + ss << base::utils::DateTime::getTimeDifference(m_endTime, + startTime, m_timestampUnit) << " " << base::consts::kTimeFormats[static_cast(m_timestampUnit)].unit; + return ss.str(); + } + return base::utils::DateTime::formatTime(base::utils::DateTime::getTimeDifference(m_endTime, + startTime, m_timestampUnit), m_timestampUnit); + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << getFormattedTimeTaken(); + } + }; + class DefaultPerformanceTrackingCallback : public PerformanceTrackingCallback { + protected: + void handle(const PerformanceTrackingData* data) { + m_data = data; + base::type::stringstream_t ss; + if (m_data->dataType() == PerformanceTrackingData::DataType::Complete) { + ss << ELPP_LITERAL("Executed [") << m_data->blockName()->c_str() << ELPP_LITERAL("] in [") << *m_data->formattedTimeTaken() << ELPP_LITERAL("]"); + } + else { + ss << ELPP_LITERAL("Performance checkpoint"); + if (!m_data->checkpointId().empty()) { + ss << ELPP_LITERAL(" [") << m_data->checkpointId().c_str() << ELPP_LITERAL("]"); + } + ss << ELPP_LITERAL(" for block [") << m_data->blockName()->c_str() << ELPP_LITERAL("] : [") << *m_data->performanceTracker(); + if (!ELPP->hasFlag(LoggingFlag::DisablePerformanceTrackingCheckpointComparison) && m_data->performanceTracker()->m_hasChecked) { + ss << ELPP_LITERAL(" ([") << *m_data->formattedTimeTaken() << ELPP_LITERAL("] from "); + if (m_data->performanceTracker()->m_lastCheckpointId.empty()) { + ss << ELPP_LITERAL("last checkpoint"); + } + else { + ss << ELPP_LITERAL("checkpoint '") << m_data->performanceTracker()->m_lastCheckpointId.c_str() << ELPP_LITERAL("'"); + } + ss << ELPP_LITERAL(")]"); + } + else { + ss << ELPP_LITERAL("]"); + } + } + el::base::Writer(m_data->performanceTracker()->level(), m_data->file(), m_data->line(), m_data->func()).construct(1, m_data->loggerId().c_str()) << ss.str(); + } + private: + const PerformanceTrackingData* m_data; + }; + } // namespace base + inline const std::string* PerformanceTrackingData::blockName() const { + return const_cast(&m_performanceTracker->m_blockName); + } + inline const struct timeval* PerformanceTrackingData::startTime() const { + return const_cast(&m_performanceTracker->m_startTime); + } + inline const struct timeval* PerformanceTrackingData::endTime() const { + return const_cast(&m_performanceTracker->m_endTime); + } + inline const struct timeval* PerformanceTrackingData::lastCheckpointTime() const { + return const_cast(&m_performanceTracker->m_lastCheckpointTime); + } + inline const std::string& PerformanceTrackingData::loggerId(void) const { return m_performanceTracker->m_loggerId; } + namespace base { + /// @brief Contains some internal debugging tools like crash handler and stack tracer + namespace debug { + class StackTrace : base::NoCopy { + public: + static const std::size_t kMaxStack = 64; + static const std::size_t kStackStart = 2; // We want to skip c'tor and StackTrace::generateNew() + class StackTraceEntry { + public: + StackTraceEntry(std::size_t index, const char* loc, const char* demang, const char* hex, const char* addr) { + m_index = index; + m_location = std::string(loc); + m_demangled = std::string(demang); + m_hex = std::string(hex); + m_addr = std::string(addr); + } + StackTraceEntry(std::size_t index, char* loc) { + m_index = index; + m_location = std::string(loc); + } + std::size_t m_index; + std::string m_location; + std::string m_demangled; + std::string m_hex; + std::string m_addr; + friend std::ostream& operator<<(std::ostream& ss, const StackTraceEntry& si) { + ss << "[" << si.m_index << "] " << si.m_location << (si.m_demangled.empty() ? "" : ":") << si.m_demangled + << (si.m_hex.empty() ? "" : "+") << si.m_hex << si.m_addr; + return ss; + } + + private: + StackTraceEntry(void); + }; + + StackTrace(void) { + generateNew(); + } + + virtual ~StackTrace(void) { + } + + inline std::vector& getLatestStack(void) { + return m_stack; + } + + friend inline std::ostream& operator<<(std::ostream& os, const StackTrace& st) { + std::vector::const_iterator it = st.m_stack.begin(); + while (it != st.m_stack.end()) { + os << " " << *it++ << "\n"; + } + return os; + } + + private: + std::vector m_stack; + + void generateNew(void) { +#if ELPP_STACKTRACE + m_stack.clear(); + void* stack[kMaxStack]; + std::size_t size = backtrace(stack, kMaxStack); + char** strings = backtrace_symbols(stack, size); + if (size > kStackStart) { // Skip StackTrace c'tor and generateNew + for (std::size_t i = kStackStart; i < size; ++i) { + char* mangName = nullptr; + char* hex = nullptr; + char* addr = nullptr; + for (char* c = strings[i]; *c; ++c) { + switch (*c) { + case '(': + mangName = c; + break; + case '+': + hex = c; + break; + case ')': + addr = c; + break; + } + } + // Perform demangling if parsed properly + if (mangName != nullptr && hex != nullptr && addr != nullptr && mangName < hex) { + *mangName++ = '\0'; + *hex++ = '\0'; + *addr++ = '\0'; + int status = 0; + char* demangName = abi::__cxa_demangle(mangName, 0, 0, &status); + // if demangling is successful, output the demangled function name + if (status == 0) { + // Success (see http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html) + StackTraceEntry entry(i - 1, strings[i], demangName, hex, addr); + m_stack.push_back(entry); + } + else { + // Not successful - we will use mangled name + StackTraceEntry entry(i - 1, strings[i], mangName, hex, addr); + m_stack.push_back(entry); + } + free(demangName); + } + else { + StackTraceEntry entry(i - 1, strings[i]); + m_stack.push_back(entry); + } + } + } + free(strings); +#else + ELPP_INTERNAL_INFO(1, "Stacktrace generation not supported for selected compiler"); +#endif // ELPP_STACKTRACE + } + }; + static std::string crashReason(int sig) { + std::stringstream ss; + bool foundReason = false; + for (int i = 0; i < base::consts::kCrashSignalsCount; ++i) { + if (base::consts::kCrashSignals[i].numb == sig) { + ss << "Application has crashed due to [" << base::consts::kCrashSignals[i].name << "] signal"; + if (ELPP->hasFlag(el::LoggingFlag::LogDetailedCrashReason)) { + ss << std::endl << + " " << base::consts::kCrashSignals[i].brief << std::endl << + " " << base::consts::kCrashSignals[i].detail; + } + foundReason = true; + } + } + if (!foundReason) { + ss << "Application has crashed due to unknown signal [" << sig << "]"; + } + return ss.str(); + } + /// @brief Logs reason of crash from sig + static void logCrashReason(int sig, bool stackTraceIfAvailable, Level level, const char* logger) { + std::stringstream ss; + ss << "CRASH HANDLED; "; + ss << crashReason(sig); +#if ELPP_STACKTRACE + if (stackTraceIfAvailable) { + ss << std::endl << " ======= Backtrace: =========" << std::endl << base::debug::StackTrace(); + } +#else + ELPP_UNUSED(stackTraceIfAvailable); +#endif // ELPP_STACKTRACE + ELPP_WRITE_LOG(el::base::Writer, level, base::DispatchAction::NormalLog, logger) << ss.str(); + } + static inline void crashAbort(int sig) { + base::utils::abort(sig); + } + /// @brief Default application crash handler + /// + /// @detail This function writes log using 'default' logger, prints stack trace for GCC based compilers and aborts program. + static inline void defaultCrashHandler(int sig) { + base::debug::logCrashReason(sig, true, Level::Fatal, base::consts::kDefaultLoggerId); + base::debug::crashAbort(sig); + } + /// @brief Handles unexpected crashes + class CrashHandler : base::NoCopy { + public: + typedef void(*Handler)(int); + + explicit CrashHandler(bool useDefault) { + if (useDefault) { + setHandler(defaultCrashHandler); + } + } + explicit CrashHandler(const Handler& cHandler) { + setHandler(cHandler); + } + void setHandler(const Handler& cHandler) { + m_handler = cHandler; +#if defined(ELPP_HANDLE_SIGABRT) + int i = 0; // SIGABRT is at base::consts::kCrashSignals[0] +#else + int i = 1; +#endif // defined(ELPP_HANDLE_SIGABRT) + for (; i < base::consts::kCrashSignalsCount; ++i) { + m_handler = signal(base::consts::kCrashSignals[i].numb, cHandler); + } + } + + private: + Handler m_handler; + }; + } // namespace debug + } // namespace base + extern base::debug::CrashHandler elCrashHandler; +#define MAKE_LOGGABLE(ClassType, ClassInstance, OutputStreamInstance) \ + el::base::type::ostream_t& operator<<(el::base::type::ostream_t& OutputStreamInstance, const ClassType& ClassInstance) + /// @brief Initializes syslog with process ID, options and facility. calls closelog() on d'tor + class SysLogInitializer { + public: + SysLogInitializer(const char* processIdent, int options = 0, int facility = 0) { +#if defined(ELPP_SYSLOG) + openlog(processIdent, options, facility); +#else + ELPP_UNUSED(processIdent); + ELPP_UNUSED(options); + ELPP_UNUSED(facility); +#endif // defined(ELPP_SYSLOG) + } + virtual ~SysLogInitializer(void) { +#if defined(ELPP_SYSLOG) + closelog(); +#endif // defined(ELPP_SYSLOG) + } + }; +#define ELPP_INITIALIZE_SYSLOG(id, opt, fac) el::SysLogInitializer elSyslogInit(id, opt, fac) + /// @brief Static helpers for developers + class Helpers : base::StaticClass { + public: + /// @brief Shares logging repository (base::Storage) + static inline void setStorage(base::type::StoragePointer storage) { + ELPP = storage; + } + /// @return Main storage repository + static inline base::type::StoragePointer storage() { + return ELPP; + } + /// @brief Sets application arguments and figures out whats active for logging and whats not. + static inline void setArgs(int argc, char** argv) { + ELPP->setApplicationArguments(argc, argv); + } + /// @copydoc setArgs(int argc, char** argv) + static inline void setArgs(int argc, const char** argv) { + ELPP->setApplicationArguments(argc, const_cast(argv)); + } + /// @brief Overrides default crash handler and installs custom handler. + /// @param crashHandler A functor with no return type that takes single int argument. + /// Handler is a typedef with specification: void (*Handler)(int) + static inline void setCrashHandler(const el::base::debug::CrashHandler::Handler& crashHandler) { + el::elCrashHandler.setHandler(crashHandler); + } + /// @brief Abort due to crash with signal in parameter + /// @param sig Crash signal + static inline void crashAbort(int sig, const char* sourceFile = "", unsigned int long line = 0) { + std::stringstream ss; + ss << base::debug::crashReason(sig).c_str(); + ss << " - [Called el::Helpers::crashAbort(" << sig << ")]"; + if (sourceFile != nullptr && strlen(sourceFile) > 0) { + ss << " - Source: " << sourceFile; + if (line > 0) + ss << ":" << line; + else + ss << " (line number not specified)"; + } + base::utils::abort(sig, ss.str()); + } + /// @brief Logs reason of crash as per sig + /// @param sig Crash signal + /// @param stackTraceIfAvailable Includes stack trace if available + /// @param level Logging level + /// @param logger Logger to use for logging + static inline void logCrashReason(int sig, bool stackTraceIfAvailable = false, + Level level = Level::Fatal, const char* logger = base::consts::kDefaultLoggerId) { + el::base::debug::logCrashReason(sig, stackTraceIfAvailable, level, logger); + } + /// @brief Installs pre rollout callback, this callback is triggered when log file is about to be rolled out + /// (can be useful for backing up) + static inline void installPreRollOutCallback(const PreRollOutCallback& callback) { + ELPP->setPreRollOutCallback(callback); + } + /// @brief Uninstalls pre rollout callback + static inline void uninstallPreRollOutCallback(void) { + ELPP->unsetPreRollOutCallback(); + } + /// @brief Installs post log dispatch callback, this callback is triggered when log is dispatched + template + static inline bool installLogDispatchCallback(const std::string& id) { + return ELPP->installLogDispatchCallback(id); + } + /// @brief Uninstalls log dispatch callback + template + static inline void uninstallLogDispatchCallback(const std::string& id) { + ELPP->uninstallLogDispatchCallback(id); + } + template + static inline T* logDispatchCallback(const std::string& id) { + return ELPP->logDispatchCallback(id); + } + /// @brief Installs post performance tracking callback, this callback is triggered when performance tracking is finished + template + static inline bool installPerformanceTrackingCallback(const std::string& id) { + return ELPP->installPerformanceTrackingCallback(id); + } + /// @brief Uninstalls post performance tracking handler + template + static inline void uninstallPerformanceTrackingCallback(const std::string& id) { + ELPP->uninstallPerformanceTrackingCallback(id); + } + template + static inline T* performanceTrackingCallback(const std::string& id) { + return ELPP->performanceTrackingCallback(id); + } + /// @brief Converts template to std::string - useful for loggable classes to log containers within log(std::ostream&) const + template + static std::string convertTemplateToStdString(const T& templ) { + el::Logger* logger = + ELPP->registeredLoggers()->get(el::base::consts::kDefaultLoggerId); + if (logger == nullptr) { + return std::string(); + } + base::MessageBuilder b; + b.initialize(logger); + logger->acquireLock(); + b << templ; +#if defined(ELPP_UNICODE) + std::string s = std::string(logger->stream().str().begin(), logger->stream().str().end()); +#else + std::string s = logger->stream().str(); +#endif // defined(ELPP_UNICODE) + logger->stream().str(ELPP_LITERAL("")); + logger->releaseLock(); + return s; + } + /// @brief Returns command line arguments (pointer) provided to easylogging++ + static inline const el::base::utils::CommandLineArgs* commandLineArgs(void) { + return ELPP->commandLineArgs(); + } + /// @brief Installs user defined format specifier and handler + static inline void installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { + ELPP->installCustomFormatSpecifier(customFormatSpecifier); + } + /// @brief Uninstalls user defined format specifier and handler + static inline bool uninstallCustomFormatSpecifier(const char* formatSpecifier) { + return ELPP->uninstallCustomFormatSpecifier(formatSpecifier); + } + /// @brief Returns true if custom format specifier is installed + static inline bool hasCustomFormatSpecifier(const char* formatSpecifier) { + return ELPP->hasCustomFormatSpecifier(formatSpecifier); + } + static inline void validateFileRolling(Logger* logger, Level level) { + if (logger == nullptr) return; + logger->m_typedConfigurations->validateFileRolling(level, ELPP->preRollOutCallback()); + } + }; + /// @brief Static helpers to deal with loggers and their configurations + class Loggers : base::StaticClass { + public: + /// @brief Gets existing or registers new logger + static inline Logger* getLogger(const std::string& identity, bool registerIfNotAvailable = true) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->get(identity, registerIfNotAvailable); + } + /// @brief Unregisters logger - use it only when you know what you are doing, you may unregister + /// loggers initialized / used by third-party libs. + static inline bool unregisterLogger(const std::string& identity) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->remove(identity); + } + /// @brief Whether or not logger with id is registered + static inline bool hasLogger(const std::string& identity) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->has(identity); + } + /// @brief Reconfigures specified logger with new configurations + static inline Logger* reconfigureLogger(Logger* logger, const Configurations& configurations) { + if (!logger) return nullptr; + logger->configure(configurations); + return logger; + } + /// @brief Reconfigures logger with new configurations after looking it up using identity + static inline Logger* reconfigureLogger(const std::string& identity, const Configurations& configurations) { + return Loggers::reconfigureLogger(Loggers::getLogger(identity), configurations); + } + /// @brief Reconfigures logger's single configuration + static inline Logger* reconfigureLogger(const std::string& identity, ConfigurationType configurationType, + const std::string& value) { + Logger* logger = Loggers::getLogger(identity); + if (logger == nullptr) { + return nullptr; + } + logger->configurations()->set(Level::Global, configurationType, value); + logger->reconfigure(); + return logger; + } + /// @brief Reconfigures all the existing loggers with new configurations + static inline void reconfigureAllLoggers(const Configurations& configurations) { + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); + it != ELPP->registeredLoggers()->end(); ++it) { + Loggers::reconfigureLogger(it->second, configurations); + } + } + /// @brief Reconfigures single configuration for all the loggers + static inline void reconfigureAllLoggers(ConfigurationType configurationType, const std::string& value) { + reconfigureAllLoggers(Level::Global, configurationType, value); + } + /// @brief Reconfigures single configuration for all the loggers for specified level + static inline void reconfigureAllLoggers(Level level, ConfigurationType configurationType, + const std::string& value) { + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); + it != ELPP->registeredLoggers()->end(); ++it) { + Logger* logger = it->second; + logger->configurations()->set(level, configurationType, value); + logger->reconfigure(); + } + } + /// @brief Sets default configurations. This configuration is used for future (and conditionally for existing) loggers + static inline void setDefaultConfigurations(const Configurations& configurations, bool reconfigureExistingLoggers = false) { + ELPP->registeredLoggers()->setDefaultConfigurations(configurations); + if (reconfigureExistingLoggers) { + Loggers::reconfigureAllLoggers(configurations); + } + } + /// @brief Returns current default + static inline const Configurations* defaultConfigurations(void) { + return ELPP->registeredLoggers()->defaultConfigurations(); + } + /// @brief Returns log stream reference pointer if needed by user + static inline const base::LogStreamsReferenceMap* logStreamsReference(void) { + return ELPP->registeredLoggers()->logStreamsReference(); + } + /// @brief Default typed configuration based on existing defaultConf + static base::TypedConfigurations defaultTypedConfigurations(void) { + return base::TypedConfigurations( + ELPP->registeredLoggers()->defaultConfigurations(), + ELPP->registeredLoggers()->logStreamsReference()); + } + /// @brief Populates all logger IDs in current repository. + /// @param [out] targetList List of fill up. + static inline std::vector* populateAllLoggerIds(std::vector* targetList) { + targetList->clear(); + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->list().begin(); + it != ELPP->registeredLoggers()->list().end(); ++it) { + targetList->push_back(it->first); + } + return targetList; + } + /// @brief Sets configurations from global configuration file. + static void configureFromGlobal(const char* globalConfigurationFilePath) { + std::ifstream gcfStream(globalConfigurationFilePath, std::ifstream::in); + ELPP_ASSERT(gcfStream.is_open(), "Unable to open global configuration file [" << globalConfigurationFilePath + << "] for parsing."); + std::string line = std::string(); + std::stringstream ss; + Logger* logger = nullptr; + auto configure = [&](void) { + ELPP_INTERNAL_INFO(8, "Configuring logger: '" << logger->id() << "' with configurations \n" << ss.str() + << "\n--------------"); + Configurations c; + c.parseFromText(ss.str()); + logger->configure(c); + }; + while (gcfStream.good()) { + std::getline(gcfStream, line); + ELPP_INTERNAL_INFO(1, "Parsing line: " << line); + base::utils::Str::trim(line); + if (Configurations::Parser::isComment(line)) continue; + Configurations::Parser::ignoreComments(&line); + base::utils::Str::trim(line); + if (line.size() > 2 && base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLoggerId))) { + if (!ss.str().empty() && logger != nullptr) { + configure(); + } + ss.str(std::string("")); + line = line.substr(2); + base::utils::Str::trim(line); + if (line.size() > 1) { + ELPP_INTERNAL_INFO(1, "Getting logger: '" << line << "'"); + logger = getLogger(line); + } + } + else { + ss << line << "\n"; + } + } + if (!ss.str().empty() && logger != nullptr) { + configure(); + } + } + /// @brief Configures loggers using command line arg. Ensure you have already set command line args, + /// @return False if invalid argument or argument with no value provided, true if attempted to configure logger. + /// If true is returned that does not mean it has been configured successfully, it only means that it + /// has attempeted to configure logger using configuration file provided in argument + static inline bool configureFromArg(const char* argKey) { +#if defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) + ELPP_UNUSED(argKey); +#else + if (!Helpers::commandLineArgs()->hasParamWithValue(argKey)) { + return false; + } + configureFromGlobal(Helpers::commandLineArgs()->getParamValue(argKey)); +#endif // defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) + return true; + } + /// @brief Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered + static inline void flushAll(void) { + ELPP->registeredLoggers()->flushAll(); + } + /// @brief Adds logging flag used internally. + static inline void addFlag(LoggingFlag flag) { + ELPP->addFlag(flag); + } + /// @brief Removes logging flag used internally. + static inline void removeFlag(LoggingFlag flag) { + ELPP->removeFlag(flag); + } + /// @brief Determines whether or not certain flag is active + static inline bool hasFlag(LoggingFlag flag) { + return ELPP->hasFlag(flag); + } + /// @brief Adds flag and removes it when scope goes out + class ScopedAddFlag { + public: + ScopedAddFlag(LoggingFlag flag) : m_flag(flag) { Loggers::addFlag(m_flag); } + ~ScopedAddFlag(void) { Loggers::removeFlag(m_flag); } + private: + LoggingFlag m_flag; + }; + /// @brief Removes flag and add it when scope goes out + class ScopedRemoveFlag { + public: + ScopedRemoveFlag(LoggingFlag flag) : m_flag(flag) { Loggers::removeFlag(m_flag); } + ~ScopedRemoveFlag(void) { Loggers::addFlag(m_flag); } + private: + LoggingFlag m_flag; + }; + /// @brief Sets hierarchy for logging. Needs to enable logging flag (HierarchicalLogging) + static inline void setLoggingLevel(Level level) { + ELPP->setLoggingLevel(level); + } + /// @brief Sets verbose level on the fly + static inline void setVerboseLevel(base::type::VerboseLevel level) { + ELPP->vRegistry()->setLevel(level); + } + /// @brief Gets current verbose level + static inline base::type::VerboseLevel verboseLevel(void) { + return ELPP->vRegistry()->level(); + } + /// @brief Sets vmodules as specified (on the fly) + static inline void setVModules(const char* modules) { + if (ELPP->vRegistry()->vModulesEnabled()) { + ELPP->vRegistry()->setModules(modules); + } + } + /// @brief Clears vmodules + static inline void clearVModules(void) { + ELPP->vRegistry()->clearModules(); + } + }; + class VersionInfo : base::StaticClass { + public: + /// @brief Current version number + static inline const std::string version(void) { return std::string("9.80"); } + /// @brief Release date of current version + static inline const std::string releaseDate(void) { return std::string("08-01-2015 0850hrs"); } + }; +} // namespace el +#undef VLOG_IS_ON + /// @brief Determines whether verbose logging is on for specified level current file. +#define VLOG_IS_ON(verboseLevel) (ELPP->vRegistry()->allowed(verboseLevel, __FILE__)) +#undef TIMED_BLOCK +#undef TIMED_SCOPE +#undef TIMED_FUNC +#undef ELPP_MIN_UNIT +#if defined(ELPP_PERFORMANCE_MICROSECONDS) +# define ELPP_MIN_UNIT el::base::TimestampUnit::Microsecond +#else +# define ELPP_MIN_UNIT el::base::TimestampUnit::Millisecond +#endif // (defined(ELPP_PERFORMANCE_MICROSECONDS)) + /// @brief Performance tracked scope. Performance gets written when goes out of scope using + /// 'performance' logger. + /// + /// @detail Please note in order to check the performance at a certain time you can use obj.checkpoint(); + /// @see el::base::PerformanceTracker + /// @see el::base::PerformanceTracker::checkpoint + // Note: Do not surround this definition with null macro because of obj instance +#define TIMED_SCOPE(obj, blockname) el::base::PerformanceTracker obj(blockname, ELPP_MIN_UNIT) +#define TIMED_BLOCK(obj, blockName) for (struct { int i; el::base::PerformanceTracker timer; } obj = { 0, \ + el::base::PerformanceTracker(blockName, ELPP_MIN_UNIT) }; obj.i < 1; ++obj.i) + /// @brief Performance tracked function. Performance gets written when goes out of scope using + /// 'performance' logger. + /// + /// @detail Please note in order to check the performance at a certain time you can use obj.checkpoint(); + /// @see el::base::PerformanceTracker + /// @see el::base::PerformanceTracker::checkpoint +#define TIMED_FUNC(obj) TIMED_SCOPE(obj, ELPP_FUNC) +#undef PERFORMANCE_CHECKPOINT +#undef PERFORMANCE_CHECKPOINT_WITH_ID +#define PERFORMANCE_CHECKPOINT(obj) obj.checkpoint(std::string(), __FILE__, __LINE__, ELPP_FUNC) +#define PERFORMANCE_CHECKPOINT_WITH_ID(obj, id) obj.checkpoint(id, __FILE__, __LINE__, ELPP_FUNC) +#undef ELPP_COUNTER +#undef ELPP_COUNTER_POS + /// @brief Gets hit counter for file/line +#define ELPP_COUNTER (ELPP->hitCounters()->getCounter(__FILE__, __LINE__)) + /// @brief Gets hit counter position for file/line, -1 if not registered yet +#define ELPP_COUNTER_POS (ELPP_COUNTER == nullptr ? -1 : ELPP_COUNTER->hitCounts()) + // Undef levels to support LOG(LEVEL) +#undef INFO +#undef WARNING +#undef DEBUG +#undef ERROR +#undef FATAL +#undef TRACE +#undef VERBOSE + // Undef existing +#undef CINFO +#undef CWARNING +#undef CDEBUG +#undef CFATAL +#undef CERROR +#undef CTRACE +#undef CVERBOSE +#undef CINFO_IF +#undef CWARNING_IF +#undef CDEBUG_IF +#undef CERROR_IF +#undef CFATAL_IF +#undef CTRACE_IF +#undef CVERBOSE_IF +#undef CINFO_EVERY_N +#undef CWARNING_EVERY_N +#undef CDEBUG_EVERY_N +#undef CERROR_EVERY_N +#undef CFATAL_EVERY_N +#undef CTRACE_EVERY_N +#undef CVERBOSE_EVERY_N +#undef CINFO_AFTER_N +#undef CWARNING_AFTER_N +#undef CDEBUG_AFTER_N +#undef CERROR_AFTER_N +#undef CFATAL_AFTER_N +#undef CTRACE_AFTER_N +#undef CVERBOSE_AFTER_N +#undef CINFO_N_TIMES +#undef CWARNING_N_TIMES +#undef CDEBUG_N_TIMES +#undef CERROR_N_TIMES +#undef CFATAL_N_TIMES +#undef CTRACE_N_TIMES +#undef CVERBOSE_N_TIMES + // Normal logs +#if ELPP_INFO_LOG +# define CINFO(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE(writer, vlevel, dispatchAction, ...) if (VLOG_IS_ON(vlevel)) writer(\ + el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#else +# define CVERBOSE(writer, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // Conditional logs +#if ELPP_INFO_LOG +# define CINFO_IF(writer, condition_, dispatchAction, ...) \ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) if (VLOG_IS_ON(vlevel) && (condition_)) writer( \ + el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#else +# define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // Occasional logs +#if ELPP_INFO_LOG +# define CINFO_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // After N logs +#if ELPP_INFO_LOG +# define CINFO_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateAfterNCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // N Times logs +#if ELPP_INFO_LOG +# define CINFO_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateNTimesCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // + // Custom Loggers - Requires (level, dispatchAction, loggerId/s) + // + // undef existing +#undef CLOG +#undef CLOG_VERBOSE +#undef CVLOG +#undef CLOG_IF +#undef CLOG_VERBOSE_IF +#undef CVLOG_IF +#undef CLOG_EVERY_N +#undef CVLOG_EVERY_N +#undef CLOG_AFTER_N +#undef CVLOG_AFTER_N +#undef CLOG_N_TIMES +#undef CVLOG_N_TIMES + // Normal logs +#define CLOG(LEVEL, ...)\ + C##LEVEL(el::base::Writer, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG(vlevel, ...) CVERBOSE(el::base::Writer, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // Conditional logs +#define CLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_IF(condition, vlevel, ...)\ + CVERBOSE_IF(el::base::Writer, condition, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // Hit counts based logs +#define CLOG_EVERY_N(n, LEVEL, ...)\ + C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_EVERY_N(n, vlevel, ...)\ + CVERBOSE_EVERY_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CLOG_AFTER_N(n, LEVEL, ...)\ + C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_AFTER_N(n, vlevel, ...)\ + CVERBOSE_AFTER_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CLOG_N_TIMES(n, LEVEL, ...)\ + C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_N_TIMES(n, vlevel, ...)\ + CVERBOSE_N_TIMES(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // + // Default Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros + // + // undef existing +#undef LOG +#undef VLOG +#undef LOG_IF +#undef VLOG_IF +#undef LOG_EVERY_N +#undef VLOG_EVERY_N +#undef LOG_AFTER_N +#undef VLOG_AFTER_N +#undef LOG_N_TIMES +#undef VLOG_N_TIMES +#undef ELPP_CURR_FILE_LOGGER_ID +#if defined(ELPP_DEFAULT_LOGGER) +# define ELPP_CURR_FILE_LOGGER_ID ELPP_DEFAULT_LOGGER +#else +# define ELPP_CURR_FILE_LOGGER_ID el::base::consts::kDefaultLoggerId +#endif +#undef ELPP_TRACE +#define ELPP_TRACE CLOG(TRACE, ELPP_CURR_FILE_LOGGER_ID) + // Normal logs +#define LOG(LEVEL) CLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG(vlevel) CVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Conditional logs +#define LOG_IF(condition, LEVEL) CLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_IF(condition, vlevel) CVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Hit counts based logs +#define LOG_EVERY_N(n, LEVEL) CLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_EVERY_N(n, vlevel) CVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define LOG_AFTER_N(n, LEVEL) CLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_AFTER_N(n, vlevel) CVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define LOG_N_TIMES(n, LEVEL) CLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_N_TIMES(n, vlevel) CVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Generic PLOG() +#undef CPLOG +#undef CPLOG_IF +#undef PLOG +#undef PLOG_IF +#undef DCPLOG +#undef DCPLOG_IF +#undef DPLOG +#undef DPLOG_IF +#define CPLOG(LEVEL, ...)\ + C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CPLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::PErrorWriter, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define DCPLOG(LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define DCPLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::PErrorWriter, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define PLOG(LEVEL) CPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define PLOG_IF(condition, LEVEL) CPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DPLOG(LEVEL) DCPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DPLOG_IF(condition, LEVEL) DCPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) + // Generic SYSLOG() +#undef CSYSLOG +#undef CSYSLOG_IF +#undef CSYSLOG_EVERY_N +#undef CSYSLOG_AFTER_N +#undef CSYSLOG_N_TIMES +#undef SYSLOG +#undef SYSLOG_IF +#undef SYSLOG_EVERY_N +#undef SYSLOG_AFTER_N +#undef SYSLOG_N_TIMES +#undef DCSYSLOG +#undef DCSYSLOG_IF +#undef DCSYSLOG_EVERY_N +#undef DCSYSLOG_AFTER_N +#undef DCSYSLOG_N_TIMES +#undef DSYSLOG +#undef DSYSLOG_IF +#undef DSYSLOG_EVERY_N +#undef DSYSLOG_AFTER_N +#undef DSYSLOG_N_TIMES +#if defined(ELPP_SYSLOG) +# define CSYSLOG(LEVEL, ...)\ + C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_EVERY_N(n, LEVEL, ...) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_AFTER_N(n, LEVEL, ...) C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_N_TIMES(n, LEVEL, ...) C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define SYSLOG(LEVEL) CSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_IF(condition, LEVEL) CSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_EVERY_N(n, LEVEL) CSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_AFTER_N(n, LEVEL) CSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_N_TIMES(n, LEVEL) CSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DCSYSLOG(LEVEL, ...) if (ELPP_DEBUG_LOG) C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_EVERY_N(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_AFTER_N(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_N_TIMES(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DSYSLOG(LEVEL) DCSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_IF(condition, LEVEL) DCSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_EVERY_N(n, LEVEL) DCSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_AFTER_N(n, LEVEL) DCSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_N_TIMES(n, LEVEL) DCSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) +#else +# define CSYSLOG(LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() +# define SYSLOG(LEVEL) el::base::NullWriter() +# define SYSLOG_IF(condition, LEVEL) el::base::NullWriter() +# define SYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() +# define SYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() +# define SYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() +# define DCSYSLOG(LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() +# define DSYSLOG(LEVEL) el::base::NullWriter() +# define DSYSLOG_IF(condition, LEVEL) el::base::NullWriter() +# define DSYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() +# define DSYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() +# define DSYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() +#endif // defined(ELPP_SYSLOG) + // + // Custom Debug Only Loggers - Requires (level, loggerId/s) + // + // undef existing +#undef DCLOG +#undef DCVLOG +#undef DCLOG_IF +#undef DCVLOG_IF +#undef DCLOG_EVERY_N +#undef DCVLOG_EVERY_N +#undef DCLOG_AFTER_N +#undef DCVLOG_AFTER_N +#undef DCLOG_N_TIMES +#undef DCVLOG_N_TIMES + // Normal logs +#define DCLOG(LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG(LEVEL, __VA_ARGS__) +#define DCLOG_VERBOSE(vlevel, ...) if (ELPP_DEBUG_LOG) CLOG_VERBOSE(vlevel, __VA_ARGS__) +#define DCVLOG(vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG(vlevel, __VA_ARGS__) + // Conditional logs +#define DCLOG_IF(condition, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_IF(condition, LEVEL, __VA_ARGS__) +#define DCVLOG_IF(condition, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_IF(condition, vlevel, __VA_ARGS__) + // Hit counts based logs +#define DCLOG_EVERY_N(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_EVERY_N(n, LEVEL, __VA_ARGS__) +#define DCVLOG_EVERY_N(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_EVERY_N(n, vlevel, __VA_ARGS__) +#define DCLOG_AFTER_N(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_AFTER_N(n, LEVEL, __VA_ARGS__) +#define DCVLOG_AFTER_N(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_AFTER_N(n, vlevel, __VA_ARGS__) +#define DCLOG_N_TIMES(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_N_TIMES(n, LEVEL, __VA_ARGS__) +#define DCVLOG_N_TIMES(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_N_TIMES(n, vlevel, __VA_ARGS__) + // + // Default Debug Only Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros + // + // undef existing +#undef DLOG +#undef DVLOG +#undef DLOG_IF +#undef DVLOG_IF +#undef DLOG_EVERY_N +#undef DVLOG_EVERY_N +#undef DLOG_AFTER_N +#undef DVLOG_AFTER_N +#undef DLOG_N_TIMES +#undef DVLOG_N_TIMES + // Normal logs +#define DLOG(LEVEL) DCLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG(vlevel) DCVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Conditional logs +#define DLOG_IF(condition, LEVEL) DCLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_IF(condition, vlevel) DCVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Hit counts based logs +#define DLOG_EVERY_N(n, LEVEL) DCLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_EVERY_N(n, vlevel) DCVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define DLOG_AFTER_N(n, LEVEL) DCLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_AFTER_N(n, vlevel) DCVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define DLOG_N_TIMES(n, LEVEL) DCLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_N_TIMES(n, vlevel) DCVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Check macros +#undef CCHECK +#undef CPCHECK +#undef CCHECK_EQ +#undef CCHECK_NE +#undef CCHECK_LT +#undef CCHECK_GT +#undef CCHECK_LE +#undef CCHECK_GE +#undef CCHECK_BOUNDS +#undef CCHECK_NOTNULL +#undef CCHECK_STRCASEEQ +#undef CCHECK_STRCASENE +#undef CHECK +#undef PCHECK +#undef CHECK_EQ +#undef CHECK_NE +#undef CHECK_LT +#undef CHECK_GT +#undef CHECK_LE +#undef CHECK_GE +#undef CHECK_BOUNDS +#undef CHECK_NOTNULL +#undef CHECK_STRCASEEQ +#undef CHECK_STRCASENE +#define CCHECK(condition, ...) CLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " +#define CPCHECK(condition, ...) CPLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " +#define CHECK(condition) CCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define PCHECK(condition) CPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define CCHECK_EQ(a, b, ...) CCHECK(a == b, __VA_ARGS__) +#define CCHECK_NE(a, b, ...) CCHECK(a != b, __VA_ARGS__) +#define CCHECK_LT(a, b, ...) CCHECK(a < b, __VA_ARGS__) +#define CCHECK_GT(a, b, ...) CCHECK(a > b, __VA_ARGS__) +#define CCHECK_LE(a, b, ...) CCHECK(a <= b, __VA_ARGS__) +#define CCHECK_GE(a, b, ...) CCHECK(a >= b, __VA_ARGS__) +#define CCHECK_BOUNDS(val, min, max, ...) CCHECK(val >= min && val <= max, __VA_ARGS__) +#define CHECK_EQ(a, b) CCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_NE(a, b) CCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_LT(a, b) CCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_GT(a, b) CCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_LE(a, b) CCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_GE(a, b) CCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_BOUNDS(val, min, max) CCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) +namespace el { + namespace base { + namespace utils { + template + static T* checkNotNull(T* ptr, const char* name, const char* loggers, ...) { + CLOG_IF(ptr == nullptr, FATAL, loggers) << "Check failed: [" << name << " != nullptr]"; + return ptr; + } + } // namespace utils + } // namespace base +} // namespace el +#define CCHECK_NOTNULL(ptr, ...) el::base::utils::checkNotNull(ptr, #ptr, __VA_ARGS__) +#define CCHECK_STREQ(str1, str2, ...) CLOG_IF(!el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " == " << #str2 << "] " +#define CCHECK_STRNE(str1, str2, ...) CLOG_IF(el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " != " << #str2 << "] " +#define CCHECK_STRCASEEQ(str1, str2, ...) CLOG_IF(!el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " == " << #str2 << "] " +#define CCHECK_STRCASENE(str1, str2, ...) CLOG_IF(el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " != " << #str2 << "] " +#define CHECK_NOTNULL(ptr) CCHECK_NOTNULL(ptr, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STREQ(str1, str2) CCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRNE(str1, str2) CCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRCASEEQ(str1, str2) CCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRCASENE(str1, str2) CCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#undef DCCHECK +#undef DCCHECK_EQ +#undef DCCHECK_NE +#undef DCCHECK_LT +#undef DCCHECK_GT +#undef DCCHECK_LE +#undef DCCHECK_GE +#undef DCCHECK_BOUNDS +#undef DCCHECK_NOTNULL +#undef DCCHECK_STRCASEEQ +#undef DCCHECK_STRCASENE +#undef DCPCHECK +#undef DCHECK +#undef DCHECK_EQ +#undef DCHECK_NE +#undef DCHECK_LT +#undef DCHECK_GT +#undef DCHECK_LE +#undef DCHECK_GE +#undef DCHECK_BOUNDS_ +#undef DCHECK_NOTNULL +#undef DCHECK_STRCASEEQ +#undef DCHECK_STRCASENE +#undef DPCHECK +#define DCCHECK(condition, ...) if (ELPP_DEBUG_LOG) CCHECK(condition, __VA_ARGS__) +#define DCCHECK_EQ(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_EQ(a, b, __VA_ARGS__) +#define DCCHECK_NE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_NE(a, b, __VA_ARGS__) +#define DCCHECK_LT(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_LT(a, b, __VA_ARGS__) +#define DCCHECK_GT(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_GT(a, b, __VA_ARGS__) +#define DCCHECK_LE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_LE(a, b, __VA_ARGS__) +#define DCCHECK_GE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_GE(a, b, __VA_ARGS__) +#define DCCHECK_BOUNDS(val, min, max, ...) if (ELPP_DEBUG_LOG) CCHECK_BOUNDS(val, min, max, __VA_ARGS__) +#define DCCHECK_NOTNULL(ptr, ...) if (ELPP_DEBUG_LOG) CCHECK_NOTNULL(ptr, __VA_ARGS__) +#define DCCHECK_STREQ(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STREQ(str1, str2, __VA_ARGS__) +#define DCCHECK_STRNE(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRNE(str1, str2, __VA_ARGS__) +#define DCCHECK_STRCASEEQ(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRCASEEQ(str1, str2, __VA_ARGS__) +#define DCCHECK_STRCASENE(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRCASENE(str1, str2, __VA_ARGS__) +#define DCPCHECK(condition, ...) if (ELPP_DEBUG_LOG) CPCHECK(condition, __VA_ARGS__) +#define DCHECK(condition) DCCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_EQ(a, b) DCCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_NE(a, b) DCCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_LT(a, b) DCCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_GT(a, b) DCCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_LE(a, b) DCCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_GE(a, b) DCCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_BOUNDS(val, min, max) DCCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_NOTNULL(ptr) DCCHECK_NOTNULL(ptr, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STREQ(str1, str2) DCCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRNE(str1, str2) DCCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRCASEEQ(str1, str2) DCCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRCASENE(str1, str2) DCCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DPCHECK(condition) DCPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#if defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) +# define ELPP_USE_DEF_CRASH_HANDLER false +#else +# define ELPP_USE_DEF_CRASH_HANDLER true +#endif // defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) +#define ELPP_CRASH_HANDLER_INIT +#define ELPP_INIT_EASYLOGGINGPP(val)\ + ELPP_INITI_BASIC_DECLR\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage(val);\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + +#if ELPP_ASYNC_LOGGING +# define INITIALIZE_EASYLOGGINGPP\ + ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()),\ + new el::base::AsyncDispatchWorker()))\ + +#else +# define INITIALIZE_EASYLOGGINGPP\ + ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()))) +#endif // ELPP_ASYNC_LOGGING +#define INITIALIZE_NULL_EASYLOGGINGPP\ + ELPP_INITI_BASIC_DECLR\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage;\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + // NOTE: no ELPP_INITI_BASIC_DECLR when sharing - causes double free corruption on external symbols +#define SHARE_EASYLOGGINGPP(initializedStorage)\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage(initializedStorage);\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + +#if defined(ELPP_UNICODE) +# define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv); std::locale::global(std::locale("")) +#else +# define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv) +#endif // defined(ELPP_UNICODE) +#endif // EASYLOGGINGPP_H \ No newline at end of file diff --git a/extensions/common/glm/CMakeLists.txt b/extensions/common/glm/CMakeLists.txt new file mode 100644 index 0000000000..fe28b5d975 --- /dev/null +++ b/extensions/common/glm/CMakeLists.txt @@ -0,0 +1,43 @@ +set(NAME glm_dummy) + +file(GLOB ROOT_SOURCE *.cpp) +file(GLOB ROOT_INLINE *.inl) +file(GLOB ROOT_HEADER *.hpp) +file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_NAT ../util/glm.natvis) + +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) +file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) +file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) + +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) +file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) +file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) + +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) +file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) +file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) + +source_group("Text Files" FILES ${ROOT_TEXT}) +source_group("Core Files" FILES ${CORE_SOURCE}) +source_group("Core Files" FILES ${CORE_INLINE}) +source_group("Core Files" FILES ${CORE_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) +source_group("GTC Files" FILES ${GTC_INLINE}) +source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) +source_group("GTX Files" FILES ${GTX_INLINE}) +source_group("GTX Files" FILES ${GTX_HEADER}) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) + +if(GLM_TEST_ENABLE) + add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) +endif(GLM_TEST_ENABLE) + +#add_library(glm STATIC glm.cpp) +#add_library(glm_shared SHARED glm.cpp) diff --git a/extensions/common/glm/common.hpp b/extensions/common/glm/common.hpp new file mode 100644 index 0000000000..57beb106a9 --- /dev/null +++ b/extensions/common/glm/common.hpp @@ -0,0 +1,35 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/common.hpp +/// @date 2013-12-24 / 2013-12-24 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "detail/func_common.hpp" diff --git a/extensions/common/glm/detail/_features.hpp b/extensions/common/glm/detail/_features.hpp new file mode 100644 index 0000000000..ce2a35d9c1 --- /dev/null +++ b/extensions/common/glm/detail/_features.hpp @@ -0,0 +1,428 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_features.hpp +/// @date 2013-02-20 / 2013-02-20 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +// #define GLM_CXX98_EXCEPTIONS +// #define GLM_CXX98_RTTI + +// #define GLM_CXX11_RVALUE_REFERENCES +// Rvalue references - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html + +// GLM_CXX11_TRAILING_RETURN +// Rvalue references for *this - GCC not supported +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Initialization of class objects by rvalues - GCC any +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Non-static data member initializers - GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm + +// #define GLM_CXX11_VARIADIC_TEMPLATE +// Variadic templates - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf + +// +// Extending variadic template template parameters - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf + +// #define GLM_CXX11_GENERALIZED_INITIALIZERS +// Initializer lists - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + +// #define GLM_CXX11_STATIC_ASSERT +// Static assertions - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + +// #define GLM_CXX11_AUTO_TYPE +// auto-typed variables - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Multi-declarator auto - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Removal of auto as a storage-class specifier - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm + +// #define GLM_CXX11_AUTO_TYPE +// New function declarator syntax - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm + +// #define GLM_CXX11_LAMBDAS +// New wording for C++0x lambdas - GCC 4.5 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf + +// #define GLM_CXX11_DECLTYPE +// Declared type of an expression - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf + +// +// Right angle brackets - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html + +// +// Default template arguments for function templates DR226 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 + +// +// Solving the SFINAE problem for expressions DR339 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html + +// #define GLM_CXX11_ALIAS_TEMPLATE +// Template aliases N2258 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf + +// +// Extern templates N1987 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm + +// #define GLM_CXX11_NULLPTR +// Null pointer constant N2431 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + +// #define GLM_CXX11_STRONG_ENUMS +// Strongly-typed enums N2347 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + +// +// Forward declarations for enums N2764 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf + +// +// Generalized attributes N2761 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf + +// +// Generalized constant expressions N2235 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + +// +// Alignment support N2341 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf + +// #define GLM_CXX11_DELEGATING_CONSTRUCTORS +// Delegating constructors N1986 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf + +// +// Inheriting constructors N2540 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm + +// #define GLM_CXX11_EXPLICIT_CONVERSIONS +// Explicit conversion operators N2437 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf + +// +// New character types N2249 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html + +// +// Unicode string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Raw string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Universal character name literals N2170 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html + +// #define GLM_CXX11_USER_LITERALS +// User-defined literals N2765 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf + +// +// Standard Layout Types N2342 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm + +// #define GLM_CXX11_DEFAULTED_FUNCTIONS +// #define GLM_CXX11_DELETED_FUNCTIONS +// Defaulted and deleted functions N2346 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm + +// +// Extended friend declarations N1791 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf + +// +// Extending sizeof N2253 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html + +// #define GLM_CXX11_INLINE_NAMESPACES +// Inline namespaces N2535 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm + +// #define GLM_CXX11_UNRESTRICTED_UNIONS +// Unrestricted unions N2544 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + +// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +// Local and unnamed types as template arguments N2657 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm + +// #define GLM_CXX11_RANGE_FOR +// Range-based for N2930 GCC 4.6 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html + +// #define GLM_CXX11_OVERRIDE_CONTROL +// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm + +// +// Minimal support for garbage collection and reachability-based leak detection N2670 No +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm + +// #define GLM_CXX11_NOEXCEPT +// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html + +// +// Defining move special member functions N3053 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html + +// +// Sequence points N2239 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Atomic operations N2427 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Strong Compare and Exchange N2748 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html + +// +// Bidirectional Fences N2752 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm + +// +// Memory model N2429 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm + +// +// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm + +// +// Propagating exceptions N2179 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html + +// +// Abandoning a process and at_quick_exit N2440 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm + +// +// Allow atomics use in signal handlers N2547 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm + +// +// Thread-local storage N2659 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm + +// +// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm + +// +// __func__ predefined identifier N2340 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm + +// +// C99 preprocessor N1653 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm + +// +// long long N1811 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf + +// +// Extended integral types N1988 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf + +#if(GLM_COMPILER & GLM_COMPILER_GCC) + +# if(GLM_COMPILER >= GLM_COMPILER_GCC43) +# define GLM_CXX11_STATIC_ASSERT +# endif + +#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +# if(__has_feature(cxx_exceptions)) +# define GLM_CXX98_EXCEPTIONS +# endif + +# if(__has_feature(cxx_rtti)) +# define GLM_CXX98_RTTI +# endif + +# if(__has_feature(cxx_access_control_sfinae)) +# define GLM_CXX11_ACCESS_CONTROL_SFINAE +# endif + +# if(__has_feature(cxx_alias_templates)) +# define GLM_CXX11_ALIAS_TEMPLATE +# endif + +# if(__has_feature(cxx_alignas)) +# define GLM_CXX11_ALIGNAS +# endif + +# if(__has_feature(cxx_attributes)) +# define GLM_CXX11_ATTRIBUTES +# endif + +# if(__has_feature(cxx_constexpr)) +# define GLM_CXX11_CONSTEXPR +# endif + +# if(__has_feature(cxx_decltype)) +# define GLM_CXX11_DECLTYPE +# endif + +# if(__has_feature(cxx_default_function_template_args)) +# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_defaulted_functions)) +# define GLM_CXX11_DEFAULTED_FUNCTIONS +# endif + +# if(__has_feature(cxx_delegating_constructors)) +# define GLM_CXX11_DELEGATING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_deleted_functions)) +# define GLM_CXX11_DELETED_FUNCTIONS +# endif + +# if(__has_feature(cxx_explicit_conversions)) +# define GLM_CXX11_EXPLICIT_CONVERSIONS +# endif + +# if(__has_feature(cxx_generalized_initializers)) +# define GLM_CXX11_GENERALIZED_INITIALIZERS +# endif + +# if(__has_feature(cxx_implicit_moves)) +# define GLM_CXX11_IMPLICIT_MOVES +# endif + +# if(__has_feature(cxx_inheriting_constructors)) +# define GLM_CXX11_INHERITING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_inline_namespaces)) +# define GLM_CXX11_INLINE_NAMESPACES +# endif + +# if(__has_feature(cxx_lambdas)) +# define GLM_CXX11_LAMBDAS +# endif + +# if(__has_feature(cxx_local_type_template_args)) +# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_noexcept)) +# define GLM_CXX11_NOEXCEPT +# endif + +# if(__has_feature(cxx_nonstatic_member_init)) +# define GLM_CXX11_NONSTATIC_MEMBER_INIT +# endif + +# if(__has_feature(cxx_nullptr)) +# define GLM_CXX11_NULLPTR +# endif + +# if(__has_feature(cxx_override_control)) +# define GLM_CXX11_OVERRIDE_CONTROL +# endif + +# if(__has_feature(cxx_reference_qualified_functions)) +# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS +# endif + +# if(__has_feature(cxx_range_for)) +# define GLM_CXX11_RANGE_FOR +# endif + +# if(__has_feature(cxx_raw_string_literals)) +# define GLM_CXX11_RAW_STRING_LITERALS +# endif + +# if(__has_feature(cxx_rvalue_references)) +# define GLM_CXX11_RVALUE_REFERENCES +# endif + +# if(__has_feature(cxx_static_assert)) +# define GLM_CXX11_STATIC_ASSERT +# endif + +# if(__has_feature(cxx_auto_type)) +# define GLM_CXX11_AUTO_TYPE +# endif + +# if(__has_feature(cxx_strong_enums)) +# define GLM_CXX11_STRONG_ENUMS +# endif + +# if(__has_feature(cxx_trailing_return)) +# define GLM_CXX11_TRAILING_RETURN +# endif + +# if(__has_feature(cxx_unicode_literals)) +# define GLM_CXX11_UNICODE_LITERALS +# endif + +# if(__has_feature(cxx_unrestricted_unions)) +# define GLM_CXX11_UNRESTRICTED_UNIONS +# endif + +# if(__has_feature(cxx_user_literals)) +# define GLM_CXX11_USER_LITERALS +# endif + +# if(__has_feature(cxx_variadic_templates)) +# define GLM_CXX11_VARIADIC_TEMPLATES +# endif + +#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) diff --git a/extensions/common/glm/detail/_fixes.hpp b/extensions/common/glm/detail/_fixes.hpp new file mode 100644 index 0000000000..9728cafb73 --- /dev/null +++ b/extensions/common/glm/detail/_fixes.hpp @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_fixes.hpp +/// @date 2011-02-21 / 2011-11-22 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif + +//! Workaround for Android +#ifdef isnan +#undef isnan +#endif + +//! Workaround for Android +#ifdef isinf +#undef isinf +#endif + +//! Workaround for Chrone Native Client +#ifdef log2 +#undef log2 +#endif + diff --git a/extensions/common/glm/detail/_noise.hpp b/extensions/common/glm/detail/_noise.hpp new file mode 100644 index 0000000000..296709d4b9 --- /dev/null +++ b/extensions/common/glm/detail/_noise.hpp @@ -0,0 +1,136 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_noise.hpp +/// @date 2013-12-24 / 2013-12-24 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mod289(T const & x) + { + return x - floor(x * static_cast(1.0) / static_cast(289.0)) * static_cast(289.0); + } + + template + GLM_FUNC_QUALIFIER T permute(T const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType permute(vecType const & x) + { + return mod289(((x * T(34)) + T(1)) * x); + } +*/ + template + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +*/ + + template + GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType fade(vecType const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +*/ +}//namespace detail +}//namespace glm + diff --git a/extensions/common/glm/detail/_swizzle.hpp b/extensions/common/glm/detail/_swizzle.hpp new file mode 100644 index 0000000000..04ea55bcf2 --- /dev/null +++ b/extensions/common/glm/detail/_swizzle.hpp @@ -0,0 +1,833 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_swizzle.hpp +/// @date 2006-04-20 / 2011-02-16 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +namespace glm{ +namespace detail +{ + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + typedef T value_type; + + protected: + GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + ValueType = type of scalar values (e.g. float, double) + VecType = class the swizzle is applies to (e.g. tvec3) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template + struct _swizzle_base2 : public _swizzle_base1 + { + typedef VecType vec_type; + typedef ValueType value_type; + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) + { + for (int i = 0; i < N; ++i) + (*this)[i] = t; + return *this; + } + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } + }; + _apply_op(that, op()); + return *this; + } + + GLM_FUNC_QUALIFIER void operator -= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator += (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator *= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator /= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + + protected: + template + GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) + { + // Make a copy of the data in this == &that. + // The copier should optimize out the copy in cases where the function is + // properly inlined and the copy is not necessary. + ValueType t[N]; + for (int i = 0; i < N; ++i) + t[i] = that[i]; + for (int i = 0; i < N; ++i) + op( (*this)[i], t[i] ); + } + }; + + // Specialization for swizzles containing duplicate elements. These cannot be modified. + template + struct _swizzle_base2 : public _swizzle_base1 + { + typedef VecType vec_type; + typedef ValueType value_type; + + struct Stub {}; + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } + + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + }; + + template + struct _swizzle : public _swizzle_base2 + { + typedef _swizzle_base2 base_type; + + using base_type::operator=; + + GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } + }; + +// +// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros +// +#define _GLM_SWIZZLE_TEMPLATE1 template +#define _GLM_SWIZZLE_TEMPLATE2 template +#define _GLM_SWIZZLE_TYPE1 _swizzle +#define _GLM_SWIZZLE_TYPE2 _swizzle + +// +// Wrapper for a binary operator (e.g. u.yy + v.zy) +// +#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return a() OPERAND b(); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) +// +#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Macro for wrapping a function taking one argument (e.g. abs()) +// +#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ + } + +// +// Macro for wrapping a function taking two vector arguments (e.g. dot()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + { \ + return FUNCTION(a(), b); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a, b()); \ + } + +// +// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + { \ + return FUNCTION(a(), b, c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a, b(), c); \ + } + +}//namespace detail +}//namespace glm + +namespace glm +{ + namespace detail + { + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) + } + + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); +} + +#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<2, T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 1,1,-1,-2> E1 ## E1; }; + +#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<3,T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; + +#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \ + struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 3,3,-1,-2> E3 ## E3; }; + +#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,3,-1> E3 ## E3 ## E3; }; + +#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/extensions/common/glm/detail/_swizzle_func.hpp b/extensions/common/glm/detail/_swizzle_func.hpp new file mode 100644 index 0000000000..4dbb783c5b --- /dev/null +++ b/extensions/common/glm/detail/_swizzle_func.hpp @@ -0,0 +1,725 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_swizzle_func.hpp +/// @date 2011-10-16 / 2011-10-16 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + SWIZZLED_TYPE A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + SWIZZLED_TYPE A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + SWIZZLED_TYPE A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_MUTABLE + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B) + +#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4) diff --git a/extensions/common/glm/detail/_vectorize.hpp b/extensions/common/glm/detail/_vectorize.hpp new file mode 100644 index 0000000000..1deff1e080 --- /dev/null +++ b/extensions/common/glm/detail/_vectorize.hpp @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_vectorize.hpp +/// @date 2011-10-14 / 2011-10-14 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" + +namespace glm{ +namespace detail +{ + template class vecType> + struct functor1{}; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) + { + return tvec1(Func(v.x)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) + { + return tvec2(Func(v.x), Func(v.y)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) + { + return tvec3(Func(v.x), Func(v.y), Func(v.z)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) + { + return tvec4(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + } + }; + + template class vecType> + struct functor2{}; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) + { + return tvec1(Func(a.x, b.x)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) + { + return tvec2(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) + { + return tvec3(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) + { + return tvec4(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; + + template class vecType> + struct functor2_vec_sca{}; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) + { + return tvec1(Func(a.x, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) + { + return tvec2(Func(a.x, b), Func(a.y, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) + { + return tvec3(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) + { + return tvec4(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; +}//namespace detail +}//namespace glm diff --git a/extensions/common/glm/detail/dummy.cpp b/extensions/common/glm/detail/dummy.cpp new file mode 100644 index 0000000000..88d8f3b807 --- /dev/null +++ b/extensions/common/glm/detail/dummy.cpp @@ -0,0 +1,232 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/core/dummy.cpp +/// @date 2011-01-19 / 2011-06-15 +/// @author Christophe Riccio +/// +/// GLM is a header only library. There is nothing to compile. +/// dummy.cpp exist only a wordaround for CMake file. +/////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include +#include + +struct material +{ + glm::vec4 emission; // Ecm + glm::vec4 ambient; // Acm + glm::vec4 diffuse; // Dcm + glm::vec4 specular; // Scm + float shininess; // Srm +}; + +struct light +{ + glm::vec4 ambient; // Acli + glm::vec4 diffuse; // Dcli + glm::vec4 specular; // Scli + glm::vec4 position; // Ppli + glm::vec4 halfVector; // Derived: Hi + glm::vec3 spotDirection; // Sdli + float spotExponent; // Srli + float spotCutoff; // Crli + // (range: [0.0,90.0], 180.0) + float spotCosCutoff; // Derived: cos(Crli) + // (range: [1.0,0.0],-1.0) + float constantAttenuation; // K0 + float linearAttenuation; // K1 + float quadraticAttenuation;// K2 +}; + + +// Sample 1 +#include // glm::vec3 +#include // glm::cross, glm::normalize + +glm::vec3 computeNormal +( + glm::vec3 const & a, + glm::vec3 const & b, + glm::vec3 const & c +) +{ + return glm::normalize(glm::cross(c - a, b - a)); +} + +typedef unsigned int GLuint; +#define GL_FALSE 0 +void glUniformMatrix4fv(GLuint, int, int, float*){} + +// Sample 2 +#include // glm::vec3 +#include // glm::vec4, glm::ivec4 +#include // glm::mat4 +#include // glm::translate, glm::rotate, glm::scale, glm::perspective +#include // glm::value_ptr +void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate) +{ + glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + glm::mat4 MVP = Projection * View * Model; + glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); +} + +// Sample 3 +#include // glm::vec2 +#include // glm::packUnorm2x16 +#include // glm::uint +#include // glm::i8vec2, glm::i32vec2 +std::size_t const VertexCount = 4; +// Float quad geometry +std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); +glm::vec2 const PositionDataF32[VertexCount] = +{ + glm::vec2(-1.0f,-1.0f), + glm::vec2( 1.0f,-1.0f), + glm::vec2( 1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f) + }; +// Half-float quad geometry +std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint); +glm::uint const PositionDataF16[VertexCount] = +{ + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f))) +}; +// 8 bits signed integer quad geometry +std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); +glm::i8vec2 const PositionDataI8[VertexCount] = +{ + glm::i8vec2(-1,-1), + glm::i8vec2( 1,-1), + glm::i8vec2( 1, 1), + glm::i8vec2(-1, 1) +}; +// 32 bits signed integer quad geometry +std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); +glm::i32vec2 const PositionDataI32[VertexCount] = +{ + glm::i32vec2 (-1,-1), + glm::i32vec2 ( 1,-1), + glm::i32vec2 ( 1, 1), + glm::i32vec2 (-1, 1) +}; + +struct intersection +{ + glm::vec4 position; + glm::vec3 normal; +}; + +/* +// Sample 4 +#include // glm::vec3 +#include // glm::normalize, glm::dot, glm::reflect +#include // glm::pow +#include // glm::vecRand3 +glm::vec3 lighting +( + intersection const & Intersection, + material const & Material, + light const & Light, + glm::vec3 const & View +) +{ + glm::vec3 Color(0.0f); + glm::vec3 LightVertor(glm::normalize( + Light.position - Intersection.position + + glm::vecRand3(0.0f, Light.inaccuracy)); + + if(!shadow(Intersection.position, Light.position, LightVertor)) + { + float Diffuse = glm::dot(Intersection.normal, LightVector); + if(Diffuse <= 0.0f) + return Color; + if(Material.isDiffuse()) + Color += Light.color() * Material.diffuse * Diffuse; + if(Material.isSpecular()) + { + glm::vec3 Reflect(glm::reflect( + glm::normalize(-LightVector), + glm::normalize(Intersection.normal))); + float Dot = glm::dot(Reflect, View); + float Base = Dot > 0.0f ? Dot : 0.0f; + float Specular = glm::pow(Base, Material.exponent); + Color += Material.specular * Specular; + } + } + return Color; +} +*/ + + +template class vecType> +T normalizeDotA(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template class + +template +T normalizeDotB(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +template +typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) +{ + return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); +} + +int main() +{ + glm::vec1 o(1); + glm::vec2 a(1); + glm::vec3 b(1); + glm::vec4 c(1); + + glm::quat q; + glm::dualquat p; + + glm::mat4 m(1); + + float a0 = normalizeDotA(a, a); + float b0 = normalizeDotB(b, b); + float c0 = normalizeDotC(c, c); + + return 0; +} diff --git a/extensions/common/glm/detail/func_common.hpp b/extensions/common/glm/detail/func_common.hpp new file mode 100644 index 0000000000..da28007b05 --- /dev/null +++ b/extensions/common/glm/detail/func_common.hpp @@ -0,0 +1,456 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/func_common.hpp +/// @date 2008-03-08 / 2010-01-26 +/// @author Christophe Riccio +/// +/// @see
GLSL 4.20.8 specification, section 8.3 Common Functions +/// +/// @defgroup core_func_common Common functions +/// @ingroup core +/// +/// These all operate component-wise. The description is per component. +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "setup.hpp" +#include "precision.hpp" +#include "type_int.hpp" +#include "_fixes.hpp" + +namespace glm +{ + /// @addtogroup core_func_common + /// @{ + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam genType floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType abs(genType x); + + template class vecType> + GLM_FUNC_DECL vecType abs(vecType const & x); + + /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. + /// + /// @tparam genType Floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType sign(vecType const & x); + + /// Returns a value equal to the nearest integer that is less then or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType floor(vecType const & x); + + /// Returns a value equal to the nearest integer to x + /// whose absolute value is not larger than the absolute value of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType trunc(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// This includes the possibility that round(x) returns the + /// same value as roundEven(x) for all values of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType round(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// A fractional part of 0.5 will round toward the nearest even + /// integer. (Both 3.5 and 4.5 for x will return 4.0.) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see New round to even technique + template class vecType> + GLM_FUNC_DECL vecType roundEven(vecType const & x); + + /// Returns a value equal to the nearest integer + /// that is greater than or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL ceil man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType ceil(vecType const & x); + + /// Return x - floor(x). + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fract(genType x); + + template class vecType> + GLM_FUNC_DECL vecType fract(vecType const & x); + + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType mod(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + + /// Returns the fractional part of x and sets i to the integer + /// part (as a whole number floating point value). Both the + /// return value and the output parameter will have the same + /// sign as x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType modf(genType x, genType & i); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType min(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType max(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); + + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of that is false, the + /// corresponding component of x is returned. For a + /// component of a that is true, the corresponding + /// component of y is returned. Components of x and y that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @param[in] x Value to interpolate. + /// @param[in] y Value to interpolate. + /// @param[in] a Interpolant. + /// + /// @tparam genTypeT Floating point scalar or vector. + /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. + /// + /// @code + /// #include + /// ... + /// float a; + /// bool b; + /// glm::dvec3 e; + /// glm::dvec3 f; + /// glm::vec4 g; + /// glm::vec4 h; + /// ... + /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. + /// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h; + /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. + /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. + /// @endcode + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); + + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); + + template + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType step(genType edge, genType x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template